├── .DS_Store ├── .vscode └── settings.json ├── NewbornOutletImages ├── account_one.png ├── account_two.png ├── customers.png ├── dashboard.png ├── login.png ├── reports.png ├── sales.png └── suppliers.png ├── README.md ├── _DS_Store ├── account.php ├── css └── custom.css ├── customers.php ├── dashboard.php ├── database └── connect.php ├── images ├── baby-background.jpg └── newbornoutletlogo.png ├── index.php ├── inventory.php ├── inventorytest.php ├── js ├── custom.js ├── loadNavBar.js ├── reload.js ├── showAdminTools.js ├── showAllCustomers.js ├── showAllSales.js ├── showAllSuppliers.js ├── showCustomer.js ├── showEmployee.js ├── showEmployeeSales.js ├── showProduct.js ├── showProducts.js ├── showSuppliers.js └── showTriggers.js ├── logout.php ├── navBar.html ├── sales.php ├── salesReports.php └── suppliers.php /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/.DS_Store -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | } -------------------------------------------------------------------------------- /NewbornOutletImages/account_one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/account_one.png -------------------------------------------------------------------------------- /NewbornOutletImages/account_two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/account_two.png -------------------------------------------------------------------------------- /NewbornOutletImages/customers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/customers.png -------------------------------------------------------------------------------- /NewbornOutletImages/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/dashboard.png -------------------------------------------------------------------------------- /NewbornOutletImages/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/login.png -------------------------------------------------------------------------------- /NewbornOutletImages/reports.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/reports.png -------------------------------------------------------------------------------- /NewbornOutletImages/sales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/sales.png -------------------------------------------------------------------------------- /NewbornOutletImages/suppliers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/NewbornOutletImages/suppliers.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NewBorn Outlet 2 | A simple and easy to use point of sales system. Built without any frameworks, only using HTML, CSS, JavaScript, PHP, and MySQL. 3 | 4 | # Features 5 | 11 | 12 | # Screenshots 13 | 14 | Smiley face 15 | 16 | # Dashboard 17 | 18 | Smiley face 19 | 20 | # Reports 21 | 22 | Smiley face 23 | 24 | # Accounts 25 | 26 | Smiley face 27 | -------------------------------------------------------------------------------- /_DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/_DS_Store -------------------------------------------------------------------------------- /account.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | 10 | 11 | Employee Account 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 | 43 |
44 | 45 |

Personal Information

46 |
47 |
48 |
49 | 140 |
141 |
142 | 143 |
144 | 145 | 366 | 367 |
368 | 369 | 488 | 489 | query("SELECT EmployeeID FROM POSDB.Employee WHERE SupervisorID=$employeeID"); 493 | $row = $sql->fetch_array(MYSQLI_ASSOC); 494 | 495 | if(is_null($row['EmployeeID'])) 496 | { 497 | echo ""; 498 | } else { 499 | echo ""; 500 | } 501 | ?> 502 | 503 | 504 | -------------------------------------------------------------------------------- /css/custom.css: -------------------------------------------------------------------------------- 1 | h1,h2,h3,h4,h5,h6 { 2 | font-family: 'Raleway'; 3 | } 4 | 5 | body { 6 | font-family: 'Open Sans'; 7 | } 8 | 9 | 10 | .nav-tabs li a { 11 | font-family: 'Raleway', sans-serif; 12 | } 13 | 14 | .panel h2, .panel .form-group { 15 | padding-left:20px !important; 16 | } 17 | 18 | /* navbar */ 19 | .navbar-default { 20 | background-color: #5eb250; 21 | border-color: #5eb250; 22 | } 23 | /* Title */ 24 | .navbar-default .navbar-brand { 25 | color: #FFFFFF; 26 | font-family: 'Pacifico'; 27 | font-size:30px; 28 | } 29 | .navbar-default .navbar-brand:hover, 30 | .navbar-default .navbar-brand:focus { 31 | color: #fff; 32 | } 33 | /* Link */ 34 | .navbar-default .navbar-nav > li > a { 35 | color: #fff; 36 | font-family: 'Raleway', sans-serif; 37 | text-transform:uppercase; 38 | font-size:12px; 39 | font-weight:400; 40 | } 41 | .navbar-default .navbar-nav > li > a:hover, 42 | .navbar-default .navbar-nav > li > a:focus { 43 | color: #fff; 44 | font-weight:600; 45 | } 46 | .navbar-default .navbar-nav > .active > a, 47 | .navbar-default .navbar-nav > .active > a:hover, 48 | .navbar-default .navbar-nav > .active > a:focus { 49 | color: #fff; 50 | background-color: rgba(0,0,0,.1); 51 | font-weight:600; 52 | } 53 | .navbar-default .navbar-nav > .open > a, 54 | .navbar-default .navbar-nav > .open > a:hover, 55 | .navbar-default .navbar-nav > .open > a:focus { 56 | color: #fff; 57 | background-color: rgba(0,0,0,.1); 58 | } 59 | 60 | /* Mobile version */ 61 | .navbar-default .navbar-toggle { 62 | border-color: rgba(0,0,0,.1); 63 | background-color: #5eb250; 64 | } 65 | .navbar-default .navbar-toggle:hover, 66 | .navbar-default .navbar-toggle:focus { 67 | background-color: #5eb250; 68 | } 69 | .navbar-default .navbar-toggle .icon-bar { 70 | background-color: #FFF; 71 | } 72 | 73 | .ct-label { 74 | font-size: 1.4rem; 75 | color: #000000; 76 | } 77 | .ct-bar { 78 | stroke-width: 30px; 79 | } 80 | @media (max-width: 767px) { 81 | .navbar-default .navbar-nav .open .dropdown-menu > li > a { 82 | color: #777; 83 | } 84 | .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, 85 | .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { 86 | color: #333; 87 | } 88 | } -------------------------------------------------------------------------------- /customers.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | 10 | 11 | Customers 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
43 | 44 |
45 |

Customer Details

46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 |
58 |

Add a Customer:

59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 |
75 | 76 |
77 | 78 |
79 | 80 |
81 | query("INSERT INTO POSDB.Customer (`CustomerID`, `LastName`, `FirstName`, `Address`, `City`, `PostalCode`, `Country`, `Phone`, `Email`, `Membership`) VALUES (0, '$LName', '$FName','$address', '$city', '$postalCode', '$country', '$phone', '$email', $membership)"); 95 | $results = mysql_query($create); 96 | 97 | echo ''; 98 | } 99 | ?> 100 |
101 | 102 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | query("SELECT * FROM POSDB.Customer"); 162 | if($counts = $query1->num_rows){ 163 | $rows1 = $query1->fetch_all(MYSQLI_ASSOC); 164 | foreach($rows1 as $row1){ 165 | echo''; 166 | echo''; 167 | echo''; 168 | echo''; 169 | echo''; 170 | echo''; 171 | echo''; 172 | echo''; 173 | echo''; 174 | echo''; 175 | echo''; 176 | echo''; 177 | } 178 | } 179 | ?> 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | showSearchedCustomer(); "; 206 | } 207 | $query1 = $db->query("SELECT * FROM POSDB.Customer WHERE FirstName LIKE '%$searchValue%' OR LastName LIKE '%$searchValue%'"); 208 | if($counts = $query1->num_rows){ 209 | $rows1 = $query1->fetch_all(MYSQLI_ASSOC); 210 | foreach($rows1 as $row1){ 211 | echo''; 212 | echo''; 213 | echo''; 214 | echo''; 215 | echo''; 216 | echo''; 217 | echo''; 218 | echo''; 219 | echo''; 220 | echo''; 221 | echo''; 222 | echo''; 223 | } 224 | } 225 | ?> 226 | 227 | 228 |
229 |
230 | 231 | 232 | -------------------------------------------------------------------------------- /dashboard.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | 10 | 11 | 12 | Dashboard 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 |

Welcome back,

36 | query("SELECT EmployeeID, FirstName, LastName FROM POSDB.Employee"); 40 | if($sql->num_rows){ 41 | $EmployeeLogins = $sql->fetch_all(MYSQLI_ASSOC); 42 | foreach($EmployeeLogins as $EInfo){ 43 | if ($EInfo['EmployeeID'] == $employeeID ) { 44 | $Name = $EInfo['FirstName']; 45 | $EmployeeIDSale = $EInfo['EmployeeID']; 46 | echo '

',$Name,'!

'; 47 | } 48 | } 49 | } 50 | ?> 51 |
52 |
53 |
54 |
55 | 56 | 57 |

query("SELECT SUM(SaleTotal) AS 'salesTotal' FROM POSDB.Sale WHERE EmployeeID = $EmployeeIDSale"); 59 | $rowz = $sql11->fetch_array(MYSQLI_ASSOC); 60 | echo round($rowz['salesTotal'], 2); 61 | ?>

62 |

Your Sales

63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | 71 | 72 |

$query("SELECT SUM(SaleTotal) AS 'sales_total' FROM POSDB.Sale"); 74 | $row = $sql->fetch_array(MYSQLI_ASSOC); 75 | echo round($row['sales_total'], 2); 76 | ?>

77 |

Total Sales

78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | 86 | 87 |

query("SELECT COUNT(*) AS 'members_total' FROM POSDB.Customer WHERE Membership='1'"); 89 | $row = $sql->fetch_array(MYSQLI_ASSOC); 90 | echo $row['members_total']; 91 | ?>

92 |

Club Members

93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |

Sales Register

101 |
102 |
103 | 104 |
105 | 106 |
107 | 108 | 109 | 133 | 134 | 135 | 136 |

Checkout Cart:

137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | query("SELECT ProductName, ProductID, ProductDetail.Description AS Descriptions, QtyInStock, UnitPrice 161 | FROM Product 162 | INNER JOIN ProductDetail ON Product.ProductDetailID = ProductDetail.ProductDetailID 163 | WHERE Product.ProductName = '$rows'"); 164 | if($count = $query->num_rows){ 165 | $rowss = $query->fetch_all(MYSQLI_ASSOC); 166 | foreach($rowss as $row){ 167 | array_push($_SESSION['cartz'], $row['ProductID']); 168 | echo''; 169 | echo''; 170 | echo''; 171 | echo''; 172 | echo''; 173 | echo''; 174 | } 175 | } 176 | } 177 | 178 | $eName = "1"; 179 | $cID = "1"; 180 | $listOfProducts = implode(',',$_SESSION['cart']); 181 | } 182 | ?> 183 | 184 |
Product NameDescriptionQty In StockPrice
', $row['ProductName'],'', $row['Descriptions'], ' ',$row['eLName'],'', $row['QtyInStock'], ' ',$row['cLName'], '', $row['UnitPrice'],'
185 | 186 | 187 |
188 |
189 | 190 |
191 |
192 | 193 | 194 |
195 | 196 |
197 | 198 | 204 | 205 | 206 | 230 | 231 | query("INSERT INTO POSDB.Sale (`SaleID`, `EmployeeID`, `CustomerID`, `ProductID`, `SaleDate`, `Qty`, `SaleTotal`) VALUES (0, $EmployeeIDSale, $customerID, $rowz, '2017-04-23', 5, 5)"); 238 | $delete =$db->query("UPDATE POSDB.Product SET Product.QtyInStock = 9 WHERE Product.ProductID = $rowz"); 239 | $results = exec($create, $delete); 240 | //$results = mysqli_multi_query($create, $delete); 241 | 242 | //$delete =$db->query("UPDATE POSDB.Product SET QtyInStock 9 WHERE ProductID = $rowz"); 243 | //$resultz = exec($delete); 244 | } 245 | } 246 | ?> 247 |
248 | 249 |

News:

250 |
    251 |
  • NewBorn Outlet is projected to hit its April sales goal 5 days early!

  • 252 |
  • Company picnic is this upcomming Saturday!

  • 253 |
  • All timesheets are due this 4/2 254 |

255 | 256 |
257 |
258 |
259 |
260 | 261 | 262 | -------------------------------------------------------------------------------- /database/connect.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/baby-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/images/baby-background.jpg -------------------------------------------------------------------------------- /images/newbornoutletlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/derreck503/PointOfSales/a3f688943273641be9366ffd1c79493703b24997/images/newbornoutletlogo.png -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | query("SELECT Username, Password, UserID FROM POSDB.Login"); 13 | if($sql->num_rows){ 14 | $Logins = $sql->fetch_all(MYSQLI_ASSOC); 15 | foreach($Logins as $Users){ 16 | if ($Users['Username'] == $username && $Users['Password'] == $password) { 17 | $_SESSION['Identifier'] = $Users['UserID']; 18 | header('Location: dashboard.php'); 19 | 20 | } 21 | } 22 | //echo "Invalid Username or Password"; 23 | echo'
'; 24 | echo '×Invalid Login. Please try again!
'; 25 | echo '
'; 26 | 27 | } 28 | 29 | 30 | } 31 | 32 | ?> 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Point of Sales 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 |
64 | 65 |


66 |

The leading point of sales system for a baby store.

67 | 68 |
69 | 70 | 71 | 97 |
98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /inventory.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | 8 | //echo "starting trigger test"; 9 | $sql7 = $db->query("SELECT Product.ProductName, Product.QtyInStock FROM POSDB.Product WHERE Product.QtyInStock < 10"); 10 | $rowd = $sql7->fetch_array(MYSQLI_ASSOC); 11 | foreach($rowd as $QtyInfo){ 12 | //echo "Low Inventory"; 13 | $item = $QtyInfo['ProductName']; 14 | $count++; 15 | } 16 | 17 | if ($count > 0) { 18 | echo'
'; 19 | echo '×Low Inventory!
'; 20 | echo '
'; 21 | } 22 | 23 | ?> 24 | 25 | 26 | 27 | 28 | 29 | 30 | Inventory 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | 64 | 80 | 81 | 82 | 83 |
84 |

Inventory Details

85 |
86 | 87 |
88 | 89 | 90 |
91 | 92 | 93 |
94 | 95 | 119 |
120 | 121 | 149 | query("UPDATE POSDB.Product SET QtyInStock = $updateAmount WHERE ProductID = $updateValue"); 157 | $result = mysql_query($update); 158 | //echo ''; 159 | //Need to refresh page to not show deleted value in dropdown menu anymore!!!!! 160 | //header("Refresh:0"); 161 | } 162 | ?> 163 |
164 | 165 | 201 |
202 | 203 |

Add a Product:

204 |
205 |

206 | 207 |
208 | 209 |
210 | 211 |
212 | 213 |
214 | 215 |
216 | 217 |
218 |
219 | 220 |

221 | query("INSERT INTO POSDB.Product (`ProductID`, `ProductName`, `SupplierID`, `ProductDetailID`, `Category`, `QtyInStock`, `UnitPrice`, `Status`) VALUES(0, '$PName', '$supplier', '$productDetail', '$category', '$quantity', '$unitPrice', 'Normal')"); 231 | 232 | $results = mysql_query($create); 233 | echo ''; 234 | } 235 | ?> 236 |
237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | query("SELECT Product.ProductID, Product.ProductName, Product.Status, Supplier.CompanyName AS Supplier, ProductDetail.Description AS Description, Product.Category, Product.QtyInStock, Product.UnitPrice 256 | FROM Product 257 | INNER JOIN Supplier ON Product.SupplierID = Supplier.SupplierID 258 | INNER JOIN ProductDetail ON Product.ProductDetailID = ProductDetail.ProductDetailID"); 259 | if($count = $query->num_rows){ 260 | $rows = $query->fetch_all(MYSQLI_ASSOC); 261 | foreach($rows as $row){ 262 | echo''; 263 | echo''; 264 | echo''; 265 | echo''; 266 | echo''; 267 | echo''; 268 | echo''; 269 | echo''; 270 | echo''; 271 | echo''; 272 | } 273 | } 274 | ?> 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | query("SELECT Product.ProductID, Product.ProductName, Product.Status , Supplier.CompanyName AS Supplier, ProductDetail.Description AS Description, Product.Category, Product.QtyInStock, Product.UnitPrice FROM Product INNER JOIN Supplier ON Product.SupplierID = Supplier.SupplierID INNER JOIN ProductDetail ON Product.ProductDetailID = ProductDetail.ProductDetailID WHERE Product.QtyInStock < 10"); 297 | if($count = $query->num_rows){ 298 | $rows = $query->fetch_all(MYSQLI_ASSOC); 299 | foreach($rows as $row){ 300 | echo''; 301 | echo''; 302 | echo''; 303 | echo''; 304 | echo''; 305 | echo''; 306 | echo''; 307 | echo''; 308 | echo''; 309 | echo''; 310 | } 311 | } 312 | ?> 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | showProduct(); "; 337 | } 338 | $query = $db->query("SELECT Product.ProductID, Product.ProductName, Product.Status, Supplier.CompanyName, ProductDetail.Description, Product.Category, Product.QtyInStock, Product.UnitPrice 339 | FROM Product 340 | INNER JOIN Supplier ON Product.SupplierID = Supplier.SupplierID 341 | INNER JOIN ProductDetail ON Product.ProductDetailID = ProductDetail.ProductDetailID 342 | WHERE Product.ProductID = $selection"); 343 | if($count = $query->num_rows){ 344 | $rows = $query->fetch_all(MYSQLI_ASSOC); 345 | foreach($rows as $row){ 346 | echo''; 347 | echo''; 348 | echo''; 349 | echo''; 350 | echo''; 351 | echo''; 352 | echo''; 353 | echo''; 354 | echo''; 355 | echo''; 356 | } 357 | } 358 | ?> 359 | 360 | 361 | 362 |
363 |
364 | 365 | 366 | 367 | -------------------------------------------------------------------------------- /inventorytest.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | //$row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | query("SELECT QtyInStock FROM POSDB.Product"); 12 | if($sql->num_rows){ 13 | echo "Executed sql query to get stock"; 14 | $InventoryPopup = $sql->fetch_all(MYSQLI_ASSOC); 15 | foreach($InventoryPopup as $Check){ 16 | echo "Checking inventory"; 17 | if ($Check['QtyInStock'] > 10) { 18 | echo "inventory is > 10"; 19 | $dummy = 0; 20 | } 21 | } 22 | 23 | $Warning = "The following products have low inventory levels. Please restock."; 24 | ?> 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Inventory 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | 65 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 |
109 |

Inventory Details

110 |
111 | 112 |
113 | 114 | 115 |
116 | 117 | 141 |
142 | 143 | 171 | query("UPDATE POSDB.Product SET QtyInStock = $updateAmount WHERE ProductID = $updateValue"); 179 | $result = mysql_query($update); 180 | //Need to refresh page to not show deleted value in dropdown menu anymore!!!!! 181 | //header("Refresh:0"); 182 | } 183 | ?> 184 |
185 | 186 | 221 |
222 | 223 |

Add a Product:

224 |
225 |

226 | 227 |
228 | 229 |
230 | 231 |
232 | 233 |
234 | 235 |
236 | 237 |
238 |
239 | 240 |

241 | query("INSERT INTO POSDB.Product (`ProductID`, `ProductName`, `SupplierID`, `ProductDetail`, `QtyInStock`, `UnitPrice`) VALUES(0, '$PName', '$supplier', '$productDetail', '$category', '$quantity', '$unitPrice')"); 251 | 252 | $results = mysql_query($create); 253 | } 254 | ?> 255 |
256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | query("SELECT Product.ProductID, Product.ProductName, Supplier.CompanyName AS Supplier, ProductDetail.Description AS Description, Product.Category, Product.QtyInStock, Product.UnitPrice 274 | FROM Product 275 | INNER JOIN Supplier ON Product.SupplierID = Supplier.SupplierID 276 | INNER JOIN ProductDetail ON Product.ProductDetailID = ProductDetail.ProductDetailID"); 277 | if($count = $query->num_rows){ 278 | $rows = $query->fetch_all(MYSQLI_ASSOC); 279 | foreach($rows as $row){ 280 | echo''; 281 | echo''; 282 | echo''; 283 | echo''; 284 | echo''; 285 | echo''; 286 | echo''; 287 | echo''; 288 | echo''; 289 | } 290 | } 291 | ?> 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | showProduct(); "; 315 | } 316 | $query = $db->query("SELECT Product.ProductID, Product.ProductName, Supplier.CompanyName, ProductDetail.Description, Product.Category, Product.QtyInStock, Product.UnitPrice 317 | FROM Product 318 | INNER JOIN Supplier ON Product.SupplierID = Supplier.SupplierID 319 | INNER JOIN ProductDetail ON Product.ProductDetailID = ProductDetail.ProductDetailID 320 | WHERE Product.ProductID = $selection"); 321 | if($count = $query->num_rows){ 322 | $rows = $query->fetch_all(MYSQLI_ASSOC); 323 | foreach($rows as $row){ 324 | echo''; 325 | echo''; 326 | echo''; 327 | echo''; 328 | echo''; 329 | echo''; 330 | echo''; 331 | echo''; 332 | echo''; 333 | } 334 | } 335 | ?> 336 | 337 | 338 | 339 |
340 |
341 | 342 | 343 | 344 | -------------------------------------------------------------------------------- /js/custom.js: -------------------------------------------------------------------------------- 1 | // Forces modal warnings to automatically popup on pageload. 2 | function modalPopup(){ 3 | $("#modalWarning").modal("show"); 4 | } 5 | jQuery(document).ready(function(){ 6 | modalPopup(); 7 | 8 | $( ".product" ).change(function() { 9 | $(".color").removeAttr("disabled"); 10 | }); 11 | $( ".color" ).change(function() { 12 | $(".size").removeAttr("disabled"); 13 | }); 14 | $( ".size" ).change(function() { 15 | $(".quantity").removeAttr("disabled"); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /js/loadNavBar.js: -------------------------------------------------------------------------------- 1 | /*Script to load navbar*/ 2 | function loadNavBar(){ 3 | $("#navigation-bar").load("navBar.html"); 4 | } 5 | jQuery(document).ready(function(){ 6 | loadNavBar(); 7 | }); -------------------------------------------------------------------------------- /js/reload.js: -------------------------------------------------------------------------------- 1 | function reloadPage(){ 2 | window.location.reload(); 3 | } -------------------------------------------------------------------------------- /js/showAdminTools.js: -------------------------------------------------------------------------------- 1 | function showAdminTools() { 2 | $('#admintools').show(); 3 | } 4 | function hideAdminTools() { 5 | $('#admintools').hide(); 6 | console.log("hiding"); 7 | } -------------------------------------------------------------------------------- /js/showAllCustomers.js: -------------------------------------------------------------------------------- 1 | function showAllCustomersTable(){ 2 | console.log("Show all customers function entered"); 3 | document.getElementById("showAllCustomerResults").style.display = "block"; 4 | document.getElementById("showCustomerResults").style.display = "none"; 5 | } -------------------------------------------------------------------------------- /js/showAllSales.js: -------------------------------------------------------------------------------- 1 | function showAll(){ 2 | console.log("Show all sales function entered"); 3 | document.getElementById("showAllSales").style.display = "block"; 4 | document.getElementById("showEmployeeSale").style.display = "none"; 5 | } -------------------------------------------------------------------------------- /js/showAllSuppliers.js: -------------------------------------------------------------------------------- 1 | function showAll() { 2 | console.log("Show All function entered"); 3 | document.getElementById("showAllSuppliers").style.display = "block"; 4 | document.getElementById("showSupplier").style.display = "none"; 5 | } -------------------------------------------------------------------------------- /js/showCustomer.js: -------------------------------------------------------------------------------- 1 | function showSearchedCustomer() { 2 | console.log("Show searched Customer function entered"); 3 | document.getElementById("showAllCustomerResults").style.display = "none"; 4 | document.getElementById("showCustomerResults").style.display = "block"; 5 | } -------------------------------------------------------------------------------- /js/showEmployee.js: -------------------------------------------------------------------------------- 1 | function showEmployee() { 2 | console.log("Show employee function entered"); 3 | document.getElementById("showEmployee").style.display = "block"; 4 | document.getElementById("updateButton").style.visibility = "visible"; 5 | } 6 | function showEmployeeDelete() { 7 | document.getElementById("showEmployeeDelete").style.display = "block"; 8 | document.getElementById("confirmDelete").removeAttribute("disabled"); 9 | } 10 | function disableConfirmButton() { 11 | document.getElementById("confirmDelete").setAttribute("disabled","disabled"); 12 | } 13 | function showAllEmployees() { 14 | document.getElementById("showAllEmployees").style.display = "block"; 15 | } 16 | function showAudit() { 17 | document.getElementById("showAuditDetails").style.display = "block"; 18 | } -------------------------------------------------------------------------------- /js/showEmployeeSales.js: -------------------------------------------------------------------------------- 1 | function employeeSales(){ 2 | console.log("Employee sales funciton entered"); 3 | document.getElementById("showAllSales").style.display = "none"; 4 | document.getElementById("showEmployeeSale").style.display = "block"; 5 | } -------------------------------------------------------------------------------- /js/showProduct.js: -------------------------------------------------------------------------------- 1 | function showProduct(){ 2 | console.log("Show product function entered"); 3 | document.getElementById("showAllProducts").style.display = "none"; 4 | document.getElementById("showAllTriggers").style.display = "none"; 5 | document.getElementById("showProduct").style.display = "block"; 6 | } -------------------------------------------------------------------------------- /js/showProducts.js: -------------------------------------------------------------------------------- 1 | function showAll(){ 2 | console.log("Entered show all function"); 3 | document.getElementById("showAllTriggers").style.display = "none"; 4 | document.getElementById("showProduct").style.display = "none"; 5 | document.getElementById("showAllProducts").style.display = "block"; 6 | } -------------------------------------------------------------------------------- /js/showSuppliers.js: -------------------------------------------------------------------------------- 1 | function showSupplier() { 2 | console.log("Show supplier function entered"); 3 | document.getElementById("showAllSuppliers").style.display = "none"; 4 | document.getElementById("showSupplier").style.display = "block"; 5 | } -------------------------------------------------------------------------------- /js/showTriggers.js: -------------------------------------------------------------------------------- 1 | function showAllTrigger() { 2 | console.log("Show triggers function entered"); 3 | document.getElementById("showAllProducts").style.display = "none"; 4 | document.getElementById("showProduct").style.display = "none"; 5 | document.getElementById("showAllTriggers").style.display = "block"; 6 | } -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | query("SELECT Username, Password FROM POSDB.Login"); 20 | if($sql->num_rows){ 21 | $Logins = $sql->fetch_all(MYSQLI_ASSOC); 22 | foreach($Logins as $Users){ 23 | if ($Users['Username'] == $username && $Users['Password'] == $password) { 24 | header('Location: dashboard.php'); 25 | } 26 | } 27 | echo "Invalid Username or Password"; 28 | 29 | } 30 | } 31 | 32 | ?> 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | Point of Sales 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
56 | 57 |
58 |

You have been logged out.

59 |
60 | 61 | 62 |
63 |
64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /navBar.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sales.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | 10 | 11 | Sales 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 |
34 |

Sales Details

35 |
36 | 37 |
38 | 39 | 40 |
41 | 42 | 66 |
67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | query("SELECT Sale.SaleID, Employee.EmployeeID, Customer.CustomerID, Product.ProductName, Sale.SaleDate, Sale.Qty, Sale.SaleTotal, Customer.FirstName as cFName, Customer.LastName as cLName, Employee.FirstName as eFName,Employee.LastName as eLName FROM Sale, Employee, Customer, Product WHERE Sale.EmployeeID = Employee.EmployeeID AND Sale.CustomerID = Customer.CustomerID AND Sale.ProductID = Product.ProductID ORDER BY Sale.SaleID DESC"); 87 | if($count = $query->num_rows){ 88 | $rows = $query->fetch_all(MYSQLI_ASSOC); 89 | foreach($rows as $row){ 90 | echo''; 91 | echo''; 92 | echo''; 93 | echo''; 94 | echo''; 95 | echo''; 96 | echo''; 97 | echo''; 98 | echo''; 99 | } 100 | } 101 | ?> 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | employeeSales(); "; 126 | } 127 | $query = $db->query("SELECT Sale.SaleID, Employee.FirstName AS eFName, Employee.LastName AS eLName, Customer.FirstName AS cFName, Customer.LastName AS cLName, Product.ProductName, Sale.SaleDate, Sale.Qty, Sale.SaleTotal 128 | FROM Sale 129 | INNER JOIN Employee ON Sale.EmployeeID = Employee.EmployeeID 130 | INNER JOIN Customer ON Sale.CustomerID = Customer.CustomerID 131 | INNER JOIN Product ON Sale.ProductID = Product.ProductID 132 | WHERE Sale.EmployeeID = $selection 133 | ORDER BY Sale.SaleDate DESC"); 134 | if($count = $query->num_rows){ 135 | $rows = $query->fetch_all(MYSQLI_ASSOC); 136 | foreach($rows as $row){ 137 | echo''; 138 | echo''; 139 | echo''; 140 | echo''; 141 | echo''; 142 | echo''; 143 | echo''; 144 | echo''; 145 | echo''; 146 | } 147 | } 148 | ?> 149 | 150 | 151 |
152 |
153 | 154 | 155 | -------------------------------------------------------------------------------- /salesReports.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | 10 | 11 | 12 | Account 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 |
34 | 35 | 41 | 42 | 43 |
44 | 45 |
46 |
47 |

Sales per Year

48 | 49 | 94 | 95 |
96 | 97 | 98 |
99 |
100 |
101 | 102 |
103 |
104 |

Product Sales

105 |
106 | 107 | 160 | 161 | 162 |
163 | Currently selected: ",$productMonth,".",$productYear,""; 172 | 173 | if($productMonth!="12") 174 | { 175 | $startDateProduct = "$productYear.$productMonth.01"; 176 | $temp = $productMonth+1; 177 | $endDateProduct = "$productYear.0$temp.01"; 178 | } 179 | else 180 | { 181 | $startDateProduct = "$productYear.$productMonth.01"; 182 | $temp = $productYear+1; 183 | $endDateProduct = "$productYear.01.01"; 184 | } 185 | 186 | $sql = $db->query("SELECT ProductName FROM POSDB.Product GROUP BY ProductName"); 187 | if($sql->num_rows){ 188 | $products = $sql->fetch_all(MYSQLI_ASSOC); 189 | } 190 | $productsArray = array(); 191 | $data = array(); 192 | foreach($products as $product){ 193 | $productTotalSales = 0; 194 | 195 | $sql = $db->query("SELECT ProductID FROM POSDB.Product WHERE ProductName='".$product['ProductName']."'"); 196 | $productIDs = $sql->fetch_all(MYSQLI_ASSOC); 197 | foreach($productIDs as $prID) 198 | { 199 | $sql = $db->query("SELECT SUM(SaleTotal) as sales FROM POSDB.Sale WHERE ProductID='".$prID['ProductID']."' AND SaleDate >= '".$startDateProduct."' AND SaleDate < '".$endDateProduct."'"); 200 | $row = $sql->fetch_array(MYSQLI_ASSOC); 201 | $productSale = $row['sales']; 202 | $productTotalSales = $productTotalSales + $productSale; 203 | } 204 | $tempArray = array($product['ProductName'],$productTotalSales); 205 | array_push($productsArray,$tempArray); 206 | } 207 | $result = $productsArray[0][1]; 208 | $index = 0; 209 | for($i=0;$i$result) 212 | { 213 | $result = $productsArray[$i][1]; 214 | $index = $i; 215 | } 216 | } 217 | echo "
Best Selling Product
",$productsArray[$index][0]," : ",'$',$productsArray[$index][1],"
"; 218 | echo ""; 219 | for($i=0;$i"; 222 | } 223 | echo "
ProductSales
",$productsArray[$i][0],"",'$',$productsArray[$i][1],"
"; 224 | 225 | ?> 226 |
227 |
228 | 229 |
230 |
231 |
232 | 233 |
234 | 235 | 236 | 237 | = '".$startDate."' AND SaleDate < '".$endDate."'"; 275 | $sql = $db->query($qry); 276 | $row = $sql->fetch_array(MYSQLI_ASSOC); 277 | $value = $row['sales_total']; 278 | if(is_null($value)) 279 | array_push($chartValues,0); 280 | else 281 | array_push($chartValues,$value); 282 | } 283 | ?> 284 | 313 | 314 | 315 | -------------------------------------------------------------------------------- /suppliers.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM POSDB.Employee WHERE EmployeeID=$employeeID"); 6 | $row = $sql->fetch_array(MYSQLI_ASSOC); 7 | ?> 8 | 9 | 10 | 11 | Suppliers Details 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 42 |
43 |
44 | 45 | 46 |
47 | 48 | 72 |
73 | 74 | 109 |
110 |

Add a Supplier:

111 | 112 |
113 |

114 | 115 |
116 | 117 |
118 | 119 |
120 | 121 |
122 | 123 |
124 | 125 |
126 | 127 |
128 | 129 |
130 | 131 |
132 | 133 |

134 | query("INSERT INTO POSDB.Supplier (`SupplierID`, `CompanyName`, `Address`, `City`, `State`, `PostalCode`, `Country`, `Phone`, `ReStockLevel`, `UnitCost`) VALUES(0, '$cName', '$address', '$city', '$state', '$postalCode', '$country', '$phone', $reStockLevel, $unitCost)"); 147 | 148 | $results = mysql_query($create); 149 | } 150 | ?> 151 |
152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | query("SELECT * FROM POSDB.Supplier"); 174 | if($count = $query->num_rows){ 175 | $rows = $query->fetch_all(MYSQLI_ASSOC); 176 | foreach($rows as $row){ 177 | echo''; 178 | echo''; 179 | echo''; 180 | echo''; 181 | echo''; 182 | echo''; 183 | echo''; 184 | echo''; 185 | echo''; 186 | echo''; 187 | echo''; 188 | echo''; 189 | } 190 | } 191 | ?> 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | showSupplier(); "; 218 | } 219 | $query = $db->query("SELECT * FROM POSDB.Supplier Where SupplierID = $selection"); 220 | if($count = $query->num_rows){ 221 | $rows = $query->fetch_all(MYSQLI_ASSOC); 222 | foreach($rows as $row){ 223 | echo''; 224 | echo''; 225 | echo''; 226 | echo''; 227 | echo''; 228 | echo''; 229 | echo''; 230 | echo''; 231 | echo''; 232 | echo''; 233 | echo''; 234 | } 235 | } 236 | ?> 237 | 238 | 239 |
240 |
241 | 242 | 243 | --------------------------------------------------------------------------------