Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions controllers/admin/AdminDashboardController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
require_once './core/Controller.php';


class AdminDashboardController extends Controller{

function __construct()
{
require './models/admin/AdminDashboardModel.php';
$this->AdminDashboardModel = new AdminDashboardModel();
}
public function logout(){
session_destroy();
unset($_SESSION['staffId']);
header("Location: /staff/login",TRUE,302);
}
}
?>
12 changes: 12 additions & 0 deletions controllers/admin/DashBoardController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
require_once './core/Controller.php';

class DashBoardController extends Controller
{
public function __construct()
{
require './models/admin/DashBoardModel.php';
$this->DashBoarModel =new DashBoardModel();
}
}
?>
3 changes: 1 addition & 2 deletions controllers/admin/MenuUpdateController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once './core/Controller.php';
session_start();
ob_start();


class MenuUpdateController extends Controller
{
Expand Down
59 changes: 57 additions & 2 deletions controllers/admin/staffManageController.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,68 @@
<?php
require_once './core/Controller.php';
session_start();
ob_start();
class StaffManageController extends Controller
{
public function __construct()
{
require './models/admin/StaffManageModel.php';
$this->StaffManageModel =new StaffManageModel();
}
public function getStaffDetails()
{
$result=$this->StaffManageModel->getAllData('staff');
return $result;
}
public function addStaff($firstname,$lastname,$cnumber,$email,$roleid,$password,$re_password){
$tpnumbereCount= preg_match_all( "/[0-9]/", $cnumber );
$val=0;
if(ctype_alpha($firstname))
{
if(ctype_alpha($lastname))
{
if (ctype_digit($cnumber))
{
if ($tpnumbereCount == 10)
{
if ($roleid < 6 && 0 < $roleid)
{
if($password===$re_password)
{
$val=1;
}
else
{
echo" password are not match ";
}
}
else
{
echo "role-id need to be less than current role id number";
}
}
else
{
echo "contact number must have 10 numbers";
}
} else {
echo " contact-number need to be a number";
}
}
else
{
echo" last names need to be a letters and not contains spaces";
}
}
else
{
echo" first names need to be a letters and not contains spaces";
}
if($val==1)
{
$this->StaffManageModel->writeData("`staff`","`firstName`,`lastName`,`contactNo`,`email`,`roleId`,`password`","'$firstname','$lastname',$cnumber,'$email',$roleid,'$password'");
header('Loction: /admin/staffmanage,',true,302);
}


}
}
?>
3 changes: 1 addition & 2 deletions controllers/store/GrnController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once './core/Controller.php';
session_start();
ob_start();

class GrnController extends Controller
{
function __construct()
Expand Down
3 changes: 1 addition & 2 deletions controllers/store/InventoryController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
require_once './core/Controller.php';
session_start();
ob_start();

class InventoryController extends Controller
{
function __construct()
Expand Down
6 changes: 5 additions & 1 deletion controllers/store/StaffLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function submitLogin($userid, $password)
while ($row = $result->fetch_assoc()) {
if ($password === $row["password"]) {
$_SESSION['staffId']=$row['staffId'];
$_SESSION['firstName']=$row['firstName'];
$_SESSION['lastName']=$row['lastName'];

// $_SESSION['lastName']=$row['staffId'];

switch ($row["roleId"]) {
case 1:
Expand Down Expand Up @@ -51,4 +55,4 @@ function submitLogin($userid, $password)
$this->triggerError('Login Failed!');
}
}
}
}
7 changes: 6 additions & 1 deletion core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public function logout(){
unset($_SESSION['user_phone']);
header("Location: /online",TRUE,302);
}
public function logoutstaffMem(){
session_destroy();
unset($_SESSION['staffId']);
header("Location: /staff/login");
}

public function parseParams($params)
{
Expand All @@ -31,4 +36,4 @@ public function parseParams($params)
}


}
}
15 changes: 0 additions & 15 deletions css/managestaffdetailsStyles.css

This file was deleted.

136 changes: 136 additions & 0 deletions css/staffManage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@

/* navigatable button page top */
.buttons-row{
display: flex;
flex-direction: row;
justify-content: center;
}
.button-is-active{
background-color: #f5a540 !important;
color: white !important;
}
.buttons-row > a > .button{
font-family: 'Baloo Thambi 2', cursive;
width: 10rem !important;
color: black;
background-color: transparent;
border: 1px solid #f5a540;
}

.left-radius{
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.right-radius{
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.idle:hover{
background-color: #f5a540 !important;
color: white !important;
}

/* container */
.content
{
box-shadow: 4px 6px 25px -8px rgba(0,0,0,0.75);
border-radius: 15px;
padding: .5rem;
margin: 51px;
margin-top: 13px;
/* margin-bottom: 20px; */
align-self: center;
cursor: pointer;
overflow: auto;
}
.font{
font-family: 'Baloo Thambi 2', cursive;
}
/* Menu Cards->box */
.box{
margin: 0 -5px;
}
.box:after{
content: "";
display: table;
clear: both;
}
.s-box{
display: inline-block;
box-shadow: 4px 6px 25px -8px rgba(0,0,0,0.75);
border-radius: 15px;
padding: 1rem;
padding-top: 0rem;
margin: 10px;
margin-top: 0px;
align-self: center;
cursor: pointer;
overflow: auto;
width: 900px;
height:410px;
height: 500px;


}
inventory-container{
position: absolute;
top:23%;

}
::-webkit-scrollbar {
width: 0px;
background: transparent;
}
.inventory-table td,th{
width:160px;
height: 50px;
}
.inventory-table #adjust-width{
width:140px;

text-align:left;
}
.inventory-table #align-right{
text-align:right;
}
.inventory-table .visibility-hide{
color:white;
background-color: white;
}
.visibility-hide:focus{
outline: none;

}
tr:hover td{
background-color: #f5a540;
box-shadow: 4px 6px 25px -8px rgba(0,0,0,0.75);
color:white;
}
#stuff .visibility-hide{
visibility: hidden;
}
tr:hover #stuff .visibility-hide{
color:#f5a540;
background:white;
visibility: visible;
}
th{
background: #d17a40;
position: sticky;
top: 0;
box-shadow: 4px 6px 25px -8px rgba(0,0,0,0.75);
font-size: 18px;
color:wheat;
}

/* change menu types color */
.change-menu-color{
color:#f5a540 !important;
}

.fill-form
{
align-items: center;
margin-left:37px;
margin-top:40px;
}
10 changes: 10 additions & 0 deletions models/admin/AdminDashboardModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
require './core/Model.php';
class AdminDashboardModel extends Model
{
function __construct()
{
parent ::__construct();
}
}
?>
10 changes: 10 additions & 0 deletions models/admin/DashBoardModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
require './core/Model.php';
class DashBoardModel extends Model
{
function __construct()
{
parent::__construct();
}
}
?>
3 changes: 0 additions & 3 deletions router.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

//Admin
$adminDashboard = 'views/admin/dashboard.php';
$staffDetails = 'views/admin/managestaffdetails.php';
$staffManage='views/admin/staffmanage.php';
$menuUpdate='views/admin/menuupdate.php';

Expand Down Expand Up @@ -141,8 +140,6 @@
case '/staff/login' :
require($staffLogin);
break;
case '/staff/details' :
require($staffDetails);
case '/api/v1/review' :
require($review);
break;
Expand Down
Loading