/web kết quả xổ số ketqua.net/Code/admin/MenuProduct.php
PHP | 237 lines | 206 code | 31 blank | 0 comment | 27 complexity | 1bb322c93aa9e8d30bcc6824323ed1ef MD5 | raw file
- <? include "check.php";?>
- <?
- if($_POST['InsertAds']) {
-
- mysql_query("INSERT INTO ".menu_product." SET
- category='".$_POST['category']."',stt='".$_POST['order']."',parent='".$_POST['parent']."',,stthome='".$_SESSION['stthome']."'");
-
- echo "Thêm '".$_POST['category']."' thành công";
-
- }
-
- if($_POST['Ads']) {
-
- mysql_query("UPDATE ".menu_product." SET
- category='".$_POST['category']."',stt='".$_POST['order']."',parent='".$_POST['parent']."',,stthome='".$_SESSION['stthome']."' WHERE id='".intval($_GET['Edit'])."'");
-
- echo "Cập nhật '".$_POST['category']."' thành công";
-
- }
-
- if($_POST['ItemDel']) {
- $action='';
- if($_POST['element']=='') {
-
- echo '<script>alert(\'Mời bạn chọn ít nhất 1 bản tin\')</script>';
- $action=true;
- }
- if($action=='') {
-
- mysql_query("DELETE FROM ".menu_product." WHERE id in (".implode(",",$_POST['element']).")");
- mysql_query("DELETE FROM ".menu_product." WHERE parent in (".implode(",",$_POST['element']).")");
- }
- }
-
- if($_POST['ItemHid']) {
- $action='';
- if($_POST['element']=='') {
-
- echo '<script>alert(\'Mời bạn chọn ít nhất 1 bản tin\')</script>';
- $action=true;
- }
- if($action=='') {
-
- mysql_query("UPDATE ".menu_product." SET status='false' WHERE id in (".implode(",",$_POST['element']).")");
-
- }
- }
-
- if($_POST['ItemShow']) {
- $action='';
- if($_POST['element']=='') {
-
- echo '<script>alert(\'Mời bạn chọn ít nhất 1 bản tin\')</script>';
- $action=true;
- }
- if($action=='') {
-
- mysql_query("UPDATE ".menu_product." SET status='true' WHERE id in (".implode(",",$_POST['element']).")");
-
- }
- }
- if($_GET['Hidden']!=""){
- mysql_query("UPDATE ".menu_product." SET status='false' WHERE id = ".intval($_GET['Hidden'])."");
- }
- if($_GET['Display']!=""){
- mysql_query("UPDATE ".menu_product." SET status='true' WHERE id = ".intval($_GET['Display'])."");
- }
- if($_POST['Update']){
- $orderNoList = $_POST["orderid"];
- foreach ($orderNoList as $k => $v){
- mysql_query("UPDATE ".menu_product." SET stt='".$v."' WHERE id = ".$k."");
- }
- }
- ?>
- <? if($_GET['Edit']=='') {?>
- <style type="text/css">
- <!--
- .style1 {font-weight: bold}
- -->
- </style>
- <div id="k2AdminContainer" class="K2AdminViewItems">
- <table class="adminlist">
- <form action="" method="post" enctype="multipart/form-data" >
- <tr class="row0">
- <td width="21%" class="height_row"><div align="right">Tên nhóm </div></td>
- <td width="28%" class="height_row">
- <input name="category" type="text" class="input-text" id="category" /> </td>
- <td width="17%" class="height_row"><div align="right">Thuộc nhóm </div></td>
- <td width="34%" class="height_row"><select name="parent" class="input-text">
- <option value="0">Không thuộc nhóm nào</option>
- <? CategoryParent($_POST['parent'],menu_product)?>
- </select></td>
- </tr>
- <tr class="row1">
- <td class="height_row"><div align="right">Số thứ tự </div></td>
- <td class="height_row">
- <select name="order" class="input-text" >
- <? order(1,50,$_POST['order']+1)?>
- </select> </td>
- <td class="height_row"><div align="right">Thứ tự trang chủ </div></td>
- <td class="height_row"><select name="stthome" class="input-text" id="stthome" >
- <? order(1,50,$_POST['stthome']+1)?>
- </select></td>
- </tr>
- <tr class="row0">
- <td> </td>
- <td colspan="3">
- <input name="InsertAds" type="submit" id="InsertAds" value="Thêm category" <? echo $_SESSION['modmana'] == '2'?'disabled':''?>/>
- <input type="reset" name="Submit2" value="Nhập Lại" <? echo $_SESSION['modmana'] == '2'?'disabled':''?>/> </td>
- </tr>
- </form>
- </table>
- </div>
- <? }?>
- <? if($_GET['Edit']!='') {?>
- <?
- $sqlstr=mysql_query("SELECT * FROM ".menu_product." WHERE id='".intval($_GET['Edit'])."'");
- if(mysql_num_rows($sqlstr)>0) {
-
- $row=mysql_fetch_assoc($sqlstr)
-
- ?>
- <div id="k2AdminContainer" class="K2AdminViewItems">
- <table class="adminlist">
- <form method="post" action="" enctype="multipart/form-data">
- <tr class="row0">
- <td width="22%" class="height_row"><div align="right">Tên nhóm </div></td>
- <td width="28%" class="height_row">
- <input name="category" type="text" class="input-text" id="category" value="<?=$row['category']?>" /> </td>
- <td width="17%" class="height_row"><div align="right">Thuộc nhóm </div></td>
- <td width="33%" class="height_row"><select name="parent" class="input-text" id="parent">
- <option value="0">Không thuộc nhóm nào</option>
- <? CategoryParent($row['parent'],menu_product)?>
- </select></td>
- </tr>
- <tr class="row1">
- <td class="height_row"><div align="right">Số thứ tự </div></td>
- <td class="height_row">
- <select name="order" class="input-text" >
- <? order(1,50,$row['stt'])?>
- </select> </td>
- <td class="height_row"><div align="right">Thứ tự trang chủ </div></td>
- <td class="height_row"><select name="stthome" class="input-text" id="stthome" >
- <? order(1,50,$row['stthome'])?>
- </select></td>
- </tr>
- <div align="right"></div>
- <tr class="row0">
- <td> </td>
- <td colspan="3">
- <input type="submit" name="Ads" value="Sửa category" <? echo $_SESSION['modmana'] == '2'?'disabled':''?>/>
- <input type="reset" name="Submit2" value="Nhập Lại" <? echo $_SESSION['modmana'] == '2'?'disabled':''?>/> </td>
- </tr>
- </form>
- </table>
- </div>
- <? }
- }?>
- <div id="k2AdminContainer" class="K2AdminViewItems">
- <form method="post" action="" name="rowsDeleteForm" id="rowsDeleteForm">
- <div>
- <a href="" onclick="if (markAllRows('rowsDeleteForm')) return false;" style="font-family:Tahoma; font-size:11px; font-weight:bolder">[Check All]</a> /
- <a href="" onclick="if (unMarkAllRows('rowsDeleteForm')) return false;" style="font-family:Tahoma; font-size:11px; font-weight:bolder">[Uncheck All]</a> <input name="ItemDel" type="submit" id="ItemDel" onclick="return confirm('Bạn có chắc không ?');" value="Xóa nhóm này" <? echo $_SESSION['modmana'] == '2'?'disabled':''?> class="ItemDel" />
- <input name="ItemHid" type="submit" id="ItemHid" onclick="return confirm('Bạn có chắc không ?');" value="Ẩn nhóm này" <? echo $_SESSION['modmana'] == '2'?'disabled':''?> class="ItemHid" />
- <input name="ItemShow" type="submit" id="ItemShow" onclick="return confirm('Bạn có chắc không ?');" value="Hiện nhóm này" <? echo $_SESSION['modmana'] == '2'?'disabled':''?> class="ItemShow" />
- <input name="Update" type="submit" id="Update" onclick="return confirm('Bạn có chắc không ?');" value="Cập nhật thay đổi" <? echo $_SESSION['modmana'] == '2'?'disabled':''?> class="ItemUpdate" />
- </div>
- <table class="adminlist">
- <thead>
- <tr>
- <th> </th>
- <th class="title">Tên nhóm</th>
- <th>Hiển thị</th>
- <th>Trạng Thái</th>
- </tr>
- </thead>
- <tbody>
- <?
- $sqlstr=mysql_query("SELECT id,category,status,stt FROM ".menu_product." WHERE parent='0' order by stt ASC");
- if(mysql_num_rows($sqlstr)>0){
- $le = 0;
- while($row=mysql_fetch_assoc($sqlstr)){ $le++;
- ?>
- <tr class="odd <?=($le%2==0?'row0':'row1')?>" style="cursor:pointer" ondblclick="location.href='index.php?menu=<?=$_GET['menu']?>&site=<?=$_GET['site']?>&Edit=<?=$row['id']?>'">
- <td width="20" height="15" align="center" bgcolor="#EEEEEE" >
- <input type="checkbox" name="element[]" id="element" value="<?=$row['id']?>" /></td>
- <td width="601"><span class="style1">
- <strong><?=$row['category']?></strong>
- </span></td>
- <td width="50" ><div align="center">
- <input name="orderid[<?=$row['id']?>]" type="text" style="width:50px; text-align:center;" id="orderid[<?=$row['id']?>]" value="<?=$row['stt']?>"/>
- </div></td>
- <td width="115" align="center" ondblclick="location.href='index.php?menu=<?=$_GET['menu']?>&site=<?=$_GET['site']?>&<? echo $row['status']=='true'?'Hidden':'Display';?>=<?=$row['id']?>'" style="cursor:pointer"><strong><? echo $row['status']=='true'?'Hiện':'Ẩn';?></strong></td>
- </tr>
- <?
- $sql=mysql_query("SELECT id,category,status,stt FROM ".menu_product." WHERE parent='".$row['id']."' order by stt ASC");
- if(mysql_num_rows($sql)>0){
- while($rs=mysql_fetch_assoc($sql)){
- ?>
- <tr class="odd <?=($le%2==0?'row0':'row1')?>">
- <td width="20" height="15" align="center" bgcolor="#EEEEEE" >
- <input type="checkbox" name="element[]" id="element" value="<?=$rs['id']?>" /></td>
- <td width="601" style="cursor:pointer; padding-left:30px;" ondblclick="location.href='index.php?menu=<?=$_GET['menu']?>&site=<?=$_GET['site']?>&Edit=<?=$rs['id']?>'">» <?=$rs['category']?></td>
- <td width="50" ><div align="center">
- <input name="orderid[<?=$rs['id']?>]" type="text" style="width:50px; text-align:center;" id="orderid[<?=$rs['id']?>]" value="<?=$rs['stt']?>"/>
- </div></td>
- <td width="115" align="center" ondblclick="location.href='index.php?menu=<?=$_GET['menu']?>&site=<?=$_GET['site']?>&<? echo $rs['status']=='true'?'Hidden':'Display';?>=<?=$rs['id']?>'" style="cursor:pointer;"><? echo $row['status']=='true'?'Hiện':'Ẩn';?></td>
- </tr>
- <? }
- }?>
- <? }
- }?>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="15">
- <div class="pagination">4
- <a class="number current">1</a><a href="#" class="number" title="2" onclick="javascript: document.adminForm.limitstart.value=5; submitform();return false;">2</a>
- <a href="#" class="number" title="3" onclick="javascript: document.adminForm.limitstart.value=10; submitform();return false;">3</a>4
- </div>
- </td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>