955 lines
33 KiB
PHP
955 lines
33 KiB
PHP
<?php include('techsyn_header.php');
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
?>
|
|
<style>
|
|
<!--
|
|
#panel-title1>a, #panel-title1>a:active{
|
|
display:block;
|
|
font-size: 12px;
|
|
font-family: "Source Sans Pro", "Helvetica Neue",Helvetica, Arial, sans-serif;
|
|
color: #337ab7;
|
|
height: 20px;
|
|
text-decoration:none;
|
|
}
|
|
#panel-heading1 a:before {
|
|
font-family: 'Glyphicons Halflings';
|
|
content: "\e114";
|
|
float: right;
|
|
transition: all 0.5s;
|
|
}
|
|
#panel-heading1.active a:before {
|
|
-webkit-transform: rotate(180deg);
|
|
-moz-transform: rotate(180deg);
|
|
transform: rotate(180deg);
|
|
}
|
|
-->
|
|
</style>
|
|
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
|
|
<link rel="stylesheet"
|
|
href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
|
|
|
<!-- page specific plugin styles -->
|
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
|
<link rel="stylesheet" href="assets/css/jquery.gritter.min.css" />
|
|
<link rel="stylesheet" href="assets/css/select2.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-editable.min.css" />
|
|
|
|
<!-- text fonts -->
|
|
<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />
|
|
|
|
<!-- ace styles -->
|
|
<link rel="stylesheet" href="assets/css/ace.min.css"
|
|
class="ace-main-stylesheet" id="main-ace-style" />
|
|
|
|
<!--[if lte IE 9]>
|
|
<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
|
|
<![endif]-->
|
|
<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
|
|
<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
|
|
|
|
<!--[if lte IE 9]>
|
|
<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
|
|
<![endif]-->
|
|
|
|
<!-- inline styles related to this page -->
|
|
|
|
<!-- ace settings handler -->
|
|
<script src="assets/js/ace-extra.min.js"></script>
|
|
|
|
<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->
|
|
|
|
<!--[if lte IE 8]>
|
|
<script src="assets/js/html5shiv.min.js"></script>
|
|
<script src="assets/js/respond.min.js"></script>
|
|
<![endif]-->
|
|
|
|
|
|
|
|
<!-- Main Content Container for side bar and body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try{ace.settings.loadState('main-container')}catch(e){}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
<?php
|
|
|
|
$emp_id =$_SESSION['logged_user_empid'];
|
|
|
|
// echo $id;
|
|
|
|
$query = "select * from patient_master where id = " . $emp_id . " ";
|
|
// echo $query;
|
|
if (! $result = @mysqli_query($conn,$query)) {
|
|
exit(mysqli_error($conn));
|
|
} else {
|
|
$row = @mysqli_fetch_array($result);
|
|
@extract($row);
|
|
}
|
|
|
|
$accessOption = $_REQUEST['accessOption'];
|
|
|
|
?>
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
<li class="active">Employee</li>
|
|
<li class="active">Update Employee Info</li>
|
|
</ul>
|
|
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="well-sm" style="margin-left: 5px;">
|
|
<div>
|
|
<div id="user-profile-2">
|
|
<form class="form-horizontal" id="employee_form"
|
|
name="employee_form" enctype="multipart/form-data" action="#"
|
|
method="post">
|
|
<div class="tabbable">
|
|
<ul class="nav nav-tabs padding-18">
|
|
<li class="active"><a data-toggle="tab" href="#dashboard"> <i
|
|
class="green ace-icon fa fa-user bigger-120"></i> Dashboard
|
|
</a></li>
|
|
<li ><a data-toggle="tab" href="#edit-basic"> <i
|
|
class="green ace-icon fa fa-user bigger-120"></i> Basic Info
|
|
</a></li>
|
|
|
|
<li><a data-toggle="tab" href="#contacts"> <i
|
|
class="blue ace-icon fa fa-phone bigger-120"></i>Contact Details
|
|
|
|
</a></li>
|
|
|
|
<li><a data-toggle="tab" href="#edit-settings"> <i
|
|
class="blue ace-icon fa fa-users bigger-120"></i> Family
|
|
|
|
</a></li>
|
|
|
|
|
|
<li><a data-toggle="tab" href="#edit-password"> <i
|
|
class="pink ace-icon fa fa-picture-o bigger-120"></i> Health Advices
|
|
& Risks
|
|
</a></li>
|
|
<li><a data-toggle="tab" href="#questionnaire"> <i
|
|
class="red ace-icon fa fa-question-circle bigger-120"></i>Health Questionnaire
|
|
</a></li>
|
|
<li><a data-toggle="tab" href="#uploadDocs"> <i
|
|
class="red ace-icon fa fa-upload bigger-120"></i> Documents
|
|
</a></li>
|
|
</ul>
|
|
|
|
<div class="tab-content profile-edit-tab-content">
|
|
<div id="dashboard" class=" tab-pane in active">
|
|
|
|
<?php include('emp_dashboard_embed.php'); ?>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div id="edit-basic" class="tab-pane">
|
|
<div class="row">
|
|
<div class="col-xs-12 col-sm-3 center">
|
|
<div class="space-20"></div>
|
|
|
|
<span class="profile-picture">
|
|
<?php if(isset($row['photo']) && $row['photo']!=null){?>
|
|
<img class="editable img-responsive" id="avatar"
|
|
src="data:<?php echo $row['image_type']?>;base64,<?php echo base64_encode( $row['photo'] )?>"
|
|
style="display: block; width: 180px; height: 200px;" />
|
|
|
|
<?php }else{
|
|
$gender = $row['gender'];
|
|
if ($gender == 'M') {
|
|
?>
|
|
<img id="avatar" class="editable img-responsive" alt="<?php echo $row['fname']?>'s Avatar"<img src="images/male-profile.png"
|
|
style="display: block; width: 180px; height: 200px;" />
|
|
<?php } else {?>
|
|
<img id="avatar" class="editable img-responsive" alt="<?php echo $row['fname']?>'s Avatar"<img src="images/female-profile.png"
|
|
style="display: block; width: 180px; height: 200px;" />
|
|
<?php }}?>
|
|
|
|
</span>
|
|
<div class="width-80 label <?php echo ($gender=='M')? "label-info":"label-warning"?> label-xlg arrowed-in arrowed-in-right">
|
|
<div class="inline position-relative">
|
|
<a href="#" class="user-title-label dropdown-toggle"
|
|
data-toggle="dropdown"> <i
|
|
class="glyphicon glyphicon-tint red"></i><span
|
|
class="red"><?php echo $row['blood_group']?> </span> <span
|
|
class="white"><?php echo $row['fname']." ".$row['lname']?></span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="space space-4"></div>
|
|
</div>
|
|
<div class="col-xs-12 col-sm-9">
|
|
<div class="space-20"></div>
|
|
<div class="profile-user-info profile-user-info-striped">
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Code</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $row['emp_code']?></span>
|
|
</div>
|
|
</div>
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Employment Type</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo ($row['employment_type_id'])==1?"Permanent Employee":"Contract"?></span>
|
|
</div>
|
|
</div>
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Designation</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo getTableFieldValue('designation','designation_name','designation_id',"'".$row['designation_id']."'")?></span>
|
|
</div>
|
|
</div>
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Manager Name</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo getTableFieldValue('patient_master','patient_name','id',"'".$row['mgr_emp_id']."'")?> </span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Father Name</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $row['father_name']?></span>
|
|
</div>
|
|
</div>
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Date of Joining</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo date_format(date_create($row['doj']),"d-M-Y ")?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Date of Birth</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo date_format(date_create($row['dob']),"d-M-Y ")?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Age</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo floor((time()-strtotime($row['dob']))/31556926)?></span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Primary Phone</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $row['primary_phone']?></span>
|
|
</div>
|
|
</div>
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Email</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $row['email_id']?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Address</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $row['address']?></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Unit</div>
|
|
|
|
<div class="profile-info-value">
|
|
<i class="fa fa-map-marker light-orange bigger-110"></i>
|
|
<ul class="breadcrumb" style="font-size: 10px">
|
|
<li><?php echo getTableFieldValue('tbl_firms','firm_name','firm_id',"'".$row['bu_id']."'")?></li>
|
|
<li><?php echo getTableFieldValue('sub_business_unit','sbu_name','sbu_id',"'".$row['sbu_id']."'")?></li>
|
|
<li> <?php echo getTableFieldValue('section','section_name','section_id',"'".$row['section_id']."'")?> </li>
|
|
<li><?php echo getTableFieldValue('sub_section','sub_section_name','sub_section_id',"'".$row['sub_section_id']."'")?></li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Aadhar No</div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $aadhar_no;?></span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Is First Aider </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo ($is_first_aid==1) ? "Yes": "No" ?></span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- /#home -->
|
|
<div id="contacts" class="tab-pane">
|
|
<div class="row">
|
|
<div class="space"></div>
|
|
<h4 class="header blue bolder smaller">Contact</h4>
|
|
|
|
<div class="profile-user-info profile-user-info-striped">
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Email </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $email_id ?></span>
|
|
</div>
|
|
|
|
<div class="profile-info-name">Phone </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $primary_phone ?></span>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
<div class="space"></div>
|
|
<h4 class="header blue bolder smaller">Emergency Contact</h4>
|
|
<div class="profile-user-info profile-user-info-striped">
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Primary Contact Person </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $primary_contact_person ?></span>
|
|
</div>
|
|
|
|
<div class="profile-info-name">Primary Contact No </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $primary_contact_no ?></span>
|
|
</div>
|
|
</div>
|
|
<div class="profile-info-row">
|
|
<div class="profile-info-name">Primary Contact Person </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $secondary_contact_person ?></span>
|
|
</div>
|
|
|
|
<div class="profile-info-name">Primary Contact No </div>
|
|
|
|
<div class="profile-info-value">
|
|
<span><?php echo $secondary_contact_no ?></span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="edit-password" class="tab-pane">
|
|
|
|
|
|
<div class="space-12"></div>
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
Known Health Advices And Health Risks
|
|
|
|
|
|
</div>
|
|
<div class="panel-body">
|
|
<table class="table table-bordered table-hover"
|
|
id="health_advices_and_risks">
|
|
<tbody>
|
|
<tr>
|
|
<th width="50%">Known Health Advices</th>
|
|
|
|
|
|
<th width="50%">Known Health Risks</th>
|
|
</tr>
|
|
<tr>
|
|
<td><?php
|
|
|
|
$advices = explode(",", trim($row['known_health_advices'], ','));
|
|
// echo $advices;
|
|
$str_advices = '';
|
|
for ($i = 0; $i < count($advices); $i ++) {
|
|
if ($i == 0)
|
|
$str_advices .= getTableFieldValue('health_advice', 'health_advice_name', 'health_advice_id', $advices[$i], '');
|
|
else
|
|
$str_advices .= ',' . getTableFieldValue('health_advice', 'health_advice_name', 'health_advice_id', $advices[$i], '');
|
|
}
|
|
echo $str_advices;
|
|
|
|
?></td>
|
|
<td>
|
|
<?php
|
|
|
|
$risks = explode(",", trim($row['known_health_risks'], ','));
|
|
// echo $advices;
|
|
$str_risks = '';
|
|
for ($i = 0; $i < count($risks); $i ++) {
|
|
if ($i == 0)
|
|
$str_risks .= getTableFieldValue('health_risk', 'health_risk_name', 'health_risk_id', $risks[$i], '');
|
|
else
|
|
$str_risks .= ',' . getTableFieldValue('health_risk', 'health_risk_name', 'health_risk_id', $risks[$i], '');
|
|
}
|
|
echo $str_risks;
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /#feed -->
|
|
|
|
<div id="edit-settings" class="tab-pane">
|
|
<div class="space-10"></div>
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
Family Members
|
|
</div>
|
|
<div class="panel-body">
|
|
<table class="table table-bordered table-hover"
|
|
id="familyMembersTable">
|
|
<tbody>
|
|
<tr>
|
|
<th>Sr</th>
|
|
<th>Name</th>
|
|
<th>Age</th>
|
|
<th>Gender</th>
|
|
<th>Relation Type</th>
|
|
<th></th>
|
|
</tr>
|
|
<?php
|
|
$count = 0;
|
|
$sql_family_members = "select * from emp_family_members where emp_id=$emp_id ";
|
|
|
|
$result_family_members = @mysqli_query($conn,$sql_family_members);
|
|
$no_of_rows = mysqli_num_rows($result_family_members);
|
|
if ($no_of_rows > 0) {
|
|
?>
|
|
<input type="hidden"
|
|
name="rowCount" id="rowCount"
|
|
value="<?php echo $no_of_rows; ?>" />
|
|
|
|
<?php }else{?>
|
|
<input type="hidden"
|
|
name="rowCount" id="rowCount" value="1" />
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
if ($no_of_rows > 0) {
|
|
while ($row_family_members = @mysqli_fetch_array($result_family_members)) {
|
|
?>
|
|
<tr
|
|
id="familyMembersTableRow<?php echo $count;?>">
|
|
<td> <?php echo $count+1;?></td>
|
|
<td><?php echo $row_family_members['name'] ?></td>
|
|
<td><?php echo $row_family_members['age'] ?></td>
|
|
<td>
|
|
|
|
<?php ($row_family_members['gender']=="M")?"Male":(($row_family_members['gender']=="F")?"Female":"Others")?>
|
|
</td>
|
|
<td><?php echo $row_family_members['relation_type'] ?></td>
|
|
<th></th>
|
|
</tr>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
++ $count;
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div id="questionnaire" class=" tab-pane">
|
|
|
|
<?php include('questionnaire_include.php'); ?>
|
|
|
|
<div class="clearfix form-actions">
|
|
<div class="col-md-offset-3 col-md-9">
|
|
<button class="btn btn-info" type="button"
|
|
onclick="save_employee()">
|
|
<i class="ace-icon fa fa-check bigger-110"></i> Save
|
|
</button>
|
|
|
|
|
|
<button class="btn" type="reset">
|
|
<i class="ace-icon fa fa-undo bigger-110"></i> Reset
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div id="uploadDocs" class=" tab-pane">
|
|
|
|
|
|
|
|
|
|
<div class="table-responsive"
|
|
style="align: center; text-align: center; width: 90%;">
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="form-group">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
$docs_select_query = "select * from employee_docs where emp_id=$emp_id";
|
|
$docs_result = @mysqli_query($conn,$docs_select_query);
|
|
$no_of_docs= @mysqli_num_rows($docs_result);
|
|
?>
|
|
|
|
<div class="table-responsive"
|
|
style="align: center; text-align: center; width: 90%; ">
|
|
|
|
<h4 style="font-size: 15px; text-align: center; font-weight: bold">Documents</h4>
|
|
<table class="table table-bordered" style="width: 100%">
|
|
<thead>
|
|
<tr>
|
|
<th>S.No.</th>
|
|
<th>Document Name</th>
|
|
<th>Uploaded Date</th>
|
|
<th>Download link</th>
|
|
<th>Edit/Delete</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
|
|
|
|
<?php if($no_of_docs==0){ ?>
|
|
|
|
|
|
<tr >
|
|
<td align='center' colspan='5'>No Files Found</td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
<?php
|
|
|
|
$count = 0;
|
|
while ($row_docs = mysqli_fetch_array($docs_result)) {
|
|
?>
|
|
|
|
<tr>
|
|
|
|
|
|
<td align="left" ><?php echo $count+1?></td>
|
|
<td align="left" ><?php echo $row_docs['doc_name']?></td>
|
|
<td align="left" ><?php echo date("d-F-Y", filemtime('files/'.$thelist[$count]))?></td>
|
|
<?php
|
|
echo '<td align="center"><a href="data:image/jpeg;base64,'.base64_encode( $row_docs['document'] ).'" download><span
|
|
class="glyphicon glyphicon-download-alt"></span></a></td>';
|
|
?>
|
|
<!-- <td align="center" > <a
|
|
href="" download><span
|
|
class="glyphicon glyphicon-download-alt"></span></a></td> -->
|
|
<td align="center" > <a
|
|
onclick="deletedocs(<?php echo $row_docs['doc_id']?>);"><span
|
|
class="glyphicon glyphicon-trash"></span></a></td>
|
|
|
|
</tr>
|
|
|
|
<?php $count++; } ?>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!-- end user profile2 -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<!-- /.page-content -->
|
|
</div>
|
|
</div>
|
|
<!-- /.main-content -->
|
|
|
|
|
|
<!-- page specific plugin scripts -->
|
|
|
|
<!--[if lte IE 8]>
|
|
<script src="assets/js/excanvas.min.js"></script>
|
|
<![endif]-->
|
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
|
<script src="assets/js/jquery.gritter.min.js"></script>
|
|
<script src="assets/js/bootbox.js"></script>
|
|
<script src="assets/js/jquery.easypiechart.min.js"></script>
|
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
|
<script src="assets/js/jquery.hotkeys.index.min.js"></script>
|
|
<script src="assets/js/bootstrap-wysiwyg.min.js"></script>
|
|
<script src="assets/js/select2.min.js"></script>
|
|
<script src="assets/js/spinbox.min.js"></script>
|
|
<script src="assets/js/bootstrap-editable.min.js"></script>
|
|
<script src="assets/js/ace-editable.min.js"></script>
|
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
|
|
|
<!-- ace scripts -->
|
|
<script src="assets/js/ace-elements.min.js"></script>
|
|
<script src="assets/js/ace.min.js"></script>
|
|
|
|
<!-- inline scripts related to this page -->
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('common_ace.php'); ?>
|
|
|
|
<script>
|
|
|
|
|
|
function addHealthAdvicesAndRisksRow(){
|
|
var table = document.getElementById("health_advices_and_risks");
|
|
|
|
var rowCount = table.rows.length;
|
|
var newRow = table.insertRow(rowCount);
|
|
var health_advices="<?php echo generateOption('health_advice','health_advice_name','health_advice_id','',''); ?>"
|
|
var health_risks="<?php echo generateOption(' health_risk','health_risk_name','health_risk_id','',''); ?>"
|
|
var content=""
|
|
content+="<td><select multiple=\"\" name=\"known_health_advices[]\" id=\"known_health_advices\" class=\"chosen-select form-control\">"
|
|
//content+="<option value=\"\"> </option>";
|
|
content+=health_advices;
|
|
content+="</select></td>"
|
|
content+="<td><select multiple=\"\" id=\"known_health_risks\" name=\"known_health_risks[]\" class=\"chosen-select form-control\">"
|
|
// content+="<option value=\"\"> </option>";
|
|
content+=health_risks;
|
|
content+="</select></td>"
|
|
|
|
|
|
$(newRow).append(content);
|
|
$('#known_health_advices').chosen({allow_single_deselect:true});
|
|
$('#known_health_advices').next().css({'width': '100%'});
|
|
$('#known_health_risks').chosen({allow_single_deselect:true});
|
|
$('#known_health_risks').next().css({'width': '100%'});
|
|
|
|
var heath_advice_array=<?php echo json_encode($advices)?>;
|
|
|
|
var element = document.getElementById('known_health_advices');
|
|
|
|
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
element.options[i].selected = heath_advice_array.indexOf(element.options[i].value) >= 0;
|
|
}
|
|
$('#known_health_advices').trigger('chosen:updated');
|
|
|
|
var heath_risk_array=<?php echo json_encode($risks)?>;
|
|
|
|
var element1 = document.getElementById('known_health_risks');
|
|
|
|
|
|
for (var i = 0; i < element1.options.length; i++) {
|
|
element1.options[i].selected = heath_risk_array.indexOf(element1.options[i].value) >= 0;
|
|
}
|
|
$('#known_health_risks').trigger('chosen:updated');
|
|
|
|
}
|
|
function addFamilyMembersRow(){
|
|
|
|
var count=parseInt($("#rowCount").val());
|
|
|
|
var table = document.getElementById("familyMembersTable");
|
|
|
|
var rowCount = table.rows.length;
|
|
var newRow = table.insertRow(rowCount);
|
|
|
|
var content="";
|
|
content+="<td>"+(count+1)+"</td>"
|
|
+"<td><input type=\"text\" name=\"name"+count+"\" id=\"name"+count+"\" class=\"form-control\"/></td>"
|
|
+"<td><input type=\"number\" id=\"age"+count+"\" name=\"age"+count+"\" class=\"form-control\"/></td>"
|
|
+"<td><select class=\"form-control\" name=\"gender"+count+"\" id=\"gender"+count+"\">"
|
|
+"<option selected disabled>--Select Gender</option>"
|
|
+" <option value=\"M\">Male</option>"
|
|
+" <option value=\"F\">Female</option>"
|
|
+" <option value=\"O\">Others</option>"
|
|
|
|
|
|
+"</select></td><td><input type=\"text\" class=\"form-control\" name=\"relation_type"+count+"\" id=\"relation_type"+count+"\" /></td>"
|
|
+"<td><a href=\"#\" onclick=\"deleteFamilyMembersRow("+count+")\"><span class=\"glyphicon glyphicon-trash\"></span> </a></td>"
|
|
|
|
|
|
|
|
|
|
$(newRow).append(content);
|
|
$(newRow).attr("id", "familyMembersTableRow" + count);
|
|
$("#rowCount").val(++count);
|
|
|
|
|
|
|
|
}
|
|
|
|
function deleteFamilyMembersRow(count){
|
|
$("#familyMembersTableRow"+count).remove();
|
|
$("#rowCount").val(count);
|
|
|
|
}
|
|
|
|
function myDateFormater(myDate){
|
|
var d=new Date(myDate);
|
|
var m=d.getMonth()+1;
|
|
var y=d.getFullYear();
|
|
var date=d.getDate();
|
|
// alert(date+"/"+m+"/"+y);
|
|
return date+"/"+m+"/"+y;
|
|
|
|
|
|
}
|
|
|
|
$(document).ready(function(e){
|
|
$("#employee_form").on('submit', function(e){
|
|
e.preventDefault();
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: 'save_employee.php',
|
|
data: new FormData(this),
|
|
contentType: false,
|
|
cache: false,
|
|
processData:false,
|
|
beforeSend: function(){
|
|
// $('.submitBtn').attr("disabled","disabled");
|
|
//$('#fupForm').css("opacity",".5");
|
|
},
|
|
success: function(msg){
|
|
var emp_id=JSON.parse(msg);
|
|
BootstrapDialog.alert('Employee Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
$("#employee_id").val(emp_id);
|
|
$('.close').click();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Employee');
|
|
$('.close').click();
|
|
return;
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
function save_employee(){
|
|
var fname = $('#fname').val();
|
|
if(fname == ''){
|
|
BootstrapDialog.alert('Please Enter First Name.!!!');
|
|
return false;
|
|
}
|
|
var lname = $('#lname').val();
|
|
if(lname == ''){
|
|
BootstrapDialog.alert('Please Enter Last Name.!!!');
|
|
return false;
|
|
}
|
|
var fathername = $('#father_name').val();
|
|
if(fathername == ''){
|
|
BootstrapDialog.alert('Please Enter Father Name.!!!');
|
|
return false;
|
|
}
|
|
var dob = $('#dob').val();
|
|
if(dob == ''){
|
|
BootstrapDialog.alert('Please Enter DOB.!!!');
|
|
return false;
|
|
}
|
|
var doj = $('#doj').val();
|
|
if(doj == ''){
|
|
BootstrapDialog.alert('Please Enter DOJ.!!!');
|
|
return false;
|
|
}
|
|
var designationid = $('#designationid').val();
|
|
if(designationid == ''){
|
|
BootstrapDialog.alert('Please Enter Designation Id.!!!');
|
|
return false;
|
|
}
|
|
var emp_code = $('#emp_code').val();
|
|
if(emp_code == ''){
|
|
BootstrapDialog.alert('Please Enter Employee Code.!!!');
|
|
return false;
|
|
}
|
|
var emp_type_id = $('#emp_type_id').val();
|
|
if(emp_type_id == ''){
|
|
BootstrapDialog.alert('Please Enter Employee Type Id.!!!');
|
|
return false;
|
|
}
|
|
var bu_id = $('#bu_id').val();
|
|
if(bu_id == ''){
|
|
BootstrapDialog.alert('Please Enter Bu Id.!!!');
|
|
return false;
|
|
}
|
|
var sbu_id = $('#sbu_id').val();
|
|
if(sbu_id == ''){
|
|
BootstrapDialog.alert('Please Enter SBU Id.!!!');
|
|
return false;
|
|
}
|
|
var section_id = $('#section_id').val();
|
|
if(section_id == ''){
|
|
BootstrapDialog.alert('Please Enter Section Id.!!!');
|
|
return false;
|
|
}
|
|
var sub_section_id = $('#sub_section_id').val();
|
|
if(sub_section_id == ''){
|
|
BootstrapDialog.alert('Please Enter Sub Section Id.!!!');
|
|
return false;
|
|
}
|
|
var mgr_emp_id = $('#mgr_emp_id').val();
|
|
if(mgr_emp_id == ''){
|
|
BootstrapDialog.alert('Please Enter Manager.!!!');
|
|
return false;
|
|
}
|
|
var gender = $('#gender').val();
|
|
if(gender == ''){
|
|
BootstrapDialog.alert('Please Select Gender.!!!');
|
|
return false;
|
|
}
|
|
var address = $('#address').val();
|
|
if(address == ''){
|
|
BootstrapDialog.alert('Please Enter Address.!!!');
|
|
return false;
|
|
}
|
|
var primary_phone = $('#primary_phone').val();
|
|
if(primary_phone == ''){
|
|
BootstrapDialog.alert('Please Enter Phone No.!!!');
|
|
return false;
|
|
}
|
|
var email = $('#email').val();
|
|
if(email == ''){
|
|
BootstrapDialog.alert('Please Enter Email.!!!');
|
|
return false;
|
|
}
|
|
var aadhar_no = $('#aadhar_no').val();
|
|
if(aadhar_no == ''){
|
|
BootstrapDialog.alert('Please Aadhar No.!!!');
|
|
return false;
|
|
}
|
|
var blood_group = $('#blood_group').val();
|
|
if(blood_group == ''){
|
|
BootstrapDialog.alert('Please Select Blood Group.!!!');
|
|
return false;
|
|
}
|
|
$("#employee_form").submit();
|
|
/* $.ajax({
|
|
type: 'POST',
|
|
url: 'save_employee.php',
|
|
data:$("#employee_form").serialize(),
|
|
|
|
success: function(msg){
|
|
BootstrapDialog.alert('Employee Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
$('.close').click();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Employee');
|
|
$('.close').click();
|
|
return;
|
|
}
|
|
}); */
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
$('#doj').datepicker({
|
|
autoclose:true,
|
|
|
|
format: 'dd/mm/yyyy',
|
|
startDate: '1d/1m/2000y',
|
|
endDate: 'current',
|
|
todayHighlight: true,
|
|
|
|
}).next().on(ace.click_event, function(){
|
|
$(this).prev().focus();
|
|
});
|
|
$('#dob').datepicker({
|
|
autoclose:true,
|
|
format: 'dd/mm/yyyy',
|
|
startDate: '1d/1m/1970y',
|
|
|
|
}).next().on(ace.click_event, function(){
|
|
$(this).prev().focus();
|
|
|
|
});
|
|
|
|
</script>
|