-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLikeHit.php
More file actions
41 lines (40 loc) · 1.71 KB
/
Copy pathLikeHit.php
File metadata and controls
41 lines (40 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
$songid = $_GET['song_id'];
$userid = $_GET['user_id'];
$pass = $_GET['password'];
$clusterid = $_GET['cluster_id'];
$sectiontoberefreshed = $_GET['to_be_refreshed'];
$link = oci_connect('system', 'Nitish91', '');
if (!$link)
{
die('Could not connect to Oracle: ');
}
else
{
$stmt = oci_parse($link,'insert into user_to_song values(\''.$songid.'\',\''.$userid.'\',\''.$clusterid.'\')');
$resultset = oci_execute($stmt);
oci_commit($link);
$var = "";
$a = "";
if($sectiontoberefreshed == 'Random')
{
$randomorsuggested = "Random";
$stmt2 = oci_parse($link,'select * from(select * from song order by DBMS_RANDOM.VALUE) where rownum=1');
$resultset2 = oci_execute($stmt2);
$ToBeRefreshed = "Random";
$RefreshSection = '\''.$ToBeRefreshed.'\'';
$a .= "<div class=\"topdownload_box\"><div class=\"title_singer\"><span class=\"download_button\"><a class=\"download_button\" href=\"javascript:RefreshSection(".$RefreshSection."); return false;\">Refresh</a></span></div></div>";
while($resultset2 = oci_fetch_array($stmt2,OCI_BOTH))
{
$songid = $resultset2['SONG_ID'];
$clusterid = $resultset2['CLUSTER_ID'];
$parameters = '\''.$songid.'\',\''.$clusterid.'\',\''.$userid.'\',\''.$pass.'\',\''.$randomorsuggested.'\'';
$a .= "<div class=\"topdownload_box\"><div class=\"title_singer\"><a style=\"color:#24211d\" href=\"#\" onclick=\"return false;\">".$resultset2['SONG_TITLE']."</a><span class=\"download_button\"><a class=\"download_button\" href=\"javascript:LikeThisSong(".$parameters.");\"); return false;\">Like</a></span></div></div>";
}
$var = "<h1>Random track</h1>";
$var .= $a;
}
}
oci_close($link);
echo $var;
?>