From 98b4b8f217da9188ade3a09e1f6fa13d8a20464f Mon Sep 17 00:00:00 2001
From: ayamberkakienam <zackhardyz@gmail.com>
Date: Sat, 7 Oct 2017 20:31:21 +0700
Subject: [PATCH] Fix update total score and votes

---
 order/order_handler.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/order/order_handler.php b/order/order_handler.php
index b676fbd7..becc1c26 100644
--- a/order/order_handler.php
+++ b/order/order_handler.php
@@ -13,6 +13,11 @@
 		INSERT INTO `order`(dest_city, pick_city, score, comment, driver_id, cust_id, date)
 		VALUES ('".$dest_city."', '".$pick_city."', '".$score."', '".$comment."', '".$driver_id."', '".$cust_id."', '".$date."')
 		") or die(mysqli_error($con));
+	$modify1_driver_query = mysqli_query($con,"
+		UPDATE `driver`
+		SET votes = votes + 1, total_score = total_score + $score
+		WHERE driver_id = '$driver_id'
+		") or die(mysqli_error($con));
 
 	mysqli_close($con);
 	
-- 
GitLab