</head>
<body>
<form method="post" action="addstaffaccess.php" id="editform" role="form">
    <div class="modal-body">
        <div class="form-group">
            <label for="name">Access Code
                <input class="form-control" type="text" id="code" name="code"/>
            </label>
        </div>
        <div class="form-group">
            <label>Staff</label>
            <select class="form-control" name="staffid" id="staffid">

                <?php 
$staff = new Staff($db);
$stmt = $staff->selectAll();
while ($row_staff = $stmt->fetch(PDO::FETCH_ASSOC)) {
    extract($row_staff);
    echo "<option value='{$Id}'>{$FirstName} {$LastName}</option>";
}
?>
            </select>

        </div>
    </div>
    <div class="modal-footer">
        <input type="submit" class="btn btn-primary" name="add" value="Add" />&nbsp;
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
</form>
</body>
Exemple #2
0
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">Staff Members</h3>
            </div>
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>First Name</th>
                        <th>Last Name</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php 
$staffMember = new Staff($db);
$stmt = $staffMember->selectAll();
while ($row_staff = $stmt->fetch(PDO::FETCH_ASSOC)) {
    extract($row_staff);
    echo "<tr>";
    echo "<td>{$FirstName}</td>";
    echo "<td>{$LastName}</td>";
    echo "<td><a class='btn btn-small btn-primary' data-toggle='modal' data-target='#editModal' data-whatever='{$Id}'>Edit</a></td>";
    echo "</tr>";
}
?>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class="modal-body">
        <div class="form-group">
            <label for="name">Access Code
                <input class="form-control" type="text" id="code" name="code" value="<?php 
echo $originalOption->Code;
?>
"/>
            </label>
        </div>
        <div class="form-group">
            <label>Staff</label>
            <select class="form-control" name="staffid" id="staffid">

                <?php 
$access = new Staff($db);
$stmt = $access->selectAll();
while ($row_access = $stmt->fetch(PDO::FETCH_ASSOC)) {
    extract($row_access);
    if ($originalOption->Staff_Id == $Id) {
        echo "<option value='{$Id}' selected='selected'>{$FirstName} {$LastName}</option>";
    } else {
        echo "<option value='{$Id}'>{$FirstName} {$LastName}</option>";
    }
}
?>
            </select>

        </div>
    </div>
    <div class="modal-footer">
        <input type="submit" class="btn btn-primary" name="update" value="Update" />&nbsp;