security department

This commit is contained in:
venbatechnologies@gmail.com 2018-02-06 12:19:21 +05:30
parent d049be389b
commit d6c244988d
4 changed files with 42 additions and 22 deletions

View File

@ -49,7 +49,7 @@ define('ROLE_ACCOUNTS', '8');*/
/***** USER DESIGNATION ******/
define('SECURITY', 'SECURITY');
//define('SECURITY', 'SECURITY');
define('SEGMENT', 2);
@ -140,6 +140,7 @@ define('FINANCE', 'DEP10');
define('PURCHASE', 'DEP11');
define('MANAGEMENT', 'DEP12');
define('HR', 'DEP13');
define('SECURITY', 'DEP15');
/* PO Type */
define('REVENUE', 'REVENUE');
define('SERVICE', 'SERVICE');

View File

@ -78,10 +78,10 @@ class Login extends CI_Controller
foreach ($result as $res)
{
$sessionArray = array('userId'=>$res->userId,
'role'=>$res->roleId,
// 'role'=>$res->roleId,
'roleText'=>$res->role,
'name'=>$res->FirstName,
'Designation'=>$res->Designation,
//'Designation'=>$res->Designation,
'DEPCode'=>$res->DEPCode,
'HeadDept'=>$res->HeadDept,
'depaccess'=>$this->login_model->Accessdep($res->EmpID),
@ -92,13 +92,14 @@ class Login extends CI_Controller
$this->session->set_userdata($sessionArray);
$role=$res->roleId;
$designation=$res->Designation;
//$role=$res->roleId;
//$designation=$res->Designation;
$DEPCode=$res->DEPCode;
}
if ($role == ROLE_EMPLOYEE && $designation == SECURITY)
if ($DEPCode == SECURITY)
{
redirect('/Addigr');
}

View File

@ -40,11 +40,11 @@ class BaseController extends CI_Controller {
if (! isset ( $isLoggedIn ) || $isLoggedIn != TRUE) {
redirect ( 'login' );
} else {
$this->role = $this->session->userdata ( 'role' );
//$this->role = $this->session->userdata ( 'role' );
$this->vendorId = $this->session->userdata ( 'userId' );
$this->name = $this->session->userdata ( 'name' );
$this->roleText = $this->session->userdata ( 'roleText' );
$this->Designation = $this->session->userdata ( 'Designation' );
//$this->Designation = $this->session->userdata ( 'Designation' );
$this->DEPCode = $this->session->userdata ( 'DEPCode' );
$this->HeadDept = $this->session->userdata ( 'HeadDept' );
$this->DepartmentName = $this->session->userdata ( 'DepartmentName' );

View File

@ -171,7 +171,7 @@ $(function() {
</a>
</li> -->
<!-- <?php echo $Designation;?> -->
<!-- <?php echo $DEPCode;?> -->
<!-- <?php echo $DEPCode;?> -->
<!-- <?php print_r($DepAccesslist); echo $DEPCode?> -->
<!-- <?php if(empty($DepAccesslist)){echo "empty";}
@ -180,7 +180,7 @@ $(function() {
<?php if($DEPCode != HR){?>
<?php if($Designation != SECURITY){?>
<?php if($DEPCode != SECURITY){?>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa-thumb-tack"></i> Requisition<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu2">
@ -241,7 +241,7 @@ $(function() {
<?php }?>
<?php if($DEPCode != HR){?>
<?php if($Designation != SECURITY){?>
<?php if($DEPCode != SECURITY){?>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa-check-square-o"></i> Store Requisition<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu2">
@ -345,7 +345,7 @@ $(function() {
<!-- <?php print_r($DepAccesslist)?> -->
<?php if(empty($DepAccesslist)){ ?>
<?php if($DEPCode == FINANCE || $DEPCode == SALES || $DEPCode == HR || $DEPCode == SYSTEM_ADMIN || $DEPCode == ADMIN && $Designation != SECURITY){?>
<?php if($DEPCode == FINANCE || $DEPCode == SALES || $DEPCode == HR || $DEPCode == SYSTEM_ADMIN || $DEPCode == ADMIN && $DEPCode != SECURITY){?>
<li class="treeview">
<span id="menu" data-toggle="dropdown"><i class="fa fa-database" aria-hidden="true"></i> Master Details<span class="caret"></span></span>
@ -391,7 +391,7 @@ $(function() {
<?php }?>
<?php if($DEPCode == ADMIN && $Designation != SECURITY ){?>
<?php if($DEPCode == ADMIN && $DEPCode != SECURITY ){?>
<li class="treeview">
<a href="<?php echo base_url(); ?>companyview" >
@ -809,14 +809,13 @@ $(function() {
<?php if($check ==1){break;}}}?>
<?php if(empty($DepAccesslist)){
<?php if(empty($DepAccesslist)){
if($DEPCode == STORE || $DEPCode == QUALITY || $Designation == SECURITY){?>
if($DEPCode == STORE || $DEPCode == QUALITY || $DEPCode == SECURITY){ ?>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa-check-square-o"></i> Inspection<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
<?php if($DEPCode == STORE || $DEPCode == QUALITY){?>
<?php if($DEPCode == STORE || $DEPCode == QUALITY || $DEPCode == SECURITY){?>
@ -826,6 +825,18 @@ $(function() {
<span>Inward Gate Register Entry</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>ViewigrDetails">
<i class="fa fa-upload"></i>
<span>View Inward Gate Register</span>
</a>
</li>
<?php if($DEPCode != SECURITY){?>
<li class="treeview">
<a href="<?php echo base_url(); ?>Viewigr">
@ -864,7 +875,7 @@ $(function() {
</a>
</li>
<?php }?>
<!-- <li class="treeview">
<a href="<?php echo base_url(); ?>ViewigrDetails">
@ -875,7 +886,7 @@ $(function() {
<?php }?>
<?php if($Designation == SECURITY){?>
<!-- <?php if($DEPCode == SECURITY){?>
<li class="treeview">
<a href="<?php echo base_url(); ?>Addigr">
@ -883,9 +894,16 @@ $(function() {
<span>Inward Gate Register Entry</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>ViewigrDetails">
<i class="fa fa-upload"></i>
<span>View Inward Gate Register</span>
</a>
</li>
<?php }?>
<?php }?> -->
</ul>
@ -908,7 +926,7 @@ $(function() {
//echo $assd;
if($assd == STORE || $DEPCode == QUALITY || $assd == QUALITY || DEPCode == STORE){ $check = $check+1;?>
if($assd == STORE || $DEPCode == QUALITY || $assd == QUALITY || DEPCode == STORE || $DEPCode == SECURITY || $assd == SECURITY){ $check = $check+1;?>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa-check-square-o"></i> Inspection<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu1">
@ -1123,7 +1141,7 @@ $(function() {
<?php if(empty($DepAccesslist)){?>
<?php if($DEPCode == ADMIN){?>
<?php if($Designation != SECURITY){?>
<?php if($DEPCode != SECURITY){?>
<li class="treeview">
<span id="menu" data-toggle="dropdown" ><i class="fa fa-thumb-tack"></i> Attendance<span class="caret"></span></span>