Preview: page_list.php
Size: 5.81 KB
/home/jambtst2015/public_html/giraffeng.com/admin/page_list.php
<?php include("includes/head.php"); ?>
<?php include("includes/header.php"); ?>
<?php
if($_REQUEST['delete']=="del" && $_REQUEST['delete_id']!='')
{
mysql_query("delete from abs_client where client_id='".$_REQUEST['delete_id']."'");
mysql_query("delete from abs_client_history where client_id='".$_REQUEST['delete_id']."'");
$delmsg="Client details deleted successfully";
}
?>
<script type="text/javascript" language="javascript">
function view(userid)
{
window.open('view_clients.php?userid='+userid,'news view','height=450, width=1000, resizable=yes, scrollbars=yes');
}
</script>
<div class="container_bottom_section">
<table width="1100" border="1" cellspacing="0" cellpadding="0" bordercolor="#616161" style="border-collapse:collapse;">
<?php
if(empty($_REQUEST['success'])){ $_REQUEST['success']=''; }
if($_REQUEST['success']=='1'){
?>
<tr>
<td colspan="4" class="head_text" style="color:#090; background:none; text-align:left;" align="left">Client Added Successfully</td>
</tr>
<?php
}
if($_REQUEST['success']=='2'){
?>
<tr>
<td colspan="4" class="head_text" style="color:#090; background:none; text-align:left;" align="left">Details Updated Successfully</td>
</tr>
<?php
}
if($delmsg!=''){
?>
<tr>
<td colspan="4" class="head_text" style=" color:#F00;background:none; text-align:left;" align="left"><?php echo $delmsg; ?></td>
</tr>
<?php
}
?>
<tr>
<td width="204" class="head_text">Page Category</td>
<td width="695" class="head_text">Pages</td>
<td width="193" class="head_text">Give Permission</td>
</tr>
<?php
$qry_contact = "select * from sat_page_name where 1 and category not in ('Clients','Requirement','Submission','Vendors','Tech Screener')";
$qry_contact .= " group by category order by category";
$sel_events=mysql_query($qry_contact);
////////////////////////////////Start pagination////////////////////////////////////
if(empty($_REQUEST['page'])) { $_REQUEST['page']=''; }
$page=$_REQUEST['page'];
if($page==""){
$page = 1;
}
$max_results = 20;
$prev = ($page - 1);
$next = ($page + 1);
$from = (($page * $max_results) - $max_results);
$total_results = mysql_num_rows($sel_events);
$total_pages = ceil($total_results / $max_results);
$pagination = '';
if($page > 1)
{
$pagination .= "<a href=\"clients.php?page=$prev&name=".$_REQUEST['name']."&email=".$_REQUEST['email']."&industry=".$_REQUEST['industry']."&contact_name=".$_REQUEST['contact_name']."&contact_phone1=".$_REQUEST['contact_phone1']."&contact_phone2=".$_REQUEST['contact_phone2']."&contact_phone3=".$_REQUEST['contact_phone3']."&city=".$_REQUEST['city']."&state=".$_REQUEST['state']."&blacklisted=".$_REQUEST['blacklisted']."&send_emails=".$_REQUEST['send_emails']."&client_type=".$_REQUEST['client_type']."&record_status=".$_REQUEST['record_status']."&order=".$_REQUEST['order']."\" class=\"more_link_pagination_prev\">Previous</a>";
$pagination.=" ";
}
for($i = 1; $i <=$total_pages; $i++)
{
if(($page) == $i)
{
$pagination .= $i;
$pagination.=' ';
}
else
{
$pagination .= "<a href=\"clients.php?page=$i&name=".$_REQUEST['name']."&email=".$_REQUEST['email']."&industry=".$_REQUEST['industry']."&contact_name=".$_REQUEST['contact_name']."&contact_phone1=".$_REQUEST['contact_phone1']."&contact_phone2=".$_REQUEST['contact_phone2']."&contact_phone3=".$_REQUEST['contact_phone3']."&city=".$_REQUEST['city']."&state=".$_REQUEST['state']."&blacklisted=".$_REQUEST['blacklisted']."&send_emails=".$_REQUEST['send_emails']."&client_type=".$_REQUEST['client_type']."&record_status=".$_REQUEST['record_status']."&order=".$_REQUEST['order']."\" class=\"more_link_pagination\">$i</a>";
$pagination.=' ';
}
}
if($page < $total_pages)
{
$pagination .= "<a href=\"clients.php?page=$next&name=".$_REQUEST['name']."&email=".$_REQUEST['email']."&industry=".$_REQUEST['industry']."&contact_name=".$_REQUEST['contact_name']."&contact_phone1=".$_REQUEST['contact_phone1']."&contact_phone2=".$_REQUEST['contact_phone2']."&contact_phone3=".$_REQUEST['contact_phone3']."&city=".$_REQUEST['city']."&state=".$_REQUEST['state']."&blacklisted=".$_REQUEST['blacklisted']."&send_emails=".$_REQUEST['send_emails']."&client_type=".$_REQUEST['client_type']."&record_status=".$_REQUEST['record_status']."&order=".$_REQUEST['order']."\" class=\"more_link_pagination_prev\">Next</a>";
$pagination.=" ";
}
$qry_contact.=" limit $from,$max_results";
//echo $qry_contact;
$result=mysql_query($qry_contact);
////////////////////////////////End pagination////////////////////////////////////
if(mysql_num_rows($result)>0)
{
$inc=1;
while($row_contact_details=mysql_fetch_array($result))
{
$category = $row_contact_details['category'];
//$userName = $row_contact_details['client_id'];
//$city = $row_contact_details['city'];
?>
<tr>
<td class="head_text2"><?php echo $category; ?></td>
<td class="head_text2">
<?php
$qry_contact = "select * from sat_page_name where category='".$category."' ";
$qry_contact .= " order by page_id";
$qry = mysql_query($qry_contact);
$pagename = '';
$sep = '';
while($arr = mysql_fetch_array($qry)){
//echo $arr['page_category'].", ";
$pagename = $pagename.$sep.$arr['page_category'];
$sep = ', ';
}
?>
<?php echo $pagename; ?></td>
<td class="head_text2">
<a href="page_auth.php?cat=<?php echo $category;?>"><img src="images/edit.png" alt="Edit" title="Edit" /></a></td>
</tr>
<?php
}
?>
<?php /*?><tr>
<td colspan="4" class="head_text" style="background-color:#B2CEFC;"><?php echo $pagination; ?></td>
</tr><?php */?>
<?php
}
else
{
?>
<tr>
<td colspan="4" class="head_text" style="background-color:#B2CEFC;">No user found</td>
</tr>
<?php
}
?>
</table>
<div class="clear"></div>
</div>
<?php include("includes/footer.php"); ?>
Directory Contents
Dirs: 17 × Files: 180