View file File name : productprice-list.php Content :<?php session_start(); include("../include/config.php"); include("../include/functions.php"); validate_admin(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo SITE_TITLE; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="css/admin.css" rel="stylesheet" type="text/css" /> <script> function checkall(objForm) { len = objForm.elements.length; var i=0; for( i=0 ; i<len ; i++){ if (objForm.elements[i].type=='checkbox') objForm.elements[i].checked=objForm.check_all.checked; } } function del_prompt(frmobj,comb) { //alert(comb); if(comb=='Delete'){ if(confirm ("Are you sure you want to delete record(s)")) { frmobj.action = "productprice-del.php?product_id=<?php echo $_REQUEST['product_id']; ?>"; frmobj.what.value="Delete"; frmobj.submit(); } else{ return false; } } else if(comb=='Deactivate'){ frmobj.action = "productprice-del.php?product_id=<?php echo $_REQUEST['product_id']; ?>"; frmobj.what.value="Deactivate"; frmobj.submit(); } else if(comb=='Activate'){ frmobj.action = "productprice-del.php?product_id=<?php echo $_REQUEST['product_id']; ?>"; frmobj.what.value="Activate"; frmobj.submit(); } } </script> </head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <?php include("header.php") ?> <script type="text/javascript"> function changeStock(chk,id){ $.ajax({ url:"changeStock.php", data:{chk:chk,id:id}, success:function(){ } }) } </script> <script type="text/javascript"> function ChangeDisplayOrder(product_price_id,value){ $.ajax({ url:"showOnHome.php", data:{product_price_id:product_price_id,value:value}, success:function(data){ //alert(data); $("#msg").html("Record updated successfully.").show().fadeOut(); } }) } </script> <tr> <td align="right" class="paddRtLt70" valign="top"> <table width="99%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" class="headingbg bodr text14"> <em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Admin: View Price/Size For <?php echo getField('product_name',$tbl_product,$_REQUEST['product_id']);?><span style="float:right; padding-right:10px;"> <input type="button" name="back" value="Back To Products" class="button" onclick="location.href='product-list.php'" /> <input type="button" name="add" value="Add Price/Size" class="button" onclick="location.href='productprice-addf.php?product_id=<?php echo $_REQUEST['product_id']; ?>'" /></span></td> </tr> <form name="frm" method="post" action="location-del.php" enctype="multipart/form-data"> <tr> <td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr"> <table width="100%" cellpadding="0" cellspacing="0"> <tr><td align="center"><font color="#FF0000"><strong id="msg"><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td></tr> <tr> <td align="left"> <?php $where=''; if($_REQUEST['product_id']) { $product_id=$_REQUEST['product_id']; $where.=" and product_id='$product_id' "; } $start=0; if(isset($_GET['start'])) $start=$_GET['start']; $pagesize=15; if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize']; $order_by='id'; if(isset($_GET['order_by'])) $order_by=$_GET['order_by']; $order_by2='desc'; if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2']; $sql=$obj->Query("select * from $tbl_productprice where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize"); $sql2=$obj->query("select * from $tbl_productprice where 1=1 $where order by $order_by $order_by2",$debug=-1); $reccnt=$obj->numRows($sql2); if($reccnt==0) { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FF0000" size="+1">No Record</font></td> </tr> </table> <?php } else { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td> <td width="13%" align="left" bgcolor="#e7efef" class="padd5"><strong>Size</strong> <?php echo sort_arrows('size') ?></td> <td width="15%" align="left" bgcolor="#e7efef" class="padd5"><strong>Price</strong> </td> <td width="14%" align="left" bgcolor="#e7efef" class="padd5"><strong>Image</strong> </td> <td width="19%" align="left" bgcolor="#e7efef" class="padd5"><strong>Barcode Number</strong> </td> <td width="16%" align="center" bgcolor="#e7efef" class="padd5"><strong>Video</strong> </td> <td width="16%" align="center" bgcolor="#e7efef" class="padd5"><strong>IN Stock</strong> </td> <td width="16%" align="center" bgcolor="#e7efef" class="padd5"><strong>Display Order</strong> </td> <td width="7%" align="left" bgcolor="#e7efef" class="padd5"><strong>Status</strong></td> <td width="4%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td> <td width="6%" align="center" bgcolor="#e7efef" class="padd5" > <input name="check_all" type="checkbox" id="check_all" onclick="checkall(this.form)" value="check_all" /></td> </tr> <?php $i=0; while($line=$obj->fetchNextObject($sql)) { $i++; if($i%2==0) { $bgcolor = "#f6f6f6"; } else { $bgcolor = ""; } ?> <tr bgcolor="<?php echo $bgcolor;?>"> <td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td> <td valign="middle" class="padd5"> <?php echo stripslashes($line->size)." ".$line->size_type; ?> </td> <td valign="middle" class="padd5"> <?php echo '<strong>Actual: </strong>'.$website_currency_symbol." ".stripslashes($line->actual_price); ?><br/> <?php echo '<strong>MRP: </strong>'.$website_currency_symbol." ".stripslashes($line->mrp_price); ?><br/> <?php echo '<strong>Discount: </strong>'.stripslashes($line->discount); ?> %<br/> <?php echo '<strong>Sell: </strong>'.$website_currency_symbol." ".stripslashes($line->sell_price); ?> </td> <td valign="middle" class="padd5"> <?php if(is_file("../upload_images/product/thumb/".$line->pphoto)){ ?> <img src="../upload_images/product/thumb/<?php echo $line->pphoto; ?>" /> <?php } ?></td> <td valign="middle" class="padd5"> <!-- <?php if(is_file("../upload_images/product/barcode/".$line->barcode)){ ?> <img src="../upload_images/product/barcode/<?php echo $line->barcode; ?>" /> <?php } ?><br/> --> <?php echo stripslashes($line->barcode_number); ?> </td> <td valign="middle" class="padd5"> <?php if($line->video!=''){?> <iframe width="250" height="150" src="<?php echo getYouTubeVideo($line->video); ?>" frameborder="0" allowfullscreen></iframe> <?php } ?> </td> <td valign="middle" align="center" class="padd5"> <input type="checkbox" name="in_stcock" value="1" <?php if($line->in_stock==1){ ?>checked<?php } ?> onclick="return changeStock(this.checked,<?php echo $line->id; ?>)"/> </td> <td valign="middle" align="center" class="padd5"> <select name="display_order" style="width:80px;" onchange="return ChangeDisplayOrder(<?php echo $line->id;?>,this.value)"> <?php for($i=0; $i<=10;$i++){ ?> <option value="<?php echo $i; ?>" <?php if($line->display_order== $i){?>selected<?php } ?>><?php echo $i; ?></option> <?php } ?> </select></td> <td align="center" valign="middle" class="padd5"> <?php if($line->status==1){?><img src="images/enable.gif" border="0" title="Activated" /> <?php } else{ ?><img src="images/disable.gif" border="0" title="Deactivated" /><?php }?> </td> <td align="center" valign="middle" class="padd5"> <a href="productprice-addf.php?id=<?php echo $line->id;?>&product_id=<?php echo $_REQUEST['product_id']; ?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a> </td> <td align="center" valign="middle" class="padd5"> <input type="checkbox" name="ids[]" value="<?php echo $line->id;?>" /> </td> </tr> <?php } ?> <tr> <td valign="top" colspan="10" align="right"> </td> </tr> <tr> <td valign="top" colspan="10" align="right" class="dark_red" style="padding-right:20px;"><?php include("../include/paging.inc.php"); ?> </td> </tr> <tr> <td align="right" style="padding-right:80px;" colspan="10"> </td> </tr> <tr><td align="right" style="padding-right:80px;" colspan="10"> <input type="hidden" name="what" value="what" /> <input type="submit" name="Submit" value="Activate" class="button" onclick="return del_prompt(this.form,this.value)" /> <input type="submit" name="Submit" value="Deactivate" class="button" onclick="return del_prompt(this.form,this.value)" /> <input type="submit" name="Submit" value="Delete" class="button" onclick="return del_prompt(this.form,this.value)" /></td></tr> </table><?php }?> </td> </tr> </table> </td> </tr> </form> </table> </td> </tr> </table> </td> </tr> <tr><td height="100"></td></tr> <?php include('footer.php'); ?> </table> </body> </html>