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');*/ define('ROLE_ACCOUNTS', '8');*/
/***** USER DESIGNATION ******/
define('SECURITY', 'SECURITY');
define('SEGMENT', 2); define('SEGMENT', 2);
/************** Requistion Status code */ /************** 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('email', 'Email', 'required|valid_email|max_length[128]|xss_clean|trim');
$this->form_validation->set_rules('password', 'Password', 'required|max_length[32]|'); $this->form_validation->set_rules('password', 'Password', 'required|max_length[32]|');
$designation='';
$role='';
if($this->form_validation->run() == FALSE) if($this->form_validation->run() == FALSE)
{ {
$this->index(); $this->index();
@ -83,11 +85,20 @@ class Login extends CI_Controller
$this->session->set_userdata($sessionArray); $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 else
{ {

View File

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