function main()
{
    global $db, $cache;
    $keyword = be("all", "keyword");
    $status = be("all", "status");
    if (!isNum($status)) {
        $status = -1;
    } else {
        $status = intval($status);
    }
    $where = " 1=1 ";
    if (!isN($keyword)) {
        $where .= " AND vod.d_name LIKE '%" . $keyword . "%' ";
    }
    if ($status == 1) {
        $where .= " AND a.status =1 ";
    }
    if ($status == 0) {
        $where .= " AND a.status =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_popular as a, {pre}vod as vod"." where ".$where ." and a.vod_id=vod.d_id";
    $nums = 1;
    //	var_dump($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = 'SELECT *
FROM (

SELECT 0 as type, a.id AS id, a.status AS
STATUS , a.disp_order AS disp_order, vod.d_name AS vod_name, vod.d_id AS vod_id, a.ipad_pic_url AS ipad_pic_url, a.iphone_pic_url AS iphone_pic_url, a.info_desc AS info_desc
FROM mac_vod_popular a, mac_vod vod
WHERE a.type =0
AND a.vod_id = vod.d_id
UNION
SELECT 1 as type, a.id AS id, a.status AS
STATUS , a.disp_order AS disp_order, vod.t_name AS vod_name, vod.t_id AS vod_id, a.ipad_pic_url AS ipad_pic_url, a.iphone_pic_url AS iphone_pic_url, a.info_desc AS info_desc
FROM mac_vod_popular a, mac_vod_topic vod
WHERE a.type =1
AND a.vod_id = vod.t_id

UNION
SELECT a.type as type, a.id AS id, a.status AS
STATUS , a.disp_order AS disp_order, "" AS vod_name, "" AS vod_id, a.ipad_pic_url AS ipad_pic_url, a.iphone_pic_url AS iphone_pic_url, a.info_desc AS info_desc
FROM mac_vod_popular a
WHERE a.type != 1 and a.type != 0

) AS b
ORDER BY b.disp_order ASC , b.id DESC ';
    //	var_dum/p($sql);
    $rs = $db->query($sql);
    //	$sql2 = "SELECT a.id as id, a.status as status, a.disp_order as disp_order, vod.t_name as vod_name,vod.t_id as vod_id ,a.ipad_pic_url as ipad_pic_url, a.iphone_pic_url as iphone_pic_url,a.info_desc as info_desc FROM {pre}vod_popular a,{pre}vod_topic vod  where  a.type=1 and a.vod_id=vod.t_id ORDER BY a.disp_order asc,a.id desc ";
    ////	var_dum/p($sql);
    //	$rs2 = $db->query($sql2);
    ?>
<script language="javascript">
function filter(){
	var status=$("#status").val();
	var keyword=$("#keyword").val();
	var url = "admin_vod_topic.php?keyword="+encodeURI(keyword)+"&status="+status;
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
				stringCheck:true,
				maxlength:64
			},
			t_enname:{
				required:true,
				stringCheck:true,
				maxlength:128
			},
			t_template:{
				required:true,
				maxlength:128
			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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}vod_popular");
				$("#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');
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
});
function edit(id,type)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$('#form2').form('load','admin_ajax.php?action=getinfo&tab={pre}vod_popular&col=id&val='+id+'&type='+type);
}
</script>

<!--<table class="tb">-->
<!--	<tr>-->
<!--	<td>-->
<!--	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">-->
<!--	<tr>-->
<!--	<td colspan="2">-->
<!--	&nbsp;-->
<!--	<select id="status" name="status">-->
<!--	<option value="-1"  <?php 
    if ($status == -1) {
        echo "selected";
    }
    ?>
>是否出现在轮播图</option>-->
<!--	<option value="1" <?php 
    if ($status == 1) {
        echo "selected";
    }
    ?>
>显示</option>-->
<!--	<option value="0" <?php 
    if ($status == 0) {
        echo "selected";
    }
    ?>
>不显示</option>-->
<!--	</select>-->
<!--	-->
<!--	</td>-->
<!---->
<!--	<td>-->
<!--	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">-->
<!--	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	-->
<!--	</td>-->
<!--	<td width="150px">-->
<!--		-->
<!--	</td>-->
<!--	</tr>-->
<!--	</table>-->
<!--	</td>-->
<!--	</tr>-->
<!--</table>-->

<table class="admin_vod_popular tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="2%">&nbsp;</td>
	<td width="5%">编号</td>
	<td >名称</td>
	<td width="20%">Iphone图片</td>
	<td width="20%">Ipad图片</td>
	<td width="10%">简介</td>
	<td width="10%">权重(越小排前)</td>
	<td width="8%">操作</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="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td>

    <a href=<?php 
            if ($row['type'] === '0') {
                echo 'admin_vod.php?action=edit&id=';
            } else {
                echo 'admin_vod_topic_items.php?topic_id=';
            }
            echo $row["vod_id"];
            ?>
>
      <?php 
            echo $row["vod_name"];
            ?>
</a> <?php 
            if ($row['type'] === '0') {
                echo '[视频]';
            } else {
                if ($row['type'] === '1') {
                    echo '[榜单]';
                } else {
                    if ($row['type'] === '3') {
                        echo '[二维码图片]';
                    }
                }
            }
            ?>
 </td>
	  <td>
	 <?php 
            echo $row["iphone_pic_url"];
            ?>
</td>
	 
      <td>
     <?php 
            echo $row["ipad_pic_url"];
            ?>
</td>
       <td>
     <?php 
            echo $row["info_desc"];
            ?>
</td>
	  <td>
	  <?php 
            echo $row["disp_order"];
            ?>
</td>
<!--	  <td>-->
<!--	 -->
<!--	  <select id="status<?php 
            echo $t_id;
            ?>
" name="status<?php 
            echo $t_id;
            ?>
">-->
<!--	<option value="0" <?php 
            if ($row["status"] == 0) {
                echo "selected";
            }
            ?>
>不显示</option>-->
<!--	<option value="1" <?php 
            if ($row["status"] == 1) {
                echo "selected";
            }
            ?>
>显示</option>-->
<!--	</select>-->
<!--	  </td>-->
	  
	  
	  
      <td>
	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
','<?php 
            echo $row['type'];
            ?>
');return false;">修改</a> |
<!--	  <a href="admin_vod_topic_items.php?topic_id=<?php 
            echo $t_id;
            ?>
">显示视频列表</a> |-->
	  <a href="admin_ajax.php?action=del&tab={pre}vod_popular&t_id=<?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,'t_id[]')" /> 全选
	<input type="button" value="批量删除" id="btnDel" class="input"  />
	
	&nbsp;<input type="button" value="添加视频" id="btnAddvideo" class="input" onclick="javascript:window.location.href='admin_vod.php?action=addVodPopular'" />
	&nbsp;<input type="button" value="添加榜单" id="btnAddbang" class="input" onclick="javascript:window.location.href='admin_vod_topic.php?keyword=&t_userid=0&t_flag=1&t_bdtype=-1'" />
	</td></tr>
    <tr align="center" class="formlast">
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_vod_popular.php?page={p}&keyword=" . urlencode($keyword) . "&status=" . $status);
    ?>
	</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}vod_popular" 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="vod_name" size=40 value="" name="vod_name" disabled>
	</td>
	</tr>
	<tr>
	<td>Iphone图片:</td>
	<td><input id="iphone_pic_url" size=40 value="" name="iphone_pic_url" >
	</td>
    </tr>
	
	<tr>
     <td>Ipad图片</td>
      <td><input id="ipad_pic_url" size=40 value="" name="ipad_pic_url" >
	  </td>
    </tr>
    
    <tr>
     <td>类别</td>
      <td><select id="type" name="type">
	   
	   <option value="0" selected>视频</option>
	   <option value="1" >榜单</option>
	</select>
	  </td>
    </tr>
    
  
    
   
    
	<tr>
     <td>排序:</td>
      <td><input id="disp_order" size=10 value="" name="disp_order" >
	  </td>
    </tr>
    
	<tr>
     <td>描述信息:</td>
      <td>
      <TEXTAREA id="info_desc" NAME="info_desc" ROWS="8" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>
	  </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);
}
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 
}
function main()
{
    global $db, $template, $cache;
    $loginname = getCookie("adminname");
    $keyword = be("all", "keyword");
    $stype = be("all", "stype");
    $area = be("all", "area");
    $topic = be("all", "topic");
    $level = be("all", "level");
    $from = be("all", "from");
    $sserver = be("all", "sserver");
    $sstate = be("all", "sstate");
    $repeat = be("all", "repeat");
    $repeatlen = be("all", "repeatlen");
    $order = be("all", "order");
    $pagenum = be("all", "page");
    $sort = be("all", "sort");
    $spic = be("all", "spic");
    $hide = be("all", "hide");
    $d_status = be("all", "d_status");
    $douban_score = be("all", "douban_score");
    $ipadpic = be("all", "ipadpic");
    $d_douban_id = be("all", "d_douban_id");
    $can_search_device = be("all", "can_search_device");
    if (!isNum($level)) {
        $level = 0;
    } else {
        $level = intval($level);
    }
    if (!isNum($sstate)) {
        $sstate = 0;
    } else {
        $sstate = intval($sstate);
    }
    if (!isNum($stype)) {
        $stype = 0;
    } else {
        $stype = intval($stype);
    }
    if (!isNum($area)) {
        $area = 0;
    } else {
        $area = intval($area);
    }
    if (!isNum($topic)) {
        $topic = 0;
    } else {
        $topic = intval($topic);
    }
    if (!isNum($spic)) {
        $spic = 0;
    } else {
        $spic = intval($spic);
    }
    if (!isNum($ipadpic)) {
        $ipadpic = 0;
    } else {
        $ipadpic = intval($ipadpic);
    }
    if (!isNum($hide)) {
        $hide = -1;
    } else {
        $hide = intval($hide);
    }
    if (!isNum($douban_score)) {
        $douban_score = 0;
    } else {
        $douban_score = intval($douban_score);
    }
    if (!isNum($repeatlen)) {
        $repeatlen = 0;
    }
    if (!isNum($d_status)) {
        $d_status = -1;
    } else {
        $d_status = intval($d_status);
    }
    if (isNum($d_douban_id)) {
        $d_douban_id = intval($d_douban_id);
    }
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $where = " d_type in (1,2,3,131) ";
    $keyword_col = be("all", "keyword_col");
    if (!isN($keyword)) {
        $keyword = trim($keyword);
        if (isN($keyword_col)) {
            $where .= " AND ( d_directed like '%" . $keyword . "%' or d_starring like '%" . $keyword . "%' or d_name like '%" . $keyword . "%' or d_enname like '%" . $keyword . "%'   ) ";
        } else {
            $where .= " AND " . $keyword_col . " like '%" . $keyword . "%' ";
        }
    }
    if ($stype > 0) {
        $typearr = getValueByArray($cache[0], "t_id", $stype);
        if (is_array($typearr)) {
            $where = $where . " and d_type in (" . $typearr["childids"] . ")";
        } else {
            $where .= " AND d_type=" . $stype . " ";
        }
    }
    if ($stype == -1) {
        $where .= " AND d_type=0 ";
    }
    if ($area > 0) {
        $where .= " AND d_area = " . $area . " ";
    }
    if ($topic > 0) {
        $where .= " AND d_topic = " . $topic . " ";
    }
    if ($level > 0) {
        $where .= " AND d_level = " . $level . " ";
    }
    if ($sstate == 1) {
        $where .= " AND d_state>0 ";
    } else {
        if ($sstate == 2) {
            $where .= " AND d_state=0 ";
        }
    }
    if ($hide != -1) {
        $where .= " AND d_hide=" . $hide . " ";
    }
    if ($d_douban_id == -1) {
        $where .= " AND d_douban_id=" . $d_douban_id . " ";
    } else {
        if ($d_douban_id == 1) {
            $where .= " AND d_douban_id >0 ";
        } else {
            if ($d_douban_id == 2) {
                $where .= " AND d_douban_id =0 ";
            }
        }
    }
    if ($d_status != -1) {
        $where .= " AND d_status=" . $d_status . " ";
    }
    if ($douban_score == 1) {
        $where .= " AND d_score >0 ";
    }
    if ($douban_score == 2) {
        $where .= " AND d_score <=0 ";
    }
    if ($stype == 1 || $stype == 2) {
        $douban_scoreT = "block";
    } else {
        $douban_scoreT = "none";
    }
    if (!isN($can_search_device)) {
        //    	if($can_search_device ==='TV'){
        //    		$where .= " AND can_search_device like '%TV%' ";
        //    	}else {
        //    		$where .= " AND (can_search_device like '".$can_search_device."' or can_search_device is null or can_search_device ='' ) ";
        //    	}
        $where .= " AND (can_search_device like '" . $can_search_device . "' or can_search_device is null or can_search_device ='' ) ";
    }
    if ($repeat == "ok") {
        $repeatSearch = " d_name ";
        if ($repeatlen > 0) {
            $repeatSearch = " substring(d_name,1," . $repeatlen . ") ";
        }
        $repeatsql = " , (SELECT " . $repeatSearch . " as d_name1 FROM {pre}vod GROUP BY d_name1 HAVING COUNT(*)>1) as `t2` ";
        $where .= " AND `{pre}vod`.`d_name`=`t2`.`d_name1` ";
        if (isN($order)) {
            $order = "d_name,d_addtime";
        }
    }
    $douban_comment = be("all", "douban_comment");
    if (!isNum($douban_comment)) {
        $douban_comment = 0;
    } else {
        $douban_comment = intval($douban_comment);
    }
    if ($douban_comment == 1) {
        $where .= " and d_id in (SELECT DISTINCT content_id FROM tbl_comments WHERE author_id IS NULL AND thread_id IS NULL) ";
    }
    if ($douban_comment == 2) {
        $where .= " and d_id not in (SELECT DISTINCT content_id FROM tbl_comments WHERE author_id IS NULL AND thread_id IS NULL) ";
    }
    if (isN($order)) {
        $orders = "d_time desc ";
    } else {
        if (!isN($sort)) {
            $orders = $order . ' ' . $sort;
        }
    }
    if (!isN($sserver)) {
        $where .= " AND d_playserver like '%" . $sserver . "%' ";
    }
    if (!isN($from)) {
        $where .= " and d_playfrom like  '%" . $from . "%' ";
    }
    if ($spic == 1) {
        $where .= " AND d_pic = '' ";
    } else {
        if ($spic == 2) {
            $where .= " and  d_pic not like '%joyplus%' and d_pic!=''  ";
        }
    }
    if ($ipadpic == 1) {
        $where .= " AND (d_pic_ipad = ''  or d_pic_ipad is null )";
    } else {
        if ($ipadpic == 2) {
            $where .= " AND d_pic_ipad not like '%joyplus%' and d_pic_ipad != '' ";
        }
    }
    $select_weburl = be("all", "select_weburl");
    $select_videourl = be("all", "select_videourl");
    $select_videourl_play = be("all", "select_videourl_play");
    if (!isNum($select_videourl_play)) {
        $select_videourl_play = -1;
    } else {
        $select_videourl_play = intval($select_videourl_play);
    }
    if ($select_videourl_play == 0) {
        $where .= " AND d_play_check = 0 ";
    }
    if ($select_videourl_play == 2) {
        $where .= " AND d_play_check = 2 ";
    }
    if ($select_videourl_play == 1) {
        $where .= " AND d_play_check = 1 ";
    }
    if ($select_weburl == 1) {
        $where .= " AND webUrls is not null and webUrls !='' ";
    }
    if ($select_weburl == 2) {
        $where .= " AND (webUrls is null or  webUrls ='') ";
    }
    if ($select_videourl == 1) {
        $where .= " AND d_downurl is not null and d_downurl !='' ";
    }
    if ($select_videourl == 2) {
        $where .= " AND (d_downurl is null or d_downurl ='') ";
    }
    $sql = "SELECT count(*) FROM {pre}vod " . $repeatsql . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    //$sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide,p.id as popular_id FROM {pre}vod ".$repeatsql." left join {pre}vod_popular as p on p.vod_id=d_id  WHERE" . $where . " ORDER BY " . $orders . "  limit ".(app_pagenum * ($pagenum-1)) .",".app_pagenum;
    $sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide FROM {pre}vod " . $repeatsql . "  WHERE" . $where . " ORDER BY " . $orders . "  limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    // var_dump($sql);
    $rs = $db->query($sql);
    ?>


<script type="text/javascript" src="./resource/thickbox-compressed.js"></script>
<script type="text/javascript" src="./resource/thickbox.js"></script>
<link href="./resource/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript">
$(document).ready(function(){
	$("#form1").validate({
		rules:{
			repeatlen:{
				number:true,
				max:10
			}
		}
	});
	
	$("#btnrepeat").click(function(){
		var repeatlen = $("#repeatlen").val();
		var reg = /^\d+$/;
		var re = repeatlen.match(reg);
		if (!re){ repeatlen=0; }
		if (repeatlen >20){ alert("长度最大20");$("#repeatlen").focus();return;}
		var url = "admin_vod.php?repeat=ok&repeatlen=" + repeatlen;
		window.location.href=url;
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_vod.php?action=del");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#plsc").click(function(){
		var ids="",rc=false;
		$("input[name='d_id']").each(function() {
			if(this.checked){
				if(rc)ids+=",";
				ids =  ids + this.value;
				rc=true;
			}
        });
		$("#form1").attr("action","admin_makehtml.php?acton=viewpl&flag=vod&d_id="+ids);
		$("#form1").submit();
	});
});
function filter(){
	var stype=$("#stype").val();
	var order=$("#order").val();
	var from=$("#from").val();
	var sort=$("#sort").val();
	var keyword=$("#keyword").val();
	var keyword_col=$("#keyword_col").val();
	var can_search_device=$("#can_search_device").val();
	var url = "admin_online_subscribe.php?can_search_device="+can_search_device+"&keyword_col="+keyword_col+"&sort="+sort+"&keyword="+encodeURI(keyword)+"&stype="+stype+"&order="+order+"&from="+from; //ipadpic
	window.location.href=url;
}


function prepareWeiboText(type,id,name){
	   document.getElementById( "weiboText").value= name; 
	   document.getElementById( "notify_msg_prod_id").value= id; 
	   document.getElementById( "notify_msg_prod_type").value= type; 
	   $('#SendWeiboMsg').empty();
}


function sendWeiboText(){

	
	var weibotxt= document.getElementById( "weiboText").value;
	var notify_msg_prod_id= document.getElementById( "notify_msg_prod_id").value;
	var notify_msg_prod_type= document.getElementById( "notify_msg_prod_type").value;
	var urlT='admin_vod.php?action=notifyMsg&prod_type='+notify_msg_prod_type+'&prod_id='+notify_msg_prod_id+'&content=' +encodeURIComponent(weibotxt) ;
	var channels= document.getElementById( "channel[]");
	alert(channels);
	for(var i = 0; i < channels.length; i++){
		 if (channels[i].checked == true) {
			  urlT = urlT +'&channels='+channels[i].value;				 		 
		  }
	}
		 $.post(urlT, {Action:"post"}, function (data, textStatus){     
			  if(textStatus == "success"){   
	          //alert(data);
				  $('#SendWeiboMsg').empty().append(data);
	           }else{
	        	   $('#SendWeiboMsg').empty().append('发送失败。');
	           }
	       });
	
    // alert(urlT);
	 
}

</script>
<table class="admin_online_subscribe tb">
	<tr>
	<td>
	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">
	过滤条件:<select id="stype" name="stype" onchange="javascript:{var typeid= this.options[this.selectedIndex].value; if(typeid=='1' ||  typeid=='2'){document.getElementById('btnsearchs').style.display='block';  document.getElementById('btnsearchsThumbs').style.display='block';document.getElementById('btnsearchsComment').style.display='block';}else {document.getElementById('btnsearchs').style.display='none'; document.getElementById('btnsearchsThumbs').style.display='none';document.getElementById('btnsearchsComment').style.display='none';}}">
	<option value="0">视频栏目</option>
	<option value="-1" <?php 
    if ($stype == -1) {
        echo "selected";
    }
    ?>
>没有栏目</option>
	<?php 
    echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $stype);
    ?>
	</select>
	&nbsp;
	
	<select id="order" name="order">
	<option value="d_time">视频排序</option>
	<option value="d_id" <?php 
    if ($order == "d_id") {
        echo "selected";
    }
    ?>
>视频编号</option>
	<option value="d_name" <?php 
    if ($order == "d_name") {
        echo "selected";
    }
    ?>
>视频名称</option>
	<option value="d_play_num" <?php 
    if ($order == "d_play_num") {
        echo "selected";
    }
    ?>
>播放次数</option>
	<option value="d_year" <?php 
    if ($order == "d_year") {
        echo "selected";
    }
    ?>
>上映日期</option>
	</select>
	&nbsp;<select id="sort" name="sort">
	<option value="desc" <?php 
    if ($sort == "desc") {
        echo "selected";
    }
    ?>
>视频排序 降序序</option>
	<option value="asc" <?php 
    if ($sort == "asc") {
        echo "selected";
    }
    ?>
>视频排序  升序</option>
	</select>
	
	
	&nbsp;
	<select id="from" name="from">
	<option value="">视频播放器</option>
	<?php 
    echo makeSelectPlayer($from);
    ?>
	</select>
	
	 <select   id="can_search_device" name="can_search_device">
	    <option value="" >投放设备</option>
		<option value="TV" <?php 
    if ($can_search_device === 'TV') {
        echo "selected";
    }
    ?>
>TV版</option>
		<option value="iPad" <?php 
    if ($can_search_device === 'iPad') {
        echo "selected";
    }
    ?>
>iPad版</option>
		<option value="iphone" <?php 
    if ($can_search_device === 'iphone') {
        echo "selected";
    }
    ?>
>iphone版</option>
		<option value="apad" <?php 
    if ($can_search_device === 'apad') {
        echo "selected";
    }
    ?>
>Android-Pad版</option>
		<option value="aphone" <?php 
    if ($can_search_device === 'aphone') {
        echo "selected";
    }
    ?>
>Android-Phone版</option>
		<option value="web" <?php 
    if ($can_search_device === 'web') {
        echo "selected";
    }
    ?>
>网站版</option>
	</select> 
	
	</td>
	</tr>
	<tr>
	<td colspan="4">
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">&nbsp;
	<select id="keyword_col" name="keyword_col">
	<option value="">关键字的匹配列</option>
	<option value="d_name" <?php 
    if ($keyword_col == "d_name") {
        echo "selected";
    }
    ?>
>视频名称</option>
	<option value="d_starring" <?php 
    if ($keyword_col == "d_starring") {
        echo "selected";
    }
    ?>
>演员</option>
	<option value="d_directed" <?php 
    if ($keyword_col == "d_directed") {
        echo "selected";
    }
    ?>
>导演</option>
	</select>
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">
	
	</td>
	
	</tr>
	</table>
	</td>
	</tr>
</table>

<form id="form1" name="form1" method="post">
<table class="tb">
	<tr>
	<td width="10%">编号</td>
	<td width="25%">名称</td>
	<td width="10%">播放次数</td>
	<td width="10%">上映日期</td>
	<td width="5%">分类</td>
	<td width="20%">时间</td>
	<td width="20%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
	<tr><td align="center" colspan="12">没有任何记录!</td></tr>
	<?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $d_id = $row["d_id"];
            $tname = "未知";
            $tenname = "";
            $typearr = getValueByArray($cache[0], "t_id", $row["d_type"]);
            if (is_array($typearr)) {
                $tname = $typearr["t_name"];
                $tenname = $typearr["t_enname"];
            }
            ?>
    <tr>
	<td><?php 
            echo $d_id;
            ?>
</td>
	<td><?php 
            echo substring($row["d_name"], 20);
            ?>
	<?php 
            if ($row["d_state"] > 0) {
                echo "<font color=\"red\">[" . $row["d_state"] . "]</font>";
            }
            ?>
	<?php 
            if (!isN($row["d_remarks"])) {
                echo "<font color=\"red\">[" . $row["d_remarks"] . "]</font>";
            }
            ?>
	<?php 
            if ($row["d_hide"] == 1) {
                echo "<font color=\"red\">[隐藏]</font>";
            }
            ?>
	</td>
	<td><?php 
            echo $row["d_play_num"];
            ?>
</td>
	<td><?php 
            echo $row["d_year"];
            ?>
</td>
	<td><?php 
            echo $tname;
            ?>
</td>
	<td><?php 
            echo isToday($row["d_time"]);
            ?>
</td>
	<td><a href="admin_vod_topic.php?action=info&id=<?php 
            echo $d_id;
            ?>
">所在榜单</a> |
	<a class="thickbox" href="#TB_inline?height=400&width=600&inlineId=myOnPageContent" onclick="javascript:{prepareWeiboText('<?php 
            echo $row["d_type"];
            ?>
','<?php 
            echo $d_id;
            ?>
','<?php 
            echo substring($row["d_name"], 20);
            ?>
');}" > 消息推送</a>	 </td>
    </tr>
	<?php 
        }
    }
    ?>
<!--	<tr>-->
<!--	<td colspan="12">-->
<!--	全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'d_id[]');"/>&nbsp;-->
<!--    批量操作:<input type="button" id="btnDel" value="删除" class="input">-->
<!--	<input type="button" id="pltj" value="推荐" onClick="plset('pltj','vod')" class="input">-->
<!--	<input type="button" id="plfl" value="分类" onClick="plset('plfl','vod')" class="input">-->
<!--	<input type="button" id="plzt" value="专题" onClick="plset('plzt','vod')" class="input">-->
<!--	<input type="button" id="plluobo" value="轮播图" onClick="plsetLuobo()" class="input">-->
<!--	<input type="button" id="plbd" value="视频悦单" onClick="plsetBD('plbd','vod','1')" class="input">-->
<!--	<input type="button" id="plbd" value="视频悦榜" onClick="plsetBD('plbd','vod','2')" class="input">-->
<!--	<input type="button" id="plrq" value="人气" onClick="plset('plrq','vod')" class="input">-->
<!--	<input type="button" id="plsc" value="生成" class="input">-->
<!--	<input type="button" id="plyc" value="显隐" onClick="plset('plyc','vod')" class="input">-->
<!--	<span id="plmsg" name="plmsg"></span>-->
<!--	</td>-->
<!--	</tr>-->
	<tr class="formlast">
	<td align="center" colspan="12">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_online_subscribe.php?page={p}&can_search_device=" . $can_search_device . "&keyword=" . urlencode($keyword) . "&keyword_col=" . $keyword_col . "&sort=" . $sort . "&order=" . $order . "&stype=" . $stype . "&from=" . $from);
    ?>
	</td>
	</tr>
</table>

</form>
<div id="myOnPageContent" style="display:none">
<script language="javascript">

$('#form2').form({
	success:function(data){
		$('#SendWeiboMsg').empty().append(data);
		$("#btnEdit").attr("disabled",false); 		
    }
});

$("#btnEdit").click(function(){
	if(confirm('确定要推送消息吗')){
		$("#form2").attr("action","?action=notifyMsg");
		var weibotxt= $("#weiboText").val();
		$("#btnEdit").attr("disabled",true); 
		if(weibotxt ==''){
          alert("发送内容不能为空。");
          $("#btnEdit").attr("disabled",false); 
          return;
		}

		if(weibotxt.length>=110){
	          alert("你发送的内容太长,不能超过110个字符。");
	          $("#btnEdit").attr("disabled",false); 
	          return;
		}
		var prod_id= $("#notify_msg_prod_id").val();
		
		var prod_type= $("#notify_msg_prod_type").val();
		 $('#SendWeiboMsg').empty().append('正在推送消息.....<br/>');
		var urlT='admin_online_subscribe.php?action=notifyMsg&notify_msg_prod_type='+prod_type+'&notify_msg_prod_id='+prod_id+'&content=' +encodeURIComponent(weibotxt) ;
		var channels=document.getElementsByName("channel[]");
		var channelFlag=true;
		var index=0;
		var indexSelect=0;
		for(var i = 0; i < channels.length; i++){
			 if (channels[i].checked == true) {
				  channelFlag=false;
				  indexSelect++;
				  urlTs = urlT +'&channel='+channels[i].value;	
				 // alert(channels[i].value);	
				  $.post(urlTs, {Action:"post"}, function (data, textStatus){     
					  if(textStatus == "success"){ 
						  index++;  
			          //alert(data);
						  $('#SendWeiboMsg').append(data).append('<br/>');
			           }else{
			        	   index++;  
			        	   $('#SendWeiboMsg').append('发送失败。').append('<br/>');
			           }
					  if( index==indexSelect){			  
						     $("#btnEdit").attr("disabled",false); 
						     $('#SendWeiboMsg').append('推送消息完成。').append('<br/>');
				      }
			       });	 		 
			  }
		}
		if(channelFlag){
			alert('你必须要选择一个频道发送');
	    }
	   
	    
		//$("#form2").submit();
		
	}
});
</script>
<form id="form2"  name="form1" method="post">
<table class="table" cellpadding="0" cellspacing="0" width="100%" border="0">

                <thead class="tb-tit-bg">
<!--                   <tr>-->
<!--                        <td > <h3 class="title">    发送设备:<select name="device_type" id="device_type" >                       -->
<!--                             <option value="" >所有设备</option>-->
<!--                             <option value="ios" >IOS</option>-->
<!--                             <option value="android" >Android</option>                          -->
<!--                        </select> -->
<!--                        </h3></td>    -->
<!--                      -->
<!--                    </tr>-->
                    <tr>
                        <td colspan="2"><span><h3>发送信息</h3></span></td>    
                       
                    </tr>
                    <input type="hidden" name="notify_msg_prod_id" id="notify_msg_prod_id" value="">
                    <input type="hidden" name="notify_msg_prod_type" id="notify_msg_prod_type" value="">
                      
                      <tr>
                        <td colspan="2" align="center"><textarea name="wbText" id="weiboText" rows="10" cols="90"></textarea></td>
                    </tr>
                     <tr>
                        <td align="left"> <br/>
                            Parse 云推送<br/>
	                        &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_ANDROID"   />悦视频 Android版<br/>
<!--						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_TV"  />悦视频 TV版<br/>-->
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IOS"  />悦视频 IOS版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPHONE"  />今晚剧场iphone版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPAD"  />今晚剧场IPAD版<br/>
                        </td>
                         <td align="left"> <br/>
                                                                         百度云推送<br/>
	                        &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_ANDROID_BAIDU"   />悦视频 Android版<br/>
<!--						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_TV_BAIDU"  />悦视频 TV版<br/>-->
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IOS_BAIDU"  />悦视频 IOS版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPHONE_BAIDU"  />今晚剧场iphone版<br/>
						    &nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" id='channel[]' name="channel[]" value="CHANNEL_IPAD_BAIDU"  />今晚剧场IPAD版<br/>
                        </td>
                    </tr>
                      <tr>
                         <td align="center" colspan="2"><input type="button" value="发送消息" id="btnEdit"  class="input"  /></td>
                      </tr>
                        <tr>
                        <td align="left" colspan="2">  <font color=red><span id="SendWeiboMsg"></span></font></td>    
                       
                    </tr> 
                    
                </thead>
            </table>
</form>
</div>
<?php 
    if ($pagenum == 1 && $where == " 1=1 ") {
        echo "<script>showpic();</script>";
    }
    unset($rs);
}
Exemplo n.º 4
0
function main()
{
    global $db, $cache, $parse_appid_restkey;
    $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(a.prod_id) FROM {pre}vod_pasre_item a,{pre}vod vod where  a.prod_id=vod.d_id and vod.favority_user_count >0 ";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT a.channels as channels, vod.d_remarks ,vod.d_state,a.d_status as status,a.id as id, a.create_date as create_date, vod.favority_user_count as favority_user_count, vod.d_name as vod_name,vod.d_id as vod_id FROM {pre}vod_pasre_item a,{pre}vod vod where  a.prod_id=vod.d_id and vod.favority_user_count >0 order by vod.favority_user_count desc, a.d_status asc, a.create_date desc limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    //var_dump($sql);
    $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_pasre_item");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnEdit").click(function(){
		if(confirm('确定要推送消息吗')){
			var url='admin_subscribe.php?action=editall&ids=';
			var channels=document.getElementsByName("ids[]");
			var channelFlag=true;
			var ids='';
			for(var i = 0; i < channels.length; i++){
				 if (channels[i].checked == true) {
					  channelFlag=false;
					  ids=channels[i].value+","+ids;
			     }
		    }
			if(channelFlag){
				alert("你至少需要选择一个视频");
		    }else {
		    	location.href=url+ids;		    	
		    }
		    
//			location.href
			
		}
	});
//	$("#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_subscribe tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="10%">视频ID</td>
	<td>视频名称</td>
	<td>推送应用</td>
	<td width="15%">更新时间</td>
	<td width="5%">追剧人数</td>
	<td width="5%">操作</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 $row["vod_id"];
            ?>
 </td>     
      <td><a href="admin_vod.php?action=edit&id=<?php 
            echo $row["vod_id"];
            ?>
">
      <?php 
            echo $row["vod_name"];
            ?>
</a>
      
      <?php 
            if ($row["d_state"] > 0) {
                echo "<font color=\"red\">[" . $row["d_state"] . "]</font>";
            }
            ?>
	<?php 
            if (!isN($row["d_remarks"])) {
                echo "<font color=\"red\">[" . $row["d_remarks"] . "]</font>";
            }
            ?>
      </td>
	   <td> <?php 
            $tempChannels = $row["channels"];
            //$parse_appid_restkey
            if (isN($tempChannels)) {
                echo '所有应用';
            } else {
                $tempChannels = explode(",", $tempChannels);
                foreach ($tempChannels as $tChannel) {
                    echo '[' . $parse_appid_restkey[$tChannel]['appname'] . '] ';
                }
            }
            ?>
</td>
	 
	  <td>
	   <?php 
            echo isToday($row["create_date"]);
            ?>
</td>
	  <td>
	 
	  <?php 
            echo $row["favority_user_count"];
            ?>
	  </td>
      <td>	
	 
	  <a href="admin_ajax.php?action=del&tab={pre}vod_pasre_item&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" />
	
	</td></tr>
    <tr align="center" class="formlast">
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_subscribe.php?page={p}&topic_id=" . $topic_id . "&flag=" . $flag);
    ?>
	</td>
    </tr>
</table>
</form>

</body>
</html>
<?php 
    unset($rs);
}
Exemplo n.º 5
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);
}
Exemplo n.º 6
0
function main()
{
    global $db, $menulist;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}thirdpart_config";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT  id,device_name,api_url,logo_url,app_key FROM {pre}thirdpart_config ORDER BY id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript" src = "../js/md.js"></script>
<script language="javascript">
$(document).ready(function(){
	
	$('#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}thirdpart_config");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnAdd").click(function(){
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open'); 
	});
	$("#btnCancel").click(function(){ 
		location.href= location.href;
	});
	$("#create_appkey").click(function(){

		var md5 = hex_md5(new Date().toString());

		$("#app_key").val(md5);
	});
});
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$.get('admin_ajax.php?action=getinfo&tab={pre}thirdpart_config&col=id&val='+id,function(obj){
		$("#win1 #id").val(obj.id);
		$("#device_name").val(obj.device_name);
		$("#api_url").val(obj.api_url);
		$("#logo_url").val(obj.logo_url);
		$("#app_key").val(obj.app_key);
	},"json");
}
</script>
<form action="" method="post" name="form1" id="form1">
<table class="tb">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="17%">设备名称</td>
	<td width="17%">API地址</td>
	<td width="15%">Logo URL</td>
	<td width="15%">APP KEY </td>
	<td width="15%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="6">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $id = $row["id"];
            ?>
    <tr>
	  <td><input name="m_id[]" type="checkbox" value="<?php 
            echo $id;
            ?>
" /></td>
      <td><?php 
            echo $row["device_name"];
            ?>
</td>
      <td><?php 
            echo $row["api_url"];
            ?>
</td>
      <td><?php 
            echo $row["logo_url"];
            ?>
</td>
      <td><?php 
            echo $row["app_key"];
            ?>
</td>
      <td><a href="javascript:void(0)" onclick="edit('<?php 
            echo $id;
            ?>
');return false;">修改</a> |
	  <a href="admin_ajax.php?action=del&tab={pre}thirdpart_config&m_id=<?php 
            echo $id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a></td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr  class="formlast">
	<td colspan="6"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'m_id[]')" /> 全选 
	&nbsp;<input type="button" id="btnDel" value="批量删除" class="input" />
	&nbsp;<input type="button" id="btnAdd" value="添加"  class="input"/>
	</td></tr>
    <tr align="center"  class="formlast">
      <td colspan="6">
       <?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "api_manager.php?page={p}");
    ?>
      </td>
    </tr>
</table>
</form>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:480px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab={pre}thirdpart_config" 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="20%" >设备名称:</td>
	<td>
		<TEXTAREA id="device_name" NAME="device_name"  style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA><br>可写入多个设备名,以“,”分开
	<td/>
	</tr>
	<tr>
	<td width="20%" >API地址:</td>
	<td><INPUT id="api_url" type="text" style="width:300px" name="api_url">
	</td>
	</tr>
	<tr>
	<td width="20%" >Logo URL:</td>
	<td><INPUT id="logo_url" type="text" style="width:300px" name="logo_url">
	</td>
	</tr>
	<tr>
	<td width="20%" >APP KEY:</td>
	<td><INPUT id="app_key" type="text" style="width:300px" name="app_key" readonly="readonly"><br> <input class="input" type="button" value="生成APP KEY" id="create_appkey"> 
	</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);
}
Exemplo n.º 7
0
function main()
{
    global $db, $cache;
    $pagenum = be("get", "page");
    if (isN($pagenum) || !isNum($pagenum)) {
        $pagenum = 1;
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $pagenum = intval($pagenum);
    $keyword = be("get", "keyword");
    $from = be("get", "playfrom");
    $project = be("get", "cj_vod_projects");
    $zt = be("get", "zt");
    $sql = "Select a.*,b.p_name as p_name from {pre}cj_vod a,{pre}cj_vod_projects b where a.m_pid=b.p_id and m_playfrom not in ('tudou','kankan','cntv','wasu') ";
    if ($zt != "") {
        $sql = $sql . " and m_zt = " . $zt;
    }
    if ($keyword != "") {
        $keyword = trim($keyword);
        $sql = $sql . " and m_name like '%" . $keyword . "%' ";
    }
    if ($project != "") {
        $sql = $sql . " and a.m_pid = " . $project;
    }
    if ($from != "") {
        $sql = $sql . " and a.m_playfrom ='" . $from . "' ";
    }
    $sql = $sql . " order by  m_zt asc, m_addtime desc,m_name desc ";
    $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 () {
            $("#btnDel").click(function () {
                if (confirm('确定要删除吗')) {
                    $("#form1").attr("action", "?action=delpl");
                    $("#form1").submit();
                }
            });
            $("#btnDelall").click(function () {
                if (confirm('确定要删除吗')) {
                    $("#form1").attr("action", "?action=delall");
                    $("#form1").submit();
                }
            });
            $("#btnSelin").click(function () {
                if (confirm('确定入库您所选择的数据吗')) {
                    $("#form1").attr("action", "?action=IDInflow");
                    $("#form1").submit();
                }
            });

            $("#btnSelinZhuiju").click(function () {
                if (confirm('确定添加您所选择的数据到自动采集/自动入库吗')) {
                    $("#form1").attr("action", "?action=IDInflowZhuiJu");
                    $("#form1").submit();
                }
            });

            $("#btnAllin").click(function () {
                if (confirm('全部入库你所采集的数据吗')) {
                    $("#form1").attr("action", "?action=AllInflow");
                    $("#form1").submit();
                }
            });
            $("#btnNoin").click(function () {
                if (confirm('确定入库所有未入库的数据吗')) {
                    $("#form1").attr("action", "?action=noInflow");
                    $("#form1").submit();
                }
            });

            $("#noInflowProject").click(function () {
                var keyword = $("#keyword").val();
                var playfrom = $("#playfrom").val();
                var project = $("#cj_vod_projects").val();
                if (confirm('确定所搜视频入库未入库吗')) {
                    $("#form1").attr("action", "?action=noInflowProject&keyword=" + keyword + "&playfrom=" + playfrom + "&cj_vod_projects=" + project);
                    $("#form1").submit();
                }
            });


            $("#AllInflowProject").click(function () {
                var keyword = $("#keyword").val();
                var playfrom = $("#playfrom").val();
                var project = $("#cj_vod_projects").val();
                if (confirm('确定所搜视频全部入库吗')) {
                    $("#form1").attr("action", "?action=AllInflowProject&keyword=" + keyword + "&playfrom=" + playfrom + "&cj_vod_projects=" + project);
                    $("#form1").submit();
                }
            });


            $("#btnType").click(function () {
                if (confirm('确定更新所选数据的分类吗')) {
                    $("#form1").attr("action", "?action=editype");
                    $("#form1").submit();
                }
            });
        });

    </script>
    <TABLE width="96%" border=0 align=center cellpadding=0 cellSpacing=0
           class=tbtitle>
        <TBODY>
        <tr>
            <td>
                <form action="collect_vod.php" method="get"><strong>搜索影片:</strong> <input
                        type="hidden" name="action" value="main"> <input id=keyword size=40
                                                                         name=keyword value="<?php 
    echo $keyword;
    ?>
">
                    <select id="playfrom"
                            name=playfrom>
                        <option value="">视频播放器</option>
                        <?php 
    echo makeSelectPlayer($from);
    ?>
                    </select> <select id="cj_vod_projects" name="cj_vod_projects">
                        <option value="">全部采集项目</option>
                        <?php 
    echo makeSelect("{pre}cj_vod_projects", "p_id", "p_name", "", "", "&nbsp;|&nbsp;&nbsp;", $project);
    ?>
                    </select> <INPUT class=inputbut type=submit value=搜索 name=submit></form>
            </td>
        </tr>
        </TBODY>
    </TABLE>

    <form action="" method="post" name="form1" id="form1">
        <table class="collect_vod tb">
            <tr>
                <td width="4%">&nbsp;</td>
                <td>影片名称</td>
                <td width="7%">状态</td>
                <td width="7%">播放器</td>
                <td width="10%">栏目分类</td>
                <td width="10%">地区</td>
                <td width="10%">上映日期</td>
                <td width="15%">所属采集项目</td>
                <td width="13%">更新时间</td>
                <td width="8%">操作</td>
            </tr>
            <?php 
    if (!$rs) {
        ?>
                <tr>
                    <td align="center" colspan="9">没有任何记录!</td>
                </tr>
            <?php 
    } else {
        $i = 0;
        while ($row = $db->fetch_array($rs)) {
            ?>
                    <tr>
                        <td><input name="m_id[]" type="checkbox" id="m_id"
                                   value="<?php 
            echo $row["m_id"];
            ?>
"/></td>
                        <td><?php 
            echo $row["m_name"];
            ?>
 (连载:<?php 
            echo $row["m_state"];
            ?>
)</td>
                        <td><?php 
            if ($row["m_zt"] == 1) {
                echo "<font color=\"#FF0000\">已入库</font>";
            } else {
                echo "未入库";
            }
            ?>
</td>
                        <td><?php 
            echo $row["m_playfrom"];
            ?>
</td>
                        <td><?php 
            if ($row["m_typeid"] == 0) {
                ?>
 <font color="#FF0000">没找到对应分类请配置</font> <?php 
            } else {
                $typearr = getValueByArray($cache[0], "t_id", $row["m_typeid"]);
                echo $typearr["t_name"];
            }
            ?>
</td>
                        <td><?php 
            echo $row["m_area"];
            ?>
</td>
                        <td><?php 
            echo $row["m_year"];
            ?>
</td>
                        <td><?php 
            echo $row["p_name"];
            ?>
</td>
                        <td><?php 
            echo isToDay($row['m_addtime']);
            ?>
</td>
                        <td><A href="?action=edit&m_id=<?php 
            echo $row["m_id"];
            ?>
">修改</A>|<A
                                href="?action=del&m_id=<?php 
            echo $row["m_id"];
            ?>
">删除</A></td>
                    </tr>
                <?php 
        }
    }
    ?>
            <tr class="formlast">
                <td colspan="9"><input name="chkall" type="checkbox" id="chkall"
                                       value="1" onClick="checkAll(this.checked,'m_id[]');"/> 全选 <input
                        type="button" id="btnDel" value="批量删除" class="btn"/>
                    <!--	&nbsp;<input type="button" id="btnDelall" value="删除所有" class="btn"  />-->
                    &nbsp;<input type="button" id="btnSelin" class="btn" name="Submit"
                                 value="入库所选"> &nbsp;<input type="button" id="btnSelinZhuiju"
                                                            class="btn" name="Submit" value="添加到自动采集入库">
                    <!--	&nbsp;<input type="button" id="btnAllin" class="btn" name="Submit" value="全部入库" >-->
                    <!--    &nbsp;<input type="button" id="btnNoin" class="btn" name="Submit" value="入库未入库" >-->
                    &nbsp;<input type="button" id="AllInflowProject" class="btn"
                                 name="Submit" value="所搜视频全部入库"> &nbsp;<input type="button"
                                                                              id="noInflowProject" class="btn"
                                                                              name="Submit" value="所搜视频入库未入库"> <font
                        color="#FF0000">&nbsp; </font></td>
            </tr>
            <tr class="formlast">
                <td colspan="9">入库同名处理: <input type="radio" name="CCTV" value="0"
                                               checked>自动处理 <input type="radio" name="CCTV" value="1">始终新增数据 <input
                        type="radio" name="CCTV" value="2">新增播放器组 <input type="radio"
                                                                         name="CCTV" value="3">不处理 <br/>
                    强制覆盖数据: <input type="checkbox" name="CCTV1" value="1">年份 <input
                        type="checkbox" name="CCTV2" value="2">地区 <input type="checkbox"
                                                                         name="CCTV3" value="3">演员 <input
                        type="checkbox" name="CCTV4"
                        value="4">图片 <input type="checkbox" name="CCTV5" value="5">简介 <input
                        type="checkbox" name="CCTV6" value="6">语言 <input type="checkbox"
                                                                         name="CCTV7" value="7">备注 <input
                        type="checkbox" name="CCTV8"
                        value="8">导演 <input type="checkbox" name="CCTV9" value="9">影片长度 <br/>
                    <font color="#FF0000">注意 :自动判断播放来源,如遇到相同来源则更新数据。</font></td>
            </tr>
            <tr align="center" class="formlast">
                <td colspan="9"><?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "collect_vod.php?action=main&page={p}&cj_vod_projects=" . $project . "&keyword=" . $keyword . "&playfrom=" . $from);
    ?>
</td>
            </tr>
        </table>
    </form>
<?php 
}
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_art_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 width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td>
		菜单:<a href="collect_art_manage.php?action=add">添加采集规则</a> | <a href="collect_art_change.php">分类转换</a> | <a href="collect_art_filters.php">信息过滤</a> 
	</td>
	</tr>
</table>
<form action="" method="post" name="form1">
<table class=tb >
	<tr>
	<td width="4%">&nbsp;</td>
	<td>项目名称</td>
	<td width="25%">入库分类</td>
	<td width="20%">上次采集</td>
	<td width="25%">操作</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 
            if ($row["p_classtype"] == 1) {
                echo "<font color=red>自定义分类</font>";
            } else {
                $typearr = getValueByArray($cache[1], "t_id", $row["p_collect_type"]);
                echo $typearr["t_name"];
            }
            ?>
	  </td>
      <td><?php 
            echo isToDay($row['p_time']);
            ?>
</td>
 	  <td>
 	   <A href="collect_art_cj.php?p_id=<?php 
            echo $row["p_id"];
            ?>
">采集</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>
	<td  colspan="7">
	全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'p_id[]');"/>&nbsp;
	<input type="submit" value="批量删除" onClick="if(confirm('确定要删除吗')){form1.action='?action=delall';}else{return false}"  class="input"/>
	<input type="submit" value="批量采集" onClick="if(confirm('确定要批量采集吗')){form1.action='collect_art_cj.php?action=pl';}else{return false}"  class="input"/>
	<input type="button" value="导入规则" onClick="$('#win1').window('open');" class="input"/>
	</td>
	</tr>
    <tr align="center" bgcolor="#f8fbfb">
	<td colspan="7">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "collect_art_manage.php?page={p}");
    ?>
	</td>
	</tr>
</table>
</form>
<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" closable="true" minimizable="false" maximizable="false">
<form enctype="multipart/form-data" action="?action=upexpsave" method="post">
<table class="tb">
  <tbody>
  	<tr>
  		<td colspan="2" align="center">
  		上传采集规则
         <input type="file" id="file1" name="file1">
		<input type="submit" name="submit" value="开始导入">
		</td>
  	</tr>
</table>
</form>
</div>
<?php 
}
Exemplo n.º 9
0
function main()
{
    global $db, $template, $cache;
    $loginname = getCookie("adminname");
    $keyword = be("all", "keyword");
    $stype = be("all", "stype");
    $area = be("all", "area");
    $topic = be("all", "topic");
    $level = be("all", "level");
    $from = be("all", "from");
    $sstate = be("all", "sstate");
    $repeat = be("all", "repeat");
    $repeatlen = be("all", "repeatlen");
    $order = be("all", "order");
    $pagenum = be("all", "page");
    $sort = be("all", "sort");
    $spic = be("all", "spic");
    $hide = be("all", "hide");
    $d_status = be("all", "d_status");
    $douban_score = be("all", "douban_score");
    $ipadpic = be("all", "ipadpic");
    $d_douban_id = be("all", "d_douban_id");
    $can_search_device = be("all", "can_search_device");
    if (!isNum($level)) {
        $level = 0;
    } else {
        $level = intval($level);
    }
    if (!isNum($sstate)) {
        $sstate = 0;
    } else {
        $sstate = intval($sstate);
    }
    if (!isNum($stype)) {
        $stype = 0;
    } else {
        $stype = intval($stype);
    }
    if (!isNum($area)) {
        $area = 0;
    } else {
        $area = intval($area);
    }
    if (!isNum($topic)) {
        $topic = 0;
    } else {
        $topic = intval($topic);
    }
    if (!isNum($spic)) {
        $spic = 0;
    } else {
        $spic = intval($spic);
    }
    if (!isNum($ipadpic)) {
        $ipadpic = 0;
    } else {
        $ipadpic = intval($ipadpic);
    }
    if (!isNum($hide)) {
        $hide = -1;
    } else {
        $hide = intval($hide);
    }
    if (!isNum($douban_score)) {
        $douban_score = 0;
    } else {
        $douban_score = intval($douban_score);
    }
    if (!isNum($repeatlen)) {
        $repeatlen = 0;
    }
    if (!isNum($d_status)) {
        $d_status = -1;
    } else {
        $d_status = intval($d_status);
    }
    if (isNum($d_douban_id)) {
        $d_douban_id = intval($d_douban_id);
    }
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $where = " d_type in (1,2,3,131,5) ";
    $keyword_col = be("all", "keyword_col");
    if (!isN($keyword)) {
        $keyword = trim($keyword);
        if (isN($keyword_col)) {
            $where .= " AND ( d_directed like '%" . $keyword . "%' or d_starring like '%" . $keyword . "%' or d_name like '%" . $keyword . "%' or d_enname like '%" . $keyword . "%'   ) ";
        } else {
            $where .= " AND " . $keyword_col . " like '%" . $keyword . "%' ";
        }
    }
    if ($stype > 0) {
        $typearr = getValueByArray($cache[0], "t_id", $stype);
        if (is_array($typearr)) {
            $where = $where . " and d_type in (" . $typearr["childids"] . ")";
        } else {
            $where .= " AND d_type=" . $stype . " ";
        }
    }
    if ($stype == -1) {
        $where .= " AND d_type=0 ";
    }
    if ($area > 0) {
        $where .= " AND d_area = " . $area . " ";
    }
    if ($topic > 0) {
        $where .= " AND d_topic = " . $topic . " ";
    }
    if ($level > 0) {
        $where .= " AND d_level = " . $level . " ";
    }
    if ($sstate == 1) {
        $where .= " AND d_state>0 ";
    } else {
        if ($sstate == 2) {
            $where .= " AND d_state=0 ";
        }
    }
    if ($hide != -1) {
        $where .= " AND d_hide=" . $hide . " ";
    }
    if ($d_douban_id == -1) {
        $where .= " AND d_douban_id=" . $d_douban_id . " ";
    } else {
        if ($d_douban_id == 1) {
            $where .= " AND d_douban_id >0 ";
        } else {
            if ($d_douban_id == 2) {
                $where .= " AND d_douban_id =0 ";
            }
        }
    }
    if ($d_status != -1) {
        $where .= " AND d_status=" . $d_status . " ";
    }
    if ($douban_score == 1) {
        $where .= " AND d_score >0 ";
    }
    if ($douban_score == 2) {
        $where .= " AND d_score <=0 ";
    }
    if ($stype == 1 || $stype == 2) {
        $douban_scoreT = "block";
    } else {
        $douban_scoreT = "none";
    }
    if (!isN($can_search_device)) {
        $where .= " AND (can_search_device like '%" . $can_search_device . "%' or can_search_device is null or can_search_device ='' ) ";
    }
    if ($repeat == "ok") {
        $repeatSearch = " d_name ";
        if ($repeatlen > 0) {
            $repeatSearch = " substring(d_name,1," . $repeatlen . ") ";
        }
        $repeatsql = " , (SELECT " . $repeatSearch . " as d_name1 FROM {pre}vod GROUP BY d_name1 HAVING COUNT(*)>1) as `t2` ";
        $where .= " AND `{pre}vod`.`d_name`=`t2`.`d_name1` ";
        if (isN($order)) {
            $order = "d_name,d_addtime";
        }
    }
    $douban_comment = be("all", "douban_comment");
    if (!isNum($douban_comment)) {
        $douban_comment = 0;
    } else {
        $douban_comment = intval($douban_comment);
    }
    if ($douban_comment == 1) {
        $where .= " and d_id in (SELECT DISTINCT content_id FROM tbl_comments WHERE author_id IS NULL AND thread_id IS NULL) ";
    }
    if ($douban_comment == 2) {
        $where .= " and d_id not in (SELECT DISTINCT content_id FROM tbl_comments WHERE author_id IS NULL AND thread_id IS NULL) ";
    }
    if (isN($order)) {
        $orders = "d_time desc ";
    } else {
        if (!isN($sort)) {
            $orders = $order . ' ' . $sort;
        }
    }
    if (!isN($from)) {
        $where .= " and d_playfrom like  '%" . $from . "%' ";
    }
    if ($spic == 1) {
        $where .= " AND d_pic = '' ";
    } else {
        if ($spic == 2) {
            $where .= " and  d_pic not like '%joyplus%' and d_pic!=''  ";
        }
    }
    if ($ipadpic == 1) {
        $where .= " AND (d_pic_ipad = ''  or d_pic_ipad is null )";
    } else {
        if ($ipadpic == 2) {
            $where .= " AND d_pic_ipad not like '%joyplus%' and d_pic_ipad != '' ";
        }
    }
    $select_weburl = be("all", "select_weburl");
    $select_videourl = be("all", "select_videourl");
    $select_videourl_play = be("all", "select_videourl_play");
    if (!isNum($select_videourl_play)) {
        $select_videourl_play = -1;
    } else {
        $select_videourl_play = intval($select_videourl_play);
    }
    if ($select_videourl_play == 0) {
        $where .= " AND d_play_check = 0 ";
    }
    if ($select_videourl_play == 2) {
        $where .= " AND d_play_check = 2 ";
    }
    if ($select_videourl_play == 1) {
        $where .= " AND d_play_check = 1 ";
    }
    if ($select_weburl == 1) {
        $where .= " AND webUrls is not null and webUrls !='' ";
    }
    if ($select_weburl == 2) {
        $where .= " AND (webUrls is null or  webUrls ='') ";
    }
    if ($select_videourl == 1) {
        $where .= " AND d_downurl is not null and d_downurl !='' ";
    }
    if ($select_videourl == 2) {
        $where .= " AND (d_downurl is null or d_downurl ='') ";
    }
    $sql = "SELECT count(*) FROM {pre}vod " . $repeatsql . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    //$sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide,p.id as popular_id FROM {pre}vod ".$repeatsql." left join {pre}vod_popular as p on p.vod_id=d_id  WHERE" . $where . " ORDER BY " . $orders . "  limit ".(app_pagenum * ($pagenum-1)) .",".app_pagenum;
    $sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide FROM {pre}vod " . $repeatsql . "  WHERE" . $where . " ORDER BY " . $orders . "  limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    //	var_dump($sql);
    $rs = $db->query($sql);
    ?>


<script
	type="text/javascript" src="./resource/thickbox-compressed.js"></script>
<script
	type="text/javascript" src="./resource/thickbox.js"></script>
<link
	href="./resource/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript">
$(document).ready(function(){
	$("#form1").validate({
		rules:{
			repeatlen:{
				number:true,
				max:10
			}
		}
	});
	
	$("#btnrepeat").click(function(){
		var repeatlen = $("#repeatlen").val();
		var reg = /^\d+$/;
		var re = repeatlen.match(reg);
		if (!re){ repeatlen=0; }
		if (repeatlen >20){ alert("长度最大20");$("#repeatlen").focus();return;}
		var url = "admin_vod.php?repeat=ok&repeatlen=" + repeatlen;
		window.location.href=url;
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_vod.php?action=del");
				$("#form1").submit();
			}
			else{return false}
	});
	
});
function filter(){
	var stype=$("#stype").val();
	var state=$("#state").val();
	var order=$("#order").val();
	var level=$("#level").val();
	var topic=$("#topic").val();
	var sserver=$("#sserver").val();
	var from=$("#from").val();
	var spic=$("#spic").val();
	var hide=$("#hide").val();
	var ipadpic=$("#ipadpic").val();
	var sort=$("#sort").val();
	
	
	var select_weburl=$("#select_weburl").val();
	var select_videourl=$("#select_videourl").val();
	var douban_score =$("#douban_score").val();
	var douban_comment =$("#douban_comment").val();
	var select_videourl_play=$("#select_videourl_play").val();
	var keyword=$("#keyword").val();	
	var d_status=$("#d_status").val();	
	var d_douban_id=$("#d_douban_id").val();
	var keyword_col=$("#keyword_col").val();
	var can_search_device=$("#can_search_device").val();
	var url = "admin_vod.php?can_search_device="+can_search_device+"&d_douban_id="+d_douban_id+"&keyword_col="+keyword_col+"&d_status="+d_status+"&sort="+sort+"&select_videourl_play="+select_videourl_play+"&douban_comment="+douban_comment+"&keyword="+encodeURI(keyword)+"&stype="+stype+"&topic="+topic+"&select_weburl="+select_weburl+"&select_videourl="+select_videourl+"&level="+level+"&order="+order+"&sserver="+sserver+"&sstate="+state+"&from="+from+"&spic="+spic+"&hide="+hide+"&douban_score="+douban_score+"&ipadpic="+ipadpic; //ipadpic
	window.location.href=url;
}

function doubans(){
	var stype=$("#stype").val();
	var state=$("#state").val();
	var order=$("#order").val();
	var level=$("#level").val();
	var topic=$("#topic").val();
	var sserver=$("#sserver").val();
	var from=$("#from").val();
	var spic=$("#spic").val();
	var hide=$("#hide").val();
	var sort=$("#sort").val();
	var ipadpic=$("#ipadpic").val();
	var douban_score =$("#douban_score").val();
	var select_weburl=$("#select_weburl").val();
	var select_videourl=$("#select_videourl").val();
	var douban_comment =$("#douban_comment").val();
	var select_videourl_play=$("#select_videourl_play").val();
	var keyword=$("#keyword").val();	
	var d_status=$("#d_status").val();
	var keyword_col=$("#keyword_col").val();	
	var d_douban_id=$("#d_douban_id").val();
	var can_search_device=$("#can_search_device").val();
	var url = "admin_vod.php?can_search_device="+can_search_device+"&d_douban_id="+d_douban_id+"&keyword_col="+keyword_col+"&d_status="+d_status+"&sort="+sort+"&select_videourl_play="+select_videourl_play+"&douban_comment="+douban_comment+"&action=doubans&keyword="+encodeURI(keyword)+"&select_weburl="+select_weburl+"&select_videourl="+select_videourl+"&stype="+stype+"&topic="+topic+"&level="+level+"&order="+order+"&sserver="+sserver+"&sstate="+state+"&from="+from+"&spic="+spic+"&hide="+hide+"&douban_score="+douban_score+"&ipadpic="+ipadpic;
	window.location.href=url;
}

function doubansComment(){
	var stype=$("#stype").val();
	var state=$("#state").val();
	var order=$("#order").val();
	var level=$("#level").val();
	var topic=$("#topic").val();
	var sserver=$("#sserver").val();
	var from=$("#from").val();
	var spic=$("#spic").val();
	var hide=$("#hide").val();
	var sort=$("#sort").val();
	var ipadpic=$("#ipadpic").val();
	var douban_score =$("#douban_score").val();
	var select_weburl=$("#select_weburl").val();
	var select_videourl=$("#select_videourl").val();
	var select_videourl_play=$("#select_videourl_play").val();
	var keyword=$("#keyword").val();
	var douban_comment =$("#douban_comment").val();	
	var d_status=$("#d_status").val();
	var keyword_col=$("#keyword_col").val();	
	var d_douban_id=$("#d_douban_id").val();
	var can_search_device=$("#can_search_device").val();
	var url = "admin_vod.php?can_search_device="+can_search_device+"&d_douban_id="+d_douban_id+"&keyword_col="+keyword_col+"&d_status="+d_status+"&sort="+sort+"&select_videourl_play="+select_videourl_play+"&douban_comment="+douban_comment+"&action=doubansComment&keyword="+encodeURI(keyword)+"&select_weburl="+select_weburl+"&select_videourl="+select_videourl+"&stype="+stype+"&topic="+topic+"&level="+level+"&order="+order+"&sserver="+sserver+"&sstate="+state+"&from="+from+"&spic="+spic+"&hide="+hide+"&douban_score="+douban_score+"&ipadpic="+ipadpic;
	window.location.href=url;
}

function doubanThumbs(){
	var stype=$("#stype").val();
	var state=$("#state").val();
	var order=$("#order").val();
	var level=$("#level").val();
	var topic=$("#topic").val();
	var sserver=$("#sserver").val();
	var from=$("#from").val();
	var spic=$("#spic").val();
	var hide=$("#hide").val();
	var sort=$("#sort").val();
	var ipadpic=$("#ipadpic").val();
	var douban_score =$("#douban_score").val();
	var select_weburl=$("#select_weburl").val();
	var select_videourl=$("#select_videourl").val();
	var select_videourl_play=$("#select_videourl_play").val();
	var keyword=$("#keyword").val();
	var douban_comment =$("#douban_comment").val();	
	var d_status=$("#d_status").val();
	var keyword_col=$("#keyword_col").val();	
	var d_douban_id=$("#d_douban_id").val();
	var can_search_device=$("#can_search_device").val();
	var url = "admin_vod.php?can_search_device="+can_search_device+"&d_douban_id="+d_douban_id+"&keyword_col="+keyword_col+"&d_status="+d_status+"&sort="+sort+"&select_videourl_play="+select_videourl_play+"&douban_comment="+douban_comment+"&action=doubanThumbs&keyword="+encodeURI(keyword)+"&select_weburl="+select_weburl+"&select_videourl="+select_videourl+"&stype="+stype+"&topic="+topic+"&level="+level+"&order="+order+"&sserver="+sserver+"&sstate="+state+"&from="+from+"&spic="+spic+"&hide="+hide+"&douban_score="+douban_score+"&ipadpic="+ipadpic;
	window.location.href=url;
}



function showpic(){
	$.get("admin_vod.php?action=chkpic&rnd=" + Math.random(),function(obj){
		if(Number(obj)>0){
			$.messager.show({
			title:'系统提示',
			msg:'发现数据中调用远程图片<br>下载到本地可以提高网页载入速度<br>',
			timeout:5000,
			showType:'slide'
			});
		}
	});
}
function gosyncpic(){
	if(confirm('确定要同步下载远程图片吗?数据不可恢复,请做好备份')){
		location.href = 'admin_pic.php?action=syncpic';
	}
}

function prepareWeiboText(type,id,name){
	   document.getElementById( "weiboText").value= name; 
	   document.getElementById( "notify_msg_prod_id").value= id; 
	   document.getElementById( "notify_msg_prod_type").value= type; 
	   $('#SendWeiboMsg').empty();
}


function sendWeiboText(){

	var device_types= document.getElementById( "device_type");
	
	var weibotxt= document.getElementById( "weiboText").value;
	var notify_msg_prod_id= document.getElementById( "notify_msg_prod_id").value;
	var notify_msg_prod_type= document.getElementById( "notify_msg_prod_type").value;
	var urlT='admin_vod.php?action=notifyMsg&prod_type='+notify_msg_prod_type+'&prod_id='+notify_msg_prod_id+'&content=' +encodeURIComponent(weibotxt) ;
	
	for(var i = 0; i < device_types.options.length; i++){
		  if(device_types.options[i].selected){
			  urlT = urlT +'&device_type='+device_types.options[i].value;				 		 
		  }
	}
		//alert(urlT);
		 $.post(urlT, {Action:"post"}, function (data, textStatus){     
			  if(textStatus == "success"){   
	          //alert(data);
				  $('#SendWeiboMsg').empty().append(data);
	           }else{
	        	   $('#SendWeiboMsg').empty().append('发送失败。');
	           }
	       });
	
    // alert(urlT);
	 
}

function send(e){
	if(e.keyCode==13){
		  filter();
    }
}
 
</script>
<table class="admin_vod_1 tb">
	<tr>
		<td>
		<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
			<tr>
				<td colspan="2">过滤条件:<br /><select id="stype" name="stype"
					onchange="javascript:{var typeid= this.options[this.selectedIndex].value; if(typeid=='1' ||  typeid=='2' ||  typeid=='131'){document.getElementById('btnsearchs').style.display='block';  document.getElementById('btnsearchsThumbs').style.display='block';document.getElementById('btnsearchsComment').style.display='block';}else {document.getElementById('btnsearchs').style.display='none'; document.getElementById('btnsearchsThumbs').style.display='none';document.getElementById('btnsearchsComment').style.display='none';}}">
					<option value="0">视频栏目</option>
					<option value="-1" <?php 
    if ($stype == -1) {
        echo "selected";
    }
    ?>
>没有栏目</option>
					<?php 
    echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $stype);
    ?>
				</select><select id="state" name="state">
					<option value="0">视频连载</option>
					<option value="1" <?php 
    if ($sstate == "1") {
        echo "selected";
    }
    ?>
>连载中</option>
					<option value="2" <?php 
    if ($sstate == "2") {
        echo "selected";
    }
    ?>
>未连载</option>
				</select><select id="order" name="order">
					<option value="d_time">视频排序</option>
					<option value="d_id" <?php 
    if ($order == "d_id") {
        echo "selected";
    }
    ?>
>视频编号</option>
					<option value="d_name"
					<?php 
    if ($order == "d_name") {
        echo "selected";
    }
    ?>
>视频名称</option>
					<option value="d_play_num"
					<?php 
    if ($order == "d_play_num") {
        echo "selected";
    }
    ?>
>播放次数</option>
					<option value="d_year"
					<?php 
    if ($order == "d_year") {
        echo "selected";
    }
    ?>
>上映日期</option>
					<option value="d_level"
					<?php 
    if ($order == "d_level") {
        echo "selected";
    }
    ?>
>推荐度</option>
				</select><select id="sort" name="sort">
					<option value="desc" <?php 
    if ($sort == "desc") {
        echo "selected";
    }
    ?>
>视频排序
					降序序</option>
					<option value="asc" <?php 
    if ($sort == "asc") {
        echo "selected";
    }
    ?>
>视频排序
					升序</option>
				</select><select id="level" name="level">
					<option value="0">视频推荐</option>
					<option value="1" <?php 
    if ($level == 1) {
        echo "selected";
    }
    ?>
>推荐1</option>
					<option value="2" <?php 
    if ($level == 2) {
        echo "selected";
    }
    ?>
>推荐2</option>
					<option value="3" <?php 
    if ($level == 3) {
        echo "selected";
    }
    ?>
>推荐3</option>
					<option value="4" <?php 
    if ($level == 4) {
        echo "selected";
    }
    ?>
>推荐4</option>
					<option value="5" <?php 
    if ($level == 5) {
        echo "selected";
    }
    ?>
>推荐5</option>
					<option value="6" <?php 
    if ($level == 6) {
        echo "selected";
    }
    ?>
>推荐6</option>
					<option value="7" <?php 
    if ($level == 7) {
        echo "selected";
    }
    ?>
>推荐7</option>
					<option value="8" <?php 
    if ($level == 8) {
        echo "selected";
    }
    ?>
>推荐8</option>
				</select><select id="from" name="from">
					<option value="">视频播放器</option>
					<?php 
    echo makeSelectPlayer($from);
    ?>
				</select><select id="spic" name="spic">
					<option value="0">视频图片</option>
					<option value="1" <?php 
    if ($spic == 1) {
        echo "selected";
    }
    ?>
>无图片</option>
					<option value="2" <?php 
    if ($spic == 2) {
        echo "selected";
    }
    ?>
>远程图片</option>
				</select><select id="ipadpic" name="ipadpic">
					<option value="0">视频IPAD图片</option>
					<option value="1" <?php 
    if ($ipadpic == 1) {
        echo "selected";
    }
    ?>
>无图片</option>
					<option value="2" <?php 
    if ($ipadpic == 2) {
        echo "selected";
    }
    ?>
>远程图片</option>
				</select><select id="hide" name="hide">
					<option value="-1">视频显隐</option>
					<option value="0" <?php 
    if ($hide == 0) {
        echo "selected";
    }
    ?>
>显示</option>
					<option value="1" <?php 
    if ($hide == 1) {
        echo "selected";
    }
    ?>
>隐藏</option>
					<option value="-100" <?php 
    if ($hide == -100) {
        echo "selected";
    }
    ?>
>视频不能播放</option>
				</select><select id="douban_score" name="douban_score">
					<option value="0">豆瓣评分</option>
					<option value="1" <?php 
    if ($douban_score == 1) {
        echo "selected";
    }
    ?>
>已采集</option>
					<option value="2" <?php 
    if ($douban_score == 2) {
        echo "selected";
    }
    ?>
>未采集</option>
				</select><select id="douban_comment" name="douban_comment">
					<option value="0">豆瓣评论</option>
					<option value="1"
					<?php 
    if ($douban_comment == 1) {
        echo "selected";
    }
    ?>
>已采集</option>
					<option value="2"
					<?php 
    if ($douban_comment == 2) {
        echo "selected";
    }
    ?>
>未采集</option>
				</select><select id="select_weburl" name="select_weburl">
					<option value="0">网页地址</option>
					<option value="1"
					<?php 
    if ($select_weburl == 1) {
        echo "selected";
    }
    ?>
>存在</option>
					<option value="2"
					<?php 
    if ($select_weburl == 2) {
        echo "selected";
    }
    ?>
>不存在</option>
				</select><select id="select_videourl" name="select_videourl">
					<option value="0">视频地址</option>
					<option value="1"
					<?php 
    if ($select_videourl == 1) {
        echo "selected";
    }
    ?>
>存在</option>
					<option value="2"
					<?php 
    if ($select_videourl == 2) {
        echo "selected";
    }
    ?>
>不存在</option>
				</select><select id="d_status" name="d_status">
					<option value="-1">是否已经审核过</option>
					<option value="0" <?php 
    if ($d_status == 0) {
        echo "selected";
    }
    ?>
>未审核</option>
					<option value="1" <?php 
    if ($d_status == 1) {
        echo "selected";
    }
    ?>
>审核并锁定</option>
				</select><select id="d_douban_id" name="d_douban_id">
					<option value="0">能否在豆瓣上找到</option>
					<option value="-1"
					<?php 
    if ($d_douban_id == -1) {
        echo "selected";
    }
    ?>
>不能</option>
					<option value="1" <?php 
    if ($d_douban_id == 1) {
        echo "selected";
    }
    ?>
>能找到</option>
					<option value="2" <?php 
    if ($d_douban_id == 2) {
        echo "selected";
    }
    ?>
>不确定,未搜索</option>
				</select><select id="can_search_device" name="can_search_device">
					<option value="">投放设备</option>
					<option value="TV"
					<?php 
    if ($can_search_device === 'TV') {
        echo "selected";
    }
    ?>
>TV版</option>
					<option value="iPad"
					<?php 
    if ($can_search_device === 'iPad') {
        echo "selected";
    }
    ?>
>iPad版</option>
					<option value="iphone"
					<?php 
    if ($can_search_device === 'iphone') {
        echo "selected";
    }
    ?>
>iphone版</option>
					<option value="apad"
					<?php 
    if ($can_search_device === 'apad') {
        echo "selected";
    }
    ?>
>Android-Pad版</option>
					<option value="aphone"
					<?php 
    if ($can_search_device === 'aphone') {
        echo "selected";
    }
    ?>
>Android-Phone版</option>
					<option value="web"
					<?php 
    if ($can_search_device === 'web') {
        echo "selected";
    }
    ?>
>网站版</option>
					<option value="Vendor"
					<?php 
    if ($can_search_device === 'Vendor') {
        echo "selected";
    }
    ?>
>Vendor版</option>
				</select></td>
			</tr>
			<tr>
				<td colspan="4">关键字:<input id="keyword" size="40" name="keyword"
					value="<?php 
    echo $keyword;
    ?>
" onkeypress="send(event);">&nbsp; <select
					id="keyword_col" name="keyword_col">
					<option value="">关键字的匹配列</option>
					<option value="d_name"
					<?php 
    if ($keyword_col == "d_name") {
        echo "selected";
    }
    ?>
>视频名称</option>
					<option value="d_starring"
					<?php 
    if ($keyword_col == "d_starring") {
        echo "selected";
    }
    ?>
>演员</option>
					<option value="d_directed"
					<?php 
    if ($keyword_col == "d_directed") {
        echo "selected";
    }
    ?>
>导演</option>
				</select> <input class="input" type="button" value="搜索"
					id="btnsearch" onClick="filter();"></td>
				<td align="left"><input style="display:<?php 
    echo $douban_scoreT;
    ?>
" type="button" value="豆瓣评分" id="btnsearchs" onClick="doubans();">
				</td>
				<td align="left"><input style="display:<?php 
    echo $douban_scoreT;
    ?>
" type="button" value="豆瓣影评" id="btnsearchsComment" onClick="doubansComment();">
				</td>
				<td align="left"><input style="display:<?php 
    echo $douban_scoreT;
    ?>
" type="button" value="豆瓣缩略图 " id="btnsearchsThumbs" onClick="doubanThumbs();">
				</td>

			</tr>
		</table>
		</td>
	</tr>
</table>


<form id="form1" name="form1" method="post">
<table class="admin_vod tb">
	<tr>
		<td width="4%"></td>
		<td width="4%">编号</td>
		<td width="15%">名称</td>
		<td width="4%">播放次数</td>
		<td width="3%">上映日期</td>
		<td width="5%">分类</td>
		<td width="5%">来源</td>
		<!--	<td width="3%">人气</td>-->
		<td width="4%">推荐</td>
		<!--	<td width="5%">专题</td>-->
		<!--	<td width="5%">轮播图</td>-->
		<td width="13%" align="center">视频榜单</td>
		<!--	<td width="5%">浏览</td>-->
		<td width="8%">时间</td>
		<td width="25%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
	<tr>
		<td align="center" colspan="12">没有任何记录!</td>
	</tr>
	<?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $d_id = $row["d_id"];
            $tname = "未知";
            $tenname = "";
            $typearr = getValueByArray($cache[0], "t_id", $row["d_type"]);
            if (is_array($typearr)) {
                $tname = $typearr["t_name"];
                $tenname = $typearr["t_enname"];
            }
            ?>
	<tr>
		<td><input name="d_id[]" type="checkbox" value="<?php 
            echo $d_id;
            ?>
"></td>
		<td><?php 
            echo $d_id;
            ?>
</td>
		<td><?php 
            echo substring($row["d_name"], 20);
            ?>
 <?php 
            if ($row["d_state"] > 0) {
                echo "<font color=\"red\">[" . $row["d_state"] . "]</font>";
            }
            ?>
		<?php 
            if (!isN($row["d_remarks"])) {
                echo "<font color=\"red\">[" . $row["d_remarks"] . "]</font>";
            }
            ?>
		<?php 
            if ($row["d_hide"] == 1) {
                echo "<font color=\"red\">[隐藏]</font>";
            }
            ?>
		</td>
		<td><?php 
            echo $row["d_play_num"];
            ?>
</td>
		<td><?php 
            echo $row["d_year"];
            ?>
</td>
		<td><?php 
            echo $tname;
            ?>
</td>
		<td title="<?php 
            echo replaceStr($row["d_playfrom"], "\$\$\$", ",");
            ?>
"><?php 
            echo substring(replaceStr($row["d_playfrom"], "\$\$\$", ","), 15, 0);
            ?>
</td>
		<!--<td><?php 
            echo $row["d_hits"];
            ?>
</td>
	-->
		<td id="tj<?php 
            echo $d_id;
            ?>
"><?php 
            echo "<img src=\"../images/icons/ico" . $row["d_level"] . ".gif\" border=\"0\" style=\"cursor: pointer;\" onClick=\"setday('tj','" . $d_id . "','vod')\"/>";
            ?>
		</td>
		<!--<td id="zt<?php 
            echo $d_id;
            ?>
" >
	<?php 
            if ($row["d_topic"] == 0) {
                ?>
	<?php 
                echo "<img src=\"../images/icons/icon_02.gif\" border=\"0\" style=\"cursor: pointer;\" onClick=\"setday('zt','" . $d_id . "','vod')\"/>";
                ?>
	<?php 
            } else {
                ?>
	<?php 
                echo "<img src=\"../images/icons/icon_01.gif\" border=\"0\" style=\"cursor: pointer;\" onClick=\"ajaxdivdel('" . $d_id . "','zt','vod')\"/>";
                ?>
	<?php 
            }
            ?>
	</td>
	
	-->
		<!--<td id="popular<?php 
            echo $d_id;
            ?>
" >
	<?php 
            if ($row["popular_id"] > 0) {
                ?>
		<?php 
                echo "<img src=\"../images/icons/icon_01.gif\" border=\"0\" style=\"cursor: pointer;\" />";
                ?>
	
	<?php 
            } else {
                ?>
	<?php 
                echo "<img src=\"../images/icons/icon_02.gif\" border=\"0\" style=\"cursor: pointer;\" onClick=\"ajaxsubmit('" . $d_id . "','lunbo','vod');\"/>";
                ?>
	<?php 
            }
            ?>
	</td>
	
	-->
		<td align="center"><span id="bd<?php 
            echo $d_id;
            ?>
"></span> <a href="#"
			onClick="setdayBD('bd','<?php 
            echo $d_id;
            ?>
','vod','1')" /> 添加悦单</a> |
		<a href="#" onClick="setdayBD('bd','<?php 
            echo $d_id;
            ?>
','vod','2')" />
		添加悦榜</a></td>
		<!--<td>
	<?php 
            if (app_playtype == 0) {
                if ($row["d_type"] == 0) {
                    $mlink = "#";
                } else {
                    $mlink = "../" . $template->getVodLink($d_id, $row["d_name"], $row["d_enname"], $row["d_type"], $tname, $tenname);
                }
                $mlink = replaceStr($mlink, "../" . app_installdir, "../");
                $plink = $mlink;
            } else {
                $mlink = "../" . $template->getVodPlayUrl($d_id, $row["d_name"], $row["d_enname"], $row["d_type"], $tname, $tenname, 1, 1);
                $mlink = replaceStr($mlink, "../" . app_installdir, "../");
                $plink = $mlink;
                $mlink = replaceStr($mlink, "javascript:OpenWindow1('", "");
                $mlink = replaceStr($mlink, "',popenW,popenH);", "");
            }
            if (substring($mlink, 1, strlen($mlink) - 1) == "/") {
                $mlink = $mlink . "index." . app_vodsuffix;
            }
            if (app_vodcontentviewtype == 2) {
                if (file_exists($mlink)) {
                    ?>
		 	<a target="_blank" href="<?php 
                    echo $plink;
                    ?>
"><Img src="../images/icons/html_ok.gif" border="0" alt='浏览' /></a>
		 	<?php 
                } else {
                    ?>
		 	<a  href="admin_makehtml.php?action=viewpl&flag=vod&d_id=<?php 
                    echo $d_id;
                    ?>
"><Img src="../images/icons/html_no.gif" border="0" alt='生成' /></a>
		 	<?php 
                }
            } else {
                ?>
	 	<a target="_blank" href="<?php 
                echo $plink;
                ?>
"><Img src="../images/icons/html_ok.gif" border="0" alt='浏览' /></a>
	 <?php 
            }
            ?>
	 </td>
	-->
		<td><?php 
            echo isToday($row["d_time"]);
            ?>
</td>
		<td><a href="admin_vod_topic.php?action=info&id=<?php 
            echo $d_id;
            ?>
">所在榜单</a>
		|<a href="admin_vod.php?action=edit&id=<?php 
            echo $d_id;
            ?>
">修改</a> | <?php 
            if ($row["d_type"] == 1 || $row["d_type"] == 2 || $row["d_type"] == 131) {
                ?>
<a
			href="admin_vod.php?action=douban&id=<?php 
                echo $d_id;
                ?>
">豆瓣评分</a> | <a
			href="admin_vod.php?action=doubanComment&id=<?php 
                echo $d_id;
                ?>
">豆瓣影评</a>
		| <?php 
            }
            ?>
 <a
			href="admin_vod.php?action=doubanPic&id=<?php 
            echo $d_id;
            ?>
">豆瓣图片</a>
		| <a href="admin_vod.php?action=doubanThumb&id=<?php 
            echo $d_id;
            ?>
">豆瓣缩略图</a>
		|<a href="#"
			onClick="if(confirm('确定要添加到追剧列表吗')){ajaxsubmit('<?php 
            echo $d_id;
            ?>
','subscribe_msg_list','vod');}">添加到追剧列表</a>
			<?php 
            if ($loginname === 'dale' || $loginname === 'admin' || $loginname === 'lulu' || $loginname === 'scottliyq' || $loginname === 'zhouyinlong') {
                ?>
		<!--	|--> <!--	 <a class="thickbox" href="#TB_inline?height=200&width=400&inlineId=myOnPageContent" onclick="javascript:{prepareWeiboText('<?php 
                echo $row["d_type"];
                ?>
','<?php 
                echo $d_id;
                ?>
','<?php 
                echo substring($row["d_name"], 20);
                ?>
');}" > 消息推送</a>	  -->
			<?php 
            }
            ?>
 | <A
			href="admin_vod.php?action=del&d_id=<?php 
            echo $d_id;
            ?>
"
			onClick="return confirm('确定要删除吗?');">删除</a></td>
	</tr>
	<?php 
        }
    }
    ?>
	<tr class="formlast">
		<td colspan="11"><input name="chkall" type="checkbox" id="chkall"
			value="1" onClick="checkAll(this.checked,'d_id[]');" /> 全选 &nbsp;批量操作:&nbsp;<input
			type="button" id="btnDel" value="删除" class="input"> <input
			type="button" id="pltj" value="推荐" onClick="plset('pltj','vod')"
			class="input"> <input type="button" id="plfl" value="分类"
			onClick="plset('plfl','vod')" class="input"> <input type="button"
			id="plluobo" value="轮播图" onClick="plsetLuobo()" class="input"> <input
			type="button" id="plbd" value="视频悦单"
			onClick="plsetBD('plbd','vod','1')" class="input"> <input
			type="button" id="plbd" value="视频悦榜"
			onClick="plsetBD('plbd','vod','2')" class="input"> <input
			type="button" id="plyc" value="显隐" onClick="plset('plyc','vod')"
			class="input"> 
			<input type="button" id="plsh" value="批量审核" onClick="plset('plsh','vod')" class="input"> 
			<span id="plmsg" name="plmsg"></span></td>
	</tr>
	<tr class="formlast">
		<td align="center" colspan="12"><?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_vod.php?page={p}&can_search_device=" . $can_search_device . "&d_douban_id=" . $d_douban_id . "&keyword=" . urlencode($keyword) . "&d_status=" . $d_status . "&keyword_col=" . $keyword_col . "&sort=" . $sort . "&select_videourl_play=" . $select_videourl_play . "&topic=" . $topic . "&level=" . $level . "&order=" . $order . "&stype=" . $stype . "&sserver=" . $sserver . "&sstate=" . $sstate . "&repeat=" . $repeat . "&repeatlen=" . $repeatlen . "&from=" . $from . "&spic=" . $spic . "&hide=" . $hide . "&douban_comment=" . $douban_comment . "&douban_score=" . $douban_score . "&select_weburl=" . $select_weburl . "&select_videourl=" . $select_videourl . "&ipadpic=" . $ipadpic);
    ?>
		</td>
	</tr>
</table>

<div id="myOnPageContent" style="display: none">

<table class="table" cellpadding="0" cellspacing="0" width="100%"
	border="0">

	<thead class="tb-tit-bg">
		<tr>
			<td>
			<h3 class="title">发送设备:<select name="device_type" id="device_type">
				<option value="">所有设备</option>
				<option value="ios">IOS</option>
				<option value="android">Android</option>
			</select></h3>
			</td>

		</tr>
		<tr>
			<td><span><font color="blue">消息内容 </font></span></td>

		</tr>
		<input type="hidden" name="notify_msg_prod_id" id="notify_msg_prod_id"
			value="">
		<input type="hidden" name="notify_msg_prod_type"
			id="notify_msg_prod_type" value="">

		<tr>
			<td align="center"><textarea name="wbText" id="weiboText" rows="9"
				cols="60" style="border: 1; border-color: blue;"></textarea></td>
		</tr>
		<tr>
			<td align="right"><a href="#" onclick="javascript:sendWeiboText();">发送</a></td>
		</tr>
		<tr>
			<td align="center"><font color=red><span id="SendWeiboMsg"></span></font></td>

		</tr>

	</thead>
</table>

</div>
</form>
	<?php 
    if ($pagenum == 1 && $where == " 1=1 ") {
        echo "<script>showpic();</script>";
    }
    unset($rs);
}
Exemplo n.º 10
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}comment";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "select c_id,c_type,c_vid,c_rid,c_audit,c_name,c_ip,c_content,c_time from {pre}comment order by c_id desc ";
    $sql .= " limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$('#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');
	    }
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
	$("#btnDel").click(function(){
		if(confirm('确定要删除吗')){
			$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}comment");
			$("#form1").submit();
		}
		else{return false}
	});
	$("#btnAudit").click(function(){
		$("#form1").attr("action","admin_comment.php?action=audit");
		$("#form1").submit();
	});
});

</script>
<form action="" method="post" name="form1" id="form1">
<table class="tb">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="15%">用户</td>
	<td >内容</td>
	<td width="20%">来源</td>
	<td width="15%">时间</td>
	<td width="10%">IP地址</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $c_id = $row["c_id"];
            $c_content = $row["c_content"];
            $c_content = regReplace($c_content, "\\[em:(\\d{1,})?\\]", "<img src=\"../images/face/\$1.gif\" border=0/>");
            ?>
	  <tr>
	  <td><input name="c_id[]" type="checkbox" id="c_id" value="<?php 
            echo $c_id;
            ?>
" /></td>
      <td><?php 
            echo $row["c_name"];
            ?>
</td>
      <td><?php 
            echo $c_content;
            ?>
</td>
      <td>
      <?php 
            $vid = $row["c_vid"];
            if ($row["c_type"] == 2) {
                $rowinfo = $db->getRow("select a_id,a_title,a_type from {pre}art where a_id=" . $vid);
                if (!$rowinfo) {
                    echo "该数据已经被删除";
                } else {
                    echo "(" . $vid . ")" . $rowinfo["a_title"];
                }
                unset($rowinfo);
            } else {
                $rowinfo = $db->getRow("select d_id,d_name,d_type from {pre}vod where d_id=" . $vid);
                if (!$rowinfo) {
                    echo "该数据已经被删除";
                } else {
                    echo "(" . $vid . ")" . $rowinfo["d_name"];
                }
                unset($rowinfo);
            }
            ?>
      </td>
      <td><?php 
            echo $row["c_time"];
            ?>
</td>
      <td><?php 
            echo $row["c_ip"];
            ?>
</td>
      </tr>
      <?php 
        }
    }
    ?>
	<tr>
	<td colspan="7">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'c_id[]')" />
	&nbsp;<input type="button" id="btnDel" value="批量删除" class="input" />
	</td></tr>
    <tr align="center">
      <td colspan="7">
	    <?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_comment.php?page={p}");
    ?>
       </td>
    </tr>
    </table>
    </form>
</body>
</html>
<?php 
    unset($rs);
}
Exemplo n.º 11
0
function main()
{
    global $db, $menulist;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}manager";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT m_id,m_name,m_status,m_logintime,m_loginip FROM {pre}manager ORDER BY m_id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			m_name:{
				required:true,
				stringCheck:true,
				maxlength:32
			},
			m_password:{
				
				maxlength:32
			},
			m_status:{
				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');
	    }
	});
	$("#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'); 
	$("#m_status").get(0).options[0].selected = true;
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
});
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$.get('admin_ajax.php?action=getinfo&tab={pre}manager&col=m_id&val='+id,function(obj){
		$("#win1 #m_id").val(obj.m_id);
		$("#m_name").val(obj.m_name);
		if(obj.m_status==1){
			$("#m_status").get(0).options[0].selected = true;
		}
		else{
			$("#m_status").get(0).options[1].selected = true;
		}
		$("input[name='m_levels[]']").each(function(i) {
			if(obj.m_levels.indexOf( $(this).val() ) !=-1 ){
				$(this).attr("checked", true);
			}
        });
	},"json");
}
</script>
<form action="" method="post" name="form1" id="form1">
<table class="tb">
	<tr>
	<td width="5%">&nbsp;</td>
	<td>帐号名</td>
	<td width="15%">是否锁定</td>
	<td width="17%">最后登陆</td>
	<td width="15%">登陆IP</td>
	<td width="15%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="6">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $m_id = $row["m_id"];
            ?>
    <tr>
	  <td><input name="m_id[]" type="checkbox" value="<?php 
            echo $m_id;
            ?>
" /></td>
      <td><?php 
            echo $row["m_name"];
            ?>
</td>
      <td><?php 
            if ($row["m_status"] == 1) {
                echo "<font color=green>启用</font>";
            } else {
                echo "<font color=red>禁用</font>";
            }
            ?>
</td>
      <td><?php 
            echo $row["m_logintime"];
            ?>
</td>
      	  
      <td><?php 
            echo $row["m_loginip"];
            ?>
</td>
      <td><a href="javascript:void(0)" onclick="edit('<?php 
            echo $m_id;
            ?>
');return false;">修改</a> |
	  <a href="admin_ajax.php?action=del&tab={pre}manager&m_id=<?php 
            echo $m_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a></td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr class="formlast">
	<td colspan="6"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'m_id[]')" /> 全选 
	&nbsp;<input type="button" id="btnDel" value="批量删除" class="input" />
	&nbsp;<input type="button" id="btnAdd" value="添加"  class="input"/>
	</td></tr>
    <tr align="center" class="formlast">
      <td colspan="6">
       <?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_manager.php?page={p}");
    ?>
      </td>
    </tr>
</table>
</form>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:480px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab={pre}manager" method="post" name="form2" id="form2">
<table class="tb">
	<input id="m_id" name="m_id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="20%" >管理员名称:</td>
	<td><INPUT id="m_name" size=50 value="" name="m_name">
	</td>
	</tr>
	<tr>
	<td width="20%" >管理员密码:</td>
	<td><INPUT id="m_password" type="password" size=50 value="" name="m_password"><br>(说明:密码为空时,不更新密码字段,仍为原密码)
	</td>
	</tr>
	<tr>
	<td>管理权限:</td>
	<td>
	<?php 
    $list1 = explode(",", $menulist);
    for ($i = 0; $i < count($list1); $i++) {
        $list2 = explode("|||", $list1[$i]);
        for ($j = 0; $j < count($list2); $j++) {
            $list3 = explode("||", $list2[$j]);
            echo "<input type=\"checkbox\" name=\"m_levels[]\" value=\"" . $list3[1] . "\" class=\"checkbox\"/>" . $list3[0];
        }
    }
    ?>
	</td>
	</tr>
	<tr>
	<td>管理员状态:</td>
	<td>
	<select id="m_status" name="m_status">
	<option value=1>启用</option>
	<option value=0>锁定</option>
	</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($rs);
}
Exemplo n.º 12
0
function main()
{
    global $db, $cache;
    $keyword = be("all", "keyword");
    $tv_type = be("all", "tv_type");
    $country = be("all", "country");
    $area = be("all", "area");
    if (!isNum($tv_type)) {
        $tv_type = -1;
    } else {
        $tv_type = intval($tv_type);
    }
    $where = "1=1 ";
    if (!isN($keyword)) {
        $where .= " AND tv_name LIKE '%" . $keyword . "%' ";
    }
    if (!isN($area)) {
        $where .= " AND area = '" . $area . "' ";
    }
    if (!isN($country)) {
        $where .= " AND country = '" . $country . "' ";
    }
    if ($tv_type !== '-1' && $tv_type != -1) {
        $where .= " AND tv_type =" . $tv_type;
    }
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}tv" . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT * FROM {pre}tv  where " . $where . " ORDER BY tv_type desc,id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
function filter(){
	var keyword=$("#keyword").val();
	var tv_type=$("#tv_type").val();
	var country=$("#country").val();
	var area=$("#area").val();		 
	var url = "admin_program.php?tv_type="+tv_type+"&keyword="+encodeURI(keyword)+"&area="+encodeURI(area)+"&country="+encodeURI(country);
	window.location.href=url;
}

function exportExcel(){	
	var url = "admin_program.php?action=exportExcel";	
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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}vod_topic");
				$("#form1").submit();
			}
			else{return false}
	});

	$("#btnAddLunBo").click(function(){
		if(confirm('确定要添加到轮播图吗')){
			$("#form1").attr("action","admin_ajax.php?action=lunboForTopic&flag=batch&tab={pre}vod_popular");
			$("#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');		
	});
	$("#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}tv&col=id&val='+id);
}
</script>

<table class="admin_program tb">
	<tr>
	<td>
	<table border="0" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">
	过滤条件:
	<select id="tv_type" name="tv_type">
	<option value="-1">类型</option>
	<option value="1" <?php 
    if ($tv_type == 1) {
        echo "selected";
    }
    ?>
>央视</option>
	<option value="2" <?php 
    if ($tv_type == 2) {
        echo "selected";
    }
    ?>
>卫视</option>
	<option value="3" <?php 
    if ($tv_type == 3) {
        echo "selected";
    }
    ?>
>城市</option>
	<option value="4" <?php 
    if ($tv_type == 4) {
        echo "selected";
    }
    ?>
>CETV</option>
	<option value="5" <?php 
    if ($tv_type == 5) {
        echo "selected";
    }
    ?>
>数字</option>
	</select>
	
	 <select id="country" name="country">
    <option value="">请选择国家</option>
    <?php 
    echo makeSelectTV_live("country", $country);
    ?>
	</select>
	
	<select id="area" name="area">
    <option value="">请选择地区</option>
    <?php 
    echo makeSelectTV_live("area", $area);
    ?>
	</select>
	</td>
	</tr>
	<tr>
	<td colspan="6">
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	<a href="admin_program.php?action=exportExcel"><font color="red"><b>导出频道</b></font></a>	
	</td>
	<td width="150px">
		
	</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="5%">编号</td>
	<td>名称</td>
	<td>国家</td>
	<td>地区</td>
<!--	<td>编码</td>-->
	<td>类型</td>
	<td>显示到app</td>
<!--	<td width="45%">直播地址</td>-->
	<td width="40%">操作</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="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td>
      <input type="text" name="tv_name<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["tv_name"];
            ?>
" size="40"/></td>
      
	<td>
	 <select id="country<?php 
            echo $t_id;
            ?>
" name="country<?php 
            echo $t_id;
            ?>
">
    <option value="">请选择国家</option>
    <?php 
            echo makeSelectTV_live("country", $row["country"]);
            ?>
	</select>
	</td>
	<td><select id="area<?php 
            echo $t_id;
            ?>
" name="area<?php 
            echo $t_id;
            ?>
">
    <option value="">请选择地区</option>
    <?php 
            echo makeSelectTV_live("area", $row["area"]);
            ?>
	</select></td>
<!--      <td>-->
<!--      <input type="text" name="tv_code<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["tv_code"];
            ?>
" size="20"/></td>-->
	  <td>
		  <select id="tv_type" name="tv_type<?php 
            echo $t_id;
            ?>
">
			<option value="-1">类型</option>
			<option value="1" <?php 
            if ($row["tv_type"] == 1) {
                echo "selected";
            }
            ?>
>央视</option>
			<option value="2" <?php 
            if ($row["tv_type"] == 2) {
                echo "selected";
            }
            ?>
>卫视</option>
			<option value="3" <?php 
            if ($row["tv_type"] == 3) {
                echo "selected";
            }
            ?>
>城市</option>
			<option value="4" <?php 
            if ($row["tv_type"] == 4) {
                echo "selected";
            }
            ?>
>CETV</option>
			<option value="5" <?php 
            if ($row["tv_type"] == 5) {
                echo "selected";
            }
            ?>
>数字</option>
		  </select>
	  </td>
	  
	  <td>
	 
	  <select id="status<?php 
            echo $t_id;
            ?>
" name="status<?php 
            echo $t_id;
            ?>
">
	<option value="0" <?php 
            if ($row["status"] == 0) {
                echo "selected";
            }
            ?>
>不显示</option>
	<option value="1" <?php 
            if ($row["status"] == 1) {
                echo "selected";
            }
            ?>
>显示</option>
	</select>
	  </td>
	  
<!--      <td>-->
<!--      <input type="text" name="tv_playurl<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["tv_playurl"];
            ?>
" size="70"/></td>-->
<!--	  -->
      <td>
     <a href="admin_program_items.php?tv_id=<?php 
            echo $t_id;
            ?>
">显示节目单</a>  |
     <a href="admin_program_play.php?tv_id=<?php 
            echo $t_id;
            ?>
">显示直播源</a>  |
	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
');return false;">修改</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 
        }
    }
    ?>
	<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" class="input" />
	</td></tr>
    <tr align="center" class="formlast">
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_program.php?page={p}&tv_type=" . $tv_type . "&keyword=" . urlencode($keyword));
    ?>
	</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" 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="tv_name" size=40 value="" name="tv_name">
	</td>
	</tr>
<!--	<tr>-->
<!--	<td>电视编码:</td>-->
<!--	<td>  <input id="tv_code" size=40 value="" name="tv_code">-->
<!--	</td>-->
<!--    </tr>-->
	<tr>
	<td>电视节目类别:</td>
	<td><select id="tv_type" name="tv_type">
	<option value="-1">类型</option>
	<option value="1" >央视</option>
	<option value="2">卫视</option>
	<option value="3" >城市</option>
	<option value="4">CETV</option>
	<option value="5">数字</option>
	</select>
	</td>
	</tr>
	
	<tr>
	<td>国家:</td>
	<td><select id="country" name="country">
	<?php 
    echo makeSelectTV_live("country", '');
    ?>
	</select>
	</td>
	</tr>
	
	<tr>
	<td>地区:</td>
	<td><select id="area" name="area">
	<?php 
    echo makeSelectTV_live("area", '');
    ?>
	</select>
	</td>
	</tr>
	
	 <tr>
     <td>显示到App:</td>
      <td><select id="status" name="status">
	   <option value="0" selected>不显示</option>
	   <option value="1" >显示</option>
	</select>
	  </td>
    </tr>
<!--	<tr>-->
<!--     <td>直播视频地址:</td>-->
<!--      <td>-->
<!--      <TEXTAREA id="tv_playurl" NAME="tv_playurl" ROWS="2" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>-->
<!--	  </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);
}
Exemplo n.º 13
0
function main()
{
    global $db, $cache;
    $pagenum = be("page", "get");
    if (isN($pagenum) || !isNum($pagenum)) {
        $pagenum = 1;
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $pagenum = intval($pagenum);
    $keyword = be("get", "keyword");
    $project = be("get", "{pre}cj_art_projects");
    $zt = be("get", "zt");
    $sql = "Select a.*,b.p_name as p_name from {pre}cj_art a,{pre}cj_art_projects b where a.m_pid=b.p_id";
    if ($zt != "") {
        $sql = $sql . " and m_zt = " . $zt;
    }
    if ($keyword != "") {
        $sql = $sql . " and m_title like '%" . $keyword . "%' ";
    }
    if ($project != "") {
        $sql = $sql . " and a.m_pid = " . $project;
    }
    $sql = $sql . " order by m_zt asc,m_addtime desc ";
    $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(){
	$("#btnDel").click(function(){
		if(confirm('确定要删除吗')){
			$("#form1").attr("action","?action=delpl");
			$("#form1").submit();
		}
	});
	$("#btnDelall").click(function(){
		if(confirm('确定要删除吗')){
			$("#form1").attr("action","?action=delall");
			$("#form1").submit();
		}
	});
	$("#btnSelin").click(function(){
		if(confirm('确定入库您所选择的数据吗')){
			$("#form1").attr("action","?action=IDInflow");
			$("#form1").submit();
		}
	});
	$("#btnAllin").click(function(){
		if(confirm('全部入库你所采集的数据吗')){
			$("#form1").attr("action","?action=AllInflow");
			$("#form1").submit();
		}
	});
	$("#btnNoin").click(function(){
		if(confirm('确定入库所有未入库的数据吗')){
			$("#form1").attr("action","?action=noInflow");
			$("#form1").submit();
		}
	});
	 $("#btnType").click(function(){
		if(confirm('确定入库所有未入库的数据吗')){
			$("#form1").attr("action","?action=editype");
			$("#form1").submit();
		}
	});
});
</script>
<TABLE width="96%" border=0 align=center cellpadding=0 cellSpacing=0 class=tbtitle >
  <TBODY>
    <tr>
      <td>
		<form action="collect_art.php" method="get"> 
          <strong>搜索文章:</strong>
          <input id=KeyWord size=40 name=keyword>
		  <INPUT class=inputbut type=submit value=搜索 name=Submit>
        &nbsp; 按项目查看:
        <select onchange=javascript:window.location.href=this.options[this.selectedIndex].value>
        <option value="collect_art.php">全部采集项目</option>
		<?php 
    echo makeSelect("{pre}cj_art_projects", "p_id", "p_name", "", "collect_art.php", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
		  </select>	
          <font color="#FF0000">(没有找到对应栏目,不能入库)</font>
		</form>
        
        </td>
    </tr>
  </TBODY>
</table>

<form action="" method="post" name="form1" id="form1">
<table  class=tb >
	<tr>
	<td width="4%">&nbsp;</td>
	<td>文章名称</td>
	<td width="7%">状态</td>
	<td width="15%">栏目分类</td>
	<td width="15%">采集项目名称</td> 
	<td width="13%">添加时间</td>
	<td width="8%">操作</td>
	</tr>
	<?php 
    if (!$rs) {
        ?>
    <tr><td align="center" colspan="9" >没有任何记录!</td></tr>
    <?php 
    } else {
        $i = 0;
        while ($row = $db->fetch_array($rs)) {
            ?>
	<tr>
		<td><input name="m_id[]" type="checkbox" id="m_id" value="<?php 
            echo $row["m_id"];
            ?>
" /></td>
		<td><?php 
            echo $row["m_title"];
            ?>
 </td>
		<td><?php 
            if ($row["m_zt"] == 1) {
                echo "<font color=\"#FF0000\">已入库</font>";
            } else {
                echo "未入库";
            }
            ?>
</td>
		<td>
	<?php 
            if ($row["m_typeid"] == 0) {
                ?>
		<font color="#FF0000">没找到对应分类请配置</font>
		<?php 
            } else {
                $typearr = getValueByArray($cache[1], "t_id", $row["m_typeid"]);
                echo $typearr["t_name"];
            }
            ?>
      </td>
      <td><?php 
            echo $row["p_name"];
            ?>
</td>
      <td><?php 
            echo isToDay($row['m_addtime']);
            ?>
</td>
      <td><A href="?action=edit&m_id=<?php 
            echo $row["m_id"];
            ?>
">修改</A>|<A href="?action=del&m_id=<?php 
            echo $row["m_id"];
            ?>
">删除</A></td></tr>
	<?php 
        }
    }
    ?>
	<tr>
	<td  colspan="9">
    全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'m_id[]');"/>&nbsp;
    &nbsp;<input type="button" id="btnDel" value="批量删除" class="btn"  />
	&nbsp;<input type="button" id="btnDelall" value="删除所有" class="btn"  />
	&nbsp;<input type="button" id="btnSelin" class="btn" name="Submit" value="入库所选" >
	&nbsp;<input type="button" id="btnAllin" class="btn" name="Submit" value="全部入库" >
    &nbsp;<input type="button" id="btnNoin" class="btn" name="Submit" value="入库未入库" >
        <select name="m_typeid" id="m_typeid"  >
        <option value="">请选择数据分类</option>
            <?php 
    echo makeSelectAll("{pre}art_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", "");
    ?>
        </select>
        <input type="button" id="btnType" class="btn" name="Submit" value="批量分类"><font color="#FF0000">&nbsp; </font></td>
</tr>
 <tr>
    <td colspan="9" >同名处理:  
	<input type="checkbox" name="CCTV1" value="1">覆盖作者:
	<input type="checkbox" name="CCTV2" value="2">覆盖内容:
     </td>
</tr>
	<tr align="center" bgcolor="#f8fbfb">
	<td colspan="8">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "collect_art.php?page={p}&{pre}cj_art_projects=" . $project . "&keyword=" . $keyword);
    ?>
	</td>
    </tr>
</table>
</form>
<?php 
}
Exemplo n.º 14
0
function main()
{
    global $db;
    $loginname = getCookie("adminname");
    $apk_id = be("all", "apk_id");
    $sql = "SELECT * FROM apk_master_items  where apk_id=" . $apk_id . " ORDER BY version_code desc,version_name desc, upload_count desc,id ASC ";
    $rs = $db->query($sql);
    $rowapk = $db->getRow("select * from apk_master_base where id=" . $apk_id);
    ?>
<script language="javascript">
function filter(){
	var category_id=$("#category_id").val();
	var status=$("#status").val();
	var keyword=$("#keyword").val();
	 
	var can_search_device=$("#can_search_device").val();
	var url = "admin_apk.php?category_id="+category_id+"&keyword="+encodeURI(keyword)+"&status="+status;
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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');
	    }
	});
	$('#form3').form({
		onSubmit:function(){
			if(!$("#form3").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=apk_master_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").click(function(){
		$('#form3').form('clear');
		$("#flag2").val("add");
		$('#win3').window('open');
		
	});
	
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
	
	$("#btnCancel2").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=apk_master_base&col=id&val='+id);
}
function setLatestItem(id,apk_id)
{
	 $.ajax({
         type: "GET",
         url: 'admin_apk_items.php?action=setLatestItem&id='+id+"&apk_id="+apk_id,
         beforeSend: function(){},
         complete: function(){},
         success:function(resp){
             alert(resp);
             location.href= location.href;
         }
     });
}


function edit2(id)
{
	$('#form3').form('clear');
	$("#flag2").val("edit");
	$('#win3').window('open');
	$('#form3').form('load','admin_ajax.php?action=getinfo&tab=apk_master_items&col=id&val='+id);
}


</script>

<table class="tb">
	<tr>
	<td>
	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr><td colspan="4" align="center">应用基本信息   <a href="javascript:void(0)" onclick="edit('<?php 
    echo $apk_id;
    ?>
');return false;"><font color="red">修改基本信息</font></a></td></tr>
	
	<tr>
	<td width="10%">应用名称:</td>
	<td> <?php 
    echo $rowapk['app_name'];
    ?>
	</td>
	
	<td width="10%">应用包名:</td>
	<td> <?php 
    echo $rowapk['package_name'];
    ?>
	</td>
	</tr>
	
	<tr>
	<td width="10%">应用类别:</td>
	<td> <select id="category_id" name="category_id" disabled>
	<?php 
    echo makeSelectAll("apk_category", "id", "name", "parent_id", "disp_order", 0, "", "&nbsp;|&nbsp;&nbsp;", $rowapk['category_id']);
    ?>
	</select>
	</td>
	
	<td width="10%">应用是否正常:</td>
	<td> <select id="status" name="status" disabled>
	<option value="1" <?php 
    if ($rowapk['status'] == 1) {
        echo "selected";
    }
    ?>
>正常</option>
	<option value="-1" <?php 
    if ($rowapk['status'] == -1) {
        echo "selected";
    }
    ?>
>不正常</option>
	</select>
	</td>
	</tr>
	
	<tr>
	<td width="10%">渠道:</td>
	<td> 
	<select id="company_id" name="company_id" disabled>

	<?php 
    echo makeSelect("apk_company", "id", "name", "id", "", "&nbsp;|&nbsp;&nbsp;", $rowapk['company_id']);
    ?>
	</select>
	</td>
		
	<td width="10%">下载次数:</td>
	<td> <?php 
    echo $rowapk['upload_count'];
    ?>
  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 排序:<?php 
    echo $rowapk['disp_order'];
    ?>
	</td>
	</tr>
	
	<tr>
	<td width="10%">标签:</td>
	<td> <?php 
    echo $rowapk['apk_tag'];
    ?>
	</td>
	
	<td width="10%">图标:</td>
	<td> <?php 
    echo $rowapk['apk_icon'];
    ?>
	</td>
	</tr>
	
	<tr>
	<td width="10%">简介:</td>
	<td colspan="3"> <?php 
    echo $rowapk['description'];
    ?>
	</td>
	
	
	</tr>
	
	</table>
	</td>
	</tr>
</table>

<table class="tb">
 <tr>
	<td  colspan="9"> 应用版本列表
	</td>
</tr>
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="5%">编号</td>
	<td>版本号</td>
	<td>版本名</td>
	<td width="10%">文件大小</td>
	<td width="15%">md5</td>
	<td width="8%">下载次数</td>	
	<td width="8%">是否正常</td>
	<td width="5%">排序</td>
	<td width="20%">操作</td>
	</tr>
	<?php 
    if (false) {
        ?>
  
    <?php 
    } else {
        $latest_apk_item_id = $rowapk['latest_item_id'];
        while ($row = $db->fetch_array($rs)) {
            $t_id = $row["id"];
            if ($latest_apk_item_id === $t_id) {
            }
            ?>
    <tr <?php 
            if ($latest_apk_item_id === $t_id) {
                echo 'style="background: #DE11FA"';
            }
            ?>
>
	  <td>
	  <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td >
     <?php 
            echo $row["version_code"];
            ?>
</td>
       <td>
      <?php 
            echo $row["version_name"];
            ?>
</td>
       <td>
      <?php 
            echo $row["file_size"];
            ?>
</td>
        <td>
      <?php 
            echo $row["md5"];
            ?>
</td>
        <td align="center">
      <?php 
            echo $row["upload_count"];
            ?>
</td>
      <td>
      <select id="status<?php 
            echo $t_id;
            ?>
" name="status<?php 
            echo $t_id;
            ?>
">
	<option value="0">版本是否正常</option>
	<option value="1" <?php 
            echo $row["status"];
            if ($row["status"] == 1) {
                echo "selected";
            }
            ?>
>正常</option>
	<option value="-1" <?php 
            if ($row["status"] == -1) {
                echo "selected";
            }
            ?>
>不正常</option>
	</select></td>
	 
       <td>
	
	  <input name="disp_order<?php 
            echo $t_id;
            ?>
" type="text" value="<?php 
            echo $row["disp_order"];
            ?>
"  size="5"/></td>
	  
	  
	  
	  
      <td>
	  <a href="javascript:void(0)" onclick="edit2('<?php 
            echo $t_id;
            ?>
');return false;">修改</a> | 
	  <?php 
            if ($latest_apk_item_id === $t_id) {
                ?>
	      
	  <?php 
            } else {
                ?>
	    <a href="javascript:void(0)" onclick="setLatestItem('<?php 
                echo $t_id;
                ?>
','<?php 
                echo $apk_id;
                ?>
');return false;">设置为最新版</a> | 
	    <?php 
            }
            ?>
	 <?php 
            if ($loginname === 'dale') {
                ?>
 <a href="admin_ajax.php?action=del&tab=apk_master_items&t_id=<?php 
                echo $t_id;
                ?>
" onClick="return confirm('确定要删除吗?');">删除</a> |<?php 
            }
            ?>
	  <a href="<?php 
            echo $row["file_url"];
            ?>
" onClick="return confirm('确定要下载吗?');">下载apk</a>
<!--	  <a href="admin_ajax.php?action=lunboForTopic&tab={pre}vod_popular&t_id=<?php 
            echo $t_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,'t_id[]')" />
	<?php 
    if ($loginname === 'dale') {
        ?>
<input type="button" value="批量删除" id="btnDel" class="input"  /><?php 
    }
    ?>
	&nbsp;<input type="button" value="批量修改" id="btnEdit" class="input" />
	&nbsp;<input type="button" value="添加" id="btnAdd" class="input" />
<!--	&nbsp;<input type="button" value="添加到轮播图" id="btnAddLunBo" class="input"  />-->
	</td></tr>
    <tr align="center" >
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_apk.php?page={p}&status=" . $status . "&keyword=" . urlencode($keyword) . "&category_id=" . $category_id);
    ?>
	</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=apk_master_base" 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="app_name" size=40 value="" name="app_name">
	</td>
	</tr>
	
	<tr>
	<td width="30%">应用包名:</td>
	<td><input id="package_name" size=40 value="" name="package_name">
	</td>
	</tr>
	<tr>
	<td width="30%">图标:</td>
	<td><input id="apk_icon" size=40 value="" name="apk_icon">
	</td>
	</tr>
	<tr>
	<td>应用是否正常:</td>
	<td>  <select id="status" name="status">
	
	<option value="1" >正常</option>
	<option value="-1" >不正常</option>
	</select>
	</td>
    </tr>
	<tr>
	<td>应用类别:</td>
	<td><select id="category_id" name="category_id">

	<?php 
    echo makeSelectAll("apk_category", "id", "name", "parent_id", "disp_order", 0, "", "&nbsp;|&nbsp;&nbsp;", '');
    ?>
	</select>
	</td>
	</tr>
	
	<tr>
	<td>应用渠道:</td>
	<td><select id="company_id" name="company_id">

	<?php 
    echo makeSelect("apk_company", "id", "name", "id", "", "&nbsp;|&nbsp;&nbsp;", '');
    ?>
	</select>
	</td>
	</tr>
	
	<tr>
	<td width="30%">下载次数:</td>
	<td><input id="upload_count" size=40 value="" name="upload_count">
	</td>
	</tr>
	
	<tr>
     <td>排序:</td>
      <td><input id="disp_order" size=40 value="" name="disp_order" >
	  </td>
    </tr>
    
    <tr>
     <td>标签:</td>
      <td><input id="apk_tag" size=40 value="" name="apk_tag" >
	  </td>
    </tr>
    
   
    
    
	<tr>
     <td>描述信息:</td>
      <td>
      <TEXTAREA id="description" NAME="description" ROWS="2" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>
	  </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>




<div id="win3" 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=apk_master_items&apk_id=<?php 
    echo $apk_id;
    ?>
&package_name=<?php 
    echo $rowapk['package_name'];
    ?>
" method="post" name="form3" id="form3">
<table class="tb">
	<input id="id" name="id" type="hidden" value="">
	<input id="flag2" name="flag2" type="hidden" value="">
	<tr>
	<td width="30%">版本号:</td>
	<td><input id="version_code" size=40 value="" name="version_code">
	</td>
	</tr>
	
	<tr>
	<td width="30%">版本名:</td>
	<td><input id="version_name" size=40 value="" name="version_name">
	</td>
	</tr>
	
	<tr>
	<td>版本是否正常:</td>
	<td>  <select id="status" name="status">	
	<option value="1" >正常</option>
	<option value="-1" >不正常</option>
	</select>
	</td>
    </tr>
	
	<tr>
	<td width="30%">下载次数:</td>
	<td><input id="upload_count" size=40 value="" name="upload_count" disabled>
	</td>
	</tr>
	
	<tr>
     <td>排序:</td>
      <td><input id="disp_order" size=40 value="" name="disp_order" >
	  </td>
    </tr>
    
    
    <tr>
     <td>下载地址:</td>
      <td><input id="file_url" size=40 value="" name="file_url" >
	  </td>
    </tr>
    
    <tr>
     <td>文件大小:</td>
      <td><input id="file_size" size=40 value="" name="file_size" >
	  </td>
    </tr>
   
    <tr>
     <td>md5:</td>
      <td><input id="md5" size=40 value="" name="md5" >
	  </td>
    </tr>
    
    <tr>
     <td>文件名:</td>
      <td><input id="file_name" size=40 value="" name="file_name" >
	  </td>
    </tr>
    
    <tr>
     <td>文件类别:</td>
      <td><input id="file_type" size=40 value="" name="file_type" >
	  </td>
    </tr>
    
     <tr>
     <td>七牛文件key:</td>
      <td><input id="qiniu_file_key" size=40 value="" name="qiniu_file_key" >
	  </td>
    </tr>
   
    
    
	<tr>
     <td>描述信息:</td>
      <td>
      <TEXTAREA id="description" NAME="description" ROWS="2" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>
	  </td>
    </tr>
    <tr align="center" >
      <td colspan="2"><input class="input" type="submit" value="保存" id="btnSave"> <input class="input" type="button" value="返回" id="btnCancel2"></td>
    </tr>
</table>
</form>
</div>

</body>
</html>
<?php 
    unset($rs);
}
Exemplo n.º 15
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}art_topic";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT * FROM {pre}art_topic ORDER BY t_sort,t_id ASC";
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
				stringCheck:true,
				maxlength:64
			},
			t_enname:{
				required:true,
				stringCheck:true,
				maxlength:128
			},
			t_template:{
				required:true,
				maxlength:128
			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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}art_topic");
				$("#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');
	});
	$("#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}art_topic&col=t_id&val='+id);
}
</script>
<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="5%">排序</td>
	<td width="10%">操作</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>
	  <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td>
      <input type="text" name="t_name<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["t_name"];
            ?>
" size="20"/></td>
	  <td>
	  <input type="text" name="t_enname<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["t_enname"];
            ?>
" size="20"/></td>
	  <td>
	  <input type="text" name="t_template<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["t_template"];
            ?>
" size="20"/></td>
      <td>
      <input type="text" name="t_pic<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["t_pic"];
            ?>
" size="20"/></td>
	  <td>
	  <input name="t_sort<?php 
            echo $t_id;
            ?>
" type="text" value="<?php 
            echo $row["t_sort"];
            ?>
"  size="5"/></td>
      <td>
	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
');return false;">修改</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 
        }
    }
    ?>
	<tr>
	<td  colspan="8">全选<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" class="input" />
	</td></tr>
    <tr align="center" >
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_art_topic.php?page={p}");
    ?>
	</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}art_topic" method="post" name="form2" id="form2">
<table class="tb">
	<input id="t_id" name="t_id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="20%">专题名称:</td>
	<td><input id="t_name" size=40 value="" name="t_name">
	</td>
	</tr>
	<tr>
	<td>专题别名:</td>
	<td><input id="t_enname" size=40 value="" name="t_enname" >
	</td>
    </tr>
	<tr>
	<td>模版文件:</td>
	<td><input id="t_template" size=40 value="" name="t_template" >
	</td>
	</tr>
	<tr>
     <td>专题图片:</td>
      <td><input id="t_pic" size=40 value="" name="t_pic" >
	  </td>
    </tr>
	<tr>
     <td>排序:</td>
      <td><input id="t_sort" size=10 value="" name="t_sort" >
	  </td>
    </tr>
	<tr>
     <td>描述信息:</td>
      <td>
      <TEXTAREA id="t_des" NAME="t_des" ROWS="8" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>
	  </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);
}
Exemplo n.º 16
0
function glist()
{
    global $action, $rtype, $rpage, $rkey, $rday, $cjurl, $xt, $rid, $cjflag;
    $unionids = getunionids();
    if ($xt == "1") {
        $url = $cjurl . "?ac=list&pg=" . $rpage . "&rid=" . $rid . "&t=" . $rtype . "&wd=" . $rkey;
        $html = trim(getPage($url, "utf-8"));
        $xn_list = '<list page="([\\s\\S]*?)" pagecount="([0-9]+)" pagesize="([0-9]+)" recordcount="([0-9]+)">';
        $xn_pagesize = 3;
        $xn_pagecount = 2;
        $xn_recordcount = 4;
        $xn_type = '/<ty id="([0-9]+)">([\\s\\S]*?)<\\/ty>/';
        $xn_vod = '/<video><last>([\\s\\S]*?)<\\/last><id>([0-9]+)<\\/id><tid>([0-9]+)<\\/tid><name><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/name><type>([\\s\\S]*?)<\\/type><dt>([\\s\\S]*?)<\\/dt><note><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/note>/';
        $xn_vod_id = 2;
        $xn_vod_name = 4;
        $xn_vod_starring = 7;
        $xn_vod_type = 5;
        $xn_vod_from = 6;
        $xn_vod_time = 1;
        if (strpos($html, "</rss>") <= 0) {
            echo "加载数据发生错误 , <a href=\"javascript:void(0)\" onclick=\"getlist(" . $rtype . "," . $rpage . ",rkey,false);\">获取数据失败,请点击我重试</a>";
            exit;
        }
    } else {
        if ($xt == "2") {
            $url = $cjurl . "-list-true-cid-" . $rtype . "-h-" . $rday . "-p-" . $rpage . "-wd-" . $rkey;
            $html = trim(getPage($url, "utf-8"));
            $xn_list = '<list page="([\\s\\S]*?)" pagecount="([0-9]+)" pagesize="([0-9]+)" recordcount="([0-9]+)">';
            $xn_pagesize = 3;
            $xn_pagecount = 2;
            $xn_recordcount = 4;
            $xn_type = '/<ty id="([0-9]+)">([\\s\\S]*?)<\\/ty>/';
            $xn_vod = '/<video><last>([\\s\\S]*?)<\\/last><id>([0-9]+)<\\/id><tid>([0-9]+)<\\/tid><name><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/name><type>([\\s\\S]*?)<\\/type><dt>([\\s\\S]*?)<\\/dt><pic>([\\s\\S]*?)<\\/pic><lang>([\\s\\S]*?)<\\/lang><area>([\\s\\S]*?)<\\/area><year>([\\s\\S]*?)<\\/year><state>([\\s\\S]*?)<\\/state><note><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/note><actor><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/actor><director><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/director><dl>([\\s\\S]*?)<\\/dl><des><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/des><reurl>([\\s\\S]*?)<\\/reurl><\\/video>/';
            $xn_vod_id = 2;
            $xn_vod_name = 4;
            $xn_vod_starring = 7;
            $xn_vod_type = 5;
            $xn_vod_from = 6;
            $xn_vod_time = 1;
            if (strpos($html, "</rss>") <= 0) {
                echo "加载数据发生错误 , <a href=\"javascript:void(0)\" onclick=\"getlist(" . $rtype . "," . $rpage . ",rkey,false);\">获取数据失败,请点击我重试</a>";
                exit;
            }
        } else {
            $url = $cjurl . "?action=list&rpage=" . $rpage . "&rtype=" . $rtype . "&rkey=" . $rkey;
            $html = trim(getPage($url, "utf-8"));
            $xn_list = '<vods pagesize="([0-9]+)" pagecount="([0-9]+)" recordcount="([0-9]+)">';
            $xn_pagesize = 1;
            $xn_pagecount = 2;
            $xn_recordcount = 3;
            $xn_type = '/<type id="([0-9]+)">([\\s\\S]*?)<\\/type>/';
            $xn_vod = '/<vod><id>([0-9]+)<\\/id><name><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/name><starring><\\!\\[CDATA\\[([\\s\\S]*?)\\]\\]><\\/starring><type>([\\s\\S]*?)<\\/type><from>([\\s\\S]*?)<\\/from><time>([\\s\\S]*?)<\\/time><\\/vod>/';
            $xn_vod_id = 1;
            $xn_vod_name = 2;
            $xn_vod_starring = 3;
            $xn_vod_type = 4;
            $xn_vod_from = 5;
            $xn_vod_time = 6;
            if (strpos($html, "</joyplus>") <= 0) {
                echo "加载数据发生错误 , <a href=\"javascript:void(0)\" onclick=\"getlist(" . $rtype . "," . $rpage . ",rkey,false);\">获取数据失败,请点击我重试</a>";
                exit;
            }
        }
    }
    echo "<div class='nav'><ul><li style=\"width:70px;\"><a href=\"javascript:void(0)\" onclick=\"getlist(0,1,rkey,true);\"><font color=\"#FF0000\"><b>全部资源</b></font></a></li>";
    if ($cjflag == "") {
        $cjflag = getBody($html, "<cjflag>", "</cjflag>");
    }
    preg_match($xn_list, $html, $array1);
    $vodpagesize = $array1[$xn_pagesize];
    $vodpagecount = $array1[$xn_pagecount];
    $vodrecordcount = $array1[$xn_recordcount];
    unset($array1);
    preg_match_all($xn_type, $html, $array2);
    foreach ($array2[1] as $key => $value) {
        $typeid = $value;
        $typename = $array2[2][$key];
        $typebind = "<a id='type" . $typeid . "' href=\"javascript:void(0)\" onclick='setunion(" . $typeid . ",\"" . $cjflag . $typeid . "\");' ";
        if (strpos("," . $unionids, "," . $cjflag . $typeid . ",") > 0) {
            $typebind .= " style=\"color:red;\">[已绑]";
        } else {
            $typebind .= ">[未绑]";
        }
        $typebind .= "</a>";
        echo "<li><a href='javascript:void(0)' onclick=\"getlist(" . $typeid . ",1,rkey,true);\">" . $typename . "</a>" . $typebind . "</li>";
    }
    unset($array2);
    echo "    </ul> </div>";
    echo "<table class=\"tb\" style=\"padding-top:0px;border-top:1px solid #DEEFFA;border-bottom:0px solid #DEEFFA;\"><tr><td>数据查询:<input id=\"rkey\" name=\"rkey\" type=\"text\" onFocus=\"if (value =='请输入关键词'){value =''}\" onBlur=\"if (value ==''){value='请输入关键词'}\" value=\"请输入关键词\" size=\"30\" value='" . $rkey . "'>&nbsp;<input type=\"button\" id=\"btnsearch\" value=\"查询数据\" onclick=\"getlist(0,1,\$('#rkey').val(),true);\" />&nbsp;<font color='red'>采集前请绑定相应分类 ,没有绑定分类的将不会采集入库</font>(<a href=\"http://www.joyplus.tv\" target=\"_blank\">joyplus联盟专用采集服务端[请不要删除版权]</a>)</td></tr></table>";
    preg_match_all($xn_vod, $html, $array3);
    echo "<form action=\"\" method=\"post\" id=\"form3\" name=\"form3\"><table class=\"tb\"><input type=\"hidden\" id=\"cjurl\" name=\"cjurl\" value=\"" . $cjurl . "\"/>";
    if (count($array3[1]) == 0) {
        echo "<tr><td align=\"center\" colspan=\"5\">没有任何数据</td></tr>";
        exit;
    }
    echo "<tr><td width=\"4%\">&nbsp;</td><td>名称</td><td width=\"20%\">分类</td><td width=\"20%\">来源</td><td width=\"20%\">时间</td></tr>";
    foreach ($array3[1] as $key => $value) {
        $vodid = $array3[$xn_vod_id][$key];
        $vodname = $array3[$xn_vod_name][$key];
        $vodstarring = $array3[$xn_vod_starring][$key];
        $vodtype = $array3[$xn_vod_type][$key];
        $vodfrom = $array3[$xn_vod_from][$key];
        $vodtime = $array3[$xn_vod_time][$key];
        $curfontstart = "";
        $curfontend = "";
        $strTime = $vodtime;
        $strNow = date('Y-m-d', time());
        $strTo = date('Y-m-d', strtotime($vodtime));
        $timearr = explode("-", $vodtime);
        if (count($timearr) == 2) {
            $strTo = substring($vodtime, 5);
        }
        if (strpos("," . $strNow, $strTo) > 0) {
            $curfontstart = "<font color=#FF0000>";
            $curfontend = "</font>";
        }
        echo "<tr>";
        echo "    <td><input name=\"ids[]\" type=\"checkbox\" value=\"" . $vodid . "\"/></td>";
        echo "    <td>" . $curfontstart . $vodname . $curfontend . "</td>";
        echo "    <td>" . $curfontstart . $vodtype . $curfontend . "</td>";
        echo "    <td>" . $curfontstart . $vodfrom . $curfontend . "</td>";
        echo "    <td>" . $curfontstart . $vodtime . $curfontend . "</td>";
        echo "    </tr>";
    }
    unset($array3);
    echo "<tr> <td colspan=\"2\">  全选<input name=\"chkall\" type=\"checkbox\" id=\"chkall\" value=\"1\" onClick=\"checkAll(this.checked,'ids[]');\"/>&nbsp;  <input type='button' id='cjsel' value='采集选中'/>  <input type='button' id='cjday' value='采集当天'/> <input type='button' id='cjtype'value='采集当前分类'/>   <input type='button' id='cjall' value='采集全部'/>   </td>  </tr>   <tr>   <td colspan=\"5\" align=\"center\">" . pagelist_manage($vodpagecount, $rpage, $vodrecordcount, $vodpagesize, "'javascript:void(0)' onclick=\"getlist(" . $rtype . ",{p},'" . $rkey . "',true);\"") . " </td>   </tr></table></form>";
}
Exemplo n.º 17
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}link";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT l_id,l_name,l_type,l_url,l_sort FROM {pre}link ORDER BY l_sort,l_id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			l_name:{
				required:true,
				stringCheck:true,
				maxlength:64
			},
			l_url:{
				required:true,
				maxlength:254
			},
			l_logo:{
				maxlength:254
			},
			l_sort:{
				number:true
			},
			l_type:{
				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');
	    }
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}link");
				$("#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'); 
	});
	$("#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}link&col=l_id&val='+id);
}
</script>
<form action="" method="post" name="form1" id="form1">
<table class="tb">
	<tr>
	<td width="5%">&nbsp;</td>
	<td>友情链接名称</td>
	<td width="25%">地址</td>
	<td width="10%">类型</td>
	<td width="10%">排序</td>
	<td width="15%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="6">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $id = $row["l_id"];
            ?>
    <tr>
	  <td><input name="l_id[]" type="checkbox" id="l_id" value="<?php 
            echo $id;
            ?>
" /></td>
      <td><input type="text" name="l_name<?php 
            echo $id;
            ?>
" value="<?php 
            echo $row["l_name"];
            ?>
" size="30"/></td>
	  <td><input name="l_url<?php 
            echo $id;
            ?>
" type="text" value="<?php 
            echo $row["l_url"];
            ?>
"  size="30"/></td>
      <td><?php 
            if ($row["l_type"] == "font") {
                echo "文字链接";
            } else {
                echo "图片链接";
            }
            ?>
</td>
	  <td><input name="l_sort<?php 
            echo $id;
            ?>
" type="text" value="<?php 
            echo $row["l_sort"];
            ?>
"  size="5"/></td>
      <td>
	  <a href="admin_link.php?action=last&l_id=<?php 
            echo $id;
            ?>
">上移</a> |
	  <a href="admin_link.php?action=next&l_id=<?php 
            echo $id;
            ?>
">下移</a> |
	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $id;
            ?>
');return false;">修改</a> |
	  <a href="admin_ajax.php?action=del&tab={pre}link&l_id=<?php 
            echo $id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a></td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr>
	<td colspan="6">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'l_id[]')" />
	&nbsp;<input type="button" id="btnDel" value="批量删除" class="input" />
	&nbsp;<input type="button" id="btnEdit" value="批量修改" class="input"/>
	&nbsp;<input type="button" id="btnAdd" value="添加"  class="input"/>
	</td></tr>
    <tr align="center">
      <td colspan="6">
	   <?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_link.php?page={p}");
    ?>
       </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}link" method="post" name="form2" id="form2">
<table class="tb">
	<input id="l_id" name="l_id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="20%">网站名称:</td>
	<td><input id="l_name" size=50 value="" name="l_name">
	</td>
	</tr>
	<tr>
	<td>网站地址:</td>
	<td><input id="l_url" size=50 value="http://" name="l_url" >
	</td>
	</tr>
	<tr>
	<td>链接类型:</td>
	<td>
	<select id="l_type" name="l_type">
	<option value="font">文字链接</option>
	<option value="pic">图片链接</option>
	</select>
	</td>
	</tr>
	<tr>
	<td>logo地址:</td>
	<td>
	<input id="l_logo" size="50" value="http://" name="l_logo" >
	</td>
	</tr>
	<tr>
	<td>排序号:</td>
	<td><input id="l_sort" size="10" value="" name="l_sort" >
	</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);
}
Exemplo n.º 18
0
function main()
{
    global $db, $cache;
    $keyword = be("all", "keyword");
    $where = " 1=1 ";
    if (!isN($keyword)) {
        $keyword = trim($keyword);
        $where .= " AND (package_name like '%" . $keyword . "%' or  app_name like '%" . $keyword . "%')";
    }
    $status = be("all", "status");
    if (!isNum($status)) {
        $status = 0;
    } else {
        $status = intval($status);
    }
    if ($status != 0) {
        $where .= " and status=" . $status;
    }
    $state = be("all", "state");
    if (!isNum($state)) {
        $state = 0;
    } else {
        $state = intval($state);
    }
    if ($state != 0) {
        $where .= " and state=" . $state;
    }
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM apk_master_temp" . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT * FROM apk_master_temp  where " . $where . " ORDER BY create_date desc, upload_count desc,id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript"><!--
function filter(){
	var keyword=$("#keyword").val();
	var status=$("#status").val();
	var state=$("#state").val();
	var url = "admin_apk_temp.php?keyword="+keyword+"&status="+status+"&state="+state;
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
			zipcode:{
				isZipCode:true
			},
			email:{
				email:true
			}
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			
		}
	});
//	$('#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',function(){
        	location.href=location.href;
        });
    }
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab=apk_master_temp");
				$("#form1").submit();
			}
			else{return false}
	});

	$("#btnAddLunBo").click(function(){
		if(confirm('确定要添加到轮播图吗')){
			$("#form1").attr("action","admin_ajax.php?action=lunboForTopic&flag=batch&tab={pre}vod_popular");
			$("#form1").submit();
		}
		else{return false}
});
	$("#btnSelin").click(function(){
		if(confirm('确定入库您所选择的数据吗')){
			$("#form1").attr("action","?action=IDInflow");
			$("#form1").submit();
		}
	});

	$("#AllInflowProject").click(function(){
		var keyword=$("#keyword").val();
		var status=$("#status").val();
		var state=$("#state").val();
		
		//var playfrom=$("#playfrom").val();
		//var project=$("#cj_vod_projects").val(); +"&playfrom="+playfrom+"&cj_vod_projects="+project
		if(confirm('确定所搜视频全部入库吗')){
			$("#form1").attr("action","?action=AllInflowProject&keyword="+keyword+"&status="+status+"&state="+state);
			$("#form1").submit();
		}
	});
	
	$("#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= location.href;
	});
});
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$('#form2').form('load','admin_ajax.php?action=getinfo&tab=apk_master_temp&col=id&val='+id);
}
--></script>

<table class="admin_apk_temp tb">
	<tr>
	<td>
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">&nbsp;
	
	<select id="status" name="status">
	<option value="0">是否入库</option>
	<option value="1" <?php 
    if ($status == 1) {
        echo "selected";
    }
    ?>
>未入库</option>
	<option value="2" <?php 
    if ($status == 2) {
        echo "selected";
    }
    ?>
>已入库</option>
	</select>&nbsp;
	<select id="state" name="state">
	<option value="0">apk入库处理状态</option>
	<option value="1" <?php 
    if ($state == 1) {
        echo "selected";
    }
    ?>
>正常</option>
	<option value="2" <?php 
    if ($state == 2) {
        echo "selected";
    }
    ?>
>package为空</option>
	<option value="3" <?php 
    if ($state == 3) {
        echo "selected";
    }
    ?>
>应用名称 有冲突</option>
    <option value="4" <?php 
    if ($state == 4) {
        echo "selected";
    }
    ?>
>文件的md5不一样</option>
	</select>&nbsp;
	
	
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	
	</td> 
	</tr>

</table>

<table class="tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="5%">编号</td>
	<td>应用名称</td>
	<td>包名</td>
	<td>版本号</td>
	<td>版本名</td>
	<td>md5</td>
	<td>文件大小</td>
	<td>上传次数</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="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
 
	<td>
	<?php 
            if (isN($row['apk_id'])) {
                ?>
	   <?php 
                echo $row["app_name"];
                ?>
	<?php 
            } else {
                ?>
		<a href="admin_apk_items.php?apk_id=<?php 
                echo $row['apk_id'];
                ?>
"><?php 
                echo $row["app_name"];
                ?>
</a>
		<?php 
            }
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["package_name"];
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["version_code"];
            ?>
	</td>
	<td>
	<?php 
            echo $row["version_name"];
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["md5"];
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["file_size"];
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["upload_count"];
            ?>
	</td>
	
	
	  
	    <td>
<!--	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
');return false;">修改</a> -->
	   <a href="admin_ajax.php?action=del&tab=apk_master_temp&t_id=<?php 
            echo $t_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a> 
	   <?php 
            if ($row['state'] === '4' && !isN($row['apk_id'])) {
                ?>
 | <a href="javascript:void(0)" onclick="edit('<?php 
                echo $t_id;
                ?>
');return false;">修改并入库</a> <?php 
            }
            ?>
	   | <a href="http://apk2.qiniudn.com/<?php 
            echo $row["qiniu_file_key"];
            ?>
" onClick="return confirm('确定要下载吗?');">下载apk</a>
	  </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" class="input" />-->
    &nbsp;<input type="button" id="btnSelin" class="btn" name="Submit" value="入库所选" >
	&nbsp;<input type="button" id="AllInflowProject" class="btn" name="Submit" value="所搜应用全部入库" >
	</td></tr>
    <tr align="center" class="formlast">
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "apk_master_temp.php?page={p}&keyword=" . urlencode($keyword) . "&status=" . $status + "&state=" . $state);
    ?>
	</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_apk_temp.php?action=updateInFlow" method="post" name="form2" id="form2">
<table class="tb">
    <tr>
	<td width="20%"></td>
	<td>相同的版本号,但md5不同,是否需要入库
	</td>
	</tr>
	<input id="id" name="id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<input id="apk_id" name="apk_id" type="hidden" value="">
	<tr>
	<td width="30%">版本号:</td>
	<td><input id="version_code" size=40 value="" name="version_code">
	</td>
	</tr>
	
	<tr>
	<td width="30%">版本名:</td>
	<td><input id="version_name" size=40 value="" name="version_name">
	</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);
}
Exemplo n.º 19
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    $used = be("all", "used");
    $sale = be("all", "sale");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    if (!isN($used)) {
        $where .= " and c_used=" . $used;
    }
    if (!isN($sale)) {
        $where .= " and c_sale=" . $sale;
    }
    $sql = "SELECT count(*) FROM {pre}user_card where 1=1 " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "select c_id,c_number,c_pass,c_money,c_point,c_addtime,c_usetime,c_user,c_used,c_sale from {pre}user_card WHERE 1=1 ";
    $sql .= $where . " limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			c_num:{
				number:true
			},
			c_money:{
				required:true,
				number:true,
				min:1
			},
			c_point:{
				required:true,
				number:true,
				min:1
			}
		}
	});
	$('#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}user_card");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnAdd").click(function(){
//		$("#trnum").css("display","block");
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open'); 
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
	$("#used").change(function(){
		var used = $(this).children('option:selected').val();
		location.href= "admin_user_card.php?used="+used;
	});
	$("#sale").change(function(){
		var used = $(this).children('option:selected').val();
		location.href= "admin_user_card.php?sale="+used;
	});
	$.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);
	};
});
function edit(id)
{
	$('#form2').form('clear');
	$("#trnum").css("display","none");
	$("#flag").val("edit");
	$('#win1').window('open');
	$('#form2').form('load','admin_ajax.php?action=getinfo&tab={pre}user_card&col=c_id&val='+id);
}
</script>
<table class="tb">
	<tr>
	<td colspan="5" ><strong>过滤条件:</strong>
	<select id="used" name="used">
	<option value="">请选择使用情况</option>
	<option value="0" <?php 
    if ($used == 0) {
        echo "selected";
    }
    ?>
>未使用</option>
	<option value="1" <?php 
    if ($used == 1) {
        echo "selected";
    }
    ?>
>已使用</option>
	</select>
	&nbsp;<select id="sale" name="sale">
	<option value="">请选择出售情况</option>
	<option value="0" <?php 
    if ($sale == 0) {
        echo "selected";
    }
    ?>
>未使用</option>
	<option value="1" <?php 
    if ($sale == 1) {
        echo "selected";
    }
    ?>
>已使用</option>
	</select>
	</td>
	</tr>
</table>

<form action="" method="post" id="form1" name="form1">
<table class="tb">
	<tr>
    <td width="4%">&nbsp;</td>
    <td	width="10%">充值卡号</td>
    <td width="10%">密码</td>
    <td width="10%">面值</td>
    <td width="10%">点数</td>
    <td width="10%">出售情况</td>
    <td width="10%">使用情况</td>
    <td width="10%">使用者</td>
    <td width="15%">充值时间</td>
    <td width="10%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="11" >没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $c_id = $row["c_id"];
            $c_sale = $row["c_sale"];
            $c_used = $row["c_used"];
            if ($c_sale == 1) {
                $c_sale = "已售出";
            } else {
                $c_sale = "<font color=red>未出售</font>";
            }
            if ($c_used == 1) {
                $c_used = "已使用";
            } else {
                $c_used = "<font color=red>未使用</font>";
            }
            if ($row["c_user"] > 0) {
                $row1 = $db->getRow("SELECT u_name FROM {pre}user WHERE u_id=" . $c_user);
                $c_user = $row1["u_name"];
                unset($row1);
            }
            ?>
	<tr>
    <td><input type="checkbox" name="c_id[]" value="<?php 
            echo $c_id;
            ?>
"></td>
    <td><?php 
            echo $row["c_number"];
            ?>
</td>
    <td><?php 
            echo $row["c_pass"];
            ?>
</td>
    <td><?php 
            echo $row["c_money"];
            ?>
元</td>
    <td><?php 
            echo $row["c_point"];
            ?>
点</td>
    <td><?php 
            echo $c_sale;
            ?>
</td>
    <td><?php 
            echo $c_used;
            ?>
</td>
    <td><?php 
            echo $c_user;
            ?>
</td>
    <td><?php 
            echo $row["c_usetime"];
            ?>
</td>
    <td>
	<a href="javascript:void(0)" onclick="edit('<?php 
            echo $c_id;
            ?>
');return false;">修改</a> |
	  <a href="admin_ajax.php?action=del&tab={pre}user_card&c_id=<?php 
            echo $c_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a>
	</td>
	</tr>
	<?php 
        }
    }
    ?>
	<td colspan="11">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'c_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="11">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_user_card.php?page={p}&used={$used}&sale={$sale}");
    ?>
	</td>
	</tr>
</table>
</form>

<div id="win1" class="easyui-window" title="窗口" style="width:400px;padding:5px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="?action=save&tab={pre}user_card" method="post" name="form2" id="form2">
<table class="tb">
	<input id="c_id" name="c_id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr id="trnum">
	<td >添加数量:</td>
	<td><input id="num" name="num" size=20 value="">个
	</td>
	</tr>
	<tr>
	<td>充值卡面值:</td>
	<td><input id="c_money" name="c_money" size=20 value="">(元)
	</td>
	</tr>
	<tr>
	<td>充值卡点数:</td>
	<td><input id="c_point" name="c_point" size=20 value="">(点)
	</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);
}
Exemplo n.º 20
0
function main()
{
    global $db, $template, $cache;
    $keyword = be("all", "keyword");
    $stype = be("all", "stype");
    $order = be("all", "order");
    $topic = be("all", "topic");
    $pagenum = be("all", "page");
    $hide = be("all", "hide");
    $repeat = be("all", "repeat");
    $repeatlen = be("all", "repeatlen");
    if (!isNum($stype)) {
        $stype = 0;
    } else {
        $stype = intval($stype);
    }
    if (!isNum($topic)) {
        $topic = 0;
    } else {
        $topic = intval($topic);
    }
    if (!isNum($repeatlen)) {
        $repeatlen = 0;
    }
    if (!isNum($hide)) {
        $hide = -1;
    } else {
        $hide = intval($hide);
    }
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $where = " 1=1 ";
    if (!isN($keyword)) {
        $where = $where . " AND a_title LIKE '%" . $keyword . "%' ";
    }
    if ($stype > 0) {
        $typearr = getValueByArray($cache[1], "t_id", $stype);
        if (is_array($typearr)) {
            $where = $where . " and a_type in (" . $typearr["childids"] . ")";
        } else {
            $where .= " AND a_type=" . $stype . " ";
        }
    }
    if ($stype == -1) {
        $where = $where . " AND a_type =0 ";
    }
    if ($topic > 0) {
        $where = $where . " AND a_topic = " . $topic . " ";
    }
    if ($hide > -1) {
        $where .= " AND a_hide=" . $hide . " ";
    }
    if ($repeat == "ok") {
        $repeatSearch = " a_title ";
        if ($repeatlen > 0) {
            $repeatSearch = " substring(a_title,1," . $repeatlen . ") as `a_title1` ";
        }
        $where .= " AND a_title IN (SELECT " . $repeatSearch . " FROM {pre}vod GROUP BY " . $repeatSearch . " HAVING COUNT(*)>1) ";
    }
    if (isN($order)) {
        $order = "a_addtime";
    }
    $sql = "SELECT count(*) FROM {pre}art where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT a_id, a_title,a_subtitle, a_entitle, a_type,a_topic, a_content, a_author, a_color, a_time, a_hits,a_hide FROM {pre}art WHERE " . $where . " ORDER BY " . $order . " DESC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#btnrepeat").click(function(){
		var repeatlen = $("#repeatlen").val();
		var reg = /^\d+$/;
		var re = repeatlen.match(reg);
		if (!re){ alert("请输入数字");$("#repeatlen").focus();return;}
		if (repeatlen >10){ alert("长度最大10");$("#repeatlen").focus();return;}
		var url = "admin_art.php?repeat=ok&repeatlen=" + repeatlen;
		window.location.href=url;
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&tab={pre}art");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#plsc").click(function(){
		var ids="",rc=false;
		$("input[name='a_id[]']").each(function() {
			if(this.checked){
				if(rc)ids+=",";
				ids =  ids + this.value;
				rc=true;
			}
        });
		$("#form1").attr("action","admin_makehtml.php?action=viewpl&flag=art&d_id="+ids);
		$("#form1").submit();
	});
});

function filter(){
	var stype=$("#stype").val();
	var order=$("#order").val();
	var keyword=$("#keyword").val();
	var topic=$("#topic").val();
	var hide=$("#hide").val();
	var url = "admin_art.php?keyword="+encodeURI(keyword)+"&stype="+stype+"&topic="+topic+"&order="+order+"&hide="+hide;
	window.location.href=url;
}
function gosyncpic(){
	if(confirm('确定要同步下载远程图片吗?数据不可恢复,请做好备份')){
		location.href = 'admin_pic.php?action=syncartpic';
	}
}
</script>
<table class="tb">
    <tr>
	<td>
	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2" >
	过滤条件:<select id="stype" name="stype">
	<option value="0">文章栏目</option>
	<option value="-1" <?php 
    if ($stype == -1) {
        echo "selected";
    }
    ?>
>没有栏目</option>
	<?php 
    echo makeSelectAll("{pre}art_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $stype);
    ?>
	</select>
	&nbsp;
	<select id="topic" name="topic">
	<option value="0">文章专题</option>
	<?php 
    echo makeSelect("{pre}art_topic", "t_id", "t_name", "t_sort", "", "&nbsp;|&nbsp;&nbsp;", $topic);
    ?>
	</select>
	&nbsp;
	<select id="order" name="order">
	<option value="a_time">文章排序</option>
	<option value="a_id" <?php 
    if ($order == "a_id") {
        echo "selected";
    }
    ?>
 >文章编号</option>
	<option value="a_title" <?php 
    if ($order == "a_title") {
        echo "selected";
    }
    ?>
 >文章名称</option>
	<option value="a_hits" <?php 
    if ($order == "a_hits") {
        echo "selected";
    }
    ?>
>文章人气</option>
	</select>
	&nbsp;
	<select id="hide" name="hide">
	<option value="-1">文章显隐</option>
	<option value="0" <?php 
    if ($hide == 1) {
        echo "selected";
    }
    ?>
>显示</option>
	<option value="1" <?php 
    if ($hide == 2) {
        echo "selected";
    }
    ?>
>隐藏</option>
	</select>
	</td>
	</tr>
	<tr>
	<td>
	&nbsp;关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">
	&nbsp; 检测名称长度:<input id="repeatlen" size="2" name="repeatlen" >
	&nbsp;<input class="input" type="button" value="检测重复数据" id="btnrepeat" name="btnrepeat" >
	</td>
	<td width="150px">
	&nbsp;<span>【<a href="###" onclick="javascript:gosyncpic();"><font color="red"><strong>同步下载远程图片</strong></font></a>】</span>
	</td>
	</tr>
	</table>
	</td>
	</tr>
</table>
<form action="" method="post" id="form1" name="form1">
<table class="tb">
	<tr>
	<td width="4%">&nbsp;</td>
	<td>标题</td>
	<td width="9%">分类</td>
	<td width="6%">人气</td>
	<td width="5%">专题</td>
	<td width="5%">浏览</td>
	<td width="15%">时间</td>
	<td width="15%">操作</td>
    </tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $a_id = $row["a_id"];
            $tname = "未知";
            $tenname = "";
            $typearr = getValueByArray($cache[1], "t_id", $row["a_type"]);
            if (is_array($typearr)) {
                $tname = $typearr["t_name"];
                $tenname = $typearr["t_enname"];
            }
            ?>
    <tr>
	<td><input name="a_id[]" type="checkbox" value="<?php 
            echo $row["a_id"];
            ?>
" /></td>
	<td><?php 
            echo $row["a_title"];
            ?>
		<?php 
            if ($row["a_hide"] == 1) {
                echo "<font color=\"red\">[隐藏]</font>";
            }
            ?>
	</td>
	<td><?php 
            echo $tname;
            ?>
</td>
	<td><?php 
            echo $row["a_hits"];
            ?>
</td>
	<td id="zt<?php 
            echo $row["a_id"];
            ?>
" >
	<?php 
            if ($row["a_topic"] == 0) {
                ?>
	<?php 
                echo "<img src=\"../images/icons/icon_02.gif\" border=\"0\" style=\"cursor: pointer;\" onClick=\"setday('zt','" . $row["a_id"] . "','art')\"/>";
                ?>
	<?php 
            } else {
                ?>
	<?php 
                echo "<img src=\"../images/icons/icon_01.gif\" border=\"0\" style=\"cursor: pointer;\" onClick=\"ajaxdivdel('" . $row["a_id"] . "','zt','art')\"/>";
                ?>
	<?php 
            }
            ?>
	</td>
	<td>
	<?php 
            if ($row["a_type"] == 0) {
                $mlink = "#";
            } else {
                $mlink = "../" . $template->getArtLink($row["a_id"], $row["a_title"], $row["a_entitle"], $row["a_type"], $tname, $tenname, true);
            }
            $mlink = replaceStr($mlink, "../" . app_installdir, "../");
            if (substring($mlink, 1, strlen($mlink) - 1) == "/") {
                $mlink = $mlink . "index." . app_artsuffix;
            }
            if (app_artcontentviewtype == 2) {
                if (file_exists($mlink)) {
                    ?>
		 	<a target="_blank" href="<?php 
                    echo $mlink;
                    ?>
"><Img src="../images/icons/html_ok.gif" border="0" alt='浏览' /></a>
		 	<?php 
                } else {
                    ?>
		 	<a  href="admin_makehtml.php?action=viewpl&flag=art&d_id=<?php 
                    echo $row["a_id"];
                    ?>
"><Img src="../images/icons/html_no.gif" border="0" alt='生成' /></a>
		 	<?php 
                }
            } else {
                ?>
	 <a target="_blank" href="<?php 
                echo $mlink;
                ?>
"><Img src="../images/icons/html_ok.gif" border="0" alt='浏览' /></a>
	 <?php 
            }
            ?>
	</td>
	<td><?php 
            echo isToDay($row["a_time"]);
            ?>
</td>
	<td><A href="admin_art.php?action=edit&a_id=<?php 
            echo $row["a_id"];
            ?>
">修改</a> | <a href="admin_ajax.php?action=del&tab={pre}art&a_id=<?php 
            echo $row["a_id"];
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a></td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr>
	<td colspan="8">
    全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'a_id[]');"/>&nbsp;
	批量操作:<input type="button" id="btnDel" value="删除" class="input" />
	<input type="button" id="plfl" value="分类" onClick="plset('plfl','art')" class="input">
	<input type="button" id="plrq" value="人气" onClick="plset('plrq','art')" class="input">
	<input type="button" id="plzt" value="专题" onClick="plset('plzt','art')" class="input">
	<input type="button" id="plsc" value="生成" class="input">
	<input type="button" id="plyc" value="显隐" onClick="plset('plyc','art')" class="input">
	<span id="plmsg" name="plmsg"></span>
	</td></tr>
	<tr>
	<td align="center" colspan="8">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_art.php?page={p}&keyword=" . urlencode($keyword) . "&order=" . $order . "&stype=" . $stype . "&state=" . $state . "&repeat=" . $repeat . "&repeatlen=" . $repeatlen . "&hide=" . $hide);
    ?>
	</td>
    </tr>
</table>
</form>
<?php 
    unset($rs);
}
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_art_projects");
    $sql = "select a.*,b.p_name from {pre}cj_filters a left join {pre}cj_art_projects b on a.f_pid=b.p_id where 1=1 and f_sys=1 ";
    if ($project != "") {
        $sql = $sql . " and a.f_pid = " . $project;
    }
    $sql = $sql . " order by f_id desc ";
    $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(){
	$("#btnDel").click(function(){
		if(confirm('确定要删除吗')){
			$("#form1").attr("action","collect_art_filters.php?action=del");
			$("#form1").submit();
		}
		else{return false}
	});
	$("#btnFlag1").click(function(){
		$("#form1").attr("action","collect_art_filters.php?action=sflag&f_flag=1");
		$("#form1").submit();
	});
	$("#btnFlag2").click(function(){
		$("#form1").attr("action","collect_art_filters.php?action=sflag&f_flag=0");
		$("#form1").submit();
	});
	$("#btnAdd").click(function(){
		location.href='collect_art_filters.php?action=add';
	});
});
</script>
<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td>
		菜单:<a href="collect_art_manage.php?action=">采集规则列表</a> | <a href="collect_art_manage.php?action=upexp">导入采集规则</a> | <a href="collect_art_change.php">分类转换</a> | <a href="collect_art_filters.php">信息过滤</a>  
	&nbsp; 按项目查看:<select onchange=javascript:window.location.href=this.options[this.selectedIndex].value>
	<option value="?">所有转换</option>
	<option value="?{pre}cj_art_projects=0" <?php 
    if ($project == "0") {
        echo "selected";
    }
    ?>
>全局转换</option>
	<?php 
    echo makeSelect("{pre}cj_art_projects", "p_id", "p_name", "", "collect_art_filters.php", "&nbsp;|&nbsp;&nbsp;", $project);
    ?>
	</select>
	</td>
	</tr>
</table>

<form action="" method="post" name="form1" id="form1" >
<table class=tb >
	<tr>
	  <td width="4%">&nbsp;</td>
      <td>过滤名称</td>
      <td width="15%" >过滤对象</td>
      <td width="15%">过滤类型</td>
      <td width="15%">所属项目</td>
      <td width="13%">状态</td>
      <td width="10%">操作</td>
	</tr>
	<?php 
    if (!$rs) {
        ?>
    <tr><td align="center" colspan="8">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            ?>
    <tr>
	<td>
	<input type="checkbox" value="<?php 
            echo $row["f_id"];
            ?>
" id="f_id" name="f_id[]">
	</td>
	<td><?php 
            echo $row["f_name"];
            ?>
</td>
	<td>
     <?php 
            if ($row["f_object"] == 1) {
                echo "标题过滤";
            } else {
                if ($row["f_object"] == 2) {
                    echo "简介过滤";
                } else {
                    if ($row["f_object"] == 3) {
                        echo "播放地址过滤";
                    } else {
                        echo "全局过滤";
                    }
                }
            }
            ?>
      </td> 
      <td>
      <?php 
            if ($row["f_type"] == 1) {
                echo "简单替换";
            } else {
                if ($row["f_type"] == 2) {
                    echo "高级过滤";
                } else {
                    echo "请选择!";
                }
            }
            ?>
      </td>
      <td>
      <?php 
            if ($row["f_pid"] == 0) {
                echo "所有项目";
            } else {
                echo $row["p_name"];
            }
            ?>
      </td>
      <td>
	  <?php 
            if ($row["f_flag"] == 1) {
                echo "<b>√</b>";
            } else {
                echo "<font color='red'><b>×</b></font>";
            }
            ?>
	</td>
	<td>
		</a>&nbsp;<a href="collect_art_filters.php?action=edit&f_id=<?php 
            echo $row["f_id"];
            ?>
">修改</a>
	</td>
    </tr>
<?php 
        }
    }
    ?>
<tr>
	<td  colspan="8">
	全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'f_id[]');"/>&nbsp;
	<input type="button" value="批量删除" id="btnDel" class="input"  />
	<input type="button" value="批量启用" id="btnFlag1" class="input"  />
	<input type="button" value="批量禁用" id="btnFlag2" class="input"  />
	<input type="button" id="btnAdd" value="添加转换" class="input">
	</td>
</tr>
	<tr align="center" bgcolor="#f8fbfb">
	<td colspan="8">
    <?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "collect_art_filters.php?{pre}cj_art_projects=" . $project . "&page={p}");
    ?>
	</td>
	</tr>
</table>
</form>
<?php 
}
Exemplo n.º 22
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}user_group";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT ug_id,ug_name,ug_type,ug_popedom,ug_upgrade,ug_popvalue FROM {pre}user_group ORDER BY ug_popvalue DESC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$("#form2").validate({
		rules:{
			ug_name:{
				required:true,
				stringCheck:true,
				maxlength:32
			},
			ug_popvalue:{
				number:true
			},
			ug_upgrade:{
				number: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');
	    }
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}user_group");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#btnAdd").click(function(){
		$('#form2').form('clear');
		$("#flag").val("add");
		$('#win1').window('open'); 
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
});
function edit(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$.get('admin_ajax.php?action=getinfo&tab={pre}user_group&col=ug_id&val='+id,function(obj){
		$("#ugid").val(obj.ug_id);
		$("#ug_name").val(obj.ug_name);
		$("#ug_popvalue").val(obj.ug_popvalue);
		$("#ug_upgrade").val(obj.ug_upgrade);
		$("input[name='ug_type[]']").each(function(i) {
			if(obj.ug_type.indexOf( ','+$(this).val()+',' ) !=-1 ){
				$(this).attr("checked", true);
			}
        });
        $("input[name='ug_popedom[]']").each(function(i) {
			if(obj.ug_popedom.indexOf( $(this).val() ) !=-1 ){
				$(this).attr("checked", true);
			}
        });
	},"json");
}
</script>
<form action="" method="post" id="form1" name="form1">
<table class="tb">
	<tr>
	<td width="4%">&nbsp;</td>
	<td>用户组名称</td>
	<td width="15%">组内人数</td>
	<td width="15%">购买所需积分</td>
	<td width="15%">权限值</td>
	<td width="15%">操作</td>
    </tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $m_id = $row["m_id"];
            ?>
	<td><?php 
            if (app_reggroup != $row["ug_id"]) {
                ?>
	<input name="ug_id[]" type="checkbox" value="<?php 
                echo $row["ug_id"];
                ?>
"/><?php 
            }
            ?>
</td>
	<td><?php 
            echo $row["ug_name"];
            ?>
</td>
	<td><?php 
            echo $db->getOne("SELECT count(u_id) FROM {pre}user WHERE u_group=" . $row["ug_id"]);
            ?>
</td>
	<td><?php 
            echo $row["ug_upgrade"];
            ?>
</td>
	<td><?php 
            echo $row["ug_popvalue"];
            ?>
</td>
	<td>
	<a href="javascript:void(0)" onclick="edit('<?php 
            echo $row["ug_id"];
            ?>
');return false;">修改</a> | <?php 
            if (app_reggroup != $row["ug_id"]) {
                ?>
<a href="admin_ajax.php?action=del&tab={pre}user_group&ug_id=<?php 
                echo $row["ug_id"];
                ?>
" onClick="return confirm('确定要删除吗?');">删除</a><?php 
            }
            ?>
</td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr>
	<tr>
	<td colspan="7">全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'ug_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="7">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_user_group.php?page={p}");
    ?>
	</td>
	</tr>
</table>
</form>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;margin-top: 30px;width:1000px;" closed="true" closable="false" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab={pre}user_group" method="post" name="form2" id="form2">
<table class="tb">
	<input id="ugid" name="ugid" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="30%">会员组名称:</td>
	<td><INPUT id="ug_name" size=20 value="" name="ug_name">
	</td>
	</tr>
	
	<tr>
	<td>升级所需积分:<br>(使用积分购买组权限)</td>
	<td>
	<INPUT id="ug_upgrade" size=20 value="0" name="ug_upgrade">
	</td>
    </tr>
	<tr>
	<td>权限值:<br>(值越大权限越高,向下兼容)</td>
	<td>
	<INPUT id="ug_popvalue" size=20 value="0" name="ug_popvalue">
	</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);
}
Exemplo n.º 23
0
function main()
{
    $backurl = getReferer();
    global $db, $template, $cache;
    $status = be("all", "status");
    $client = be("all", "client");
    $feedback_type = be("all", "feedback_type");
    $pagenum = be("all", "page");
    if (!isNum($feedback_type)) {
        $feedback_type = 9;
    } else {
        $feedback_type = intval($feedback_type);
    }
    if (!isNum($status)) {
        $status = -1;
    } else {
        $status = intval($status);
    }
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $where = " 1=1 ";
    if ($client === '1') {
        $where .= " AND client !='android' ";
    } else {
        if ($client === '2') {
            $where .= " AND client ='android' ";
        }
    }
    if ($feedback_type > 0) {
        $where .= " AND feedback_type like '%" . $feedback_type . "%' ";
    }
    if ($status > 0) {
        $where .= " AND status =" . $status . " ";
    }
    $sql = "SELECT COUNT( * ) from (\r\nSELECT vod.d_name\r\nFROM mac_vod AS vod, (\r\n\r\nSELECT prod_id, feedback_type, COUNT( * ) AS feedback_count\r\nFROM tbl_video_feedback where \r\n" . $where . " \r\nGROUP BY prod_id\r\n) AS feed\r\nWHERE vod.d_id = feed.prod_id\r\n) AS feeds";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    //$sql = "SELECT d_year,d_id, d_name, d_enname, d_play_num,d_type,d_state,d_topic, d_level, d_hits, d_time,d_remarks,d_playfrom,d_hide,p.id as popular_id FROM {pre}vod ".$repeatsql." left join {pre}vod_popular as p on p.vod_id=d_id  WHERE" . $where . " ORDER BY " . $orders . "  limit ".(app_pagenum * ($pagenum-1)) .",".app_pagenum;
    //  var_dump($sql);
    $sql = "SELECT vod.d_name, vod.d_play_num, feed. * \r\nFROM mac_vod AS vod, (\r\n\r\nSELECT prod_id, feedback_type, COUNT( * ) AS feedback_count,status\r\nFROM tbl_video_feedback where\r\n" . $where . " \r\nGROUP BY prod_id\r\n) AS feed\r\nWHERE vod.d_id = feed.prod_id\r\nORDER BY feedback_count DESC , d_play_num DESC   limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    // var_dump($sql);
    $rs = $db->query($sql);
    ?>


<script type="text/javascript" src="./resource/thickbox-compressed.js"></script>
<script type="text/javascript" src="./resource/thickbox.js"></script>
<link href="./resource/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript">
$(document).ready(function(){
	$("#form1").validate({
		rules:{
			repeatlen:{
				number:true,
				max:10
			}
		}
	});
	
	$("#btnrepeat").click(function(){
		var repeatlen = $("#repeatlen").val();
		var reg = /^\d+$/;
		var re = repeatlen.match(reg);
		if (!re){ repeatlen=0; }
		if (repeatlen >20){ alert("长度最大20");$("#repeatlen").focus();return;}
		var url = "admin_vod.php?repeat=ok&repeatlen=" + repeatlen;
		window.location.href=url;
	});
	$("#btnDel").click(function(){
			if(confirm('确定要删除吗')){
				$("#form1").attr("action","admin_vod.php?action=del");
				$("#form1").submit();
			}
			else{return false}
	});
	$("#plsc").click(function(){
		var ids="",rc=false;
		$("input[name='d_id']").each(function() {
			if(this.checked){
				if(rc)ids+=",";
				ids =  ids + this.value;
				rc=true;
			}
        });
		$("#form1").attr("action","admin_makehtml.php?acton=viewpl&flag=vod&d_id="+ids);
		$("#form1").submit();
	});
});
function filter(){
	var feedback_type=$("#feedback_type").val();	
	var status=$("#status").val();
	var client=$("#client").val();
	var url = "admin_vod_feedback.php?feedback_type="+feedback_type+"&status="+status+"&client="+client;
	window.location.href=url;
}

function updateStatus(id){
	$.get("admin_vod_feedback.php","id="+id+"&action=updateStatus", function(obj) {
		alert(obj);
		window.location.href="<?php 
    echo "admin_vod_feedback.php?page=" . $pagenum . "&feedback_type=" . $feedback_type . '&status=' . $status;
    ?>
";
	});
}
function deleteStatus(id){
	$.get("admin_vod_feedback.php","id="+id+"&action=deleteStatus", function(obj) {
		alert(obj);
		window.location.href="<?php 
    echo "admin_vod_feedback.php?page=" . $pagenum . "&feedback_type=" . $feedback_type . '&status=' . $status;
    ?>
";
	});
}


</script>
<table class="admin_vod_feedback_1 tb">
	<tr>
	<td>
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">过滤条件:反馈意见类别:
	<select id="feedback_type" name="feedback_type">
	<option value="9" <?php 
    if ($feedback_type == "9") {
        echo "selected";
    }
    ?>
>程序反馈影片无法播放</option>
	<option value="1" <?php 
    if ($feedback_type == "1") {
        echo "selected";
    }
    ?>
>用户反馈影片无法播放</option>
	<option value="2" <?php 
    if ($feedback_type == "2") {
        echo "selected";
    }
    ?>
>用户反馈影片播放不流畅</option>
	<option value="3" <?php 
    if ($feedback_type == "3") {
        echo "selected";
    }
    ?>
>用户反馈影片加载比较慢</option>
	<option value="4" <?php 
    if ($feedback_type == "4") {
        echo "selected";
    }
    ?>
>用户反馈影片不能下载</option>
	<option value="5" <?php 
    if ($feedback_type == "5") {
        echo "selected";
    }
    ?>
>用户反馈观看影片时出现闪退</option>
	<option value="6" <?php 
    if ($feedback_type == "6") {
        echo "selected";
    }
    ?>
>用户反馈画质不清晰</option>
	<option value="7" <?php 
    if ($feedback_type == "7") {
        echo "selected";
    }
    ?>
>用户反馈音画不同步</option>
	<option value="8" <?php 
    if ($feedback_type == "8") {
        echo "selected";
    }
    ?>
>用户反馈其它(用户自己填写,可不填)</option>
	<option value="10" <?php 
    if ($feedback_type == "10") {
        echo "selected";
    }
    ?>
>程序反馈视频地址失效</option>
	</select>
	
	<select id="client" name="client">
	<option value="0" >来源</option>
	<option value="1" <?php 
    if ($client == "1") {
        echo "selected";
    }
    ?>
>ios</option>
	<option value="2" <?php 
    if ($client == "2") {
        echo "selected";
    }
    ?>
>android</option>
	</select>
	
	<select id="status" name="status">
	<option value="-1">是否修正</option>
	<option value="1" <?php 
    if ($status == "1") {
        echo "selected";
    }
    ?>
>未修改</option>
	<option value="2" <?php 
    if ($status == "2") {
        echo "selected";
    }
    ?>
>已修改</option>
	
	</select>
	
<!--	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">&nbsp;-->
	
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">
	
	</td>
	
	</tr>
	</table>
	</td>
	</tr>
</table>

<form id="form1" name="form1" method="post">
<table class="tb">
	<tr>
	<td width="5%">编号</td>
	<td width="15%">名称</td>
	<td width="6%">播放次数</td>
	<td width="6%">反馈次数</td>
<!--	<td width="5%">反馈类别</td>-->
	<td width="25%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
	<tr><td align="center" colspan="12">没有任何记录!</td></tr>
	<?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $d_id = $row["prod_id"];
            ?>
    <tr>
	<td><?php 
            echo $d_id;
            ?>
</td>
	<td><?php 
            echo substring($row["d_name"], 100);
            ?>
	
	</td>
	<td><?php 
            echo $row["d_play_num"];
            ?>
</td>
	<td><?php 
            echo $row["feedback_count"];
            ?>
</td>
	
	<td>
	<?php 
            if ($row['status'] === '1') {
                ?>
	<a href="#" onclick='updateStatus(<?php 
                echo $d_id;
                ?>
);' id="updateStatus_<?php 
                echo $d_id;
                ?>
">完成修改</a> |<?php 
            }
            ?>
<a href="admin_vod.php?action=edit&id=<?php 
            echo $d_id;
            ?>
">修改视频</a> |  <a href="admin_vod_feedback.php?action=view&id=<?php 
            echo $d_id;
            ?>
">视频反馈</a> | <a href="#" onclick='deleteStatus(<?php 
            echo $d_id;
            ?>
);' id="deleteStatus_<?php 
            echo $d_id;
            ?>
">删除</a>  
	 
    </tr>
	<?php 
        }
    }
    ?>

	<tr class="formlast">
	<td align="center" colspan="12">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_vod_feedback.php?page={p}&feedback_type=" . $feedback_type . '&status=' . $status . '&client=' . $client);
    ?>
	</td>
	</tr>
</table>

</form>
<?php 
    if ($pagenum == 1 && $where == " 1=1 ") {
        echo "<script>showpic();</script>";
    }
    unset($rs);
    echo '</body>
</html>';
}
Exemplo n.º 24
0
function main()
{
    global $db;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}gbook";
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT g_id,g_vid,g_audit,g_name,g_content,g_ip,g_reply,g_time,g_replytime FROM {pre}gbook ORDER BY g_id DESC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
$(document).ready(function(){
	$('#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');
	    }
	});
	$("#btnCancel").click(function(){
		location.href= location.href;
	});
	$("#btnDel").click(function(){
		if(confirm('确定要删除吗')){
			$("#form1").attr("action","admin_ajax.php?action=del&flag=batch&tab={pre}gbook");
			$("#form1").submit();
		}
		else{return false}
	});
	$("#btnAudit").click(function(){
		$("#form1").attr("action","admin_gbook.php?action=audit");
		$("#form1").submit();
	});
});
function reply(id)
{
	$('#form2').form('clear');
	$("#flag").val("edit");
	$('#win1').window('open');
	$('#form2').form('load','admin_ajax.php?action=getinfo&tab={pre}gbook&col=g_id&val='+id);
}
</script>
	<?php 
    if ($nums == 0) {
        ?>
	<div align="center">没有任何记录!</div>
	<?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $g_id = $row["g_id"];
            $g_content = $row["g_content"];
            $g_content = regReplace($g_content, "\\[em:(\\d{1,})?\\]", "<img src=\"../images/face/\$1.gif\" border=0/>");
            ?>
<form id="form1" name="form1" method="post">
 <div style="width:100%; border:1px solid #B5D6E6; margin-top:10px;">
	 <div style="width:100%; height:30px; line-height:30px; font-size:12px; background:#EEF7FE">
		 <span style="float:left;color:#185691;">
		 	<input type="checkbox" name="g_id[]" value="<?php 
            echo $g_id;
            ?>
" class="checkbox">
		 	&nbsp;昵称:<strong><?php 
            echo $row["g_name"];
            ?>
</strong>
		 	&nbsp;&nbsp;IP:<?php 
            echo $row["g_ip"];
            ?>
		 	&nbsp;&nbsp;<?php 
            if ($row["g_audit"] == 1) {
                ?>
<font color=green>已审核</font><?php 
            } else {
                ?>
<font color=red>未审核</font><?php 
            }
            ?>
		 </span>
		 <span style="float:right;text-align:right; font-size:12px;">
		 	发表于:<font color="red"><?php 
            echo $row["g_time"];
            ?>
</font>
		 </span>
	 </div>
	 <div style="width:95%; margin:0 auto; height:60px; font-size:12px; line-height:20px; border-bottom:1px solid #CCC">
	 	留言内容:<?php 
            echo $g_content;
            ?>
	 	<br>
	 	<font color="red">回复内容:</font><?php 
            echo $row["g_reply"];
            ?>
	 </div>
	 <div style="width:100%; height:20px; text-align:right;font-size:12px; line-height:20px;">
	 	&nbsp;&nbsp;[<a style="cursor:pointer" onclick="reply(<?php 
            echo $g_id;
            ?>
)">
	 	回复</a>]&nbsp;&nbsp;[<a href="admin_ajax.php?action=del&tab={pre}gbook&g_id=<?php 
            echo $g_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a>]&nbsp;&nbsp;
	 </div>
 </div>
	<?php 
        }
    }
    ?>
<table>
<tr><td>
全选<input name="chkall" type="checkbox" id="chkall" value="1" onClick="checkAll(this.checked,'g_id[]');"/>&nbsp;
<input type="button" id="btnDel" value="批量删除" class="input">
<input type="button" id="btnAudit" value="批量审核" class="input">
</td></tr>
</table>
<div align="center">
	<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_gbook.php?page={p}");
    ?>
</div>
<br><br>
</form>

<div id="win1" class="easyui-window" title="窗口" style="padding:5px;width:400px;" closed="true" minimizable="false" maximizable="false">
<form action="admin_ajax.php?action=save&tab={pre}gbook" method="post" name="form2" id="form2">
<table class="tb">
	<input id="g_id" name="g_id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="20%" >回复内容:</td>
	<td><textarea id="g_reply" rows="8" style="width:200px;" value="" name="g_reply"></textarea>
	</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);
}
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);
}
Exemplo n.º 26
0
function main()
{
    global $db, $cache;
    $keyword = be("all", "keyword");
    $t_flag = be("all", "t_flag");
    $t_userid = be("all", "t_userid");
    $t_type = be("all", "t_type");
    $t_bdtype = be("all", "t_bdtype");
    $can_search_device = be("all", "can_search_device");
    if (!isNum($t_userid)) {
        $t_userid = -1;
    } else {
        $t_userid = intval($t_userid);
    }
    if (!isNum($t_bdtype)) {
        $t_bdtype = -1;
    } else {
        $t_bdtype = intval($t_bdtype);
    }
    if (!isNum($t_flag)) {
        $t_flag = -1;
    } else {
        $t_flag = intval($t_flag);
    }
    if (!isNum($t_type)) {
        $t_type = -1;
    } else {
        $t_type = intval($t_type);
    }
    $where = " t_id>4 ";
    if (!isN($keyword)) {
        $where .= " AND t_name LIKE '%" . $keyword . "%' ";
    }
    if ($t_type > 0) {
        $typearr = getValueByArray($cache[0], "t_id", $t_type);
        if (is_array($typearr)) {
            $where = $where . " and t_type in (" . $typearr["childids"] . ")";
        } else {
            $where .= " AND t_type=" . $t_type . " ";
        }
    }
    if (!isN($can_search_device)) {
        //if($can_search_device ==='TV'){
        //	$where .= " AND can_search_device like '%TV%' ";
        //}else {
        $where .= " AND (can_search_device like '" . $can_search_device . "' or can_search_device is null or can_search_device ='' ) ";
        //}
    }
    if ($t_flag == 1) {
        $where .= " AND t_flag =1 ";
    }
    if ($t_bdtype != -1) {
        $where .= " AND t_bdtype=" . $t_bdtype;
    }
    if ($t_flag == 0) {
        $where .= " AND t_flag =0 ";
    }
    if ($t_userid == 1) {
        $where .= " AND t_userid >0 ";
    }
    if ($t_userid == 0) {
        $where .= " AND t_userid =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" . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT * FROM {pre}vod_topic  where " . $where . " ORDER BY t_sort desc,t_id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
function filter(){
	var t_userid=$("#t_userid").val();
	var t_flag=$("#t_flag").val();
	var t_type=$("#t_type").val();
	var keyword=$("#keyword").val();
	var t_bdtype=$("#t_bdtype").val();
	 
	var can_search_device=$("#can_search_device").val();
	var url = "admin_vod_topic.php?can_search_device="+can_search_device+"&keyword="+encodeURI(keyword)+"&t_userid="+t_userid+"&t_flag="+t_flag+"&t_type="+t_type+"&t_bdtype="+t_bdtype;
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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}vod_topic");
				$("#form1").submit();
			}
			else{return false}
	});

	$("#btnAddLunBo").click(function(){
		var ids = "",tid="";
		tid= "t_id[]";
		$("input[name='"+tid+"']").each(function() {
			if(this.checked){ ids =  ids + this.value + ","; }
		});
		if (ids != ""){
			if(confirm('确定要添加到轮播图吗')){
				$("#form1").attr("action","admin_ajax.php?action=lunboForTopic&flag=batch&tab={pre}vod_popular");
				$("#form1").submit();
			}else{return false;}
			}else{
				alert("请至少选择一个数据!");
				}
});

	
	$("#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= 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_1 tb">
	<tr>
	<td>
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
	<tr>
	<td colspan="2">
	过滤条件:<select id="t_type" name="t_type">
	<option value="0">视频栏目</option>
	<option value="-1" <?php 
    if ($t_type == -1) {
        echo "selected";
    }
    ?>
>没有栏目</option>
	<?php 
    echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", $t_type);
    ?>
	</select>
	
	<select id="t_bdtype" name="t_bdtype">
	<option value="-1">榜单类型</option>
	<option value="1" <?php 
    if ($t_bdtype == 1) {
        echo "selected";
    }
    ?>
>悦单</option>
	<option value="2" <?php 
    if ($t_bdtype == 2) {
        echo "selected";
    }
    ?>
>悦榜</option>
	</select>
	
	&nbsp;
	<select id="t_flag" name="t_flag">
	<option value="-1">显示到APP</option>
	<option value="1" <?php 
    if ($t_flag == 1) {
        echo "selected";
    }
    ?>
>显示</option>
	<option value="0" <?php 
    if ($t_flag == 0) {
        echo "selected";
    }
    ?>
>隐藏</option>
	</select>
	<select id="t_userid" name="t_userid">
	<option value="-1">系统/用户创建</option><?php 
    echo $t_userid;
    ?>
	<option value="0" <?php 
    if ($t_userid == 0) {
        echo "selected";
    }
    ?>
>系统创建</option>
	<option value="1" <?php 
    if ($t_userid > 0) {
        echo "selected";
    }
    ?>
>用户创建</option>
	</select>
	
	 <select   id="can_search_device" name="can_search_device">
	    <option value="" >投放设备</option>
		<option value="TV" <?php 
    if ($can_search_device === 'TV') {
        echo "selected";
    }
    ?>
>TV版</option>
		<option value="iPad" <?php 
    if ($can_search_device === 'iPad') {
        echo "selected";
    }
    ?>
>iPad版</option>
		<option value="iphone" <?php 
    if ($can_search_device === 'iphone') {
        echo "selected";
    }
    ?>
>iphone版</option>
		<option value="apad" <?php 
    if ($can_search_device === 'apad') {
        echo "selected";
    }
    ?>
>Android-Pad版</option>
		<option value="aphone" <?php 
    if ($can_search_device === 'aphone') {
        echo "selected";
    }
    ?>
>Android-Phone版</option>
		<option value="web" <?php 
    if ($can_search_device === 'web') {
        echo "selected";
    }
    ?>
>网站版</option>
	</select>
	
	</td>
	</tr>
	<tr>
	<td colspan="6">
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	
	</td>
	<td width="150px">
		
	</td>
	</tr>
	</table>
	</td>
	</tr>
</table>

<table class="admin_vod_topic tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="5%">编号</td>
	<td>名称</td>
	<td>关注度</td>
	<td width="3%">类别</td>
	<td width="10%">视频栏目</td>
	<td width="8%">投放设备</td>
	<td width="5%">图片</td>
	<td width="5%">排序</td>
	<td width="10%">显示到App</td>
	<td width="30%">操作</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>
	  <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
      <td>
      <input type="text" name="t_name<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["t_name"];
            ?>
" size="20"/></td>
	  <td>
	   <select 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 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 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 width="20%"><?php 
            if (isN($row["can_search_device"])) {
                echo 'TV,iPad,iphone,apad,aphone,web';
            } else {
                echo $row["can_search_device"];
            }
            ?>
	</td>
      <td>
      <input type="text" name="t_pic<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["t_pic"];
            ?>
" size="20"/></td>
	  <td>
	  <input name="t_sort<?php 
            echo $t_id;
            ?>
" type="text" value="<?php 
            echo $row["t_sort"];
            ?>
"  size="5"/></td>
	  <td>
	 
	  <select 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="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
');return false;">修改</a> | 
	  <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> |-->
	  <a href="admin_ajax.php?action=lunboForTopic&tab={pre}vod_popular&t_id=<?php 
            echo $t_id;
            ?>
" onClick="return confirm('确定要添加到轮播图吗?');">添加到轮播图</a>
	  </td>
    </tr>
	<?php 
        }
    }
    ?>
	<tr class="formlast">
	<td  colspan="12">全选<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" class="input" />
	&nbsp;<input type="button" value="添加到轮播图" id="btnAddLunBo" class="input"  />
	</td></tr>
    <tr align="center" class="formlast">
	<td colspan="12">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_vod_topic.php?page={p}&can_search_device=" . $can_search_device . "&keyword=" . urlencode($keyword) . "&t_type=" . $t_type . "&t_flag=" . $t_flag . "&t_userid=" . $t_userid . "&t_bdtype=" . $t_bdtype);
    ?>
	</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}vod_topic" method="post" name="form2" id="form2">
<table class="tb">
	<input id="t_id" name="t_id" type="hidden" value="">
	<input id="flag" name="flag" type="hidden" value="">
	<tr>
	<td width="30%">专题名称:</td>
	<td><input id="t_name" size=40 value="" name="t_name">
	</td>
	</tr>
	<tr>
	<td>关注度:</td>
	<td>  <select id="t_toptype" name="t_toptype">
	<option value="0" >非热门</option>
	<option value="1">热门</option>
	</select>
	</td>
    </tr>
	<tr>
	<td>节目类别:</td>
	<td><select id="t_type" name="t_type">
	<option value="0" >没有栏目</option>
	<?php 
    echo makeSelectAll("{pre}vod_type", "t_id", "t_name", "t_pid", "t_sort", 0, "", "&nbsp;|&nbsp;&nbsp;", 0);
    ?>
	</select>
	</td>
	</tr>
	<tr>
     <td>专题图片:</td>
      <td><input id="t_pic" size=40 value="" name="t_pic" >
	  </td>
    </tr>
    
    <tr>
     <td>显示到App:</td>
      <td><select id="t_flag" name="t_flag">
	   <option value="0" selected>不显示</option>
	   <option value="1" >显示</option>
	</select>
	  </td>
    </tr>
    
     <tr>
     <td>榜单类型</td>
      <td> <select  id="t_bdtype" name="t_bdtype">
	<option value="1" selected>悦单</option>
	<option value="2">悦榜</option>
	</select>
	  </td>
    </tr>
    
    <tr id="can_search_device">
     <td>投放设备(可以多选)</td>
      <td><input type="checkbox" name="can_search_device[]" value="TV"
		<?php 
    if (strpos($can_search_device, "TV") != false) {
        echo "checked";
    }
    ?>
 />TV版
		<input type="checkbox" name="can_search_device[]" value="iPad"
		<?php 
    if (strpos($can_search_device, "iPad") != false) {
        echo "checked";
    }
    ?>
 />iPad版
		<input type="checkbox" name="can_search_device[]" value="iphone"
		<?php 
    if (strpos($can_search_device, "iphone") != false) {
        echo "checked";
    }
    ?>
 />iphone版
		<input type="checkbox" name="can_search_device[]" value="apad"
		<?php 
    if (strpos($can_search_device, "apad") != false) {
        echo "checked";
    }
    ?>
 />Android-Pad版
		<input type="checkbox" name="can_search_device[]" value="aphone"
		<?php 
    if (strpos($can_search_device, "aphone") != false) {
        echo "checked";
    }
    ?>
 />Android-phone版
		<input type="checkbox" name="can_search_device[]" value="web"
		<?php 
    if (strpos($can_search_device, "web") != false) {
        echo "checked";
    }
    ?>
 />网站版
<!--<input type="checkbox" id="can_search_device[]" name="can_search_device[]" value="TV"  />TV版-->
<!--    <input type="checkbox" id="can_search_device[]" name="can_search_device[]" value="Pad"  />Pad版-->
<!--    <input type="checkbox"  id="can_search_device[]" name="can_search_device[]" value="Mobile" />Mobile版-->
<!--    <input type="checkbox"  name="can_search_device[]" value="Web" />网站版-->
	  </td>
    </tr>
    
    
    
	<!--    <tr>-->
	<!--     <td>榜单归档,Tag:</td>-->
	<!--      <td>-->
	<!--      <TEXTAREA id="t_tag_name" NAME="t_tag_name" ROWS="1" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>-->
	<!--	  </td>-->
	<!--    </tr>-->
	<!--   -->
    
	<tr>
     <td>排序:</td>
		<td><input id="t_sort" size=10 value="" name="t_sort"></td>
    </tr>
	<tr>
     <td>描述信息:</td>
		<td><TEXTAREA id="t_des" NAME="t_des" ROWS="2"
			style="width: 300px; table-layout: fixed; word-wrap: break-word;"></TEXTAREA>
	  </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);
}
Exemplo n.º 27
0
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 
}
Exemplo n.º 28
0
function main()
{
    global $db, $cache;
    $keyword = be("all", "keyword");
    $where = " 1=1 ";
    if (!isN($keyword)) {
        $keyword = trim($keyword);
        $where .= " AND name like '%" . $keyword . "%'";
    }
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM apk_company" . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT * FROM apk_company  where " . $where . " ORDER BY id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
function filter(){
	var tv_id=$("#keyword").val();
	var url = "admin_apk_company.php?keyword="+tv_id;
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
			zipcode:{
				isZipCode:true
			},
			email:{
				email:true
			}
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			
		}
	});
	$('#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=apk_company");
				$("#form1").submit();
			}
			else{return false}
	});

	$("#btnAddLunBo").click(function(){
		if(confirm('确定要添加到轮播图吗')){
			$("#form1").attr("action","admin_ajax.php?action=lunboForTopic&flag=batch&tab={pre}vod_popular");
			$("#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');
		
	});
	$("#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=apk_company&col=id&val='+id);
}
</script>

<table class="admin_apk_company tb">
	<tr>
	<td colspan="2">
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">&nbsp;
	
	
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	
	</td> 
	</tr>
</table>

<table class="tb">
<form action="" method="post" id="form1" name="form1">
	<tr>
	<td width="5%">&nbsp;</td>
	<td width="5%">编号</td>
	<td>名称</td>
	<td>电子邮件</td>
	<td>联系人</td>
	<td>邮编</td>
	<td width="20%">操作</td>
	</tr>
	<?php 
    if ($nums == 0) {
        ?>
    <tr class="formlast"><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        while ($row = $db->fetch_array($rs)) {
            $t_id = $row["id"];
            ?>
    <tr class="formlast">
	  <td>
	  <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
 
	<td>
	<?php 
            echo $row["name"];
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["email"];
            ?>
	</td>
	
	<td>
	<?php 
            echo $row["contact"];
            ?>
	</td>
	<td>
	<?php 
            echo $row["zipcode"];
            ?>
	</td>
	
	  
	    <td>
	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
');return false;">修改</a> |  
	   <a href="admin_apk.php?company_id=<?php 
            echo $t_id;
            ?>
">应用列表</a> | 
	   <a href="admin_ajax.php?action=del&tab=apk_company&t_id=<?php 
            echo $t_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a> 
	  </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" class="input" />
	</td></tr>
    <tr align="center" >
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_apk_company.php?page={p}&keyword=" . urlencode($keyword));
    ?>
	</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=apk_company" 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>名称:</td>
	<td><input type="text" name="name" id="name" value="" size=25>
	</td>
	</tr>
	
	<tr>
	<td>电子邮件:</td>
	<td><input type="text" name="email" id="email" value="" size=25>
	</td>
	</tr>
	
	<tr>
	<td>联系人:</td>
	<td><input type="text" name="contact" id="contact" value="" size=25>
	</td>
	</tr>
	
	<tr>
	<td>邮编:</td>
	<td><input type="text" name="zipcode" id="zipcode" value="" size=25>
	</td>
	</tr>
	
	<tr>
	<td>地址:</td>
	<td><input type="text" name="adress" id="adress" value="" size=25>
	</td>
	</tr>
	
	
	
	 <tr>
     <td>是否隐藏:</td>
      <td><select id="status" name="status">
	   <option value="0" selected>隐藏</option>
	   <option value="1" >显示</option>
	</select>
	  </td>
    </tr>
    
	<tr>
     <td>简介:</td>
      <td>
      <TEXTAREA id="description" NAME="description" ROWS="2" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>
	  </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);
}
Exemplo n.º 29
0
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;
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count(*) FROM {pre}tv_play" . " where " . $where;
    $nums = $db->getOne($sql);
    $pagecount = ceil($nums / app_pagenum);
    $sql = "SELECT * FROM {pre}tv_play  where " . $where . " ORDER BY id ASC limit " . app_pagenum * ($pagenum - 1) . "," . app_pagenum;
    $rs = $db->query($sql);
    ?>
<script language="javascript">
function filter(){
	var tv_id=$("#tv_id").val();
	var url = "admin_program_play.php?tv_id="+tv_id;
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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}vod_topic");
				$("#form1").submit();
			}
			else{return false}
	});

	$("#btnAddLunBo").click(function(){
		if(confirm('确定要添加到轮播图吗')){
			$("#form1").attr("action","admin_ajax.php?action=lunboForTopic&flag=batch&tab={pre}vod_popular");
			$("#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');
		
	});
	$("#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}tv&col=id&val='+id);
}
</script>

<table class="admin_program_play tb">
	<tr>
	<td>
	<table border="0" align="center" 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 class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	| <a href="admin_program.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="5%">编号</td>
	<td>播放来源</td>
	<td>显示到app</td>
	<td width="45%">直播地址</td>
	<td>清晰度</td>
	<td width="10%">操作</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="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" /></td>
      <td><?php 
            echo $t_id;
            ?>
</td>
 
	<td>
	 <select id="tv_playfrom<?php 
            echo $t_id;
            ?>
" name="tv_playfrom<?php 
            echo $t_id;
            ?>
">
    <option value="">请选择播放来源</option>
    <?php 
            echo makeSelectTV_live("tv_playfrom", $row["tv_playfrom"]);
            ?>
	</select>
	</td>
	
	  
	  <td>
	 
	  <select id="status<?php 
            echo $t_id;
            ?>
" name="status<?php 
            echo $t_id;
            ?>
">
	<option value="0" <?php 
            if ($row["status"] == 0) {
                echo "selected";
            }
            ?>
>不显示</option>
	<option value="1" <?php 
            if ($row["status"] == 1) {
                echo "selected";
            }
            ?>
>显示</option>
	</select>
	  </td>
	  
      <td>
      <input type="text" name="tv_playurl<?php 
            echo $t_id;
            ?>
" value="<?php 
            echo $row["tv_playurl"];
            ?>
" size="100"/></td>
	  
      <td>
	  <select id="tv_definition<?php 
            echo $t_id;
            ?>
" name="tv_definition<?php 
            echo $t_id;
            ?>
">
	  <option value=""> </option>
	<option value="mp4" <?php 
            if ($row["tv_definition"] === 'mp4') {
                echo "selected";
            }
            ?>
>高清</option>
	<option value="flv" <?php 
            if ($row["tv_definition"] === 'flv') {
                echo "selected";
            }
            ?>
>流畅</option>
	</select>
	  </td>
	  
	    <td>
<!--	  <a href="javascript:void(0)" onclick="edit('<?php 
            echo $t_id;
            ?>
');return false;">修改</a> -->
	   <a href="admin_ajax.php?action=del&tab={pre}tv_play&t_id=<?php 
            echo $t_id;
            ?>
" onClick="return confirm('确定要删除吗?');">删除</a> 
	  </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" class="input" />
	</td></tr>
    <tr align="center" >
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_program.php?page={p}&tv_type=" . $tv_type . "&keyword=" . urlencode($keyword));
    ?>
	</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_play&tv_id=<?php 
    echo $tv_id;
    ?>
" 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>直播地址来源:</td>
	<td><select id="tv_playfrom" name="tv_playfrom">
	<?php 
    echo makeSelectTV_live("tv_playfrom", '');
    ?>
	</select>
	</td>
	</tr>
	
	
	
	 <tr>
     <td>显示到App:</td>
      <td><select id="status" name="status">
	   <option value="0" selected>不显示</option>
	   <option value="1" >显示</option>
	</select>
	  </td>
    </tr>
    
	<tr>
     <td>直播视频地址:</td>
      <td>
      <TEXTAREA id="tv_playurl" NAME="tv_playurl" ROWS="2" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>
	  </td>
    </tr>
     <tr>
     <td>直播来源清晰度:</td>
      <td>
        <select id="tv_definition" name="tv_definition">
	  <option value=""> </option>
	<option value="mp4" >高清</option>
	<option value="flv">流畅</option>
	</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($rs);
}
function main()
{
    global $db, $cache;
    $keyword = be("all", "keyword");
    $tv_type = be("all", "tv_type");
    $where = " 1=1 ";
    if (!isN($keyword)) {
        $where .= " AND video_name LIKE '%" . $keyword . "%' ";
    }
    $pagenum = be("all", "page");
    if (!isNum($pagenum)) {
        $pagenum = 1;
    } else {
        $pagenum = intval($pagenum);
    }
    if ($pagenum < 1) {
        $pagenum = 1;
    }
    $sql = "SELECT count( * )\r\nFROM (\r\n\r\nSELECT count( video_name )\r\nFROM `mac_tv_program_item`\r\nWHERE (program_type IS NULL\r\nOR program_type = '' ) and video_name is not null and video_name !='' and " . $where . "\r\nGROUP BY video_name\r\n) AS c\r\n\t";
    $nums = $db->getOne($sql);
    //	var_dump($sql);
    $pagecount = ceil($nums / 100);
    $sql = "SELECT  video_name FROM `mac_tv_program_item` WHERE (program_type IS NULL OR program_type = '' ) and video_name is not null and video_name !='' and " . $where . " GROUP BY video_name   limit " . 100 * ($pagenum - 1) . "," . '100';
    $rs = $db->query($sql);
    ?>
<script language="javascript">
function filter(){
	var keyword=$("#keyword").val(); 
	var url = "admin_program_type_items.php?keyword="+encodeURI(keyword);
	window.location.href=url;
}

$(document).ready(function(){
	$("#form2").validate({
		rules:{
			t_name:{
				required:true,
//				stringCheck:true,
				maxlength:64
			},
//			t_enname:{
//				required:true,
////				stringCheck:true,
//				maxlength:128
//			},
//			t_template:{
//				required:true,
//				maxlength:128
//			},
			t_pic:{
				maxlength:254
			},
			t_sort:{
				number:true
			},
			t_des:{
				required:true,
				maxlength:254
			}
		}
	});
	$('#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}vod_topic");
				$("#form1").submit();
			}
			else{return false}
	});

	$("#btnAddLunBo").click(function(){
		if(confirm('确定要添加到轮播图吗')){
			$("#form1").attr("action","admin_ajax.php?action=lunboForTopic&flag=batch&tab={pre}vod_popular");
			$("#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');
		
	});
	$("#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}tv&col=id&val='+id);
}
</script>

<table class="tb">
	<tr>
	<td>
	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1">
	
	<tr>
	<td colspan="6">
	关键字:<input id="keyword" size="40" name="keyword" value="<?php 
    echo $keyword;
    ?>
">
	<input class="input" type="button" value="搜索" id="btnsearch" onClick="filter();">	
	</td>
	<td width="150px">
		
	</td>
	</tr>
	</table>
	</td>
	</tr>
</table>

<table class="tb">
<form action="" method="post" id="form1" name="form1">
	
	<?php 
    if ($nums == 0) {
        ?>
    <tr><td align="center" colspan="7">没有任何记录!</td></tr>
    <?php 
    } else {
        ?>
	<tr>
	<td>下面节目还没归类,请选择相应的节目类别<select id="program_type" name="program_type" >
	<?php 
        echo makeSelectTV_live("prod_type", '');
        ?>
	</select>  全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onClick="checkAll(this.checked,'t_id[]')" />

	&nbsp;<input type="button" value="批量归档" id="btnEdit" class="input" />
	 </td>
	</tr>
    <tr>
	  <td>
	   <?php 
        $index = 0;
        while ($row = $db->fetch_array($rs)) {
            $index++;
            $t_id = $row["video_name"];
            ?>
	  <input name="t_id[]" type="checkbox" id="t_id" value="<?php 
            echo $t_id;
            ?>
" />
      <?php 
            echo $t_id;
            ?>
 &nbsp; &nbsp;  <?php 
            if ($index % 10 === 0) {
                echo '<br/>';
            }
            ?>
      <?php 
        }
        ?>
     </td>
      
    </tr>
	<?php 
    }
    ?>
	
	
    <tr align="center" >
	<td colspan="8">
		<?php 
    echo pagelist_manage($pagecount, $pagenum, $nums, app_pagenum, "admin_program_type_items.php?page={p}&keyword=" . urlencode($keyword));
    ?>
	</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" 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="tv_name" size=40 value="" name="tv_name">
	</td>
	</tr>
<!--	<tr>-->
<!--	<td>电视编码:</td>-->
<!--	<td>  <input id="tv_code" size=40 value="" name="tv_code">-->
<!--	</td>-->
<!--    </tr>-->
	<tr>
	<td>电视节目类别:</td>
	<td><select id="tv_type" name="tv_type">
	<option value="-1">类型</option>
	<option value="1" >央视</option>
	<option value="2">卫视</option>
	<option value="3" >城市</option>
	<option value="4">CETV</option>
	<option value="5">数字</option>
	</select>
	</td>
	</tr>
	
	<tr>
	<td>国家:</td>
	<td><select id="country" name="country">
	<?php 
    echo makeSelectTV_live("country", '');
    ?>
	</select>
	</td>
	</tr>
	
	<tr>
	<td>地区:</td>
	<td><select id="area" name="area">
	<?php 
    echo makeSelectTV_live("area", '');
    ?>
	</select>
	</td>
	</tr>
	
	 <tr>
     <td>显示到App:</td>
      <td><select id="status" name="status">
	   <option value="0" selected>不显示</option>
	   <option value="1" >显示</option>
	</select>
	  </td>
    </tr>
<!--	<tr>-->
<!--     <td>直播视频地址:</td>-->
<!--      <td>-->
<!--      <TEXTAREA id="tv_playurl" NAME="tv_playurl" ROWS="2" style="width:300px;table-layout:fixed; word-wrap:break-word;"></TEXTAREA>-->
<!--	  </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);
}