Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // memulai session
- session_start();
- if (isset($_SESSION['role']))
- {
- // jika level admin
- if ($_SESSION['role'] == "admin")
- {
- }
- // jika kondisi level user maka akan diarahkan ke halaman lain
- else if ($_SESSION['role'] == "member")
- {
- header('location:index.php');
- }
- }
- else
- {
- header('location:index.php');
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <!--- Begin from here --->
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Web by Fajar Priadi">
- <meta name="author" content="Fajar Priadi">
- <title>Legoland - Order</title>
- <?include 'incubator/incubator.php';?>
- <!--- end here --->
- </head>
- <body>
- <!-- Navigation Begin Here -->
- <?include 'incubator/navigation.php';?>
- <!-- Navigation End Here -->
- <!-- Main Page Content Start here -->
- <div class="panel panel-default">
- <!-- Default panel contents -->
- <div class="panel-heading"><h3>Order Update<h3></div>
- <div class="panel-body">
- </div>
- <?php
- $message = $_GET['msg'];
- if ($message == 'success')
- {
- ?>
- <div class="alert alert-success">
- <strong>DELETE SUCCESS! </strong><a href="index.php" class="alert-link">Back to home?</a>
- </div>
- <?php
- }
- else if ($message == 'success2')
- {
- ?>
- <div class="alert alert-success">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <strong>UPDATE SUCCESS!</strong>
- </div>
- <?php
- }
- else if ($message == 'error')
- {
- ?>
- <div class="alert alert-dismissable">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <strong>Warning!</strong> Error
- </div>
- <?php
- }
- else if ($message == 'null')
- {
- ?>
- <div class="alert alert-dismissable">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <strong>Warning!</strong> Gender Form Cannot be empty!
- </div>
- <?php
- }
- ?>
- <!-- Table -->
- <?php
- include 'config/koneksi.php';
- if ($_GET['uid'] == true && $_GET['status'] == true)
- {
- $status=array('Awaiting','Confirmation');
- echo '<center>
- <form id="form1" name="form1" method="get" action="edit.php">
- <table width="100%" border="0">
- <tr>
- <td><span>ID </span></td>
- <td><input type="text" name="uid" id="uid" value="'.$_GET['uid'].'" readonly></td>
- </tr>
- <tr><td><span>STATUS</span></td>
- <td>
- <select name="status" id="status">';
- foreach($status as $st){
- echo '<option value="'.$st.'"'.($st==$_GET['status']?' selected="selected"':'').'>$st</option>';
- }
- echo ' </select>
- </tr>
- <tr>
- <td colspan="2">
- <button type="submit" class="btn btn-default">Update</button>
- <a class="btn btn-default" type="submit" href="index.php?act=update-order" />Exit</a>
- </td>
- </tr>
- </table>
- </form>
- </center>';
- }
- else
- {
- ?>
- <table class="table">
- <thead>
- <tr>
- <th>#</th>
- <th>Name</th>
- <th>Email</th>
- <th>Town</th>
- <th>Address</th>
- <th>Phone Number</th>
- <th>Plan-Order</th>
- <th>Company Name</th>
- <th>Company Email</th>
- <th>Company Address</th>
- <th>Order Status</th>
- <th>Action</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $query = "SELECT * FROM `order`";
- $result = mysql_query($query);
- $no = 0;
- while($row = mysql_fetch_assoc($result)){
- echo " <tr>
- <td>".(++$no)."</td>
- <td>".$row['fullname']."</td>
- <td>".$row['email']."</td>
- <td>".$row['town']."</td>
- <td>".$row['address']."</td>
- <td>".$row['number']."</td>
- <td>".$row['planorder']."</td>
- <td>".$row['cname']."</td>
- <td>".$row['cemail']."</td>
- <td>".$row['caddress']."</td>
- <td>
- <span class='label label-".($row['status']=='Awaiting'?'danger':'primary')."'>"
- .$row['status']
- ."</span>
- </td>
- <td>
- <a class='label label-primary'
- href='edit-order.php?uid=".$row['uid']."&status=".$row['status']."'>[Edit]</a>|
- <a class='label label-primary' href='delete.php?uid=".$row['uid']."'>[Delete]</a>
- </td>
- </tr>
- ";
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- <!-- Main Page Content End Here -->
- <!-- Footer page start here -->
- <?php include 'incubator/footer.php';?>
- <!-- Footer Page End Here -->
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement