/var/www/(Del)pathways.org.hk/MIS20140127/old20140414/System/Venue.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

<!DOCTYPE html>
<html>
    <head>
        <?php require_once '../include/head.php'?>
        <?php require_once '../include/checkuser.php'?>
        <?php require_once '../include/Nav_bar.php'?>
        <?php include_once '../include/DBConnect.php'?>
    </head>
    <body>
        <?php
        
/*if (isset($_POST['venue_se'])) {
            $del_id = $_POST['venue_se'];
            $sth = $dbh->prepare("UPDATE `venue` SET `lastupby`= 1,`lastupdate`= now(), `deleted`= 1 WHERE room_id = '$del_id'");
            $sth->execute();

            echo "<script>alert('delete data successful.')</script>";
            echo("<script>location.href ='Venue.php';</script>");
        }*/
        
?>
        <!-- line between nav bar and content -->
        <div class="text-right">
            <ul class="breadcrumb">
                <li class="active">Venue</li>
            </ul>
        </div>

        <div class="container-fluid pathways-container">
            <div>
                <table border="0" width="100%">
                    <tr>
                        <td><h2>Venue</h2></td>
                        <td><a href="addVenue.php" class="btn pull-right"><i class="icon-plus"></i> Add</a></td>
                    </tr>
                </table>
            </div>
            <form id="search_form" class="form-inline" action="" method="POST">
            <table class="table table-striped table-bordered table-hover table-condensed" id="tablehead">  
                <thead>
                    <tr>
                        <!--th style="min-width:20px; width:5%">&nbsp;</th-->
                        <th style="min-width:50px; width:5%">Edit</th>
                        <th style="min-width:50px; width:50%">Venue Name</th>
                        <th style="min-width:150px; width:55%">Campus</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $query 
"select v.room_id as room_id, c.campus_name as campus_name from venue v, campus c where v.deleted = 0 and c.deleted=0 and c.campus_id = v.campus_id group by v.room_id";
                    
$result $dbh->query($query);
                    
$result->setFetchMode(PDO::FETCH_OBJ);
                    while (
$row $result->fetch()) {
                        
?>
                        <tr>
                            <!--td>
                                <button class="btn" name="venue_se" value="<?= $row->room_id ?>" type="submit"><i class="icon-remove"></i></button>
                            </td-->
                            <td>
                                <a href="editvenue.php?id=<?= $row->room_id ?>" class="btn">Edit</a>
                            </td>
                            <td>
                                <?= $row->room_id ?>
                            </td>
                            <td>
                                <?= $row->campus_name ?>
                            </td> 
                        </tr>
                        <?php
                    
}
                    
?>
                </tbody>
            </table>
            </form>
        </div> <!-- /container -->
    </body>
</html>