0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
USER
/
[
Home
]
File: employee_edit_ctrl.php
<?php require_once "../lib/config.php"; require_once BASE_DIR."/lib/db/connection.php"; require_once"../model/employee_mdl.php"; $p_id=@$_SESSION['project_id']; $u_id=@$_SESSION['user_id']; $empdb_id=$_GET['id']; $sql="select * from employe where user_id='$u_id' and project_id='$p_id' and emp_id='$empdb_id'"; $sql1=mysql_query($sql); while($row=mysql_fetch_array($sql1)) { //1 $empname=$row['emp_name']; $address=$row['address']; $phone=$row['phone']; $mobile=$row['mobile']; $joindate=$row['join_date']; $mailid=$row['mail_id']; $salary=$row['salary']; list($editJD_yy, $editJD_mm, $editJD_dd) = split('[/.-]', $joindate); } if(isset($_POST['update'])) { $error_flag=0; $editempName=@$_POST['txtempname']; $editempAddress= @$_POST['txEmpaddress']; $editempPhone= @$_POST['txtEmpphone']; $editempMobile=@$_POST['txtEmpmobile']; $editempEmail=@$_POST['txtEmpemail']; $editempSalary= @$_POST['txtEmpsalary']; $editJD_mm= @$_POST['cmbJoinmm']; $editJD_dd=@$_POST['cmbJoindd']; $editJD_yy=@$_POST['txtJoinyy']; $editempid=@$_POST['txtempid']; $editJD=$editJD_yy."-".$editJD_mm."-".$editJD_dd; if (!is_numeric(@$_POST['txtEmpphone'])) { $error['phone_numeric']="Only allow numbers"; $error_flag=1; } if($error_flag==1) { $url=$server_ip."/USER/employee_edit.php?message=$message"; echo "<script>window.location='$url'</script>"; } else { $result= Employee::UpdateEmployee($editempid,$editempName,$editempAddress,$editempPhone,$editempMobile,$editJD,$editempEmail,$editempSalary); if ($result=="True") { $message="Updation Completed successfully.."; $url=$server_ip."/USER/search_emp.php?message=$message"; echo "<script>window.location='$url'</script>";//include("addemployee.php"); } else { $message="Updation Failed.."; echo "<script>window.location='http://localhost/CPFMS/USER/search_emp.php?message=$message'</script>"; } } } ?>