171 lines
7.8 KiB
PHP
Executable File
171 lines
7.8 KiB
PHP
Executable File
<?php
|
||
|
||
$DEPCode = '';
|
||
$DepartmentName = '';
|
||
$HeadDept = '';
|
||
$IsActive = '';
|
||
$chk = '';
|
||
if (!empty($department)) {
|
||
foreach ($department as $uf) {
|
||
$DEPCode = $uf->DEPCode;
|
||
$DepartmentName = $uf->DepartmentName;
|
||
$HeadDept = $uf->HeadDept;
|
||
//$IsActive = $uf->IsActive;
|
||
//echo 'CST date:'. $CSTDt ;
|
||
$chk = $uf->IsActive;
|
||
|
||
if ($chk == 1) {
|
||
$IsActive = 'checked';
|
||
} else {
|
||
$IsActive = '';
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
?>
|
||
|
||
<script>
|
||
// function blockKeyPress(evt)
|
||
// {
|
||
// var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||
// alert(charCode);
|
||
// if(charCode == 8 || charCode == 46 )
|
||
//
|
||
// {
|
||
// return false;
|
||
// }
|
||
// else
|
||
// {
|
||
// return false;
|
||
// }
|
||
// }
|
||
|
||
// function isNumberKey(evt)
|
||
// {
|
||
// var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||
// if (charCode != 46 && charCode > 31
|
||
// && (charCode < 48 || charCode > 57))
|
||
// return false;
|
||
//
|
||
// return true;
|
||
// }
|
||
|
||
// function onlyAlphabets(evt) {
|
||
// var charCode;
|
||
// if (window.event)
|
||
// charCode = window.event.keyCode; //for IE
|
||
// else
|
||
// charCode = evt.which; //for firefox
|
||
// if (charCode == 32) //for <space> symbol
|
||
// return true;
|
||
// if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
|
||
// return false;
|
||
// if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
|
||
// return false;
|
||
// if (charCode > 122) //for characters beyond 'z' in ASCII Table
|
||
// return false;
|
||
// return true;
|
||
// }
|
||
</script>
|
||
|
||
<style>
|
||
/* legend{
|
||
color:#00c0ef ! important;
|
||
} */
|
||
|
||
legend {
|
||
margin-left: 0% !important;
|
||
}
|
||
|
||
.pad {
|
||
padding-bottom: 1%;
|
||
}
|
||
|
||
.badge {
|
||
color: red;
|
||
background-color: #fff;
|
||
}
|
||
</style>
|
||
|
||
<div class="content-page">
|
||
<div class="content">
|
||
<!-- Start Content-->
|
||
<div class="container-fluid">
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="page-title-box page-title-box-alt">
|
||
<h4 class="page-title">Edit Department - <?php echo $DepartmentName; ?> Details</h4>
|
||
<a class="btn btn-secondary" href="<?php echo base_url(); ?>departmentListing"><span class="bold">Back</span></a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="card">
|
||
<div class="card-body" style="padding: 1rem 2rem !important;">
|
||
<form role="form" id="Updatedepartment" action="<?php echo base_url() ?>editdepartment" method="post">
|
||
<div class="box-body">
|
||
<!-- Department Information -->
|
||
<legend>Department Information</legend>
|
||
<div class="form-row" style="margin-top:10px">
|
||
<div class="col-md-3">
|
||
<label class="col-form-label" for="DEPCode">Department Code</label>
|
||
<input type="text" name="DEPCode" id="DEPCode" class="form-control" readonly value="<?php echo $DEPCode; ?>">
|
||
</div>
|
||
<div class="col-md-3">
|
||
<label class="col-form-label" for="DepartmentName">Department Name<span class="badge">*</span></label>
|
||
<input type="text" name="DepartmentName" id="DepartmentName" class="form-control" required value="<?php echo $DepartmentName; ?>">
|
||
</div>
|
||
<div class="col-md-3">
|
||
<label class="col-form-label" for="HeadDept">Head Department</label>
|
||
<select class="form-control required" id="HeadDept" name="HeadDept">
|
||
<option value="<?php echo $HeadDept; ?>"><?php echo $HeadDept; ?></option>
|
||
<?php if (!empty($depcode)) {
|
||
foreach ($depcode as $DC) { ?>
|
||
<option value="<?php echo $DC->DEPCode; ?>"><?php echo $DC->DEPCode . " - " . $DC->DepartmentName; ?></option>
|
||
<?php }
|
||
} ?>
|
||
</select>
|
||
</div>
|
||
<div class="col-md-2">
|
||
<label class="col-form-label" for="IsActive">Is Active</label><br>
|
||
<input type="checkbox" id="IsActive" name="IsActive" <?php echo $IsActive; ?>>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" style="margin-top:10px">
|
||
<div class="col-md-12 text-right">
|
||
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red; color: white; margin-right: 15px; width: 80px;" value="Reset" />
|
||
<input type="submit" value="Update" class="btn btn-success">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<?php
|
||
helper('form');
|
||
$error = session()->getFlashdata('error');
|
||
if ($error) { ?>
|
||
<div class="alert alert-danger alert-dismissable">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
<?php echo session()->getFlashdata('error'); ?>
|
||
</div>
|
||
<?php }
|
||
$success = session()->getFlashdata('success');
|
||
if ($success) { ?>
|
||
<div class="alert alert-success alert-dismissable">
|
||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||
<?php echo session()->getFlashdata('success'); ?>
|
||
</div>
|
||
<?php } ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div> <!-- end card -->
|
||
</div><!-- end col -->
|
||
</div>
|
||
<!-- end row -->
|
||
</div> <!-- container -->
|
||
</div> <!-- content -->
|
||
</div>
|