View file File name : sitemap-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=iso-8859-1" /> <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 = "sitemap-del.php"; frmobj.what.value="Delete"; frmobj.submit(); } else{ return false; } } else if(comb=='Deactivate'){ frmobj.action = "sitemap-del.php"; frmobj.what.value="Deactivate"; frmobj.submit(); } else if(comb=='Activate'){ frmobj.action = "sitemap-del.php"; frmobj.what.value="Activate"; frmobj.submit(); } } </script> <?php $category_search=true; if(isset($_REQUEST['sitemap_type']) && $_REQUEST['sitemap_type']!='' && !isset($_POST['sitemap_type'])){ $category_search=false; } ?> </head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <?php include("header.php") ?> <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="sitemap-list.php?sitemap_type=<?php echo $_REQUEST['sitemap_type']; ?>"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="75%"><table width="95%" border="0" cellspacing="0" cellpadding="0"> <tr> <?php if($category_search){ ?> <td width="15%" align="right" ><strong>URL Category: </strong></td> <td width="20%"> <select name="sitemap_type" style="width:206px"> <option value="" <?php if($_REQUEST['sitemap_type']==''){ echo "selected"; } ?>>All</option> <option value="General" <?php if($_REQUEST['sitemap_type']=='General'){ echo "selected"; } ?>>General</option> <option value="Grocery" <?php if($_REQUEST['sitemap_type']=='Grocery'){ echo "selected"; } ?>>Grocery</option> <option value="Food" <?php if($_REQUEST['sitemap_type']=='Food'){ echo "selected"; } ?>>Food & Nationwode</option> <option value="blog" <?php if($_REQUEST['sitemap_type']=='Blog'){ echo "selected"; } ?>>Blog</option> <option value="Product" <?php if($_REQUEST['sitemap_type']=='Product'){ echo "selected"; } ?>>Product</option> </select></td><?php } ?> <td width="10%" align="right" ><strong>URL:</strong></td> <td width="35%"><input type="text" name="search_url" value="<?php echo $_REQUEST['search_url']; ?>" style="width: 100%"/></td> <?php if($_REQUEST['sitemap_type']==''){ ?> <td width="10%" align="right" ><strong>Store: </strong></td> <td width="20%"> <select name="search_store" style="width:206px"> <option value="" <?php if($_REQUEST['search_store']==''){ echo "selected"; } ?>>All</option> <?php $stores=$obj->query("select storename from stores where status=1 order by storename"); while($resultstores=$obj->fetchNextObject($stores)){ ?> <option value="<?php echo $resultstores->storename; ?>" <?php if($_REQUEST['search_store']==$resultstores->storename){ echo "selected"; } ?>><?php echo $resultstores->storename; ?></option> <?php } ?> </select></td> <?php } ?> </tr> </table> </td> <td width="15%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="30%"><input type="submit" name="search" value="Search" /></td> <td width="50%"><a href="<?php echo $_REQUEST['PHP_SELF']."?sitemap_type=".$_REQUEST['sitemap_type']; ?>"><button>View All</button></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 sitemap for <?php echo ucwords($_REQUEST['sitemap_type']); ?> URLs <span style="float:right; padding-right:10px;"> <input type="button" name="add" value="Add sitemap" class="button" onclick="location.href='sitemap-addf.php'" /></span> </td> </tr> <form name="frm" method="post" action="sitemap-del.php" enctype="multipart/form-data"> <input type="hidden" name="category" value="<?php echo $_REQUEST['sitemap_type']; ?>"> <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 }?> <?php if($_SESSION['invalidlist']){ ?> <tr><td align="center"><font color="#000"><strong style="color:red">Some urls are not valid, See the list:</strong><br> <span style="text-align: left; display: table-cell;"><?php echo "- ".str_replace(',','<br>- ',$_SESSION['invalidlist']); $_SESSION['invalidlist']=''; ?></span></font></td></tr> <?php }?> <?php if($_SESSION['existlist']){ ?> <tr><td align="center"><font color="#000"><strong style="color:red">Some url(s) are already exist, See the list:</strong><br> <span style="text-align: left; display: table-cell;"><?php echo "- ".str_replace(',','<br>- ',$_SESSION['existlist']); $_SESSION['existlist']=''; ?></span></font></td></tr> <?php }?> <tr> <td align="left"> <?php $where=''; if($_REQUEST['search_url']!=''){ $name=$_REQUEST['search_url']; $where.=" and url like '%".$name."%'"; } if($_REQUEST['search_store']!=''){ $name=buildURL($_REQUEST['search_store']); $where.=" and url like '%".$name."%'"; } if($_REQUEST['sitemap_type']!=''){ $name=$_REQUEST['sitemap_type']; $where.=" and url_category='".$name."'"; } $start=0; if(isset($_GET['start'])) $start=$_GET['start']; $pagesize=100; $sql=$obj->Query("select * from tbl_sitemap where 1=1 $where order by updated_on,id desc limit $start, $pagesize"); $sql2=$obj->query("select id from tbl_sitemap where 1=1 $where",$debug=-1); $reccnt=$obj->numRows($sql2); if($reccnt<1) { ?> <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 align="center" colspan="15"><strong><?php echo $reccnt; ?> Record Found.</strong></td></tr> <tr> <td width="3%" align="left" class="padd5" bgcolor="#f3f4f6"><strong>S No.</strong></td> <td width="30%" align="left" class="padd5" bgcolor="#f3f4f6"><strong>URL</strong></td> <td width="7%" align="left" class="padd5" bgcolor="#f3f4f6"><strong>Category</strong></td> <td width="5%" align="center" bgcolor="#f3f4f6" class="padd5"><strong>Priority</strong></td> <td width="10%" align="center" bgcolor="#f3f4f6" class="padd5"><strong>Added Date</strong></td> <td width="10%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Last Updated</strong></td> <td width="5%" align="left" bgcolor="#f3f4f6" class="padd5"><strong>Status</strong></td> <td width="5%" align="center" class="padd5" bgcolor="#f3f4f6"><strong>Action</strong></td> <td width="5%" align="center" bgcolor="#f3f4f6" 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++; ?> <tr bgcolor="<?php echo $bgcolor;?>"> <td class="padd5"><strong><?php echo $i+$start; ?>.</strong></td> <td class="padd5"><?php echo $line->url; ?></td> <td class="padd5"><?php echo $line->url_category; ?></td> <td class="padd5"><?php echo $line->priority; ?></td> <td class="padd5"><?php echo $line->added_on; ?></td> <td class="padd5"><?php echo $line->updated_on; ?></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="sitemap-addf.php?id=<?php echo $line->id;?>" ><img src="images/edit3.gif" border="0" title="Edit" /></a><br/> </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="15" align="right"> </td> </tr> <tr> <td valign="top" colspan="15" 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="15"> </td> </tr> <tr> <td align="right" style="padding-right:80px;" colspan="15"> </td> </tr> <tr><td align="right" style="padding-right:80px;" colspan="15"> <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>