department details UI changes add and edit headdept dropdown values
This commit is contained in:
parent
8a10c76ee9
commit
1b99546775
@ -18,8 +18,8 @@ class department extends BaseController
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('department_model');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('pagination');
|
||||
// $this->load->library('form_validation');
|
||||
// $this->load->library('pagination');
|
||||
$this->load->library('Excel');
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
@ -29,33 +29,35 @@ class department extends BaseController
|
||||
public function index()
|
||||
{
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Department';
|
||||
$this->global['pageTitle'] = 'Siddharth : Department Details';
|
||||
|
||||
$this->loadViews("departmentListing", $this->global, NULL , NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used to load the Supplier list
|
||||
* This function is used to load the Department list
|
||||
*/
|
||||
function departmentListing()
|
||||
{
|
||||
|
||||
if($this->isAdmin() == TRUE)
|
||||
{
|
||||
$this->loadThis();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('department_model');
|
||||
|
||||
$searchText = $this->input->post('searchText');
|
||||
$data['searchText'] = $searchText;
|
||||
|
||||
//$searchText = $this->input->post('searchText');
|
||||
//$data['searchText'] = $searchText;
|
||||
//$count = $this->department_model->departmentListing($searchText);
|
||||
//$returns = $this->paginationCompress ( "departmentListing/", $count, 20 );
|
||||
|
||||
$count = $this->department_model->departmentListing($searchText);
|
||||
|
||||
$returns = $this->paginationCompress ( "departmentListing/", $count, 20 );
|
||||
$data['userRecords'] = $this->department_model->departmentListing();//$searchText, $returns["page"], $returns["segment"]);
|
||||
|
||||
$data['userRecords'] = $this->department_model->departmentListing($searchText, $returns["page"], $returns["segment"]);
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth Industries : department Listing';
|
||||
$this->global['pageTitle'] = 'Siddharth Industries : Department Listing';
|
||||
|
||||
$this->loadViews("departmentListing", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This function is used to load the add new supplier */
|
||||
@ -63,6 +65,7 @@ class department extends BaseController
|
||||
{
|
||||
|
||||
//$data['payment'] = $this->department_model->getpayment();
|
||||
//$data['depcode'] = $this->department_model->getdepcode();
|
||||
$data['depcode'] = $this->department_model->getdepcode();
|
||||
|
||||
$this->global['pageTitle'] = 'siddharth : AddNew Department';
|
||||
@ -76,8 +79,6 @@ class department extends BaseController
|
||||
function addNewdepartment()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$DepartmentName = $this->input->post('DepartmentName');
|
||||
$DEPCode = $this->input->post('DEPCode');
|
||||
$HeadDept = $this->input->post('HeadDept');
|
||||
@ -98,14 +99,15 @@ class department extends BaseController
|
||||
|
||||
if($result > 0)
|
||||
{
|
||||
redirect('departmentListing','refresh');
|
||||
echo "<script>alert('New Department Created successfully!');</script>";
|
||||
echo "<script>alert('Department Created successfully!');</script>";
|
||||
redirect('departmentListing','refresh');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
redirect('departmentListing','refresh');
|
||||
echo "<script>alert('department Record Not Created!');</script>";
|
||||
echo "<script>alert('Department Record Not Created!');</script>";
|
||||
redirect('departmentListing','refresh');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,14 +147,14 @@ class department extends BaseController
|
||||
|
||||
if($result == True)
|
||||
{
|
||||
redirect('departmentListing','refresh');
|
||||
echo "<script>alert(' department record successfully updated!');</script>";
|
||||
echo "<script>alert('Department Record Successfully Updated!');</script>";
|
||||
redirect('departmentListing','refresh');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "<script>alert('Department Record Not Updated!');</script>";
|
||||
redirect('departmentListing','refresh');
|
||||
echo "<script>alert('department Record Not updated!');</script>";
|
||||
}
|
||||
|
||||
|
||||
@ -191,33 +193,16 @@ class department extends BaseController
|
||||
$this->load->library('excel');
|
||||
$this->excel->setActiveSheetIndex(0);
|
||||
|
||||
$this->excel->getActiveSheet()->setTitle('supplier details');
|
||||
$this->excel->getActiveSheet()->setTitle('Department Details');
|
||||
|
||||
$this->excel->getActiveSheet()->setCellValue('A1', 'DepartmentID');
|
||||
$this->excel->getActiveSheet()->setCellValue('B1', 'SupplierName');
|
||||
$this->excel->getActiveSheet()->setCellValue('C1', 'Address');
|
||||
$this->excel->getActiveSheet()->setCellValue('D1', 'ContactNumber');
|
||||
$this->excel->getActiveSheet()->setCellValue('E1', 'AlternateContactNumber');
|
||||
$this->excel->getActiveSheet()->setCellValue('F1', 'EmailAddress');
|
||||
$this->excel->getActiveSheet()->setCellValue('G1', 'Exiseregistration');
|
||||
$this->excel->getActiveSheet()->setCellValue('H1', 'TIN');
|
||||
$this->excel->getActiveSheet()->setCellValue('I1', 'PAN');
|
||||
$this->excel->getActiveSheet()->setCellValue('J1', 'CSTNO');
|
||||
$this->excel->getActiveSheet()->setCellValue('K1', 'CST Date');
|
||||
$this->excel->getActiveSheet()->setCellValue('L1', 'GST NO');
|
||||
$this->excel->getActiveSheet()->setCellValue('M1', 'GST Range');
|
||||
$this->excel->getActiveSheet()->setCellValue('N1', 'Collectrate Address');
|
||||
$this->excel->getActiveSheet()->setCellValue('O1', 'UANumber');
|
||||
$this->excel->getActiveSheet()->setCellValue('P1', 'PaymentTerms');
|
||||
$this->excel->getActiveSheet()->setCellValue('Q1', 'PaymentDays');
|
||||
$this->excel->getActiveSheet()->setCellValue('R1', 'PayableAT');
|
||||
$this->excel->getActiveSheet()->setCellValue('S1', 'Createdby');
|
||||
$this->excel->getActiveSheet()->setCellValue('T1', 'UpdatedBy');
|
||||
$this->excel->getActiveSheet()->setCellValue('U1', 'IsActive');
|
||||
$this->excel->getActiveSheet()->setCellValue('A1', 'Department ID');
|
||||
$this->excel->getActiveSheet()->setCellValue('B1', 'Department Name');
|
||||
$this->excel->getActiveSheet()->setCellValue('C1', 'Head Deptment ID');
|
||||
$this->excel->getActiveSheet()->setCellValue('D1', 'Is Active');
|
||||
$this->excel->getActiveSheet()->setCellValue('E1', 'Created By');
|
||||
$this->excel->getActiveSheet()->setCellValue('F1', 'Created Date');
|
||||
|
||||
|
||||
|
||||
|
||||
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('B1')->getFont()->setSize(12);
|
||||
@ -230,77 +215,28 @@ class department extends BaseController
|
||||
$this->excel->getActiveSheet()->getStyle('E1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('F1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('F1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('G1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('G1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('H1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('H1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('I1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('I1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('J1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('J1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('K1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('K1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('L1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('L1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('M1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('M1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('N1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('N1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('O1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('O1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('P1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('P1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('R1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('R1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('S1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('S1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('T1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('T1')->getFont()->setBold(true);
|
||||
$this->excel->getActiveSheet()->getStyle('U1')->getFont()->setSize(12);
|
||||
$this->excel->getActiveSheet()->getStyle('U1')->getFont()->setBold(true);
|
||||
|
||||
|
||||
|
||||
$exportData = $this->supplier_model->export_excel();
|
||||
$exportData = $this->department_model->export_excel();
|
||||
|
||||
if ($exportData) {
|
||||
$i = 2;
|
||||
$s = 1;
|
||||
foreach ($exportData as $data) {
|
||||
|
||||
$this->excel->getActiveSheet()->setCellValue('A' . $i,$data['DepartmentID']);
|
||||
$this->excel->getActiveSheet()->setCellValue('B' . $i,$data['SupplierName']);
|
||||
$this->excel->getActiveSheet()->setCellValue('C' . $i,$data['Address']);
|
||||
$this->excel->getActiveSheet()->setCellValue('D' . $i,$data['ContactNumber']);
|
||||
$this->excel->getActiveSheet()->setCellValue('E' . $i,$data['AlternateContactNumber']);
|
||||
$this->excel->getActiveSheet()->setCellValue('F' . $i,$data['EmailAddress']);
|
||||
$this->excel->getActiveSheet()->setCellValue('G' . $i,$data['Exiseregistration']);
|
||||
$this->excel->getActiveSheet()->setCellValue('H' . $i,$data['TIN']);
|
||||
$this->excel->getActiveSheet()->setCellValue('I' . $i,$data['PAN']);
|
||||
$this->excel->getActiveSheet()->setCellValue('J' . $i,$data['CSTNO']);
|
||||
$this->excel->getActiveSheet()->setCellValue('K' . $i,$data['CSTDate']);
|
||||
$this->excel->getActiveSheet()->setCellValue('L' . $i,$data['GSTNO']);
|
||||
$this->excel->getActiveSheet()->setCellValue('M' . $i,$data['GSTRange']);
|
||||
$this->excel->getActiveSheet()->setCellValue('N' . $i,$data['CollectrateAddress']);
|
||||
$this->excel->getActiveSheet()->setCellValue('O' . $i,$data['UANumber']);
|
||||
$this->excel->getActiveSheet()->setCellValue('P' . $i,$data['PaymentTerms']);
|
||||
$this->excel->getActiveSheet()->setCellValue('Q' . $i,$data['PaymentDays']);
|
||||
$this->excel->getActiveSheet()->setCellValue('R' . $i,$data['PayableAT']);
|
||||
$this->excel->getActiveSheet()->setCellValue('S' . $i,$data['firstname']);
|
||||
$this->excel->getActiveSheet()->setCellValue('T' . $i,$data['Update_by']);
|
||||
$this->excel->getActiveSheet()->setCellValue('U' . $i,$data['IsActive']);
|
||||
|
||||
|
||||
|
||||
$this->excel->getActiveSheet()->setCellValue('A' . $i,$data['DEPCode']);
|
||||
$this->excel->getActiveSheet()->setCellValue('B' . $i,$data['DepartmentName']);
|
||||
$this->excel->getActiveSheet()->setCellValue('C' . $i,$data['HeadDept']);
|
||||
$this->excel->getActiveSheet()->setCellValue('D' . $i,$data['firstname']);
|
||||
$this->excel->getActiveSheet()->setCellValue('E' . $i,$data['CreatedDt']);
|
||||
$this->excel->getActiveSheet()->setCellValue('F' . $i,$data['IsActive']);
|
||||
|
||||
|
||||
$i++;
|
||||
$s++;
|
||||
}
|
||||
}
|
||||
|
||||
$filename = 'supplierdetails' .' '. '.xls'; //save our workbook as this file name
|
||||
$filename = 'departmentdetails' .' '. '.xls'; //save our workbook as this file name
|
||||
header('Content-Type: application/vnd.ms-excel'); //mime type
|
||||
header('Content-Disposition: attachment;filename="' . $filename . '"'); //tell browser what's the file name
|
||||
header('Cache-Control: max-age=0'); //no cache
|
||||
|
||||
@ -7,37 +7,37 @@ class department_model extends CI_Model
|
||||
* @param string $searchText : This is optional search text
|
||||
* @return number $count : This is row count
|
||||
*/
|
||||
function departmentListingCount($searchText = '')
|
||||
{
|
||||
$this->db->select('BaseT.DepartmentID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration,BaseT.TIN,BaseT.PAN,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT');
|
||||
$this->db->from('T_DepartmentDetails as BaseT');
|
||||
//$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
||||
//$this->db->join('T_SupplierDetails as ID', 'ID.DepartmentID = BaseT.DepartmentID','left');
|
||||
if(!empty($searchText)) {
|
||||
$likeCriteria = "(BaseT.DepartmentID LIKE '%".$searchText."%'
|
||||
OR BaseT.SupplierName LIKE '%".$searchText."%'
|
||||
OR BaseT.Address LIKE '%".$searchText."%'
|
||||
OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
||||
OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
||||
OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
||||
OR BaseT.Exiseregistration LIKE '%".$searchText."%'
|
||||
OR BaseT.TIN LIKE '%".$searchText."%'
|
||||
OR BaseT.PAN LIKE '%".$searchText."%'
|
||||
OR BaseT.GSTNO LIKE '%".$searchText."%'
|
||||
OR BaseT.GSTRange LIKE '%".$searchText."%'
|
||||
OR BaseT.CollectrateAddress LIKE '%".$searchText."%'
|
||||
OR BaseT.UANumber LIKE '%".$searchText."%'
|
||||
OR BaseT.PaymentTerms LIKE '%".$searchText."%'
|
||||
OR BaseT.PaymentDays LIKE '%".$searchText."%'
|
||||
OR BaseT.PayableAT LIKE '%".$searchText."%')";
|
||||
$this->db->where($likeCriteria);
|
||||
}
|
||||
//$this->db->where('BaseT.isDeleted', 0);
|
||||
//$this->db->where('BaseT.userId !=', 1);
|
||||
$query = $this->db->get();
|
||||
// function departmentListingCount($searchText = '')
|
||||
// {
|
||||
// $this->db->select('BaseT.DepartmentID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration,BaseT.TIN,BaseT.PAN,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT');
|
||||
// $this->db->from('T_DepartmentDetails as BaseT');
|
||||
// //$this->db->join('tbl_users as users', 'users.userId = BaseT.userId','left');
|
||||
// //$this->db->join('T_SupplierDetails as ID', 'ID.DepartmentID = BaseT.DepartmentID','left');
|
||||
// if(!empty($searchText)) {
|
||||
// $likeCriteria = "(BaseT.DepartmentID LIKE '%".$searchText."%'
|
||||
// OR BaseT.SupplierName LIKE '%".$searchText."%'
|
||||
// OR BaseT.Address LIKE '%".$searchText."%'
|
||||
// OR BaseT.ContactNumber LIKE '%".$searchText."%'
|
||||
// OR BaseT.AlternateContactNumber LIKE '%".$searchText."%'
|
||||
// OR BaseT.EmailAddress LIKE '%".$searchText."%'
|
||||
// OR BaseT.Exiseregistration LIKE '%".$searchText."%'
|
||||
// OR BaseT.TIN LIKE '%".$searchText."%'
|
||||
// OR BaseT.PAN LIKE '%".$searchText."%'
|
||||
// OR BaseT.GSTNO LIKE '%".$searchText."%'
|
||||
// OR BaseT.GSTRange LIKE '%".$searchText."%'
|
||||
// OR BaseT.CollectrateAddress LIKE '%".$searchText."%'
|
||||
// OR BaseT.UANumber LIKE '%".$searchText."%'
|
||||
// OR BaseT.PaymentTerms LIKE '%".$searchText."%'
|
||||
// OR BaseT.PaymentDays LIKE '%".$searchText."%'
|
||||
// OR BaseT.PayableAT LIKE '%".$searchText."%')";
|
||||
// $this->db->where($likeCriteria);
|
||||
// }
|
||||
// //$this->db->where('BaseT.isDeleted', 0);
|
||||
// //$this->db->where('BaseT.userId !=', 1);
|
||||
// $query = $this->db->get();
|
||||
|
||||
return count($query->result());
|
||||
}
|
||||
// return count($query->result());
|
||||
// }
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
@ -45,37 +45,39 @@ class department_model extends CI_Model
|
||||
* @param number $segment : This is pagination limit
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function departmentListing($searchText = '')
|
||||
function departmentListing()
|
||||
{
|
||||
$this->db->select('BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive');
|
||||
$this->db->from('T_DepartmentDetails as BaseT');
|
||||
if(!empty($searchText)) {
|
||||
$likeCriteria = "(BaseT.DepartmentName LIKE '%".$searchText."%'
|
||||
OR BaseT.DEPCode LIKE '%".$searchText."%'
|
||||
OR BaseT.HeadDept LIKE '%".$searchText."%'
|
||||
OR BaseT.IsActive LIKE '%".$searchText."%')";
|
||||
$this->db->where($likeCriteria);
|
||||
}
|
||||
//$this->db->where('BaseT.isDeleted', 0);
|
||||
//$this->db->where('BaseT.userId !=', 1);
|
||||
// $this->db->limit($page, $segment);
|
||||
$this->db->order_by("BaseT.DEPCode", "asc");
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
// function ($searchText = '')
|
||||
// {
|
||||
// if(!empty($searchText)) {
|
||||
// $likeCriteria = "(BaseT.DepartmentName LIKE '%".$searchText."%'
|
||||
// OR BaseT.DEPCode LIKE '%".$searchText."%'
|
||||
// OR BaseT.HeadDept LIKE '%".$searchText."%'
|
||||
// OR BaseT.IsActive LIKE '%".$searchText."%')";
|
||||
// $this->db->where($likeCriteria);
|
||||
// }
|
||||
// //$this->db->where('BaseT.isDeleted', 0);
|
||||
// //$this->db->where('BaseT.userId !=', 1);
|
||||
// // $this->db->limit($page, $segment);
|
||||
// $query = $this->db->get();
|
||||
|
||||
// $result = $query->result();
|
||||
// return $result;
|
||||
// }
|
||||
/**
|
||||
* This function used to get user information by id
|
||||
* @param number $userId : This is user id
|
||||
* @return array $result : This is user information
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function addNewdepartment($department)
|
||||
{
|
||||
|
||||
@ -89,9 +91,12 @@ function addNewdepartment($department)
|
||||
|
||||
function getdepcode()
|
||||
{
|
||||
//$limit = 12;
|
||||
$this->db->distinct();
|
||||
$this->db->select('HeadDept');
|
||||
$this->db->select('DEPCode, DepartmentName');
|
||||
$this->db->from('T_DepartmentDetails');
|
||||
$this->db->where('IsActive =', 1);
|
||||
//$this->db->limit($limit);
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
|
||||
@ -80,16 +80,16 @@
|
||||
<!-- general form elements -->
|
||||
|
||||
|
||||
<div class="box box-primary">
|
||||
<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="adddepartment" action="<?php echo base_url() ?>addNewdepartment" method="post" role="form">
|
||||
<div class="col-md-10 col-md-offset-1"> <!--style="border:3px solid #3c8dbc;">-->
|
||||
<form class="form-horizontal" role="form" id="adddepartment" action="<?php echo base_url() ?>addNewdepartment" method="post" role="form"><br/>
|
||||
<fieldset>
|
||||
|
||||
|
||||
<!-- Form Name -->
|
||||
<legend>Department Information</legend>
|
||||
|
||||
@ -114,17 +114,18 @@
|
||||
foreach ($depcode as $DC)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $DC->HeadDept?>"><?php echo $DC->HeadDept ?> </option>
|
||||
<option value="<?php echo $DC->DEPCode?>"><?php echo $DC->DEPCode." - " .$DC->DepartmentName ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<div class="form-group">
|
||||
<span for="Active">IsActive</span> <br>
|
||||
<span for="Active">Is Active</span> <br>
|
||||
<input type="checkbox" id="IsActive" name="IsActive" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,71 +1,72 @@
|
||||
<script>
|
||||
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-8'i><'col-sm-4'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
|
||||
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
|
||||
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
|
||||
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
|
||||
</script>
|
||||
<script>
|
||||
// (function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-8'i><'col-sm-4'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
|
||||
// b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
|
||||
// f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
|
||||
// collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
|
||||
</script>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Siddharth Industries -Department Details</center>
|
||||
|
||||
</h1>
|
||||
</section>
|
||||
<!-- <section class="content-header"> -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<center> <h3 class="box-title">Siddharth Industries -Department Details</h3></center>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<!-- </section> -->
|
||||
<!-- <section class="content"> -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-info" href="<?php echo base_url(); ?>adddepartment">Add New department</a>
|
||||
<a class="btn btn-primary" href="<?php echo base_url(); ?>adddepartment">Add New department</a>
|
||||
<!--<a class="btn btn-info" href="<?php echo base_url(); ?>supplier/export_supplierdetails">Export department details <i class="fa fa-download"aira-hidden="true"></i></a>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
||||
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;" >
|
||||
<thead>
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
<th>department code</th>
|
||||
<th >Dapartmentname</th>
|
||||
<th>head deapartment</th>
|
||||
<th>Department Code</th>
|
||||
<th>Department Name</th>
|
||||
<th>Head Department</th>
|
||||
<th>IsActive</th>
|
||||
<th>Action</th>
|
||||
<!-- <th>Action</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(!empty($userRecords))
|
||||
{
|
||||
foreach($userRecords as $record)
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(!empty($userRecords))
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td title="<?php echo $record->DEPCode; ?> - Click here to view department details"><?php echo $record->DEPCode ?> </td>
|
||||
|
||||
<td><?php echo $record->DepartmentName ?></td>
|
||||
<td><?php echo $record->HeadDept ?></td>
|
||||
<td><?php echo $record->IsActive ?></td>
|
||||
|
||||
<td><a href="<?php echo base_url().'editOlddepartment/?SID='.$record->DEPCode?>" data-toggle="tooltip" - Click here to view department details"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the department details"></i> </a></td>
|
||||
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
foreach($userRecords as $record)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<!-- <td title=" - Click here to view department details"> </td> -->
|
||||
<td><u><a href="<?php echo base_url().'editOlddepartment/?SID='.$record->DEPCode?>" data-toggle="tooltip" title="<?php echo $record->DEPCode ?> - Click here to view Department details"><?php echo $record->DEPCode; ?></a></u></td>
|
||||
<td><?php echo $record->DepartmentName ?></td>
|
||||
<td><?php echo $record->HeadDept ?></td>
|
||||
<td><?php if($record->IsActive == 1){echo "Active";}
|
||||
else { echo "In Active";} ?></td>
|
||||
<!-- <td><a data-toggle="tooltip" "><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the department details"></i> </a></td> -->
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- colsxs12 div closed-->
|
||||
</div><!-- row div closed -->
|
||||
</div><!-- containerfluid div closed -->
|
||||
</div><!-- box div closed -->
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</div><!-- content wrapper div closed -->
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
22
application/views/editdepartment.php
Executable file → Normal file
22
application/views/editdepartment.php
Executable file → Normal file
@ -12,8 +12,8 @@ if(!empty($department))
|
||||
$DEPCode = $uf->DEPCode;
|
||||
$DepartmentName = $uf->DepartmentName;
|
||||
$HeadDept = $uf->HeadDept;
|
||||
//$IsActive = $uf->IsActive;
|
||||
//echo 'CST date:'. $CSTDt ;
|
||||
//$IsActive = $uf->IsActive;
|
||||
//echo 'CST date:'. $CSTDt ;
|
||||
$chk = $uf->IsActive;
|
||||
|
||||
if($chk == 1)
|
||||
@ -94,7 +94,7 @@ if(!empty($department))
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center> Siddharth Industries - <?php echo $DepartmentName; ?> Department DETAILS</center>
|
||||
<center> Siddharth Industries - <?php echo $DepartmentName; ?> Department Details</center>
|
||||
|
||||
</h1>
|
||||
|
||||
@ -111,24 +111,24 @@ if(!empty($department))
|
||||
<!-- general form elements -->
|
||||
|
||||
|
||||
<div class="box box-primary">
|
||||
<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">
|
||||
<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">DEPCode</span>
|
||||
<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">DepartmentName</span><span class="badge">*</span>
|
||||
<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>
|
||||
@ -143,7 +143,7 @@ if(!empty($department))
|
||||
foreach ($depcode as $DC)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $DC->HeadDept?>"><?php echo $DC->HeadDept ?></option>
|
||||
<option value="<?php echo $DC->DEPCode?>"><?php echo $DC->DEPCode ?> - <?php echo $DC->DepartmentName ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -152,7 +152,7 @@ if(!empty($department))
|
||||
</div>
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<div class="form-group">
|
||||
<span for="Active">IsActive</span> <br>
|
||||
<span for="Active">Is Active</span> <br>
|
||||
<input type="checkbox" id="IsActive" name="IsActive" <?php echo $IsActive;?> >
|
||||
</div>
|
||||
</div>
|
||||
@ -161,7 +161,7 @@ if(!empty($department))
|
||||
<div class="col-md-3 col-md-offset-9">
|
||||
<div class="pull-right">
|
||||
|
||||
<input type="submit" value="update" class="btn btn-primary">
|
||||
<input type="submit" value="Update" class="btn btn-primary">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user