PK

ADDRLIN : /home/anibklip/pcfcindia.com/2021-22/
FLL :
Current File : /home/anibklip/pcfcindia.com/2021-22/xxxclients_admin.php

<?php
session_start();
require_once 'common/common.php';
require_once 'common/secure.php';

include("connexion.php");
include "head.php";
?>
<script>
function del(p){
	cn=confirm("Are you sure to delete this record");
	if(cn){
		window.location.href=p;
	}
}
</script>
<h2 id="icon_pick">Delete Clients</h2> 

<table cellspacing="1" align="center" width="100%" border="1" cellpadding="3">
<tr>
 <td align="center"><a href="clients_admin.php?typ=C"><strong>Client</strong></a><br></td>
 <td align="center"><strong><a href="clients_admin.php?typ=SC">Sub Client</a><br>
 </strong></td>
 <td align="center"><strong><a href="clients_admin.php?typ=A">Agents</a></strong></td>
</tr>
</table>
<br><br>
<?php
if($_GET[typ]=="C"){
	if($_GET[id]!="" && $_GET[action]=="del"){
		$sql="delete from head WHERE headid='$_GET[id]'";
		$result=mysql_query($sql) or die('error');
		echo "<h3 align='center'>Record Deleted</h3>";
	}
	?>
	<font color="#006699"><b>Clients List for Monthly Billing:</b></font>
	<table cellspacing="1" align="center" width="100%" border="1" cellpadding="2">
	<tr>
	  <td><strong>NAME</strong></td>
	  <td><strong>ADDRESS</strong></td>
	  <td><strong>Description</strong></td>
	  <td><strong>Contact Person</strong></td>
	  <td><strong>PHONE</strong></td>
	  <td><strong>Delete</strong></td>
	</tr>
	<?php
	$sql="SELECT * FROM head WHERE headid>2 AND parhead='1'";
	$result=mysql_query($sql) or die('error');
	if (mysql_num_rows($result) == 0){
		echo "<tr>
			<td colspan=6 align=center><font color=red><strong><br>No Client/records Found</strong>, please add an account first.</font><br><br></td>
		</tr>";
	}
	while($row=mysql_fetch_array($result)){
		echo"<tr>
		  <td>{$row['headname']}</td>       
		  <td>{$row['headaddress']}</td>     
		  <td>{$row['headdecp']}</td> 
		  <td>{$row['headperson']}</td>    
		  <td>{$row['headphone']}</td>
		  <td><a href=javascript:del('?typ=$_GET[typ]&id=$row[headid]&action=del')>Delete</a></td>
		</tr>";
	}
	?>
	</table>
	<? 
} 
if($_GET[typ]=="SC"){
	if($_GET[id]!="" && $_GET[action]=="del"){
		$sql="delete from head WHERE headid='$_GET[id]'";
		$result=mysql_query($sql) or die('error');
		echo "<h3 align='center'>Record Deleted</h3>";
	}
	?>
	<font color="#006699"><b>Clients List for Non-Monthly Billing:</b></font>
	<table cellspacing="3" align="center" width="100%" border="4" cellpadding="3">
	<tr>
	  <td><strong>NAME</strong></td>
	  <td><strong>ADDRESS</strong></td>
	  <td><strong>Description</strong></td>
	  <td><strong>Contact Person</strong></td>
	  <td><strong>PHONE</strong></td>
	  <td><strong>Deletes</strong></td>
	</tr>
	<?php
	$sql="SELECT * FROM head WHERE headid>2 AND parhead='2'";
	$result=mysql_query($sql) or die('error');
	if (mysql_num_rows($result) == 0)
	{
	echo "<tr><td colspan=6 align=center><font color=red><strong><br>No Client/records Found</strong>, please add an account first.</font><br><br></td></tr>";
	}
	while($row=mysql_fetch_array($result))
	{
		echo"<tr>
		  <td>{$row['headname']}</td>       
		  <td>{$row['headaddress']}</td>     
		  <td>{$row['headdecp']}</td>  
		  <td>{$row['headperson']}</td>    
		  <td>{$row['headphone']}</td>
		  <td><a href=javascript:del('?typ=$_GET[typ]&id=$row[headid]&action=del')>Delete</a></td>
		</tr>";
	}
	?>
	</table>
	<? 
} 
if($_GET[typ]=="A"){
	if($_GET[id]!="" && $_GET[action]=="del"){
		$sql="delete from ajent WHERE ajid='$_GET[id]'";
		$result=mysql_query($sql) or die('error');
		echo "<h3 align='center'>Record Deleted</h3>";
	}
	?>
	<font color="#006699"><b>Agent List:</b></font>
    <table cellspacing="3" align="center" width="100%" border="4" cellpadding="3">
    <tr>
      <td><strong>NAME</strong></td>
      <td><strong>ADDRESS</strong></td>
      <td><strong>Description</strong></td>
      
      <td><strong>PHONE</strong></td>
     
      <td><strong>Delete</strong></td>
    </tr>
    <?php
    $sql="SELECT * FROM ajent";
    $result=mysql_query($sql) or die('error');
    if (mysql_num_rows($result) == 0){
	    echo "<tr><td colspan=6 align=center><font color=red><strong><br>No Client/records Found</strong>, please add an account first.</font><br><br></td></tr>";
    }
    while($row=mysql_fetch_array($result)){
        echo"<tr>
          <td>{$row['ajcomp']}</td>
          <td>{$row['ajaddress']}</td>     
          <td>{$row['ajdec']}</td>    
          <td>{$row['ajphone']}</td>
		  <td><a href=javascript:del('?typ=$_GET[typ]&id=$row[ajid]&action=del')>Delete</a></td>
        </tr>";
    }
    ?>
    </table>
    <?php
}
include "foot.php";
?>


PK 99