本文整理汇总了PHP中Staff::selectAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Staff::selectAll方法的具体用法?PHP Staff::selectAll怎么用?PHP Staff::selectAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Staff
的用法示例。
在下文中一共展示了Staff::selectAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Staff
</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" />
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</body>
示例2: Staff
<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>
示例3: Staff
<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" />