View file File name : deliveryestimate-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" /> </head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <?php include("header.php") ?> <script type="text/javascript"> $(document).ready(function(){ $("#check_all").click(function(){ if($(this).is(":checked")){ $(".checkall").attr("checked","checked"); }else{ $(".checkall").removeAttr("checked"); } }) }) </script> <script type="text/javascript"> function changeDeliveryEstimate(field,id,value){ $.ajax({ url:"changeEstimate.php", data:{"field":field,cat_id:id,value:value}, success:function(data){ $("#msg").html("Record updated successfully").show().fadeOut(); } }) } function changeDayHour(field,id,value){ $.ajax({ url:"changedayhours.php", data:{"field":field,cat_id:id,value:value}, success:function(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: Manage Delivery Estimate</td> </tr> <form action="attributegroup-del.php" method="post" enctype="multipart/form-data" name="frm" id="frm"> <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=''; $where.=" and parent_id=0 "; $start=0; if(isset($_GET['start'])) $start=$_GET['start']; $pagesize=15; if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize']; $order_by=" $tbl_maincategory.id "; if(isset($_GET['order_by'])) $order_by=$_GET['order_by']; $order_by2=" asc "; if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2']; $sql=$obj->Query("select *,$tbl_maincategory.id as cid from $tbl_maincategory left join $tbl_deliveryestimate on $tbl_deliveryestimate.cat_id=$tbl_maincategory.id where 1=1 $where order by $order_by $order_by2 limit $start, $pagesize"); $sql2=$obj->query("select *,$tbl_maincategory.id as cid from $tbl_maincategory left join $tbl_deliveryestimate on $tbl_deliveryestimate.cat_id=$tbl_maincategory.id 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="33%" align="left" bgcolor="#e7efef" class="padd5"><strong> Category</strong></td> <td width="39%" align="left" bgcolor="#e7efef" class="padd5"><strong> Delivery Estimate</strong></td> <td width="20%" align="left" bgcolor="#e7efef" class="padd5"><strong>Days / Hours</strong></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 class="padd5"><?php echo stripslashes($line->maincategory); ?></td> <td class="padd5"><strong>Typically delivered in <input type="text" name="min_days" value="<?php echo $line->min_days; ?>" onkeyup="return changeDeliveryEstimate('min_days',<?php echo $line->cid; ?>,this.value)" style="width:80px;" /> - <input type="text" name="max_days" value="<?php echo $line->max_days; ?>" onkeyup="return changeDeliveryEstimate('max_days',<?php echo $line->cid; ?>,this.value)" style="width:80px;" /> Business </strong></td> <td class="padd5"><input type="radio" name="dayhours<?php echo $line->cid; ?>" id="dayhours" value="1"<?php if($line->dayshour==1) { ?>Checked<?php } ?> onchange="return changeDayHour('dayshour',<?php echo $line->cid; ?>,this.value)" />Days <input type="radio" name="dayhours<?php echo $line->cid; ?>" id="dayhours" value="2"<?php if($line->dayshour==2) { ?>Checked<?php } ?> onchange="return changeDayHour('dayshour',<?php echo $line->cid; ?>,this.value)"/>Hours</td> </tr> <?php }?> <tr> <td valign="top" colspan="8" align="right"> </td> </tr> <tr> <td valign="top" colspan="8" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td> </tr> <tr> <td align="right" style="padding-right:80px;" colspan="8"> </td> </tr> <tr> <td align="right" style="padding-right:80px;" colspan="8"> </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>