siddharth_application/application/views/editdepartment.php
2017-09-15 12:46:13 +05:30

210 lines
7.0 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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 &lt;space&gt; 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;
}
.pad{
padding-bottom:1%;
}
.badge
{
color:red; background-color:#fff;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center> Siddharth Industries - <?php echo $DepartmentName; ?> Department Details</center>
</h1>
</section>
<section class="content">
<div style="text-align:right;">
<a href="<?php echo base_url() ?>departmentListing" class="btn btn-primary" value="Back"/>Back</a>
</div>
<br/>
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box">
<!-- form start -->
<div class="row">
<div class="col-md-10 col-md-offset-1"> <!--style="border:3px solid #3c8dbc;">-->
<form class="form-horizontal" role="form" id="Updatedepartment" action="<?php echo base_url() ?>editdepartment" method="post" role="form"><br/>
<fieldset>
<!-- Form Name -->
<legend>Department Information</legend>
<div class="col-md-2 pad">
<span for="DEPCode">Department Code</span>
<input type="text" name="DEPCode" id="DEPCode" class="form-control" readonly value="<?php echo $DEPCode;?>">
</div>
<div class="col-md-4 pad">
<span for="DepartmentName">Department Name</span><span class="badge">*</span>
<input type="text" name="DepartmentName" id="DepartmentName" class="form-control" required value="<?php echo $DepartmentName;?>">
</div>
<div class="col-md-3 pad">
<span for="HeadDept">Head Department</span>
<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 ?> - <?php echo $DC->DepartmentName ?></option>
<?php
}
}
?>
</select>
</div>
<div class="col-md-offset-1 col-md-2">
<div class="form-group">
<span for="Active">Is Active</span> <br>
<input type="checkbox" id="IsActive" name="IsActive" <?php echo $IsActive;?> >
</div>
</div>
<div class="form-group">
<div class="col-md-3 col-md-offset-9">
<div class="pull-right">
<input type="submit" value="Update" class="btn btn-primary">
</div>
</div>
</div>
</fieldset>
</form>
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->
</div>
</div>
<div class="col-md-4">
<?php
$this->load->helper('form');
$error = $this->session->flashdata('error');
if($error)
{
?>
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('error'); ?>
</div>
<?php } ?>
<?php
$success = $this->session->flashdata('success');
if($success)
{
?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<?php echo $this->session->flashdata('success'); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-md-12">
<?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
</div>
</div>
</div>
</div>
</section>
</div>