From e8a03d8041d5bf4c3180a34ffe0b7322cd35a5c4 Mon Sep 17 00:00:00 2001
From: "fariz.tumbuan" <13515050@std.stei.itb.ac.id>
Date: Sat, 7 Oct 2017 09:12:10 +0800
Subject: [PATCH] hide button sudah berfungsi di prev order dan driver history

---
 css/history.css                 | 12 +++++++-----
 history/driver_history.html     |  0
 history/driver_history.php      | 11 +++++++----
 history/hide_history.js         |  4 ++++
 history/history.html            |  0
 history/order_history.html      |  0
 history/transaction_history.php |  8 +++++++-
 7 files changed, 25 insertions(+), 10 deletions(-)
 delete mode 100755 history/driver_history.html
 create mode 100644 history/hide_history.js
 delete mode 100755 history/history.html
 delete mode 100755 history/order_history.html

diff --git a/css/history.css b/css/history.css
index 62d0ac3b..dd3da3a4 100755
--- a/css/history.css
+++ b/css/history.css
@@ -1,7 +1,6 @@
 .history_container {
     margin-top: 10%;
     height: 79%;
-    border: 1px solid red; /*OJO LALI HAPUS IKI*/
 }
 
 .history_container .subheader {
@@ -31,7 +30,6 @@
     font-family: calibri;
 
 	position: relative;;
-	border: 0.5px solid black;
 	display: block;
 
 	text-decoration: none;
@@ -48,9 +46,7 @@
 
 table.history_table {
 	margin-top: 5px;
-	border: 1px solid blue; /*OJO LALI HAPUS IKI*/
 	width: 100%;
-	border: 1px solid purple;
     padding: 0;
     border-collapse: collapse;
 }
@@ -89,7 +85,6 @@ p.history_comment {
 }
 
 table.history_table th, td {
-	border: 1px solid purple;
     padding: 5px;
     border-collapse: collapse;
 }
@@ -105,4 +100,11 @@ img.history_pict {
     display: inline;
     margin: 0;
     
+}
+
+.hide_hist_button {
+	margin: 0;
+	color: white;
+	background-color: red;
+	font-size: 9px;
 }
\ No newline at end of file
diff --git a/history/driver_history.html b/history/driver_history.html
deleted file mode 100755
index e69de29b..00000000
diff --git a/history/driver_history.php b/history/driver_history.php
index d1e4a056..3b724f75 100644
--- a/history/driver_history.php
+++ b/history/driver_history.php
@@ -64,14 +64,15 @@
                                     echo
                                         "<tr>
                                             <td>
-                                                <img class='history_pict' src='../profile/getProfilePict.php?id=".$row['cust_id']."'
+                                                <img class='history_pict' src='../profile/getProfilePict.php?id=".$row['cust_id']."'>
+                                                <button class='hide_hist_button' type='button' value='hide' onclick='hide_row(this)'>Hide</button>
                                             </td>
                                             <td>
                                                 <p class='history_date'>".$row['date']."</p>
                                                 <p class='history_username'>".$driver_name."</p>
                                                 <p class='history_loc'>".$row['pick_city']." - ".$row['dest_city']."</p>
-                                                <p class='history_rating'>rating ".$row['score']."</p>
-                                                <p class='history_comment'>You commented:</p>
+                                                <p class='history_rating'>gave ".$row['score']." stars for this order</p>
+                                                <p class='history_comment'>and left comment:</p>
                                                 <p class='history_comment' style='margin-left: 30px;'>".$row['comment']."</p>
                                             </td>
                                         </tr>";
@@ -85,4 +86,6 @@
         </div>
 	</div>
 </body>
-</html>
\ No newline at end of file
+</html>
+
+<script type="text/javascript" src="hide_history.js"></script>
\ No newline at end of file
diff --git a/history/hide_history.js b/history/hide_history.js
new file mode 100644
index 00000000..13ad2f0e
--- /dev/null
+++ b/history/hide_history.js
@@ -0,0 +1,4 @@
+function hide_row(o) {
+	var p = o.parentNode.parentNode;
+	p.parentNode.removeChild(p);
+}
\ No newline at end of file
diff --git a/history/history.html b/history/history.html
deleted file mode 100755
index e69de29b..00000000
diff --git a/history/order_history.html b/history/order_history.html
deleted file mode 100755
index e69de29b..00000000
diff --git a/history/transaction_history.php b/history/transaction_history.php
index 9be4a6d8..17e99d6b 100644
--- a/history/transaction_history.php
+++ b/history/transaction_history.php
@@ -5,6 +5,9 @@
 	<link rel="stylesheet" type="text/css" href="../css/default_style.css">
     <link rel="stylesheet" type="text/css" href="../css/history.css">
     <link rel="stylesheet" type="text/css" href="../css/header.css">
+    <script type="text/javascript" src="hide_history.js">
+    </script>
+}
 </head>
 <body>
 	<div class="frame">
@@ -63,7 +66,8 @@
 		                            echo
 		                            	"<tr>
 		                            		<td>
-		                            			<img class='history_pict' src='../profile/getProfilePict.php?id=".$row['driver_id']."'
+		                            			<img class='history_pict' src='../profile/getProfilePict.php?id=".$row['driver_id']."'>
+		                            			<button class='hide_hist_button' type='button' value='hide' onclick='hide_row(this)'>Hide</button>
 		                            		</td>
 		                            		<td>
 		                            			<p class='history_date'>".$row['date']."</p>
@@ -85,3 +89,5 @@
 	</div>
 </body>
 </html>
+
+<script type="text/javascript" src="hide_history.js"></script>
\ No newline at end of file
-- 
GitLab