ria/app/Views/adddepartment.php
2024-08-29 08:51:04 +05:30

164 lines
8.5 KiB
PHP
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.

<style>
.pad{
padding-bottom:1%;
}
.badge
{
color:red; background-color:#fff;
}
</style>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Add Department Details</h4>
</div>
</div>
<div class="col-6 text-right">
<a class="btn btn-dark waves-effect waves-light" href="<?php echo base_url(); ?>departmentListing"><span class="bold">Back</span></a>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12">
<div class="p-2">
<form role="form" id="adddepartment" action="<?php echo base_url() ?>savedepartment" method="post">
<div class="box-body">
<!-- Supplier Information -->
<div class="col-md-12" style="margin-bottom: 27px;">
<legend>Department Information</legend>
<div class="form-row" style="margin-top:10px">
<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>
</div>
</div>
<div class="form-row" style="margin-top:10px">
<div class=" col-md-3">
<label class="col-form-label" for="HeadDepartment">Head Department<span class="badge">*</span></label>
<select class="form-control required" id="HeadDept" name="HeadDept">
<option value="-1" required>Select Department Code</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>
<div class="form-row" style="margin-top:10px">
<div class="col-md-3">
<input type="checkbox" id="IsActive" name="IsActive" >
<span for="Active">Is Active</span>
</div>
</div>
</div>
<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" onclick="return Validate();" value="Submit" class="btn btn-success">
</div>
</div>
</form>
<div class="col-md-4">
<?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 } ?>
<?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 class="row">
<div class="col-md-12">
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?> </div>
</div>
</div>
</div>
</div>
</div>
<!-- end row -->
</div>
</div> <!-- end card -->
</div><!-- end col -->
</div>
<!-- end row -->
</div> <!-- container -->
</div> <!-- content -->
</div>
<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>