diff --git a/controllers/admin/AdminDashboardController.php b/controllers/admin/AdminDashboardController.php new file mode 100644 index 0000000..2f4eb9a --- /dev/null +++ b/controllers/admin/AdminDashboardController.php @@ -0,0 +1,18 @@ +AdminDashboardModel = new AdminDashboardModel(); + } + public function logout(){ + session_destroy(); + unset($_SESSION['staffId']); + header("Location: /staff/login",TRUE,302); + } + } +?> \ No newline at end of file diff --git a/controllers/admin/DashBoardController.php b/controllers/admin/DashBoardController.php new file mode 100644 index 0000000..748be39 --- /dev/null +++ b/controllers/admin/DashBoardController.php @@ -0,0 +1,12 @@ +DashBoarModel =new DashBoardModel(); + } + } +?> diff --git a/controllers/admin/MenuUpdateController.php b/controllers/admin/MenuUpdateController.php index aae6c93..d9b1073 100644 --- a/controllers/admin/MenuUpdateController.php +++ b/controllers/admin/MenuUpdateController.php @@ -1,7 +1,6 @@ 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); + } + + + } } ?> \ No newline at end of file diff --git a/controllers/store/GrnController.php b/controllers/store/GrnController.php index 0127ccf..da46572 100644 --- a/controllers/store/GrnController.php +++ b/controllers/store/GrnController.php @@ -1,7 +1,6 @@ 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: @@ -51,4 +55,4 @@ function submitLogin($userid, $password) $this->triggerError('Login Failed!'); } } -} +} \ No newline at end of file diff --git a/core/Controller.php b/core/Controller.php index bba2913..41df3e6 100644 --- a/core/Controller.php +++ b/core/Controller.php @@ -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) { @@ -31,4 +36,4 @@ public function parseParams($params) } -} +} \ No newline at end of file diff --git a/css/managestaffdetailsStyles.css b/css/managestaffdetailsStyles.css deleted file mode 100644 index bd0d5ef..0000000 --- a/css/managestaffdetailsStyles.css +++ /dev/null @@ -1,15 +0,0 @@ -body{ - margin:0; - padding:0; - background-size:cover; - background-position:center; -} - -#btn{ - padding: 10px 25px; - background-color: #ff4747; - color:#5e0000; - border: 0px; - border-radius: 5px; - cursor: pointer; -} diff --git a/css/staffManage.css b/css/staffManage.css new file mode 100644 index 0000000..b9b0572 --- /dev/null +++ b/css/staffManage.css @@ -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; +} \ No newline at end of file diff --git a/models/admin/AdminDashboardModel.php b/models/admin/AdminDashboardModel.php new file mode 100644 index 0000000..ba61f25 --- /dev/null +++ b/models/admin/AdminDashboardModel.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/models/admin/DashBoardModel.php b/models/admin/DashBoardModel.php new file mode 100644 index 0000000..88bd0ab --- /dev/null +++ b/models/admin/DashBoardModel.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/router.php b/router.php index dea5aff..3340125 100644 --- a/router.php +++ b/router.php @@ -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'; @@ -141,8 +140,6 @@ case '/staff/login' : require($staffLogin); break; - case '/staff/details' : - require($staffDetails); case '/api/v1/review' : require($review); break; diff --git a/views/admin/dashboard.php b/views/admin/dashboard.php index 6a1eb0b..f9d0648 100755 --- a/views/admin/dashboard.php +++ b/views/admin/dashboard.php @@ -1,123 +1,174 @@ +logoutstaffMem(); +} +?> - - - - - - - - Admin Dashboard - - + + + + + + + + + + Admin Dashboard + + + + + +
+ -
-

Ongoing Orders

- - - - - - - - - - - - - - - - - - - - - - - - - - -
IDCustomerItemsPriceStatus
1001Moda ThilinaCoca ColaLKR 230.00Ongoing
1001Moda NuwanmaliCoca ColaLKR 230.00Ongoing
-
+
+

Ongoing Orders

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
IDCustomerItemsPriceStatus
1001ThilinaCoca ColaLKR 230.00Ongoing
1001NuwanmaliCoca ColaLKR 230.00Ongoing
+
-
-

Inventory Items

- - - - - - - - - - - - - - - - - - - - - - - - - - -
IDCustomerItemsPriceStatus
1001Moda HasaCoca ColaLKR 230.00Ongoing
1001Moda AmodCoca ColaLKR 230.00Ongoing
-
- - +
+

Inventory Items

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
IDCustomerItemsPriceStatus
1001HasaCoca ColaLKR 230.00Ongoing
1001AmodCoca ColaLKR 230.00Ongoing
+
+ + + \ No newline at end of file diff --git a/views/admin/managestaffdetails.php b/views/admin/managestaffdetails.php deleted file mode 100644 index 5802aca..0000000 --- a/views/admin/managestaffdetails.php +++ /dev/null @@ -1,74 +0,0 @@ -saveData($staffid, $firstname, $lastname, $contactno, $email, $roleid, $password); -//} - - -?> - - - - - - - - - - - - - - - - Manage Staff Details - - - - - - - - - - - - - - - - - - - diff --git a/views/admin/menuupdate.php b/views/admin/menuupdate.php index c6e589a..b4ebcc9 100644 --- a/views/admin/menuupdate.php +++ b/views/admin/menuupdate.php @@ -1,6 +1,15 @@ logoutstaffMem(); + } ?> @@ -19,40 +28,57 @@ -