
PK 
<?php
session_start();
require_once 'common/common.php';
require_once 'common/secure.php';
include("connexion.php");
include("head.php");
?>
<h2 id="icon_pick">Client Added</h2>
<?php
$dat=date("d-m-Y");
/*echo "<pre>";
print_r($_POST);
echo "</pre>";*/
//exit;
if($_POST['action']=='add')
{
$sql_test="SELECT * FROM
head
WHERE
headname='".$_POST['headname']."'
AND
headaddress='".$_POST['headaddress']."'
AND
headdecp='".$_POST['headdecp']."'
AND
headphone='".$_POST['headphone']."'
AND
headperson='".$_POST['headperson']."'
AND
headdate='".$dat."'
AND
parhead='".$_POST['btype']."'";
$result_test=mysql_query($sql_test);
$num_test=mysql_num_rows($result_test);
if($num_test==0)
{
//echo "never";
$sql="INSERT INTO head
(headname,headaddress,headdecp,headphone,headperson,headdate,parhead,status)
VALUES
('".$_POST['headname']."','".$_POST['headaddress']."','".$_POST['headdecp']."','".$_POST['headphone']."','".$_POST['headperson']."','".$dat."','".$_POST['btype']."','active')";
$result=mysql_query($sql) or die('error');
/*echo "<center><br><br><img src=msg.jpg alt=Sucess><br><br>Client <b>$headname</b> Added Sucessfully, <a href=addaclnt.php>Click here</a> to Add Another Client.
<br><br>
<a href=clients.php>Click here to be back at Clients Management</a><br></center>";*/
}
}
echo "<center><br><br><img src=msg.jpg alt=Sucess><br><br>Client <b>$headname</b> Added Sucessfully, <a href=addaclnt.php>Click here</a> to Add Another Client.
<br><br>
<a href=clients.php>Click here to be back at Clients Management</a><br></center>";
?>
<br><br><br>
<?php
include "foot.php";
?>


PK 99