function editall()
{
    global $db;
    $t_id = be("arr", "t_id");
    $ids = explode(",", $t_id);
    foreach ($ids as $id) {
        $t_name = be("post", "t_name" . $id);
        $t_enname = be("post", "t_enname" . $id);
        $t_sort = be("post", "t_sort" . $id);
        //		$t_template = be("post","t_template" .$id);
        //		$t_vodtemplate = be("post","t_vodtemplate" .$id);
        //		$t_playtemplate = be("post","t_playtemplate" .$id);
        //		$t_key = be("post","t_key" .$id);
        //		$t_des = be("post","t_des" .$id);
        if (isN($t_name)) {
            echo "名称不能为空";
            exit;
        }
        if (isN($t_enname)) {
            echo "别名不能为空";
            exit;
        }
        if (!isNum($t_sort)) {
            echo "排序号不能为空或不是数字";
            exit;
        }
        //		if (isN($t_template)) { $t_template = "vodlist.html";}
        //		if (isN($t_vodtemplate)) { $t_vodtemplate = "vod.html";}
        //		if (isN($t_playtemplate)) { $t_playtemplate = "vodplay.html";}
        $db->Update("{pre}vod_type", array("t_name", "t_enname", "t_sort"), array($t_name, $t_enname, $t_sort), "t_id=" . $id);
    }
    updateCacheFile();
    echo "修改完毕";
}
Example #2
0
function chkLogin()
{
    global $db;
    $m_id = getCookie("adminid");
    $m_id = chkSql($m_id, true);
    $m_name = getCookie("adminname");
    //	writetofile("operate.log", "loginame:{".$m_name ."};action:{".be("all","action")."};referce:{".getReferer()."}.request:{".$_SERVER["REQUEST_URI"]."};parameters GET:{".json_encode($_GET)."}" );
    writetofile("operate.log", "loginame:{" . $m_name . "};action:{" . be("all", "action") . "};referce:{" . getReferer() . "}.request:{" . $_SERVER["REQUEST_URI"] . "};parameters POST:{" . json_encode($_POST) . "}");
    $m_name = chkSql($m_name, true);
    if (!isN($m_name) && !isN($m_id)) {
        $row = $db->getRow("SELECT * FROM {pre}manager WHERE m_name='" . $m_name . "' AND m_id= '" . $m_id . "' AND m_status ='1'");
        if ($row) {
            $loginValidate = md5($row["m_random"] . $row["m_name"] . $row["m_id"]);
            if (getCookie("admincheck") != $loginValidate) {
                sCookie("admincheck", "");
                die("<script>top.location.href='index.php?action=login';</script>");
            }
        } else {
            sCookie("admincheck", "");
            die("<script>top.location.href='index.php?action=login';</script>");
        }
    } else {
        die("<script>top.location.href='index.php?action=login';</script>");
    }
}
Example #3
0
function checkLogin()
{
    global $db;
    $m_name = be("post", "m_name");
    $m_name = chkSql($m_name, true);
    $m_password = be("post", "m_password");
    $m_password = chkSql($m_password, true);
    $m_password = md5($m_password);
    $m_check = be("post", "m_check");
    if (isN($m_name) || isN($m_password) || isN($m_check)) {
        alertUrl("请输入您的用户名或密码!", "?action=login");
    }
    $row = $db->getRow("SELECT * FROM {pre}manager WHERE m_name='" . $m_name . "' AND m_password = '******' AND m_status=1");
    if ($row && $m_check == app_safecode) {
        sCookie("adminid", $row["m_id"]);
        sCookie("adminname", $row["m_name"]);
        sCookie("adminlevels", $row["m_levels"]);
        $randnum = md5(rand(1, 99999999));
        sCookie("admincheck", md5($randnum . $row["m_name"] . $row["m_id"]));
        $db->Update("{pre}manager", array("m_logintime", "m_loginip", "m_random"), array(date("Y-m-d H:i:s"), getIP(), $randnum), " m_id=" . $row["m_id"]);
        echo "<script>top.location.href='index.php';</script>";
    } else {
        alertUrl("您输入的用户名和密码不正确或者您不是系统管理员!", "?action=login");
    }
}
function save()
{
    $areastr = be("post", "areastr");
    $langstr = be("post", "langstr");
    fwrite(fopen("../inc/vodarea.txt", "wb"), $areastr);
    fwrite(fopen("../inc/vodlang.txt", "wb"), $langstr);
    updateCacheFile();
    echo "修改完毕";
}
function save()
{
    $program_country = be("post", "program_country");
    $program_area = be("post", "program_area");
    $program_type = be("post", "program_type");
    $tv_playfrom = be("post", "tv_playfrom");
    fwrite(fopen("../inc/program_country.txt", "wb"), $program_country);
    fwrite(fopen("../inc/program_area.txt", "wb"), $program_area);
    fwrite(fopen("../inc/program_type.txt", "wb"), $program_type);
    fwrite(fopen("../inc/tv_playfrom.txt", "wb"), $tv_playfrom);
    updateCacheFile();
    echo "修改完毕";
}
function chgpwd()
{
    global $db;
    $oldP = be('all', 'old_pwds');
    $newP = be('all', 'new_pwd');
    $m_name = getCookie("adminname");
    $row = $db->getRow("select m_id from {pre}manager where m_password='******' and m_name='" . $m_name . "'");
    if (!isN($row['m_id'])) {
        $db->Update("{pre}manager", array('m_password'), array(md5($newP)), "m_name='" . $m_name . "'");
        echo '更新密码成功';
    } else {
        echo '输入的旧密码不对';
    }
}
function cjsel()
{
    global $action, $rtype, $rpage, $rkey, $rday, $cjurl, $xt, $rid, $cjflag;
    $ids = be("arr", "ids");
    if (isN($ids)) {
        errMsg("采集提示", "请选择采集数据");
    }
    if ($xt == "1") {
        $url = $cjurl . "?ac=videolist&rid=" . $rid . "&ids=" . $ids;
    } else {
        if ($xt == "2") {
            $url = $cjurl . "?s=plus-api-xml-cms-ff-action-ids-vodids-" . $ids . "-cid--play--inputer--wd--h-0-p-1";
        } else {
            $url = $cjurl . "?action=cjsel&ids=" . $ids;
        }
    }
    insertdata($url, "cjsel");
}
 * Date: 14-2-18
 * Time: 下午3:11
 */
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "api_collect_youku_cj.php";
headAdminCollect("优酷视频采集");
define("VIDEOS", "https://openapi.youku.com/v2/shows/videos.json?client_id=715115c589f8533a&show_id={id}&page=1&count={count}");
define("SHOWINFO", "https://openapi.youku.com/v2/shows/show.json?client_id=715115c589f8533a&show_id={id}");
$action = be("get", "action");
$contentparmStart = "showid_en=\"";
$contentparaend = "\";";
if (isset($action) && $action === 'collectSimpl') {
    $type_id = be("all", "type_id");
    $web_url = be("all", "web_url");
    $site_url = be("all", "site_url");
    $id = '';
    if (!isN($web_url)) {
        $content = getPage($web_url, 'utf-8');
        $id = getBody($content, $contentparmStart, $contentparaend);
    } else {
        if (!isN($site_url) && preg_match('/id_z(\\w.+?).html/', $site_url)) {
            $ids = preg_match_all('/id_z(\\w.+?).html/', $site_url, $match);
            $id = $match[1][0];
        } else {
            errmsg("采集提示", "采集信息不能为空");
        }
    }
    $content = getYoukuInfo($id, $type_id);
    $pid = '';
    $category = "电影";
Example #9
0
    $tpl->H = str_replace("{maccms:gbookverify}", $MAC['other']['gbookverify'], $tpl->H);
    if (strpos($tpl->H, '{maccms:count_gbook_all}')) {
        $tpl->H = str_replace("{maccms:count_gbook_all}", $tpl->getDataCount('gbook', "all"), $tpl->H);
    }
    if (strpos($tpl->H, '{maccms:count_gbook_day}')) {
        $tpl->H = str_replace("{maccms:count_gbook_day}", $tpl->getDataCount('gbook', "day"), $tpl->H);
    }
    $tpl->pageshow();
} elseif ($method == 'save') {
    $g_vid = be("all", "g_vid");
    $g_vid = chkSql($g_vid);
    $g_name = be("all", "g_name");
    $g_name = chkSql($g_name);
    $g_content = be("all", "g_content");
    $g_content = chkSql($g_content);
    $g_code = be("all", "g_code");
    $g_code = chkSql($g_code);
    if (!isNum($g_vid)) {
        $g_vid = 0;
    }
    if (isN($g_name) || isN($g_content)) {
        alert('请输入昵称和内容');
        exit;
    }
    if ($MAC['other']['gbookverify'] == 1 && $_SESSION["code_gbook"] != $g_code) {
        alert('验证码错误');
        exit;
    }
    if (getTimeSpan("last_gbooktime") < $MAC['other']['gbooktime']) {
        alert('请不要频繁操作');
        exit;
Example #10
0
File: make.php Project: klarclm/sgv
     $tab = $p['tab'];
 }
 if ($tab == 'art') {
     if ($MAC['view']['artdetail'] != 2) {
         showMsg('内容页面浏览模式非静态,不需要生成静态文件', '');
     }
     $tpl->C["siteaid"] = 26;
     $pre = 'a';
 } else {
     if ($MAC['view']['voddetail'] != 2 && $MAC['view']['vodplay'] < 2 && $MAC['view']['voddown'] < 2) {
         showMsg('内容、播放、下载页面浏览模式均非静态,不需要生成静态文件', '');
     }
     $tpl->C["siteaid"] = 16;
     $pre = 'd';
 }
 $ids = be('arr', $tab . 'type');
 $no = $p['no'];
 $ac2 = $p['ac2'];
 $num = 0;
 $page = 1;
 if (empty($ids)) {
     $ids = $p['ids'];
     $vid = $p['vid'];
     $num = intval($p['num']);
     $min = intval($p['min']);
     $jump = $p['jump'];
     $pagecount = $p['pagecount'];
     $datacount = $p['datacount'];
     $page = intval($p['pg']);
 }
 if (!empty($ids)) {
Example #11
0
<?php

ob_implicit_flush(true);
ini_set('max_execution_time', '0');
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "../score/AutoDouBanParseScore.php";
$pagenum = be("all", "pagenum");
if (!isNum($pagenum)) {
    $pagenum = 1;
} else {
    $pagenum = intval($pagenum);
}
updateVodPic($pagenum);
writetofile("mac_cj_vod.txt", 'finish');
function updateVodPic($pagenum)
{
    global $db;
    $scoreDouban = new AutoDouBanParseScore();
    $sql = "SELECT count(*)  FROM ( SELECT m_name\nFROM mac_cj_vod\nWHERE m_pid =180 AND m_typeid =131\nGROUP BY m_name) as c";
    $nums = $db->getOne($sql);
    $app_pagenum = 10;
    $pagecount = ceil($nums / $app_pagenum);
    //	 $pagecount=2;
    $flag = true;
    for ($i = $pagenum; $i <= $pagecount && $flag; $i++) {
        writetofile("mac_cj_vod.txt", 'check item for vod type{=}' . $nums . '{=}Total{=}' . $pagecount . '{=}' . $i);
        $sql = "SELECT m_name, m_pic, m_pic_ipad, m_year,m_language \nFROM mac_cj_vod\nWHERE m_pid =180 \nAND m_typeid =131\nGROUP BY m_name order by m_name asc  limit " . $app_pagenum * ($i - 1) . "," . $app_pagenum;
        //	    var_dump($sql);
        $rs = $db->query($sql);
        $flag = parseVodPad($rs, $scoreDouban);
function main()
{
    global $arrtype;
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			name:{
				required:true,
				stringCheck:true,
				maxlength:64
			},
			
			parent_id:{
				required:true
			},
			
			disp_order:{
				number:true
			},
			type_desc:{
				maxlength:254
			},
			type_key:{
				maxlength:254
			}
		}
	});
	$("#form3").validate({
		rules:{
			t_type1:{
				required:true
			},
			t_type2:{
				required:true
			}
		}
	});
	$('#form1').form({
		onSubmit:function(){
			if(!$("#form1").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info',function(){
	        	location.href=location.href;
	        });
	    }
	});
	$('#form2').form({
		onSubmit:function(){
			if(!$("#form2").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info');
	    }
	});
	$("#btnEdit").click(function(){
		$("#form1").attr("action","?action=editall");
		$("#form1").submit();
	});
	$("#btnAdd").click(function(){
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open'); 
	});
	$("#btnCancel").click(function(){
		location.href= "admin_apk_category.php?updatecache=1";
	});
	$("#btnMove").click(function(){
		$('#form3').form('clear');
		$('#win2').window('open'); 
	});
});
function ShowPDIV(i,p){
    if($("#type_P_CID_"+i)[0].length==0){
	    var v = $("#type_H_V")[0].innerHTML.split('@|@');
		$("#type_P_CID_"+i)[0].options[0] = new Option("作为顶级","0");
		for(j=1;j<v.length;j++){
		    $("#type_P_CID_"+i)[0].options[j] = new Option(v[j].split('|=|')[1],v[j].split('|=|')[0]);
			if(p==v[j].split('|=|')[0]) $("#type_P_CID_"+i)[0].options[j].selected = true;
		}
	}	
	$("#type_P_DIV_"+i)[0].style.display = ($("#type_P_DIV_"+i)[0].style.display == "none") ? "block" : "none";
}
function SelectPid(p,i){
	window.location.href = '?action=editid&typeid='+i+'&t_pid='+p;
}
</script>
<form action="" method="post" id="form1" name="form1">
<table class="tb2">
	<tr>
	<td>&nbsp;</td>
	<td width="35" align="center">编号</td>
	<td width="15%">名称</td>
	<td width="10%">关键字</td>
	<td width="15%">描述</td>
	<td width="5%">排序</td>
	<td width="25%">操作</td>
	</tr>
	<?php 
    $type = be("all", "type");
    if (isNum($type)) {
        $type = intval($type);
    } else {
        $type = 0;
    }
    getTypeList($type);
    ?>
	<tr>
	<td colspan="8"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'t_id[]')" /> 全选
	&nbsp;<input type="button" value="批量修改" id="btnEdit" class="input" />
	&nbsp;<input type="button" value="添加" id="btnAdd" class="input" />
<!--	&nbsp;<input type="button" value="数据转移" id="btnMove" class="input" />-->
	</td>
	</tr>
</table>
</form>
<div id="type_H_V" style="display:none"><?php 
    echo $arrtype;
    ?>
</div>


<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab=apk_category" method="post" id="form2" name="form2">
<table class="tb">
	<input id="flag" name="flag" type="hidden" value="add">
	<tr>
	<td width="20%">父级分类:</td>
	<td><select id="parent_id" name="parent_id">
      <option value="0">顶级分类</option>
    	<?php 
    echo makeSelectAll("apk_category", "id", "name", "parent_id", "disp_order", 0, "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
	  </select>
	</td>
	</tr>
	<tr>
	<td>名称:</td>
	<td><input type="text" id="name" name="name" size="25">
	</td>
	</tr>
	
	<tr>
	<td>关键字:</td>
	<td><input type="text" id="type_key" name="type_key" size="25">
	</td>
	</tr>
	<tr>
	<td>描述:</td>
	<td><input type="text" id="type_desc" name="type_desc" size="25">
	</td>
	</tr>
	<tr>
	<td>排序:</td>
	<td><input type="text" id="disp_order" name="disp_order" size="25">
	</td>
	</tr>
	<tr align="center">
      <td colspan="2"><input class="input" type="submit" value="保存" id="btnSave"> <input class="input" type="button" value="返回" id="btnCancel"> </td>
    </tr>
  </form>
</table>
</div>

<div id="win2" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" minimizable="false" maximizable="false">
<form action="?action=into" method="post" id="form3" name="form3">
<table class="tb">
	<tr>
	<td>
	选择分类:
	<select name="t_type1">
	<?php 
    echo makeSelectAll("{pre}art_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
	</select>
	</td>
	</tr>
	<tr>
	<td>
	目标分类:
	<select name="t_type2">
	<?php 
    echo makeSelectAll("{pre}art_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
	</select>
	</td>
	</tr>
	<tr>
	<td>
	<input class="input" type="submit" value="保存" id="btnSave">
	
</table>
</form>
</div>

</body>
</html>
<?php 
}
Example #13
0
File: vod.php Project: klarclm/sgv
} elseif ($method == 'topic') {
    $tpl->C["siteaid"] = 14;
    $tpl->P['cp'] = 'vodtopic';
    $tpl->P['cn'] = $tpl->P['id'] . '-' . $tpl->P['pg'] . '-' . $tpl->P['order'] . '-' . $tpl->P['by'];
    echoPageCache($tpl->P['cp'], $tpl->P['cn']);
    $tpl->P['vodtopicid'] = $tpl->P['id'];
    $tpl->T = $MAC_CACHE['vodtopic'][$tpl->P['vodtopicid']];
    if (!is_array($tpl->T)) {
        showMsg("获取数据失败,请勿非法传递参数", "../");
    }
    $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
    $tpl->loadtopic('vod');
    $tpl->pageshow();
} elseif ($method == 'search') {
    $tpl->C["siteaid"] = 15;
    $wd = trim(be("all", "wd"));
    $wd = chkSql($wd);
    if (!empty($wd)) {
        $tpl->P["wd"] = $wd;
    }
    //if(empty($tpl->P["wd"]) && empty($tpl->P["ids"]) && empty($tpl->P["pinyin"]) && empty($tpl->P["starring"]) && empty($tpl->P["directed"]) && empty($tpl->P["area"]) && empty($tpl->P["lang"]) && empty($tpl->P["year"]) && empty($tpl->P["letter"]) && empty($tpl->P["tag"]) && empty($tpl->P["type"]) && empty($tpl->P["typeid"]) && empty($tpl->P["classid"]) ){ alert ("搜索参数不正确"); }
    if ($tpl->P['pg'] == 1 && getTimeSpan("last_searchtime") < $MAC['app']['searchtime']) {
        showMsg("请不要频繁操作,时间间隔为" . $MAC['app']['searchtime'] . "秒", MAC_PATH);
        exit;
    }
    $tpl->P['cp'] = 'vodsearch';
    $tpl->P['cn'] = urlencode($tpl->P['wd']) . '-' . $tpl->P['pg'] . '-' . $tpl->P['order'] . '-' . $tpl->P['by'] . '-' . $tpl->P['ids'] . '-' . $tpl->P['pinyin'] . '-' . $tpl->P['type'] . '-' . $tpl->P['year'] . '-' . $tpl->P['letter'] . '-' . $tpl->P['typeid'] . '-' . $tpl->P['classid'] . '-' . urlencode($tpl->P['area']) . '-' . urlencode($tpl->P['lang']) . '-' . urlencode($tpl->P['tag']) . '-' . urlencode($tpl->P['starring']) . '-' . urlencode($tpl->P['directed']);
    echoPageCache($tpl->P['cp'], $tpl->P['cn']);
    $tpl->P["where"] = '';
    $tpl->P["des"] = '';
    $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
function main()
{
    global $db, $cache;
    $pagenum = be("get", "page");
    if (isN($pagenum) || !isNum($pagenum)) {
        $pagenum = 1;
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $pagenum = intval($pagenum);
    $sql = "select * from {pre}cj_vod_projects ";
    $rscount = $db->query($sql);
    $nums = $db->num_rows($rscount);
    //总记录数
    $pagecount = ceil($nums / app_pagenum);
    //总页数
    $sql = $sql . "limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<table border="0" cellpadding="3" cellspacing="1">
	<tr>
	<td>
		菜单:<a href="collect_vod_manage.php?action=add">添加采集规则</a> | <a href="collect_vod_manage.php?action=upexp">导入采集规则</a>
	</td>
	</tr>
</table>
<form action="" method="post" name="form1">
<table class="collect_vod_manage tb">
    <tr>
	  <td width="5%">&nbsp;</td>
      <td width="10%">项目名称</td>
      <td width="10%">播放类型</td>
      <td width="10%">入库分类</td>
      <td width="20%">上次采集</td>
      <td width="45%">操作</td>
    </tr>
	<?php 
    if (!$rs) {
        ?>
    <tr><td align="center" colspan="7" >没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            ?>
    <tr>
	  <td><input name="p_id[]" type="checkbox" id="p_id" value="<?php 
            echo $row["p_id"];
            ?>
" /></td>
      <td><a href="?action=edit&p_id=<?php 
            echo $row["p_id"];
            ?>
"><?php 
            echo $row["p_name"];
            ?>
</a></td>
      
	  <td><?php 
            echo $row["p_playtype"];
            ?>
</td>
	  <td>
	  <?php 
            if ($row["p_classtype"] == 1) {
                echo "<font color=red>自定义分类</font>";
            } else {
                $typearr = getValueByArray($cache[0], "t_id", $row["p_collect_type"]);
                echo $typearr["t_name"];
            }
            ?>
	  </td>
      <td><?php 
            echo isToDay($row['p_time']);
            ?>
</td>
 	  <td>
 	  <A href="collect_vod_cj.php?ignoreExistM=true&p_id=<?php 
            echo $row["p_id"];
            ?>
">采集</A>|
 	   <A href="collect_vod_cj.php?p_id=<?php 
            echo $row["p_id"];
            ?>
">采集(包括已经采集过)</A>|
 	  <A href="?action=collectSimple&p_id=<?php 
            echo $row["p_id"];
            ?>
&p_name=<?php 
            echo $row["p_name"];
            ?>
">采集单个视频</A>|
 	  <A href="?action=collectVideo&p_id=<?php 
            echo $row["p_id"];
            ?>
&p_name=<?php 
            echo $row["p_name"];
            ?>
">采集视频地址</A>|
 	  <A href="?action=edit&p_id=<?php 
            echo $row["p_id"];
            ?>
">设置</A>|
 	  <A href="?action=copy&p_id=<?php 
            echo $row["p_id"];
            ?>
">复制</A>|
 	  <A href="?action=export&p_id=<?php 
            echo $row["p_id"];
            ?>
">导出</A>|
 	  <A href="?action=del&p_id=<?php 
            echo $row["p_id"];
            ?>
">删除</A>
 	  
 	  </td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr class="formlast">
	<td  colspan="6">
	<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'p_id[]');"/> 全选
	<input type="submit" value="批量删除" onClick="if(confirm('确定要删除吗')){form1.action='?action=delall';}else{return false}"  class="input"/>
	
	</td>
	</tr>
    <tr align="center" class="formlast">
      <td colspan="7">
        <?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "collect_vod_manage.php?page={p}");
    ?>
      </td>
    </tr>
</table>
</form>
<?php 
}
function main()
{
    global $db, $cache;
    $tv_id = be("all", "tv_id");
    $day = be("all", "day");
    if (!isNum($tv_id)) {
        $tv_id = 0;
    } else {
        $tv_id = intval($tv_id);
    }
    if (isN($day)) {
        $day = date('Y-m-d', time());
    }
    $where = " 1=1 ";
    $where .= " AND tv_id =" . $tv_id;
    $where .= " AND day ='" . $day . "'";
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}tv_program_item as a " . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql1 = "SELECT * FROM {pre}tv_program_item  where  " . $where . " and play_time<='12:00'  order by play_time asc ";
    $sql2 = "SELECT * FROM {pre}tv_program_item  where  " . $where . " and play_time>'12:00'  order by play_time asc ";
    //	var_dump($sql);
    $rs1 = $db->query($sql1);
    $rs2 = $db->query($sql2);
    ?>
<script language="javascript">
function filter(){
	var tv_id=$("#tv_id").val();
	var day  =$("#date").val();
	if(day ==''){
		var url = "admin_program_items_day.php?tv_id="+tv_id+"&day="+day;
	}else {
		var url = "admin_program_items.php?tv_id="+tv_id+"&day="+day;
	}
	
	
	window.location.href=url;
}

function collecProgram(){
	var tv_id=$("#tv_id").val();
	var day  =$("#date").val();
	var url = "admin_program_items.php?action=collecProgram&tv_id="+tv_id+"&day="+day;
	$.get(url,"", function(obj) {
		alert(obj);
	});
	
}

$(document).ready(function(){
	
	$('#form1').form({
		onSubmit:function(){
			if(!$("#form1").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info',function(){
	        	location.href=location.href;
	        });
	    }
	});
	
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}vod_topic_items");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnEdit").click(function(){
		$("#form1").attr("action","?action=editall");
		$("#form1").submit();
	});
	$("#btnAdd").click(function(){
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open');
		
	});
	$("#btnAdd_down").click(function(){
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open');
		
	});

	$('#form2').form({
		onSubmit:function(){
			if(!$("#form2").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info');
	    }
	});
	
	
//	$("#btnAdd").click(function(){
//		window.location.href="admin_vod.php?topic_id=<?php 
    echo $topic_id;
    ?>
";
//	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
});
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$('#form2').form('load','admin_ajax.php?action=getinfo&tab={pre}vod_topic&col=t_id&val='+id);
}
</script>
<script type="text/javascript" src="/js/calendar.js"></script>
<table class="admin_program_items tb">
	<tr>
	<td>
	<table border="0" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">
	过滤条件:频道 <select id="tv_id" name="tv_id" >
	
	<?php 
    echo makeSelectWhere("{pre}tv", "id", "tv_name", "tv_type", "", "&nbsp;|&nbsp;&nbsp;", $tv_id, " where status=1");
    ?>
	</select>
	
	<input id="date" name="date" type="text" onclick="new Calendar().show(this);" value="<?php 
    echo $day;
    ?>
" readonly="readonly"/>
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	 |  <input class="input" type="button" value="采集节目单" id="btnsearch1" onClick="collecProgram();">	 | <a class="input" href="admin_program.php">返回电视直播</a>
	</td> 
	</tr>
	
	</table>
	</td>
	</tr>
</table>

<table class="tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td align="left">AM 00:00-12:00节目单</td>
	<td align=""left"" width="50%">AM 12:00-24:00节目单   <input type="button" value="添加" id="btnAdd" class="input" /> </td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr class="formlast"><td align="center" colspan="2">没有任何记录!</td></tr>
    <?php 
    } else {
        ?>
    <tr>
	  <td align="left" valign="top">
	  <?php 
        while ($row1 = $db->fetch_array($rs1)) {
            $t_id1 = $row1["id"];
            ?>
	      <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id1;
            ?>
" /> 
	       <input type="text" name="play_time<?php 
            echo $t_id1;
            ?>
" value="<?php 
            echo $row1["play_time"];
            ?>
" size="5"/>
	       <input type="text" name="video_name<?php 
            echo $t_id1;
            ?>
" value="<?php 
            echo $row1["video_name"];
            ?>
" size="40"/> 
	       <select id="program_type<?php 
            echo $t_id1;
            ?>
" name="program_type<?php 
            echo $t_id1;
            ?>
" >
	<option value=''>节目类别</option>
	<?php 
            echo makeSelectTV_live("prod_type", $row1["program_type"]);
            ?>
	</select><br/>
	    <?php 
        }
        ?>
	  </td>
	<td align="left">
	    <?php 
        while ($row2 = $db->fetch_array($rs2)) {
            $t_id2 = $row2["id"];
            ?>
	      <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id2;
            ?>
" />
	       <input type="text" name="play_time<?php 
            echo $t_id2;
            ?>
" value="<?php 
            echo $row2["play_time"];
            ?>
" size="5"/>
	       <input type="text" name="video_name<?php 
            echo $t_id2;
            ?>
" value="<?php 
            echo $row2["video_name"];
            ?>
" size="40"/> 
     <select id="program_type<?php 
            echo $t_id2;
            ?>
" name="program_type<?php 
            echo $t_id2;
            ?>
" >
	<option value=''>节目类别</option>
	<?php 
            echo makeSelectTV_live("prod_type", $row2["program_type"]);
            ?>
	</select><br/>
	    <?php 
        }
        ?>
	  </td>
	 
   
    </tr>
	<?php 
    }
    ?>
	<tr class="formlast">
	<td  colspan="7"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'t_id[]')" /> 全选 
<!--	<input type="button" value="批量删除" id="btnDel" class="input"  />-->
	&nbsp;<input type="button" value="批量修改" id="btnEdit" class="input" />
	&nbsp;<input type="button" value="添加" id="btnAdd_down" class="input" />
	</td></tr>
</table>
</form>


<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:450px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab={pre}tv_program_item&tv_id=<?php 
    echo $tv_id;
    ?>
&day=<?php 
    echo $day;
    ?>
" method="post" name="form2" id="form2">
<table class="tb">
	<input id="id" name="id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="30%">播放时间:</td>
	<td><input id="play_time" size=5 value="" name="play_time">(格式xx:xx, 比如23:20)
	</td>
	</tr>
	<tr>
	<td width="30%">播放节目:</td>
	<td><input id="video_name" size=40 value="" name="video_name">
	</td>
	</tr>
	<tr>
	<td width="30%">节目类别:</td>
	<td> <select id="program_type" name="program_type" >
	<option value=''></option>
	<?php 
    echo makeSelectTV_live("prod_type", '');
    ?>
	</select>
	</td>
	</tr>
	 
    <tr align="center" >
      <td colspan="2"><input class="input" type="submit" value="保存" id="btnSave"> <input class="input" type="button" value="返回" id="btnCancel"></td>
    </tr>
</table>
</form>
</div>
</body>
</html>
<?php 
    unset($rs1);
    unset($rs2);
}
<?php

require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "MovieType.php";
require_once "NBaidu.php";
require_once "tools/ContentManager.php";
require_once "collect_vod.php";
require_once "../score/AutoDouBanParseScore.php";
$host = $_SERVER['HTTP_HOST'];
$crontab = be("all", "crontab");
crawler($crontab);
exit(-1);
function crawler($crontab)
{
    global $db;
    writetofile("crawler_collect.sql", 'crawler start: crontab: ' . $crontab);
    $sql = "SELECT * FROM mac_cj_zhuiju  where status=0 and crontab_desc like'%" . $crontab . "%' GROUP BY m_urltest order by m_urltest ";
    writetofile("crawler_collect.sql", 'crawler start: sql: ' . $sql);
    $rs = $db->query($sql);
    parseVodPad($rs);
    unset($rs);
    writetofile("crawler_collect.sql", 'crawler stop.');
    collect($crontab);
}
function collect($crontab)
{
    writetofile("crawler_collect.sql", 'collect start.');
    global $db;
    $time = date("Y-m-d");
    $count = $db->getOne("SELECT count(*) FROM mac_cj_zhuiju  where status=0 and crontab_desc like'%" . $crontab . "%'  ");
Example #17
0
             echo '<select id="val" name="val"><option value="">取消绑定分类</option>' . makeSelectAll('{pre}' . $tab . '_type', 't_id', 't_name', 't_pid', 't_sort', 0, '', '&nbsp;|&nbsp;&nbsp;', '') . '</select><input class="input" type="button" value="绑定" onclick="bindsave(\'' . $tab . '\',\'' . $bind . '\');"><input class="input" type="button" value="取消" onclick="closew();">';
         } else {
             $bindcache = @(include MAC_ROOT . "/inc/config/config.collect.bind.php");
             if (!is_array($bindcache)) {
                 $bindcache = array();
                 $bindcache['1_1'] = 0;
             }
             $bindinsert[$bind] = $val;
             $bindarray = array_merge($bindcache, $bindinsert);
             $cv = "<?php\nreturn " . var_export($bindarray, true) . ";\n?>";
             fwrite(fopen(MAC_ROOT . "/inc/config/config.collect.bind.php", 'wb'), $cv);
             echo 'ok';
         }
     } elseif ($ac == 'memcached') {
         $host = be("all", "host");
         $port = be("all", "port");
         try {
             $mem = new Memcache();
             if (!$mem->connect($host, $port)) {
                 echo '连接失败!';
             } else {
                 echo 'ok';
             }
         } catch (Exception $e) {
             echo 'err';
             exit;
         }
     } else {
         redirect(getReferer());
     }
 }
function deleteStatus()
{
    $d_id = be("all", "id");
    global $db;
    $db->query("delete from tbl_video_feedback where prod_id=" . $d_id);
    echo "删除成功";
}
Example #19
0
function showfile()
{
    global $adpath, $updateserver, $verstr, $updatelog;
    ?>
<link rel="stylesheet" type="text/css" href="../images/manage.css" />
	<form action="?action=showfile" method="post" name="updateform">
	<table class="tb">
	<tr>
	<td align="center">升级文件</td>
	<td width="15%" align="center">更新时间</td>
	<td width="40%" align="center">描述信息</td>
	<td width="10%" align="center">更新状态</td>
	</tr>
<?php 
    $files = be("arr", "f_id");
    $logStr = file_get_contents($updatelog);
    $doc = new DOMDocument();
    $doc->formatOutput = true;
    $doc->load($updatelog);
    $xmlnode = $doc->documentElement;
    $nodes = $xmlnode->getElementsByTagName("file");
    if (!isN($files)) {
        $filesarr = explode(",", $files);
        $filescount = count($filesarr);
        for ($i = 0; $i < $filescount; $i++) {
            $fileTemp = "";
            $filearr = "";
            $filesrc = "";
            $filetime = "";
            $savefilepath = "";
            $fileStr = "";
            $fileTemp = trim($filesarr[$i]);
            $filearr = explode("||||", $fileTemp);
            $filesrc = $filearr[0];
            $filetime = $filearr[1];
            if (strpos($filesrc, ".txt") > 0) {
                $savefilepath = replaceStr($filesrc, "txt", "php");
            } else {
                $savefilepath = $filesrc;
            }
            $savefilepath = replaceStr($savefilepath, chr(10), "");
            $savefilepath = replaceStr($savefilepath, chr(13), "");
            $savefilepath = "../" . $savefilepath;
            $savefilepath = replaceStr($savefilepath, "admin/", $adpath);
            $fileStr = getPage($updateserver . $filesrc, "utf-8");
            if ($fileStr != "") {
                fwrite(fopen(replaceStr($savefilepath, version, ""), "wb"), $fileStr);
                if (strpos($logStr, "<file src=\"" . $filesrc . "\"") > 0) {
                    foreach ($nodes as $node) {
                        if ($filesrc == $node->attributes->item(0)->nodeValue) {
                            $node->attributes->item(1)->nodeValue = $filetime;
                            $doc->save($updatelog);
                        }
                    }
                } else {
                    $nodenew = $doc->createElement("file");
                    $nodesrc1 = $doc->createAttribute("src");
                    $nodesrc2 = $doc->createTextNode($filesrc);
                    $nodesrc1->appendChild($nodesrc2);
                    $nodetime1 = $doc->createAttribute("time");
                    $nodetime2 = $doc->createTextNode($filetime);
                    $nodetime1->appendChild($nodetime2);
                    $nodenew->appendChild($nodesrc1);
                    $nodenew->appendChild($nodetime1);
                    $doc->getElementsByTagName("updatefiles")->item(0)->appendChild($nodenew);
                    $doc->save($updatelog);
                    unset($nodenew);
                }
                ?>
		<tr>
		<td><?php 
                echo $filesrc;
                ?>
</td>
		<td align="center"><?php 
                echo $filetime;
                ?>
</td>
		<td>更新成功</td>
		</tr>
		<?php 
            }
        }
    }
    ?>
	</table>
	</form>
	<?php 
    unset($nodes);
    unset($xmlnode);
    unset($doc);
    showmsg("更新完毕!", "?action=showfilelist");
}
Example #20
0
<?php

require_once "admin_conn.php";
chkLogin();
$action = be("all", "action");
$stype = be("get", "type");
if (isN($stype)) {
    $stype = 0;
} else {
    $stype = intval($stype);
}
switch ($action) {
    case "cls":
        cls();
        break;
    case "upto":
        update();
        break;
    case "uptodata":
        updatedata();
        break;
    case "uptofile":
        updatefile();
        break;
    case "uptoindex":
        updateindex();
        break;
    default:
        headAdmin("缓存管理");
        main();
        break;
$playcodeApiUrlParamstart = $row["p_playcodeApiUrlParamstart"];
if (isN($playcodeApiUrltype)) {
    $playcodeApiUrltype = 0;
}
if (isN($p_videocodeType)) {
    $p_videocodeType = 0;
}
$starringarr = array();
$titlearr = array();
$picarr = array();
$strdstate = "";
$flag = false;
$reCollExistMovie = falses;
$action = be("all", "action");
if (isN($action)) {
    $collExiM = be("all", "ignoreExistM");
    if (!isN($collExiM)) {
        $reCollExistMovie = true;
    }
    if (strpos($pagenums, "-") !== false) {
        $nums = explode("-", $pagenums);
        writetofile("crawel_auto_info.log", $nums[1] . '{=====}' . $nums[0]);
        for ($i = $nums[0]; $i <= $nums[1]; $i++) {
            writetofile("crawel_auto_info.log", $p_id . '===Current Number{=====}' . $i);
            $strListUrl = replaceStr($p_pagebatchurl, "{ID}", $i);
            writetofile("crawel_auto_info.log", $p_id . '{=====}' . $strListUrl . "{=====}start");
            clearSession();
            cjList();
            writetofile("crawel_auto_info.log", $p_id . '{=====}' . $strListUrl . "{=====}end");
            writetofile("crawel_auto_info.log", $p_id . '===Current Number{=====}' . $i . "{=====}end");
        }
function main()
{
    global $db;
    $pagenum = be("get", "page");
    if (isN($pagenum) || !isNum($pagenum)) {
        $pagenum = 1;
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $pagenum = intval($pagenum);
    $project = be("get", "{pre}cj_vod_projects");
    $sql = "select * from {pre}cj_change where c_sys=0 ";
    if ($project != "") {
        $sql = $sql . " and c_pid = " . $project;
    }
    $rscount = $db->query($sql);
    $nums = $db->num_rows($rscount);
    //总记录数
    $pagecount = ceil($nums / app_pagenum);
    //总页数
    $sql = $sql . " limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			name:{
				required:true,
				maxlength:32
			},
			toid:{
				required:true
			},
			pid:{
				required:true
			}
		}
	});
	
	$("#btnDel").click(function(){
		if(confirm('确定要删除吗')){
			$("#form1").attr("action","collect_vod_change.php?action=del");
			$("#form1").submit();
		}
		else{return false}
	});
	$("#btnEdit").click(function(){
		if(confirm('确定要保存修改吗')){
			$("#form1").attr("action","collect_vod_change.php?action=save");
			$("#form1").submit();
		}
		else{return false}
	});
	$("#btnAdd").click(function(){
		$('#form2').form('clear');
		$('#win1').window('open'); 
	});
	$("#btnCancel").click(function(){
		location.href = location.href ;
	});	
});
</script>
<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td>
		菜单:<a href="collect_vod_manage.php?action=">采集规则列表</a> | <a href="collect_vod_manage.php?action=upexp">导入采集规则</a> | <a href="collect_vod_change.php">分类转换</a> | <a href="collect_vod_filters.php">信息过滤</a>  
	&nbsp; 按项目查看:<select onchange=javascript:window.location.href=this.options[this.selectedIndex].value>
	<option value="?action=">所有转换</option>
	<option value="?action=&{pre}cj_vod_projects=0" <?php 
    if ($project == "0") {
        echo "selected";
    }
    ?>
>全局转换</option>
	<?php 
    echo makeSelect("{pre}cj_vod_projects", "p_id", "p_name", "", "collect_vod_change.php", "&nbsp;|&nbsp;&nbsp;", $project);
    ?>
	</select>
	</td>
	</tr>
</table>

<form id="form1" name="form1" method="post">
<table class="tb">
<tr>
	<td width="10%" >ID</td>
	<td width="30%" >采集分类</td>
	<td width="30%" >系统分类</td>
	<td width="30%" >所属项目</td>
</tr>
	<?php 
    if (!$rs) {
        ?>
	<tr><td align="center" colspan="5">没有任何记录!</td></tr>
    <?php 
    } else {
        $i = 0;
        while ($row = $db->fetch_array($rs)) {
            ?>
    <tr>
	<td><input name="c_id[]" type="checkbox" value="<?php 
            echo $row["c_id"];
            ?>
" /><?php 
            echo $row["c_id"];
            ?>
</td>
	<td><input name="c_name<?php 
            echo $row["c_id"];
            ?>
" type="text" value="<?php 
            echo $row["c_name"];
            ?>
" size="40"></td>
	<td>
	<select name="c_toid<?php 
            echo $row["c_id"];
            ?>
">
	<?php 
            echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $row["c_toid"]);
            ?>
	</select>
	</td>
	<td>
	<select name="c_pid<?php 
            echo $row["c_id"];
            ?>
">
	<option value="0">全局过滤项目</option>
	<?php 
            echo makeSelect("{pre}cj_vod_projects", "p_id", "p_name", "", "", "&nbsp;|&nbsp;&nbsp;", $row["c_pid"]);
            ?>
	</select>
	</td>
	</tr>
<?php 
            $i = $i + 1;
        }
    }
    ?>
	<tr>
	<tr>
	<td colspan="5">
	全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'c_id[]');"/>&nbsp;
    <input type="button" id="btnDel" value="批量删除" class="input">
	<input type="button" id="btnEdit" value="批量修改" class="input">
	<input type="button" id="btnAdd" value="添加转换" class="input">
	</td>
	</tr>
	<th colspan="5" align=center>
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "collect_vod_change.php?page={p}&{pre}cj_vod_projects=" . $project . "");
    ?>
    </th>
	</tr>
</table>
</form>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" minimizable="false" maximizable="false">
<form action="?action=save" method="post" id="form2" name="form2">
<table class="tb">
<tr>
	<td>
	采集分类:
	<input name="c_name" type="text" size="30">
	</td>
</tr>
<tr>
	<td>
	目标分类:
	<select name="c_toid" style="width:180px;">
	<?php 
    echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
	</select>
	</td>
</tr>
<tr>
	<td>所属项目:
	<select name="c_pid" style="width:180px;">
	<option value="0">全局过滤项目</option>
	  	<?php 
    echo makeSelect("{pre}cj_vod_projects", "p_id", "p_name", "", "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
	</select>
	</td>
</tr>
<tr>
	<td align=center>
	<input class="input" type="submit" value="保存" id="btnSave">
	<input class="input" type="button" value="返回" id="btnCancel"> 
	</td>
</tr>
</table>
</form>
</div>
<?php 
}
<?php

ob_implicit_flush(true);
ini_set('max_execution_time', '0');
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "MovieType.php";
require_once "Project.php";
require_once "collect_vod_cjVideoUrl.php";
require_once "collect_vod_cjVideoAndroidUrl.php";
require_once "collect_vod_cjVideoIOSUrl.php";
//chkLogin();
//$sql = "SELECT url.u_id as u_id, url.u_weburl as u_weburl, p.p_id as p_id, m.m_urltest as m_urltest, m.m_type as m_type,
//    	        m.m_typeid as m_typeid
//    	        FROM {pre}cj_vod_url url, {pre}cj_vod_projects p, {pre}cj_vod m
//                WHERE m.m_id = url.u_movieid AND m.m_pid = p.p_id  AND (url.iso_video_url IS NUaL OR url.iso_video_url ='') and m.m_id=13079";
//
////parseVideoUrlsByMovieId('13079');
$p_ids = be("all", "p_id");
//parseVideoTypes($p_ids);
//echo $p_ids;
parseVideoUrlsByProjectIdNullUrls($p_ids);
<?php

/**
 * Created by PhpStorm.
 * User: yangliu
 * Date: 14-2-28
 * Time: 上午11:22
 */
ob_implicit_flush(true);
ini_set('max_execution_time', '0');
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "MovieType.php";
require_once "NBaidu.php";
require_once "tools/ContentManager.php";
$p_id = be("all", "p_id");
/**
 * p_id=1_1-3 pid is 1 and page from 1 to 3
 * p_id=1_1,3,5 pid is 1 and page is 1,3,5
 * http://cmsdev.joyplus.tv/manager/collect/auto_collect_vod_cj.php?p_id=1_1-3
 */
writetofile("crawel_auto_info.log", $p_id . '{=====}Project===start');
if (isN($p_id)) {
    writetofile("crawel_auto_info.log", $p_id . '采集提示","采集项目ID不能为空!');
    return;
}
$tem = explode("_", $p_id);
if (count($tem) == 2) {
    $p_id = $tem[0];
    $pagenums = $tem[1];
} else {
Example #25
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    $group = be("get", "group");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    if (!isN($group)) {
        $where = " where u_group = " . $group;
    }
    $sql = "SELECT count(*) FROM {pre}user " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT u_id,u_name,u_group,u_qq,u_email,u_status,u_points,u_tj,u_loginnum,u_logintime,u_ip,u_flag FROM {pre}user ";
    $sql .= $where . " ORDER BY u_id DESC  limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			u_name:{
				required:true,
				stringCheck:true,
				maxlength:32
			},
			u_password:{
				maxlength:32
			},
			u_flag:{
				required:true
			},
			u_group:{
				required:true
			},
			u_qq:{
				number:true,
				maxlength:16
			},
			u_email:{
				email:true,
				maxlength:32
			},
			u_points:{
				number:true
			},
			u_status:{
				required:true
			}
		}
	});
	$("#group").change(function(){
		var group = $(this).children('option:selected').val();
		location.href= "admin_user.php?group=" + group;
	});
	$('#form1').form({
		onSubmit:function(){
			if(!$("#form1").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info',function(){
	        location.href=location.href;
	        });
	    }
	});
	$('#form2').form({
		onSubmit:function(){
			if(!$("#form2").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info');
	    }
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}manager");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnAdd").click(function(){
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open'); 
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
	$.fn.datebox.defaults.formatter = function(date) {
	var y = date.getFullYear();
	var m = date.getMonth() + 1;
	var d = date.getDate();
	return y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d);
	};
	$('#u_starttime').datebox();
	$('#u_endtime').datebox();
});
function showflag(flag){
	if (flag==2){
		$("#flag2").show();
		$("#flag1").hide();
	}
	else if (flag==1){
		$("#flag2").hide();
		$("#flag1").show();
	}
	else{
		$("#flag2").hide();
		$("#flag1").hide();
	}
}
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$.get('admin_ajax.php?action=getinfo&tab={pre}user&col=u_id&val='+id,function(obj){
		$("#uid").val(obj.u_id);
		$("#u_name").val(obj.u_name);
		$("#u_qq").val(obj.u_qq);
		$("#u_email").val(obj.u_email);
		$("#u_points").val(obj.u_points);
		$("#u_phone").val(obj.u_phone);
		$("#u_question").val(obj.u_question);
		$("#u_answer").val(obj.u_answer);
		
		if(obj.u_status==1){
			$("#u_status").get(0).options[0].selected = true;
		}
		else{
			$("#u_status").get(0).options[1].selected = true;
		}
		if(obj.u_flag==1){
			$("#u_flag").get(0).options[1].selected = true;
			$('#u_starttime').datebox('setValue',obj.u_start);
			$('#u_endtime').datebox('setValue',obj.u_end);
			$("#flag1").show();
			$("#flag2").hide();
		}
		else if(obj.u_flag==2){
			$("#u_flag").get(0).options[2].selected = true;
			$("#u_startip").val(obj.u_start);
			$("#u_endip").val(obj.u_end);
			$("#flag2").show();
			$("#flag1").hide();
		}
		else{
			$("#u_flag").get(0).options[0].selected = true;
		}
		$("#u_group option").each(function(i){
       		if($(this).val() == obj.u_group){
            	$("#u_group").get(0).options[i].selected = true;
            }
        });
	},"json");
}
</script>
<table class="tb">
	<tr>
	<td colspan="5" ><strong>会员组查看:</strong>
	<select id="group" name="group">
	<option value="">全部会员</option>
	<?php 
    echo makeSelect("{pre}user_group", "ug_id", "ug_name", "", "", "&nbsp;|&nbsp;&nbsp;", $group);
    ?>
	</select>
	</td>
	</tr>
</table>

<form action="" method="post" id="form1" name="form1">
<table class="tb">
	<tr>
	<td width="4%">&nbsp;</td>
	<td>会员</td>
	<td width="10%">计费类型</td>
	<td width="15%">会员组</td>
	<td width="10%">积分</td>
	<td width="10%">推荐数</td>
	<td width="15%">是否锁定</td>
	<td width="15%">最后登陆</td>
	<td width="15%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="9" >没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $u_id = $row["u_id"];
            ?>
    <tr>
	  <td><input name="u_id[]" type="checkbox" value="<?php 
            echo $u_id;
            ?>
" /></td>
      <td><?php 
            echo $row["u_name"];
            ?>
</td>
      <td>
	  <?php 
            echo $row["u_flag"];
            ?>
      </td>
      <td><?php 
            $row1 = $db->getRow("SELECT ug_name FROM {pre}user_group WHERE ug_id=" . $row["u_group"]);
            if ($row1) {
                echo $row1["ug_name"];
            } else {
                echo "未知";
            }
            unset($row1);
            ?>
</td>
      <td><?php 
            echo $row["u_points"];
            ?>
</td>
      <td><?php 
            echo $row["u_tj"];
            ?>
</td>
      <td><?php 
            if ($row["u_status"] == 1) {
                echo "<font color=green>启用</font>";
            } else {
                echo "<font color=red>禁用</font>";
            }
            ?>
</td>
      <td><?php 
            echo $row["u_logintime"];
            ?>
</td>
      <td><a href="javascript:void(0)" onclick="edit('<?php 
            echo $u_id;
            ?>
');return false;">修改</a> |
	  <a href="admin_ajax.php?action=del&tab={pre}user&u_id=<?php 
            echo $u_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a></td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr>
	<td colspan="9">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'u_id[]')" />
	&nbsp;<input type="button" id="btnDel" value="批量删除" class="input" />
	&nbsp;<input type="button" id="btnAdd" value="添加"  class="input"/>
	</td></tr>
    <tr align="center">
	<td colspan="9">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_user.php?page={p}&group={$group}");
    ?>
	</td>
	</tr>
</table>
</form>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab={pre}user" method="post" name="form2" id="form2">
<table class="tb">
	<input id="uid" name="uid" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
    <tr>
	<td width="30%">名称:</td>
	<td><INPUT type="text" id="u_name" size=20 value="" name="u_name">
	</td>
    </tr>
    <tr>
	<td>密码:</td>
	<td><INPUT id="u_password" type="password" size=20 value="" name="u_password">
	</td>
    </tr>
    <tr>
	<td>状态:</td>
	<td>
	<select id="u_status" name="u_status" style="width:100px;">
	<option value=1>启动</option>
	<option value=0>锁定</option>
	</select>
	</td>
    </tr>
	<tr id="flag1" style="display:none">
	<td>设置时间:</td>
	<td>
	起始时间:<INPUT type="text" id="u_starttime" size=20 value="" name="u_starttime"><br>
	截止时间:<INPUT type="text" id="u_endtime" size=20 value="" name="u_endtime" >
	</td>
	</tr>
	<tr id="flag2" style="display:none">
	<td>设置IP段:</td>
	<td>
	起始IP:<INPUT type="text" id="u_startip" size=20 value="" name="u_startip"><br>
	截止IP:<INPUT type="text" id="u_endip" size=20 value="" name="u_endip">
	</td>
    </tr>
    <tr>
	<td>会员组:</td>
	<td>
	<select id="u_group" name="u_group" style="width:100px;">
	<option value="">请选择会员组</option>
	<?php 
    echo makeSelect("{pre}user_group", "ug_id", "ug_name", "", "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
	</select>
	</td>
    </tr>
	<tr>
	<td>QQ:</td>
	<td><INPUT id="u_qq" type="text" size=20 value="" name="u_qq">
	</td>
    </tr>
	<tr>
	<td>email:</td>
	<td><INPUT id="u_email" type="text" size=20 value="" name="u_email">
	</td>
    </tr>
    <tr>
	<td>电话:</td>
	<td><INPUT id="u_phone" type="text" size=20 value="" name="u_phone">
	</td>
    </tr>
	
	<tr align="center">
      <td colspan="2"><input class="input" type="submit" value="保存" id="btnSave"> <input class="input" type="button" value="返回" id="btnCancel"> </td>
    </tr>
</table>
</form>
</div>
</body>
</html>
<?php 
    unset($rs);
}
<?php

/**
 * Created by PhpStorm.
 * User: yangliu
 * Date: 14-2-17
 * Time: 上午10:27
 */
require_once "../admin_conn.php";
require_once "collect_fun.php";
require_once "tools/ContentManager.php";
define("CATEGORY", "https://openapi.youku.com/v2/shows/by_category.json?client_id=715115c589f8533a&category={category}&release_year=&page={page}&count=20&paid=0");
define("VIDEOS", "https://openapi.youku.com/v2/shows/videos.json?client_id=715115c589f8533a&show_id={id}&page=1&count={count}");
define("SHOWINFO", "https://openapi.youku.com/v2/shows/show.json?client_id=715115c589f8533a&show_id={id}");
$action = be("all", "a_p");
echo $action;
$action = explode("_", $action);
$type = $action[0];
$page = $action[1];
switch ($type) {
    case "1":
        //电影
        for ($i = 1; $i <= $page; $i++) {
            CjYoukuVideos("电影", '1', $i, "177");
        }
        break;
    case "2":
        //电视剧
        for ($i = 1; $i <= $page; $i++) {
            CjYoukuVideos("电视剧", '2', $i, "178");
        }
function notifyMsg()
{
    $d_id = be("all", "notify_msg_prod_id");
    $prod_type = be("all", "notify_msg_prod_type");
    global $parse_appid_restkey, $parse_appid_restkey_baidu;
    $can_search_device = be("all", "channel");
    if (!isN($can_search_device)) {
        $content = be("all", "content");
        $msg = new Notification();
        $msg->alert = $content;
        $msg->prod_id = $d_id;
        $msg->prod_type = $prod_type;
        $msg->push_type = '1';
        $msg->channels = explode(",", $can_search_device);
        $isoFlag = false;
        $androidFlag = false;
        if (strpos($can_search_device, 'CHANNEL_ANDROID') !== false || strpos($can_search_device, 'CHANNEL_TV') !== false) {
            $androidFlag = true;
        }
        if (strpos($can_search_device, 'CHANNEL_IOS') !== false || strpos($can_search_device, 'CHANNEL_IPAD') !== false || strpos($can_search_device, 'CHANNEL_IPHONE') !== false) {
            $isoFlag = true;
        }
        if ($isoFlag && !$androidFlag) {
            $msg->type = NotificationsManager::DEVICE_ISO;
        }
        if ($androidFlag && !$isoFlag) {
            $msg->type = NotificationsManager::DEVICE_ANDROID;
        }
        if (strpos($can_search_device, '_BAIDU') === false) {
            $appname = $parse_appid_restkey[$can_search_device]['appname'];
            $msg->appid = $parse_appid_restkey[$can_search_device]['appid'];
            $msg->restkey = $parse_appid_restkey[$can_search_device]['restkey'];
            $result = NotificationsManager::push($msg);
            $appname = $parse_appid_restkey[$can_search_device]['appname'];
        } else {
            if ($isoFlag && !$androidFlag) {
                $msg->iosCertPath = $parse_appid_restkey_baidu[$can_search_device]['iosCertPath'];
                $msg->iosCertPathRel = $parse_appid_restkey_baidu[$can_search_device]['iosCertPathRel'];
            }
            $appname = $parse_appid_restkey_baidu[$can_search_device]['appname'];
            $msg->appid = $parse_appid_restkey_baidu[$can_search_device]['appid'];
            $msg->restkey = $parse_appid_restkey_baidu[$can_search_device]['restkey'];
            //			var_dump($parse_appid_restkey_baidu);
            $result = NotificationsManager::pushBaidu($msg);
        }
        if ($result['code'] . '' == '200') {
            echo "消息推送到 [" . $appname . "] 成功";
        } else {
            echo "消息推送到 [" . $appname . "] 失败:" . $result['response'];
        }
    } else {
        echo "你必须要选择一个频道发送";
    }
}
Example #28
0
function sqlexe()
{
    global $db;
    $sql = be("post", "sql");
    if (!isN($sql)) {
        $sql = stripslashes($sql);
        if (strtolower(substr($sql, 0, 6)) == "select") {
            $isselect = true;
        } else {
            $isselect = false;
        }
        echo "执行sql: " . $sql;
        echo '</br>';
        $rs = $db->query($sql);
        echo "执行结果: " . mysql_affected_rows();
        echo '</br>';
    }
    if (!isN($_FILES['import_file']['tmp_name'])) {
        execImport();
    }
    ?>
<table class="tb">
<?php 
    if ($isselect) {
        $i = 0;
        while ($row = $db->fetch_array($rs)) {
            if ($i == 0) {
                foreach ($row as $k => $v) {
                    echo "<td><strong>{$k}</strong></td>";
                }
            }
            ?>
	<tr>
	<?php 
            foreach ($row as $k => $v) {
                ?>
		<td><?php 
                echo $v;
                ?>
</td>
		<?php 
            }
            ?>
	</tr>
	<?php 
            $i++;
        }
    } else {
        //	$nums=mysql_affected_rows();
        ?>
	
	<?php 
    }
    ?>
</table>
	<?php 
}
function info()
{
    global $db, $cache;
    $prod_id = be("all", "id");
    $sql = "SELECT * FROM {pre}vod_topic ,{pre}vod_topic_items as items where t_id = topic_id and t_userid=0 and t_id>4 and  vod_id=" . $prod_id . " ORDER BY t_sort,t_id ASC ";
    //var_dump($sql)
    $rs = $db->query($sql);
    $nums = 1;
    ?>


<table class="tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="10%">编号</td>
	<td>名称</td>
	<td>关注度</td>
	<td width="15%">类别</td>
	<td width="15%">视频栏目</td>
	<td width="10%">显示到App</td>
	<td width="20%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $t_id = $row["t_id"];
            ?>
    <tr>
	  <td>
	 </td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td>
     <?php 
            echo $row["t_name"];
            ?>
</td>
	  <td>
	   <select disabled id="t_toptype<?php 
            echo $t_id;
            ?>
" name="t_toptype<?php 
            echo $t_id;
            ?>
">
	<option value="-1">关注度</option>
	<option value="1" <?php 
            if ($row["t_toptype"] == 1) {
                echo "selected";
            }
            ?>
>热门</option>
	<option value="0" <?php 
            if ($row["t_toptype"] == 0) {
                echo "selected";
            }
            ?>
>非热门</option>
	</select>
	  </td>
	  <td>
	 
	  <select disabled id="t_type<?php 
            echo $t_id;
            ?>
" name="t_type<?php 
            echo $t_id;
            ?>
">
	<option value="0" <?php 
            if ($row["t_type"] == 0) {
                echo "selected";
            }
            ?>
>没有栏目</option>
	<?php 
            echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $row["t_type"]);
            ?>
	</select>
	  </td>
       <td>
	 <select disabled id="t_bdtype<?php 
            echo $t_id;
            ?>
" name="t_bdtype<?php 
            echo $t_id;
            ?>
">
	<option value="-1">榜单类型</option>
	<option value="1" <?php 
            if ($row["t_bdtype"] == 1) {
                echo "selected";
            }
            ?>
>悦单</option>
	<option value="2" <?php 
            if ($row["t_bdtype"] == 2) {
                echo "selected";
            }
            ?>
>悦榜</option>
	</select></td>
      
	  <td>
	 
	  <select disabled id="t_flag<?php 
            echo $t_id;
            ?>
" name="t_flag<?php 
            echo $t_id;
            ?>
">
	<option value="0" <?php 
            if ($row["t_flag"] == 0) {
                echo "selected";
            }
            ?>
>不显示</option>
	<option value="1" <?php 
            if ($row["t_flag"] == 1) {
                echo "selected";
            }
            ?>
>显示</option>
	</select>
	  </td>
	  
	  
	  
      <td>
	  <a href="admin_vod_topic_items.php?topic_id=<?php 
            echo $t_id;
            ?>
">显示视频列表</a> |
<!--	  <a href="admin_ajax.php?action=del&tab={pre}vod_topic&t_id=<?php 
            echo $t_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a>-->
	  </td>
    </tr>
	<?php 
        }
    }
    ?>
	   
</table>
</form>

</body>
</html>
<?php 
    unset($rs);
}
function main()
{
    global $db, $cache;
    $topic_id = be("all", "topic_id");
    $flag = be("all", "flag");
    if (!isNum($topic_id)) {
        $topic_id = 0;
    } else {
        $topic_id = intval($topic_id);
    }
    if (!isNum($flag)) {
        $flag = -1;
    } else {
        $flag = intval($flag);
    }
    $where = " 1=1 ";
    $where .= " AND a.topic_id =" . $topic_id;
    if ($flag == 1) {
        $where .= " AND a.flag =1 ";
    }
    if ($flag == 0) {
        $where .= " AND a.flag =0 ";
    }
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}vod_topic_items as a " . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    //$sql = "SELECT a.id as id, a.flag as flag, a.disp_order as disp_order, vod.d_name as vod_name,vod.d_id as vod_id FROM {pre}vod_topic_items a,{pre}vod vod where ".$where." and a.vod_id=vod.d_id ORDER BY a.disp_order,a.id ASC limit ".(app_pagenum * ($pagenum-1)) .",".app_pagenum;
    //	var_dump($sql);
    $sql = "SELECT a.id as id, a.flag as flag, a.disp_order as disp_order, vod.d_name as vod_name,vod.d_id as vod_id FROM {pre}vod_topic_items AS a LEFT JOIN {pre}vod AS vod ON a.vod_id = vod.d_id WHERE " . $where . " and a.topic_id ={$topic_id} ORDER BY a.disp_order,a.id ASC LIMIT " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
function filter(){
	var topic_id=$("#topic_id").val();
	var st_flag  =$("#st_flag").val();
	var url = "admin_vod_topic_items.php?topic_id="+topic_id+"&flag="+st_flag;
	window.location.href=url;
}

$(document).ready(function(){
	
	$('#form1').form({
		onSubmit:function(){
			if(!$("#form1").valid()) {return false;}
		},
	    success:function(data){
	        $.messager.alert('系统提示', data, 'info',function(){
	        	location.href=location.href;
	        });
	    }
	});
	
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}vod_topic_items");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnEdit").click(function(){
		$("#form1").attr("action","?action=editall");
		$("#form1").submit();
	});
//	$("#btnAdd").click(function(){
//		window.location.href="admin_vod.php?topic_id=<?php 
    echo $topic_id;
    ?>
";
//	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
});
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$('#form2').form('load','admin_ajax.php?action=getinfo&tab={pre}vod_topic&col=t_id&val='+id);
}
</script>

<table class="admin_vod_topic_items tb">
	<tr>
	<td>
	<table border="0" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">
	过滤条件:视频榜单 <select id="topic_id" name="topic_id" >
	
	<?php 
    echo makeSelectWhere("{pre}vod_topic", "t_id", "t_name", "t_sort", "", "&nbsp;|&nbsp;&nbsp;", $topic_id, " where t_id>4");
    ?>
	</select>
	
	 <select id="st_flag" name="st_flag">
	 <option value="-1" <?php 
    if ($flag == -1) {
        echo "selected";
    }
    ?>
>显示到榜单</option>
	<option value="0" <?php 
    if ($flag == 0) {
        echo "selected";
    }
    ?>
>不显示</option>
	<option value="1" <?php 
    if ($flag == 1) {
        echo "selected";
    }
    ?>
>显示</option>
	</select>
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	 | <a href="admin_vod_topic.php">返回视频榜单</a>
	</td> 
	</tr>
	
	</table>
	</td>
	</tr>
</table>

<table class="tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="10%">编号</td>
	<td>名称</td>
	<td width="5%">排序</td>
	<td width="10%">显示到榜单</td>
	<td width="20%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $t_id = $row["id"];
            ?>
    <tr>
	  <td>
	  <input name="ids[]" type="checkbox" id="ids" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td><a href="admin_vod.php?action=edit&id=<?php 
            echo $row["vod_id"];
            ?>
">
      <?php 
            echo $row["vod_name"];
            ?>
</a></td>
	  
	 
	  <td>
	  <input name="disp_order<?php 
            echo $t_id;
            ?>
" type="text" value="<?php 
            echo $row["disp_order"];
            ?>
"  size="5"/></td>
	  <td>
	 
	  <select id="t_flag<?php 
            echo $t_id;
            ?>
" name="t_flag<?php 
            echo $t_id;
            ?>
">
	   <option value="-1" <?php 
            if ($flag == -1) {
                echo "selected";
            }
            ?>
>显示到榜单</option>
	<option value="0" <?php 
            if ($row["flag"] == 0) {
                echo "selected";
            }
            ?>
>不显示</option>
	<option value="1" <?php 
            if ($row["flag"] == 1) {
                echo "selected";
            }
            ?>
>显示</option>
	</select>
	  </td>
      <td>	
	 
	  <a href="admin_ajax.php?action=del&tab={pre}vod_topic_items&ids=<?php 
            echo $t_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a></td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr class="formlast">
	<td  colspan="8"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'ids[]')" /> 全选
	<input type="button" value="批量删除" id="btnDel" class="input"  />
	&nbsp;<input type="button" value="批量修改" id="btnEdit" class="input" />
	&nbsp;<input id="addvod" type="button" value="添加视频" class="input" onclick="javascript:window.location.href='admin_vod.php?action=addTopicItems&topic_id=<?php 
    echo $topic_id;
    ?>
'" />
	</td></tr>
    <tr align="center" class="formlast">
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_vod_topic_items.php?page={p}&topic_id=" . $topic_id . "&flag=" . $flag);
    ?>
	</td>
    </tr>
</table>
</form>

</body>
</html>
<?php 
    unset($rs);
}