Esempio n. 1
0
        if ($id) {
            PtpVideoDB::delCategory($id);
        } else {
            $delete_id = $_POST['delete_id'];
            foreach ($delete_id as $id) {
                PtpVideoDB::delCategory($id);
            }
        }
        header("Location: ?page=" . PtpVideo::$_category_url);
        exit;
    } else {
        if (!$action && $id) {
            //select
            //URL : /wp-admin/admin.php?page=ptp-video-category&file=category_op.php&id=2
            $title = "更新";
            $data = PtpVideoDB::getCategoryRow($id);
        } else {
            if (isset($_POST['act_sort'])) {
                $sorts = $_POST['sort'];
                foreach ($sorts as $id => $sort) {
                    $data = array('sort' => $sort);
                    PtpVideoDB::saveCategory($data, $id);
                }
                header("Location: ?page=" . PtpVideo::$_category_url);
                exit;
            }
        }
    }
}
?>
Esempio n. 2
0
                                            <th width="5%" align="left" style="background: #fff;">
                                             <input type="checkbox" value="Y" name="check_all" onclick="checkAll(this)"> 全选
                                            </th>
                                            <th width="5%" align="left" style="background: #fff;">排序</th>
                                            <th width="20%" align="left" style="background: #fff;">名称</th>
                                            <th width="20%" align="left" style="background: #fff;">视频</th>
                                            <th width="20%" align="left" style="background: #fff;">封面</th>
                                            <th width="10%" align="left" style="background: #fff;">分类</th>
                                            <th width="10%" align="left" style="background: #fff;">是否显示</th>
                                            <th width="10%" align="left" style="background: #fff;">操作</th>
                                        </tr>
                                        <!--//循环输出管理员列表-->
                                   <?php 
foreach (PtpVideoDB::pageRows($pstart, $pagesize, $video_table, $keywords) as $row) {
    $id = $row['id'];
    $category = PtpVideoDB::getCategoryRow($row['category_id']);
    ?>
                                    <tr height="40">
                                            <td class="center" style="background: #fff;">
                                                <input name="delete_id[]" type="checkbox" class="checkbox cm-item" value="<?php 
    echo $id;
    ?>
">
                                            </td>
                                            <td style="background: #fff;"><input type="text" class="input-text-short" size="3" value="<?php 
    echo $row['sort'];
    ?>
" name="sort[<?php 
    echo $id;
    ?>
]"></td>
Esempio n. 3
0
<?php

/*
Template Name:视频
*/
//header("Location: /video/culture/");
get_header();
$post_id = get_the_ID();
$post = get_post($post_id);
$title = $post->post_title;
$where = "name = '{$title}'";
//根据栏目标题匹配分类
$videoCat = PtpVideoDB::getCategoryRow($where);
$cat_id = $videoCat['id'];
$where = "category_id = '{$cat_id}'";
$videos = PtpVideoDB::getVideoRows($where);
?>

<div class="centerdiv home_bg">
	<div class="center_topimg">
    	<p class="top_img_draw"></p>
    </div>
    
    <div class="center_div">
    	<div class="p2">
        	<div class="p2-1 clearfix">
        		<?php 
get_sidebar('video-sidebar');
?>
        		
                <div class="company_info">