Location: PHPKode > projects > WebPOS > pda/admin/showProducts.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;
}
$id_category=$_GET["id_category"];
$sql="select * from ".$config_table["product"]." where id_category=$id_category";
$sql_count="select count(id) from ".$config_table["product"]." where id_category=$id_category";
//echo $sql;
$arr=$mydb->showPage($page,$sql_count,$sql,19);
//print_r($arr);

$sql_ctg="select * from ".$config_table["category"]." where id=$id_category";
$arr_ctg=$mydb->executeQuery($sql_ctg);
$ctg_title=$arr_ctg[0]["title"];

?>
<html>
<head>
<title>Dian38 POS</title>
<link href="../css/red_theme.css" rel="stylesheet" type="text/css" />
</head>
<body>
<? include("top_bar.php"); ?>
<br/>·ÖÀà -&gt; <?=$ctg_title?> -&gt; ²é¿´²úÆ·
<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>
</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=\"ProductActive.php?id=$id&active=1&page=$page&id_category=$id_category\"><img src=\"../images/button/off.gif\" alt=\"²»¿ÉÓÃ\" border=\"0\" /></a>";
   	  }else{
   	  	$active="<a href=\"ProductActive.php?id=$id&active=0&page=$page&id_category=$id_category\"><img src=\"../images/button/on.gif\" alt=\"¿ÉÓÃ\" border=\"0\" /></a>";
   	  }
	  $nopicture=false;
	   if($picture=="")
	   { 
	     $nopicture=true;
	   }
   	  ?>
   	  <tr>
   	  <td bgcolor="#CC0000"><?=$id?></td>
   	  <td bgcolor="#6600FF"><a href="ModifyProduct.php?id=<?=$id?>" title="<?=$description?>"><?=$title?></a></td>
   	  <td bgcolor="#6600FF">
	  <? if(!$nopicture){ ?>
	  <img src="../../web/img/products/small/<?=$picture?>" width="30" height="30"/>
	  <? }else{ echo "ÎÞͼƬ"; } ?>
	  </td>
   	  <td bgcolor="#ffffff"><?=$active?></td>
   	  <td bgcolor="#0033CC"><a href="deleteProduct.php?id=<?=$id?>">ɾ³ý</a></td>
   	  </tr>
   	  <?php
   	  
   }
?>

<?
}
?>
</table>
 <?
   $pb=$mydb->pageBar();
   $first=$pb["First"];
   $next=$pb["Next"];
   $prev=$pb["Prev"];
   $last=$pb["Last"];
   $pb_front="showProducts.php?id_category=$id_category&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