$curpid = floor($curtime * 1000 / $row["piecelength"]); $channel["id"] = $row["channel_hashid"]; $channel["name"] = $row["name"]; $channel["image"] = "channel" . substr('00' . $row["image"], -2) . ".png"; $channel["curpid"] = number_format($curpid, 0, '', ''); $channel["piecelength"] = $row["piecelength"]; $channel["groupname"] = $row["groupname"]; $channel["grouptype"] = $row["grouptype"]; $channel["date"] = array(); $channel["programs"] = array(array("program" => array())); if ($channel["grouptype"] == 1 && substr($userflag, 0, 1) == "1") { // date $starttime = strtotime(date('Y-m-d 0:0:0', strtotime("-6 day"))); // floor(UNIX_TIMESTAMP(c.program_time) * 1000 / " . $channel["piecelength"] . ") as pid, // UNIX_TIMESTAMP(c.program_time) as program_time, $sql = "\n\t\t\t\t\tselect \n\t\t\t\t\t\tc.title, \n\t\t\t\t\t\tc.contents, \n\t\t\t\t\t\tc.program_time\n\t\t\t\t\tfrom \n\t\t\t\t\t\ttbl_channel_program c\n\t\t\t\t\twhere \n\t\t\t\t\t\tc.channelid ='" . toStringForSql($row["id"]) . "' and c.delete_flag=0 and c.program_time >= " . $starttime . "\n\t\t\t\t\torder by \n\t\t\t\t\t\tc.program_time\n\t\t\t\t"; $result_program = querySQL($conn, $sql); $row_program = mysql_fetch_array($result_program, MYSQL_ASSOC); for ($d = 0; $d < 7; $d++) { $date = array("name" => date('Y-m-d', $starttime), "programs" => array(array("program" => array()))); // time if ($d < 6) { $endtime = $starttime + 3600 * 23; } else { $endtime = floor($curtime / 3600) * 3600; } $date["start_pid"] = number_format($starttime / $row["piecelength"] * 1000, 0, '', ''); $date["start_time"] = intval(date('G', $starttime)); $date["end_pid"] = number_format($endtime / $row["piecelength"] * 1000, 0, '', ''); $date["end_time"] = intval(date('G', $endtime)); $date["step_pid"] = 3600 * 1000 / $row["piecelength"];
$sql = "update tbl_user_macid set delete_flag=1, update_id=" . correctSQL($userid) . ", update_date=now() where userid=" . correctSQL($old_uid) . " and macid=" . correctSQL($macid); executeSQL($conn, $sql); $sql = "\n\t\t\t\t\t\tupdate tbl_user a,\n\t\t\t\t\t\t(\n\t\t\t\t\t\tselect a.userid, a.macid\n\t\t\t\t\t\tfrom tbl_user_macid a,\n\t\t\t\t\t\t(select userid, max(update_date) as update_date from tbl_user_macid where delete_flag=0 group by userid) b\n\t\t\t\t\t\twhere a.delete_flag=0 and a.userid=b.userid and a.update_date=b.update_date\n\t\t\t\t\t\t) b\n\t\t\t\t\t\tset a.macid = b.macid\n\t\t\t\t\t\twhere a.id = b.userid and a.id=" . correctSQL($old_uid); executeSQL($conn, $sql); } // set macid $sql = "insert into tbl_user_macid (userid, macid, create_id, create_date, update_id, update_date)\n\t\t\t\t\t\t\t\tVALUES('" . toStringForSql($uid) . "', '" . toStringForSql($macid) . "', '" . toStringForSql($userid) . "', now(), '" . toStringForSql($userid) . "', now())"; executeSQL($conn, $sql); $sql = "update tbl_user set macid='" . toStringForSql($macid) . "' where id='" . toStringForSql($uid) . "'"; executeSQL($conn, $sql); } // activate online payment if ($activation == 1) { $sql = "update tbl_user set activation=0 where id='" . toStringForSql($uid) . "'"; executeSQL($conn, $sql); $sql = "select userid, serviceid, start_date, end_date from tbl_user_status where userid='" . toStringForSql($uid) . "' and delete_flag=0"; $result = querySQL($conn, $sql); $row = mysql_fetch_array($result); $start_date = $row["start_date"]; $now = date("Y-m-d"); $end_date = $row["end_date"]; $days = ceil((strtotime($now) - strtotime($start_date)) / (60 * 60 * 24)); $y = intval(substr($start_date, 0, 4)); $m = intval(substr($start_date, 5, 2)); $d = intval(substr($start_date, 8, 2)); $start_date = date('Y-m-d', mktime(0, 0, 0, $m, $d + $days, $y)); $y = intval(substr($end_date, 0, 4)); $m = intval(substr($end_date, 5, 2)); $d = intval(substr($end_date, 8, 2)); $end_date = date('Y-m-d', mktime(0, 0, 0, $m, $d + $days, $y)); $sql = 'update tbl_user_status' . ' set start_date=' . correctSQL(substr($start_date, 0, 10)) . ' , end_date=' . correctSQL(substr($end_date, 0, 10)) . ' where userid=' . $uid . ' and delete_flag=0';
function getCurrentTVGuide($conn, $channels) { $sql = "\n\t\tSELECT * FROM (\n\t\t\tSELECT b.channel_hashid AS id, a.program_time AS program_time, a.title AS title \n\t\t\tFROM tbl_channel_program a, tbl_channel b\n\t\t\tWHERE b.channel_hashid in (" . toStringForSql($channels) . ")'\n\t\t\tAND\t\ta.channelid = b.channelid\n\t\t\tAND\t\tprogram_time <= NOW()\n\t\t\tORDER BY b.channel_hashid ASC , a.program_time DESC\n\t\t\tLIMIT 1\n\t\t) A\n\t\tUNION ALL\n\t\tSELECT * FROM (\n\t\t\tSELECT b.channel_hashid AS id, a.program_time AS program_time, a.title AS title \n\t\t\tFROM tbl_channel_program a, tbl_channel b\n\t\t\tWHERE b.channel_hashid in (" . toStringForSql($channels) . ")'\n\t\t\tAND\t\ta.channelid = b.channelid\n\t\t\tAND\t\tprogram_time > NOW()\n\t\t\tORDER BY b.channel_hashid ASC , a.program_time ASC\n\t\t\tLIMIT 5\n\t\t) B\n\t\t"; $result = querySQL($conn, $sql); return $result; }
<?php // error_reporting(E_ALL ^ E_NOTICE); ini_set('display_errors', '0'); require_once '../../../config.inc'; require_once '../../../include/share.php'; $userid = $_REQUEST["userid"]; $tel = null; if ($userid != null && $userid != "") { $conn = connectDB(); // get current userid from macid $sql = "select b.tel from tbl_user a, tbl_agent_emp b where a.userid='" . toStringForSql($userid) . "' and a.delete_flag=0 and b.delete_flag=0 and a.agentempid=b.id"; $tel = executeScalar($conn, $sql); } $back = $_REQUEST["back"]; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <!-- saved from url=(0044)http://www.skylive365.com/ --> <HTML xmlns="http://www.w3.org/1999/xhtml" oncontextmenu="javascript: return false;"> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <META content="MSHTML 6.00.6000.16825" name="GENERATOR"> <STYLE type="text/css"> html { overflow: hidden; } BODY { font-family:helvetica,tahoma,verdana,sans-serif, simsun; FONT-SIZE: 30px;
function getChannelOfService($conn, $serviceid) { $sql = "\n\t\t\tselect \n\t\t\t\tsubstr(a.groupname, 3) as groupname, a.grouptype, \n\t\t\t\ta.id, a.channel_hashid, substr(a.name, 4) as name, a.image, a.piecelength,\n\t\t\t\tsubstr(a.groupname, 1, 1) as gorder,\n\t\t\t\tsubstr(a.name, 1, 2) as corder\n\t\t\tfrom \n\t\t\t\ttbl_channel a, tbl_service_channel b\n\t\t\twhere \n\t\t\t\ta.delete_flag=0 and b.delete_flag=0 and b.serviceid='" . toStringForSql($serviceid) . "' and a.id=b.channelid and a.status=1 and a.grouptype = 1\n\t\t\tunion all\n\t\t\tselect \n\t\t\t\tsubstr(a.groupname, 3) as groupname, a.grouptype, \n\t\t\t\ta.id, a.channel_hashid, substr(a.name, 6) as name, a.image, a.piecelength,\n\t\t\t\tsubstr(a.groupname, 1, 1) as gorder,\n\t\t\t\tsubstr(a.name, 1, 4) as corder\n\t\t\tfrom \n\t\t\t\ttbl_channel a\n\t\t\twhere \n\t\t\t\ta.delete_flag=0 and a.status=1 and a.grouptype = 2\n\t\t\torder by \n\t\t\t\tgrouptype, gorder, corder\n\t\t"; $result = querySQL($conn, $sql); return $result; }
function getChannelByHashId($conn, $channel_hashid) { $sql = "\r\n\t\tselect\r\n\t\tsubstr(a.groupname, 3) as groupname, a.grouptype,\r\n\t\ta.id, a.channel_hashid, substr(a.name, 6) as name, a.image, a.piecelength,\r\n\t\tsubstr(a.groupname, 1, 1) as gorder,\r\n\t\tsubstr(a.name, 1, 4) as corder\r\n\t\tfrom\r\n\t\ttbl_channel a\r\n\t\twhere channel_hashid='" . toStringForSql($channel_hashid) . "'\n\t\torder by\r\n\t\tgrouptype, gorder, corder\r\n\t\t"; $result = querySQL($conn, $sql); return $result; }
<?php require_once '../config.inc'; require_once '../include/share.php'; $id = $_REQUEST["id"]; $old = $_REQUEST["old"]; $new = $_REQUEST["new"]; $db = connectDB(); // check user id / pwd $sql = "select count(*) from tbl_user where delete_flag=0 and userid='" . toStringForSql($id) . "' and password='******'"; $valid = executeScalar($db, $sql); if ($valid == 0) { die("invalid user"); } $sql = "update tbl_user set password='******' where delete_flag=0 and userid='" . toStringForSql($id) . "'"; $valid = executeSQL($db, $sql); if ($valid != 1) { die("error"); } die("ok");