From de133e5a06a6367e0492e2c2a892cf60347ed358 Mon Sep 17 00:00:00 2001 From: "fariz.tumbuan" <13515050@std.stei.itb.ac.id> Date: Sat, 7 Oct 2017 10:33:02 +0800 Subject: [PATCH] Ngeformat rating: di transaction history pakai jumlah bintang dan di driver history pakai integer oranya dengan spacing khusus --- css/history.css | 19 +++++++++++++++---- history/driver_history.php | 6 ++++-- history/transaction_history.php | 12 ++++++++++-- order/order.php | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/css/history.css b/css/history.css index dd3da3a4..f54827c6 100755 --- a/css/history.css +++ b/css/history.css @@ -52,7 +52,7 @@ table.history_table { } table.history_table p { - margin: 0; + margin: 5px 0; padding: 0; font-style: "Lucida Console", Monaco, monospace; } @@ -85,11 +85,11 @@ p.history_comment { } table.history_table th, td { - padding: 5px; + padding: 0 5px; border-collapse: collapse; } -p.history_table td { +table.history_table tr td.order_data { vertical-align: top; } @@ -102,9 +102,20 @@ img.history_pict { } -.hide_hist_button { +button.hide_hist_button { margin: 0; color: white; background-color: red; font-size: 9px; + margin-bottom: 45px; +} + +.checked { + color:orange +} + +.yellow_score { + font-size: 20px; + color: orange; + vertical-align: middle; } \ No newline at end of file diff --git a/history/driver_history.php b/history/driver_history.php index f9789aab..16f0e00a 100644 --- a/history/driver_history.php +++ b/history/driver_history.php @@ -64,17 +64,19 @@ $driver_query=mysqli_query($con,"SELECT username FROM user WHERE user_id='".$row['cust_id']."'") or die(mysqli_error()); $driver_row=mysqli_fetch_assoc($driver_query); $driver_name=$driver_row['username']; + $given_score=(int)$row['score']; + echo "<tr> <td> <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> + <td class='order_data'> <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'>gave ".$row['score']." stars for this order</p> + <p class='history_rating'>gave <span class='yellow_score'>  ".$given_score." </span> 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> diff --git a/history/transaction_history.php b/history/transaction_history.php index 789778ff..068d2cea 100644 --- a/history/transaction_history.php +++ b/history/transaction_history.php @@ -2,6 +2,7 @@ <html> <head> <title>transaction history</title> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <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"> @@ -72,11 +73,18 @@ <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> + <td class='order_data'> <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_rating'>You rated: "; + + for ($i = 0; $i < $row['score']; $i++) { + echo "<span class='fa fa-star checked'></span>"; + } + + echo + "</p> <p class='history_comment'>You commented:</p> <p class='history_comment' style='margin-left: 30px;'>".$row['comment']."</p> </td> diff --git a/order/order.php b/order/order.php index dd216505..c6fd2793 100644 --- a/order/order.php +++ b/order/order.php @@ -5,6 +5,7 @@ <link rel="stylesheet" type="text/css" href="../css/default_style.css"> <link rel="stylesheet" type="text/css" href="../css/order.css"> <link rel="stylesheet" type="text/css" href="../css/header.css"> + </head> <body> <div class="frame"> -- GitLab