Poor";
$pattern_one ='red';
$pattern_two ='#BABABA';
if( (isset($_SESSION['user_KO']['username'])=="") and (isset($_COOKIE['remember_me'])==""))
{
header("location: index.php");
}
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require('includes/config_db.php');
if(!empty($_SESSION['rurl']))
{
//$_SESSION['rurl']=$_GET['idu'];
$rurl =$_SESSION['rurl'];
header("location: $rurl");
}
unset($_SESSION['answer']);
$_SESSION["answer"][]="";
if(!empty($_POST)){
//print_r($_POST);
$ethnicity = $_POST['ethnicity'];
$birthday = $_POST['birthday'];
$jobrole = $_POST['jobrole'];
$Location = "";
$company =$_POST['company'];
$project =$_POST['project'];
$_SESSION['project'] =$project;
$user_id=$_SESSION['uid'];
$sql = "update employee set ethnicity='$ethnicity',birthday='$birthday',companty='$company',jobrole='$jobrole',location='$Location',project ='$project',p_status=1 where id='$user_id'";
if ($con->query($sql) === TRUE) {
//echo "New record created successfully";
$message= "Record Updates successfully";
$_SESSION['pstatus']=1;
$pstatus=1;
} else {
echo "Error: " . $sql . "
" . $con->error;
}
}
if (isset($_POST["signature"])&& $dstatus==0 && $pstatus==1)
{
//$date =$_POST['dates'];
$signature = $_POST['signature'];
$signatureFileName = uniqid().'.png';
$signature = str_replace('data:image/png;base64,', '', $signature);
$signature = str_replace(' ', '+', $signature);
$data = base64_decode($signature);
$file = 'signature/'.$signatureFileName;
file_put_contents($file, $data);
$signaturename =$signatureFileName;
$user_id=$_SESSION['uid'];
$sql = "update employee set signaturename='$signatureFileName',dclaimer=1 where id='$user_id'";
if ($con->query($sql) === TRUE) {
//echo "New record created successfully";
$message= "Thank You For Accpeting The Discalimer";
$_SESSION['dstatus']=1;
$dstatus=1;
} else {
echo "Error: " . $sql . "
" . $con->error;
}
}
?>