changes in header

This commit is contained in:
saravanakumar_kandasami 2017-06-30 16:29:45 +05:30
parent 818a956e9b
commit ec87a639bd
5 changed files with 70 additions and 41 deletions

View File

@ -48,6 +48,9 @@ define('ROLE_SALES', '7');
define('ROLE_ACCOUNTS', '8');*/
/***** USER DESIGNATION ******/
define('SECURITY', 'SECURITY');
define('SEGMENT', 2);
/************** Requistion Status code */

View File

@ -53,7 +53,9 @@ class Login extends CI_Controller
$this->form_validation->set_rules('email', 'Email', 'required|valid_email|max_length[128]|xss_clean|trim');
$this->form_validation->set_rules('password', 'Password', 'required|max_length[32]|');
$designation='';
$role='';
if($this->form_validation->run() == FALSE)
{
$this->index();
@ -83,11 +85,20 @@ class Login extends CI_Controller
$this->session->set_userdata($sessionArray);
$role=$res->roleId;
$designation=$res->Designation;
}
redirect('dashboard');
if ($role == ROLE_EMPLOYEE && $designation == SECURITY)
{
redirect('/Addigr');
}
else
{
redirect('/dashboard');
}
}
else
{

View File

@ -53,6 +53,7 @@ class BaseController extends CI_Controller {
$this->global ['role'] = $this->role;
$this->global ['role_text'] = $this->roleText;
$this->global ['DEPCode'] = $this->DEPCode;
$this->global ['Designation'] = $this->Designation;
}
}

View File

@ -0,0 +1,3 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
ERROR - 2017-06-30 12:34:19 --> Severity: Notice --> Undefined variable: designation C:\xampp\htdocs\sia306\siddharth_application\application\views\includes\header.php 248

View File

@ -143,13 +143,15 @@
<div class="navbar-custom-menu collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less -->
<?php if($Designation != SECURITY ){ ?>
<li class="treeview">
<a href="<?php echo base_url(); ?>dashboard">
<i class="fa fa-dashboard"></i> <span>Dashboard</span>
</a>
</li>
<?php
if($role == ROLE_ADMIN || $DEPCode == SALES || $DEPCode == FINANCE )
}
if($role == ROLE_ADMIN || $DEPCode == SALES || $DEPCode == FINANCE )
{
?>
@ -243,16 +245,16 @@
?>
<?php
if( $role == ROLE_MANAGER|| $role == ROLE_EMPLOYEE || $role == ROLE_ADMIN || $DEPCode == MANAGEMENT)
if (( $role == ROLE_MANAGER|| $role == ROLE_EMPLOYEE || $role == ROLE_ADMIN || $DEPCode == MANAGEMENT) && $Designation != 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">
<?php if($role == ROLE_MANAGER || $role == ROLE_EMPLOYEE || $role == ROLE_ADMIN )
<?php if (($role == ROLE_MANAGER || $role == ROLE_EMPLOYEE || $role == ROLE_ADMIN ) && $Designation != SECURITY)
{
?>
<li class="treeview">
<li class="treeview">
<a href="<?php echo base_url(); ?>Requisition">
<i class="fa fa-arrow-circle-up"></i>
<span>Raise Requisition </span>
@ -301,21 +303,15 @@
<li class="treeview">
<span id="menu" data-toggle="dropdown"><i class="fa fa-first-order"></i> Purchase order<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu" aria-labelledby="menu2">
<?php
//if($DEPCode != FINANCE || $DEPCode == PURCHASE)
if( $DEPCode == PURCHASE)
{
?>
<li class="treeview">
<!-- All User can create Emergency po -->
<?php if($Designation != SECURITY ){ ?>
<li class="treeview">
<a href="<?php echo base_url(); ?>EmergencyPO">
<i class="fa fa-ambulance"></i>
<span>Emergency Purchase Order </span>
</a>
</li>
<?php
}
?>
<?php } ?>
<?php
//if($DEPCode == PURCHASE && $role == ROLE_EMPLOYEE)
if($DEPCode == PURCHASE )
@ -428,35 +424,50 @@
<?php
}
?>
<?php if($Designation == SECURITY || $DEPCode == STORE || $DEPCode == QUALITY){ ?>
<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="menu2">
<li class="treeview">
<a href="<?php echo base_url(); ?>Addigr">
<i class="fa fa-upload"></i>
<span>Inward Gate Register Entry</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>Viewigr">
<i class="fa fa-eye"></i>
<span>View Inward Gate Register</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>inwardgateregister/materialinspectionreport">
<i class="fa fa-upload"></i>
<span>Material Inspection Report Entry</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>inwardgateregister/viewmaterialinspectionreport">
<i class="fa fa-upload"></i>
<span>View Material Inspection Report</span>
</a>
</li>
</ul>
<?php if($Designation == SECURITY) {?>
<li class="treeview">
<a href="<?php echo base_url(); ?>Addigr">
<i class="fa fa-upload"></i>
<span>Inward Gate Register Entry</span>
</a>
</li>
<?php }
if($Designation == SECURITY || $DEPCode == STORE || $DEPCode == QUALITY)
{
?>
<li class="treeview">
<a href="<?php echo base_url(); ?>Viewigr">
<i class="fa fa-eye"></i>
<span>View Inward Gate Register</span>
</a>
</li>
<?php
if($DEPCode == STORE || $DEPCode == QUALITY)
{
?>
<li class="treeview">
<a href="<?php echo base_url(); ?>inwardgateregister/materialinspectionreport">
<i class="fa fa-upload"></i>
<span>Material Inspection Report Entry</span>
</a>
</li>
<li class="treeview">
<a href="<?php echo base_url(); ?>inwardgateregister/viewmaterialinspectionreport">
<i class="fa fa-upload"></i>
<span>View Material Inspection Report</span>
</a>
</li>
<?php
}
}
?>
</ul>
</li>
<?php } ?>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="<?php echo base_url(); ?>assets/dist/img/avatar.png" class="user-image" alt="User Image"/>