Location: PHPKode > projects > WebPOS > pda/admin/listCategory.php
<?
session_start();
?><?
require_once("../../config/configDB.php");
require("../inc/yqrdb.php");
require("../inc/resizeToFile.func.php");
$mydb=new yqrPage($config_db);

if(isset($_GET["page"]))
{
	$page=$_GET["page"];
}else{
	$page=1;
}
$sql="select * from ".$config_table["category"];
$sql_count="select count(id) from ".$config_table["category"];
$arr=$mydb->showPage($page,$sql_count,$sql,19);
//print_r($arr);
?>
<html>
<head>
<title>Dian38 POS</title>
<link href="../css/red_theme.css" rel="stylesheet" type="text/css" />
</head>
<body>
<? include("top_bar.php"); ?>
<br/>²é¿´·ÖÀà
<table width="800">
<tr>
<td height="19" bgcolor="#990000">񅧏</td>
<td bgcolor="#990000">Ãû³Æ</td>
<td bgcolor="#990000">ͼƬ</td>
<td bgcolor="#990000">״̬</td>
<td bgcolor="#990000"></td>
<td bgcolor="#990000">²é¿´²úÆ·</td>
<td bgcolor="#990000">н¨²úÆ·</td>
</tr>

<?php
if(isset($arr))
{
   for($i=0;$i<count($arr);$i++)
   {
   	  $id=$arr[$i]["id"];
   	  $title=$arr[$i]["title"];
   	  $description=$arr[$i]["description"];
   	  $picture=$arr[$i]["picture"];
   	  $active=$arr[$i]["active"];
   	  if($active==0)
   	  {
   	  	$active="<a href=\"CategoryActive.php?id=$id&active=1&page=$page\"><img src=\"../images/button/off.gif\" alt=\"²»¿ÉÓÃ\" border=\"0\" /></a>";
   	  }else{
   	  	$active="<a href=\"CategoryActive.php?id=$id&active=0&page=$page\"><img src=\"../images/button/on.gif\" alt=\"¿ÉÓÃ\" border=\"0\" /></a>";
   	  }
   	  ?>
   	  <tr>
   	  <td bgcolor="#CC0000"><?=$id?></td>
   	  <td bgcolor="#6600FF"><a href="ModifyCategory.php?id=<?=$id?>" title="<?=$description?>"><?=$title?></a></td>
   	  <td bgcolor="#6600FF"><img src="../../web/img/categories/<?=$picture?>" width="30" height="30"/></td>
   	  <td bgcolor="#ffffff"><?=$active?></td>
   	  <td bgcolor="#0033CC"><a href="deleteCategory.php?id=<?=$id?>">ɾ³ý</a></td>
   	  <td bgcolor="#333366"><a href="showProducts.php?id_category=<?=$id?>">²é¿´</a></td>
   	  <td bgcolor="#333366"><a href="newProduct.php?id_category=<?=$id?>">н¨</a></td>
   	  </tr>
   	  <?php
   	  
   }
?>

<?
}
?>
</table>
 <?
   $pb=$mydb->pageBar();
   $first=$pb["First"];
   $next=$pb["Next"];
   $prev=$pb["Prev"];
   $last=$pb["Last"];
   $pb_front="listCategory.php?page=";
  ?>
  <a href="<?=$pb_front.$first?>">Í·Ò³</a>
  <a href="<?=$pb_front.$prev?>">ÉÏÒ³</a>
  <a href="<?=$pb_front.$next?>">ÏÂÒ³</a>
  <a href="<?=$pb_front.$last?>">βҳ</a>
</body>
  </html>
Return current item: WebPOS