Edit file File name : product-history.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" /> <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> <link rel="stylesheet" href="../css/colorbox.css" /> <script src="../js/jquery.colorbox.js"></script> <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"); ?> <link rel="stylesheet" href="calender/css/jquery-ui.css"> <script src="calender/js/jquery-ui.js"></script> <script> $(function() { $( "#search_from_date" ).datepicker({ changeMonth: true, changeYear: true, dateFormat:'yy-mm-dd' , yearRange:'2014:<?php echo date('Y'); ?>', onClose: function( selectedDate ) { $( "#search_to_date" ).val(selectedDate); $( "#search_to_date" ).datepicker( "option", "minDate", selectedDate ); } }); $( "#search_to_date" ).datepicker({ changeMonth: true, changeYear: true, numberOfMonths: 2, dateFormat:'yy-mm-dd' , yearRange:'2014:<?php echo date('Y'); ?>', }) $( "#search_from_date" ).datepicker({ changeMonth: true, changeYear: true, dateFormat:'yy-mm-dd' , yearRange:'2014:<?php echo date('Y'); ?>', onClose: function( selectedDate ) { $( "#visit_date_to" ).val(selectedDate); $( "#visit_date_to" ).datepicker( "option", "minDate", selectedDate ); } }); $( "#search_to_date" ).datepicker({ changeMonth: true, changeYear: true, numberOfMonths: 2, dateFormat:'yy-mm-dd' , yearRange:'2014:<?php echo date('Y'); ?>', }) }); </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"> <!------------ Search Section -----------------> <tr> <td align="left" valign="middle" class="bodr" style="padding-bottom:20px;"> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td class="headingbg bodr text14" style="padding-left:20px;">Search<span style="float:right; padding-right:10px;"></span></td> </tr> <tr><td height="10"></td></tr> <tr> <td> <form name="searchForm" method="post" action="product-history.php"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="72%"><table width="89%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="10%" align="right" ><strong>Store:</strong></td> <td width="15%"><select name="search_store"> <option value="">All</option> <?php $store=$obj->query("select storename,storeid from stores where status=1 order by storename"); while($storeresult=$obj->fetchNextObject($store)){ ?> <option value="<?php echo $storeresult->storeid; ?>" <?php if($_REQUEST['search_store']==$storeresult->storeid){ ?>selected="selected"<?php } ?>><?php echo ucwords($storeresult->storename); ?></option> <?php } ?></select></td> <td width="10%" align="right" ><strong>Admin:</strong></td> <td width="15%"><select name="search_user"> <option value="">All</option> <?php $stores=$obj->query("select storename,storeid from stores where status=1 order by storename"); while($storesresult=$obj->fetchNextObject($stores)){ ?> <option value="<?php echo $storesresult->storeid; ?>" <?php if($_REQUEST['search_user']==$storesresult->storeid){ ?>selected="selected"<?php } ?>><?php echo ucwords($storesresult->storename); ?></option> <?php } ?> <?php $admin=$obj->query("select full_name,id from tbl_admin where status=1 order by full_name"); while($adminresult=$obj->fetchNextObject($admin)){ ?> <option value="<?php echo $adminresult->id; ?>" <?php if($_REQUEST['search_user']==$adminresult->id){ ?>selected="selected"<?php } ?>><?php echo ucwords($adminresult->full_name); ?></option> <?php } ?> </select></td> <td width="10%" align="right" ><strong>Product Name:</strong></td> <td width="15%"><input type="text" name="search_pname" value="<?php echo $_REQUEST['search_pname']; ?>"/></td> </tr> <tr><td> </td></tr> <tr> <td width="10%" align="right" ><strong>From Date:</strong></td> <td width="15%"><input type="text" name="search_from_date" id="search_from_date" value="<?php echo $_REQUEST['search_from_date']; ?>" style="width:190px"/></td> <td width="10%" align="right" ><strong>To Date:</strong></td> <td width="15%"><input type="text" name="search_to_date" id="search_to_date" value="<?php echo $_REQUEST['search_to_date']; ?>" style="width:180px"/></td> </tr> </table> </td> <td width="28%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="22%"><input type="submit" class="button" name="search" value="Search" /></td> <td width="78%"><a href="product-history.php">View All</a></td> </tr> </table> </td> </tr> </table> </td></tr> </table> </form> </td> </tr> </table> </td> </tr> <tr><td height="10"></td></tr> <!----- Search End ---------> <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 Product History <span style="float:right; padding-right:10px;"> <!--<a href="registeruser_csv.php"> <input type="button" name="add" value="Download Excell" class="button" /></a>--></span> </td> </tr> <tr> <td height="100" align="left" valign="top" bgcolor="#FFFFFF" class="bodr"> <table width="100%" cellpadding="0" cellspacing="0"> <?php if($_SESSION['sess_msg']){ ?> <tr><td align="center"><font color="#FF0000"><strong><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></strong></font></td></tr> <?php }?> <tr> <td align="left"> <?php $where=''; if($_REQUEST['search_store']!=''){ $where.=" and storeid='".$_REQUEST['search_store']."' "; } if($_REQUEST['search_user']!=''){ $where.=" and user_id='".$_REQUEST['search_user']."' "; } if($_REQUEST['search_pname']!=''){ $where.=" and product_name like '%".$_REQUEST['search_pname']."%' "; } if($_REQUEST['search_from_date']!='' && $_REQUEST['search_to_date']!=''){ $where.=" and modify_date>='".$_REQUEST['search_from_date']."' and modify_date<='".$_REQUEST['search_to_date']."' "; } $start=0; if(isset($_GET['start'])) $start=$_GET['start']; $pagesize=100; if(isset($_GET['pagesize'])) $pagesize=$_GET['pagesize']; if(isset($_GET['order_by2'])) $order_by2=$_GET['order_by2']; $sql=$obj->Query("select * from tbl_product_history where 1=1 $where order by id desc limit $start, $pagesize"); $sql2=$obj->query("select * from tbl_product_history where 1=1 $where order by id desc",$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="3%" align="left" class="padd5" bgcolor="#e7efef"><strong>S No.</strong></td> <td width="6%" align="left" bgcolor="#e7efef" class="padd5"><strong>Product Name</strong></td> <td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>Store Name</strong></td> <td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>MRP Price</strong> </td> <td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>Sell Price</strong> </td> <td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>Size</strong> </td> <td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>Modify By</strong></td> <td width="10%" align="left" bgcolor="#e7efef" class="padd5"><strong>User Type</strong> </td> <td width="5%" align="left" bgcolor="#e7efef" class="padd5"><strong>Date</strong> </td> <td width="10%" align="left" bgcolor="#e7efef" class="padd5"><strong>System/User</strong> </td> <td width="8%" align="left" bgcolor="#e7efef" class="padd5"><strong>IP Address</strong> </td> <!--<td width="5%" align="center" class="padd5" bgcolor="#e7efef"><strong>Action</strong></td> --> <!-- <td width="2%" 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 class="padd5"><?php echo ucwords($line->product_name);?></td> <td class="padd5"><?php echo ucwords(getFieldWhere('storename','stores','storeid',$line->storeid));?></td> <td class="padd5"><?php echo $website_currency_symbol.stripslashes($line->mrp_price);?></td> <td class="padd5"><?php echo $website_currency_symbol.stripslashes($line->sell_price);?></td> <td class="padd5"><?php echo ucwords(strtolower(stripslashes($line->size.' '.$line->size_type)));?></td> <td class="padd5"><?php if($line->user_type=="admin"){ echo ucwords(getFieldWhere('full_name','tbl_admin','id',$line->user_id)); }else{ echo ucwords(getFieldWhere('storename','stores','storeid',$line->user_id)); } ?></td> <td class="padd5"><?php echo ucwords(stripslashes($line->user_type));?></td> <td align="center" class="padd5"><?php echo date('d M Y H:i',strtotime($line->modify_date));?></td> <td align="center" class="padd5"><?php echo $line->system.' / '. $line->system_user;?></td> <td class="padd5"><?php echo $line->ip_address; ?></td> </tr> <?php } ?> <tr> <td valign="top" colspan="13" align="right"> </td> </tr> <tr> <td valign="top" colspan="13" align="right" class="dark_red" style="padding-right:150px;"><?php include("../include/paging.inc.php"); ?></td> </tr> </table> <?php }?> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> <?php include('footer.php'); ?> </table> </body> </html> Save