?
Path : /home/enviro777/public_html/admin/ |
Current File : /home/enviro777/public_html/admin/product.php |
<?php include "include/header.php"; if($_GET['id']) { $res=$obj->query("select * from category where `catId`='".$_GET['id']."'"); $rowcat=$obj->fetch_query($res); } if($_GET['idst']) { $status =$_GET['act']==0 ? 1 : 0; $obj->query("update product set `proStatus`='$status' where `productId`='".$_GET['idst']."'"); } if($_GET['idd']) { $obj->query("delete from product where `productId`='".$_GET['idd']."'"); } if($_GET['page']) $no=$_GET['page']*10-9; else $no=1; ?> <!--main page--> <link href="style.css" rel="stylesheet" type="text/css"> <table width="100%" border="0" cellspacing="2" cellpadding="3"> <tr> <td width="20%" class="border" valign="top"><?php include "include/leftmenu.php" ?></td> <td bgcolor="#e6e4ef" id="welcomenote" valign="top"> <table cellpadding="4" cellspacing="0" border="0" width="90%" class="normaltext" align="center"> <tr bgcolor="#FFFFFF"><td align="center" colspan="5"><strong><?=$rowcat->catName?> Management</strong></td></tr> <tr><td colspan="5" align="right"><a href="addProduct.php?id=<?=$rowcat->catId?>"><strong><img src="images/Addproduct.jpg" border="0" /></strong></a></td></tr> <tr><td><strong>Serial No</strong></td> <td><strong>Product Name</strong></td> <td><strong>Status</strong></td><td><strong>Edit</strong></td><td><strong>Delete</strong></td> <?php $sql="select * from product where `proType`='$rowcat->catId'"; $conn=$obj->conn(); $pager = new PS_Pagination($conn, $sql, 10, 5, "param1=valu1¶m2=value2",$rowcat->catId); $pager->setDebug(true); $rs = $pager->paginate(); $num=$obj->count_row($sql); if($num==0) echo "<tr height='60'><td colspan='4' align='center'><strong>No Products</strong></td></tr>"; else { while($row=$obj->fetch_query($rs)) { if($row->proStatus==0) $status="Inactive"; else $status="Active"; ?> <tr><td><?=$no?></td><td><?=$row->proName?></td><td><a href="product.php?id=<?=$rowcat->catId?>&idst=<?=$row->productId?>&act=<?=$row->proStatus?>"><?=$status?></a></td><td><a href="editProduct.php?id=<?=$rowcat->catId?>&eid=<?=$row->productId?>">Edit</a></td><td><a href="product.php?id=<?=$rowcat->catId?>&idd=<?=$row->productId?>">Delete</a></td></tr> <?php $no++; } } ?> <tr><td colspan="5" align="center" class="content"><p> </p><?php echo $pager->renderFirst(); echo $pager->renderPrev(); echo $pager->renderNav('<span>', '</span>'); echo $pager->renderNext(); echo $pager->renderLast(); ?></td></tr> </table> </td> </tr> </table> <!--end main page--> <?php include "include/footer.php";?>