Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/JellyAB/Cafe99
Browse files Browse the repository at this point in the history
  • Loading branch information
espurrr committed Mar 31, 2021
2 parents 5d5d366 + 83c7ef6 commit c4303c3
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 38 deletions.
2 changes: 1 addition & 1 deletion application/controllers/cashier_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function completeOrder(){
if($cart_data['status'] === "success"){

$data = [
'Order_Date_Time' => date($cart_data['data']->Service_date ." ". $cart_data['data']->Service_time), //combined serve date and time
'Order_Date_Time' => date("Y-m-d H:i:s"), //combined serve date and time
'Item_count' => $cart_data['data']->Item_count,
'Total_price' => $cart_data['data']->Sub_total + $cart_data['data']->Sub_total*0.05, //including service charge, disregarded discounts here...
'Service_charge' => $cart_data['data']->Sub_total*0.05, //service charge is 5%
Expand Down
8 changes: 6 additions & 2 deletions application/controllers/rm_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public function createSubmit(){
$Ann_title = $this->post('Announcement_title');
// $Ann_date = $this->post('Announcement_date');
// $Ann_time = $this->post('Announcement_time');
$Ann_date = date("Y-d-m");
date_default_timezone_set('Asia/Colombo');
$Ann_date = date("Y-m-d");
$Ann_time = date("H:i:s");
$content = $this->post('Content');
$Ann_towhom=$_POST['To_whom'];
Expand Down Expand Up @@ -132,7 +133,8 @@ public function newsfeed_update_save(){
$Ann_title = $this->post('Announcement_title');
// $Ann_date = $this->post('Announcement_date');
//$Ann_time = $this->post('Announcement_time');
$Ann_date = date("Y-d-m");
date_default_timezone_set('Asia/Colombo');
$Ann_date = date("Y-m-d");
$Ann_time = date("H:i:s");
$content = $this->post('Content');
// $Ann_towhom = $this->post('To_whom');
Expand Down Expand Up @@ -593,6 +595,7 @@ public function addFooditem(){
}

public function createFoodItem(){
$x=$this->get_session('user_id');
// echo $_POST['Food_name'];
// echo $_POST['Description'];
// echo $_POST['Unit_Price'];
Expand Down Expand Up @@ -622,6 +625,7 @@ public function createFoodItem(){
];

if($this->model->addFoodItem($data)){
$this->informational("New fooditem,$Food_name:unit price is $Unit_Price create by $x");
$this->set_flash("fooditemSuccess", "Fooditem added successfully");
//$this->fooditem();
redirect("rm_controller/fooditem");
Expand Down
10 changes: 10 additions & 0 deletions application/logs/2021-03-31.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
2021-03-31 20:09:31 localhost/cafe99/account_controller/loginSubmit session opened for user 200 3 INFORMATIONAL
2021-03-31 20:58:26 localhost/cafe99/account_controller/loginSubmit session opened for user 202 3 INFORMATIONAL
2021-03-31 20:58:53 localhost/cafe99/km_controller/updateOrderStatus order#24 pickup order email notif is sent successfully 3 INFORMATIONAL
2021-03-31 21:00:33 localhost/cafe99/account_controller/loginSubmit session opened for user 198 3 INFORMATIONAL
2021-03-31 21:00:43 localhost/cafe99/account_controller/loginSubmit session opened for user 202 3 INFORMATIONAL
2021-03-31 21:03:16 localhost/cafe99/account_controller/loginSubmit session opened for user 200 3 INFORMATIONAL
2021-03-31 21:03:39 localhost/cafe99/account_controller/loginSubmit session opened for user 202 3 INFORMATIONAL
2021-03-31 22:46:19 localhost/cafe99/km_controller/updateOrderStatus order#24 pickup order email notif is sent successfully 3 INFORMATIONAL
2021-03-31 23:04:11 localhost/cafe99/account_controller/loginSubmit session opened for user 202 3 INFORMATIONAL
2021-03-31 23:56:31 localhost/cafe99/account_controller/loginSubmit session opened for user 202 3 INFORMATIONAL
30 changes: 15 additions & 15 deletions application/models/cashier_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,24 @@ public function get_cart_items($cart_id){
}
}

public function getQtywithItemCount_reorder($order_id){
// public function getQtywithItemCount_reorder($order_id){

$query =
"SELECT order_item.Quantity AS Quantity , fooditem.Current_count AS Current_count
FROM order_item
INNER JOIN fooditem ON order_item.Food_ID = fooditem.Food_ID
WHERE order_item.Order_ID='".$order_id."' ";
// $query =
// "SELECT order_item.Quantity AS Quantity , fooditem.Current_count AS Current_count
// FROM order_item
// INNER JOIN fooditem ON order_item.Food_ID = fooditem.Food_ID
// WHERE order_item.Order_ID='".$order_id."' ";

$result =$this->Query($query, $options = []);
// $result =$this->Query($query, $options = []);

if($this->Count() > 0){
$order_items = $this->AllRecords();
//print_r($order_items);
return ['status'=>'success', 'data'=>$order_items];
}else{
return "order_items_not_found";
}
}
// if($this->Count() > 0){
// $order_items = $this->AllRecords();
// //print_r($order_items);
// return ['status'=>'success', 'data'=>$order_items];
// }else{
// return "order_items_not_found";
// }
// }

public function get_cart_data($cart_id){

Expand Down
2 changes: 1 addition & 1 deletion application/models/dp_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getAnnouncement(){
$announcement = $this->AllRecords();
//print_r($announcement);
if($announcement){
return ['status'=>'success', 'data'=>$announcement];
return ['status'=>'success','data'=>array_reverse($announcement, true)];
}else{
return "Announcement_not_retrieved";
}
Expand Down
2 changes: 1 addition & 1 deletion application/models/rm_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getAnnouncement(){
$announcement = $this->AllRecords();
//print_r($announcement);
if($announcement){
return ['status'=>'success', 'data'=>$announcement];
return ['status'=>'success', 'data'=>array_reverse($announcement, true)];
}else{
return "Announcement_not_retrieved";
}
Expand Down
2 changes: 1 addition & 1 deletion application/views/cashier/orderfood/cashier-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class="delete" onclick="onclickDeleteCartitem(<?php echo $row->CartItem_ID ?>)"

</div><br><br>
<div class="total"><b>Total: LKR <?php echo number_format($this->get_session('cart_sub_total'),2,'.', ','); ?></b></div><br>
<input type="submit" class="checkout-button" value="COMPLETE ORDER">
<input type="submit" class="checkout-button" value="COMPLETE ORDER">

<?php echo form_close();?>
</div>
Expand Down
6 changes: 3 additions & 3 deletions application/views/kitchenmanager/foodmenu/foodmenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
<?php echo form_open("km_controller/updateCurrentCount/".$row->Food_ID."/".$category->Category_name, "POST");?>
<label for="quantity">Count :</label>
<input type="number" id="quantity" name="quantity" value=<?php echo $row->Current_count;?> min="1" max="1000">
<!-- <input type="submit" value='<i class="fas fa-check"></i>'> -->
<button type="submit" id="count_submit"><i class="fas fa-check"></i></button>
<input type="submit" value="submit">
<!-- <button type="submit" id="count_submit"><i class="fas fa-check"></i></button> -->
<?php echo form_close();?>
</div>

Expand Down Expand Up @@ -123,7 +123,7 @@
<?php echo form_open("km_controller/updateCurrentCount/".$row->Food_ID."/".$category->Category_name, "POST");?>
<label for="quantity">Count :</label>
<input type="number" id="quantity" name="quantity" value=<?php echo $row->Current_count;?> min="1" max="1000">
<input type="submit">
<input type="submit" value="submit">
<?php echo form_close();?>
</div>

Expand Down
18 changes: 10 additions & 8 deletions application/views/kitchenmanager/orders/orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<?php if($order_status[$order_id] == "Onqueue" || $order_status[$order_id] == "onqueue"):?>

<tr>
<td><?php echo $order_id ?></td>
<td><?php echo $order_id.str_repeat('&nbsp;', 3)."(".$order_types[$order_id].")" ?></td>
<td ><div class="cell-desc"><?php echo $values ?></div></td>
<td>
<div class="btn-container">
Expand Down Expand Up @@ -144,7 +144,7 @@
<?php if($order_status[$order_id] == "Processing" || $order_status[$order_id] == "processing"):?>

<tr>
<td><?php echo $order_id ?></td>
<td><?php echo $order_id.str_repeat('&nbsp;', 3)."(".$order_types[$order_id].")" ?></td>
<td ><div class="cell-desc"><?php echo $values ?></div></td>
<td>
<div class="btn-container">
Expand Down Expand Up @@ -181,11 +181,13 @@
<tr>
<td>
<?php
if($order_types[$order_id] == "delivery"){
echo $order_id .str_repeat('&nbsp;', 3)."(Delivery)";
}else{
echo $order_id;
}
// if($order_types[$order_id] == "delivery"){
// echo $order_id .str_repeat('&nbsp;', 3)."(Delivery)";
// }else{
// echo $order_id;
// }
echo $order_id.str_repeat('&nbsp;', 3)."(".$order_types[$order_id].")"

?>
</td>
<td ><div class="cell-desc"><?php echo $values ?></div></td>
Expand Down Expand Up @@ -235,7 +237,7 @@
<?php if($order_status[$order_id] == "Dispatched" || $order_status[$order_id] == "dispatched"):?>

<tr>
<td><?php echo $order_id ?></td>
<td><?php echo $order_id.str_repeat('&nbsp;', 3)."(".$order_types[$order_id].")" ?></td>
<td ><div class="cell-desc"><?php echo $values ?></div></td>
<td>
<div class="btn-container">
Expand Down
2 changes: 1 addition & 1 deletion application/views/restaurantmanager/RMnewsfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<?php echo link_css("css/modal/delete_modal.css?ts=<?=time()?>"); ?>
<?php echo link_css("css/footer_3.css?ts=<?=time()?>"); ?>

<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions application/views/restaurantmanager/analytics/multichart.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
$handle3->execute();
$result3 = $handle3->fetchAll(\PDO::FETCH_OBJ);

$handle4 = $link->prepare('select Order_ID,sum(case when Order_is_for_me="1" then 1 else 0 end) AS App,sum(case when Order_is_for_me="0" then 1 else 0 end) AS WalkingCustomer From orders');
//select Order_ID,sum(case when Order_is_for_me="1" then 1 else 0 end) AS App,sum(case when Order_is_for_me="0" then 1 else 0 end) AS WalkingCustomer From orders where Order_Date_Time=CURRENT_DATE
$handle4 = $link->prepare('select Order_ID,sum(case when isCashier="0" then 1 else 0 end) AS App,sum(case when isCashier="1" then 1 else 0 end) AS WalkingCustomer From orders');
//select Order_ID,sum(case when isCashier="0" then 1 else 0 end) AS App,sum(case when isCashier="1" then 1 else 0 end) AS WalkingCustomer From orders where Order_Date_Time=CURRENT_DATE
$handle4->execute();
$result4 = $handle4->fetchAll(\PDO::FETCH_OBJ);

Expand Down
2 changes: 1 addition & 1 deletion application/views/restaurantmanager/orders/RM.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<td><?php echo $row->Special_notes ?></td>
<td><?php echo $row->Payment_method ?></td>
<td><?php echo $row->Order_type ?></td>
<?php if($row->Order_type="delivery"){?>
<?php if($row->Order_type=="delivery"){?>
<td><?php echo $row->Delivery_Dispatch_DateTime ?></td>
<?php } else{ ?>
<td><?php echo $row->Kitchen_Dispatch_DateTime?></td>
Expand Down
5 changes: 4 additions & 1 deletion public/css/cashier/cashier_cart.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,20 @@ body {
.cart-container .summary-container .summary-title {
font-weight: 600;
font-size: 20px;
margin-bottom: 20px;

}
.cart-container .summary-container .total {
/* border-bottom: 1px solid #ccc; */
font-weight: 500;
margin-top: 20px;
}
.checkout-button {
background-color: var(--buy-color);
color: #fff;
font-size: 14px;
font-weight: 600;
width: 80%;
width: 90%;
height: 50px;
margin: 12% auto;
border: 1px solid #ccc;
Expand Down
2 changes: 1 addition & 1 deletion public/css/kitchen-manager/foodmenu/foodmenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
.grid article .quantity input[type=number]{
height: 30px;
padding-left: 10px;
width: 60px;
width: 50px;
border: 1px solid #999;
}

Expand Down

0 comments on commit c4303c3

Please sign in to comment.