本文整理匯總了PHP中Store::getAllActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getAllActive方法的具體用法?PHP Store::getAllActive怎麽用?PHP Store::getAllActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Store
的用法示例。
在下文中一共展示了Store::getAllActive方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
<p class="form-title">Registro de Nuevo Usuario</p>
<?php
if (!Forms::checkPermission(FORM_USER_NEW)) {
return;
}
require_once 'inc/class.store.php';
$stores = Store::getAllActive("name", "ASC");
$firstname = isset($_POST['firstname']) ? $_POST['firstname'] : "";
$lastname = isset($_POST['lastname']) ? $_POST['lastname'] : "";
$username = isset($_POST['username']) ? $_POST['username'] : "";
$passwd = isset($_POST['passwd']) ? $_POST['passwd'] : "";
$ci = isset($_POST['ci']) ? $_POST['ci'] : "";
$address = isset($_POST['address']) ? $_POST['address'] : "";
$phone = isset($_POST['phone']) ? $_POST['phone'] : "";
$role = isset($_POST['role']) ? $_POST['role'] : "";
$store = isset($_POST['store']) ? $_POST['store'] : "";
$email = isset($_POST['email']) ? $_POST['email'] : "";
$active = true;
if (isset($_POST['page'])) {
$active = isset($_POST['active']);
}
include 'inc/widget/error.php';
?>
<form action="" method="POST" enctype="multipart/form-data">
<table class="form">
<tbody>
<tr>
<td class="label">Nombre:</td>
<td><input name="firstname" type="text" value="<?php
echo $firstname;
?>
示例2: foreach
<tr>
<td class="label">Stock:</td>
<td><input name="stock" type="text" readonly="readonly" id="stock" value="0" size="20"/></td>
</tr>
<tr>
<td class="label">Activo:</td>
<td><input name="active" type="checkbox" id="active" value="1"/></td>
</tr>
<tr>
<td class="label">Almacen</td>
<td>
<?php
if ($storeid) {
echo "<input type='hidden' name='storeid' value='{$storeid}'/>{$store->name}";
} else {
$stores = Store::getAllActive("name");
echo "<select name='storeid'>";
echo "<option value=''>-Seleccione-</option>";
foreach ($stores as $store) {
echo "<option value='{$store->id}'>{$store->name}</option>";
}
echo "</select>";
}
?>
</td>
</tr>
<tr>
<td class="label">Costo:</td>
<td><input name="costo" onchange="sumar()" type="text" id="costo" value="0" size="30"/></td>
</tr>
<tr>
示例3:
<p class="form-title">Listado de Productos</p>
<?php
if (!Forms::checkPermission(FORM_ITEM_LIST)) {
return;
}
require_once 'inc/class.mysqli.php';
require_once 'inc/class.item.php';
require_once 'inc/class.store.php';
require_once 'inc/class.formatter.php';
$db = Database::getInstance();
$stores = Store::getAllActive("");
?>
<div id="tabs">
<ul>
<?php
foreach ($stores as $store) {
echo "<li><a href='#tab_{$store->id}'>{$store->name}</a></li>";
}
?>
</ul>
<?php
foreach ($stores as $store) {
?>
<div id="tab_<?php
echo $store->id;
?>
">
<table class="default" style="width:99.9%">
<thead>
<tr>
示例4: foreach
<?php
require_once 'inc/class.queries.php';
require_once 'inc/class.store.php';
$stores = Store::getAllActive('', '');
?>
<div style="font-size:0.9em">
<p class="form-subtitle">Stock en almacenes</p>
<?php
foreach ($stores as $store) {
echo "<table class='default' style='float:left;margin-right:0.2em'>";
echo "<caption style='text-align:center'>{$store->name}</caption>";
echo "<thead><tr><th>Item</th><th>Stock</td></tr></thead>";
$itemsStock = Queries::getStock($store->id, "stock", "ASC", 10);
foreach ($itemsStock as $row) {
echo "<tr>";
echo "<td>{$row['name']}</td>";
echo "<td class='number" . ($row['stock'] < $row['stock_min'] ? " mandatory" : "") . "'>{$row['stock']}</td>";
echo "</tr>";
}
echo "</table>";
}
?>
<br style="clear:both"/>
<p>Los items de <span class="mandatory">color</span> estan por debajo del stock mínimo.</p>
</div>
示例5: isset
<p class="form-title">Traspasos</p>
<?php
require_once 'inc/class.store.php';
$db = Database::getInstance();
$session = Session::getInstance();
$storeid = isset($_GET['storeid']) ? $_GET['storeid'] : false;
$stores = Store::getAllActive('name', 'ASC');
if ($session->userlevel < USER_LEVEL) {
die("Acceso Denegado");
}
if (isset($_POST['data_row'])) {
// Traspaso de lotes
foreach ($_POST['data_row'] as $row) {
$jsonRow = json_decode(urldecode($row));
Store::transfer($jsonRow->source, $jsonRow->target, $jsonRow->stock, $session->uniqueid);
}
}
?>
<form action="index.php" method="GET">
<input type="hidden" name="pages" value="traspaso_new"/>
Ver lotes por almacen:
<select name="storeid">
<option value="">- Todos -</option>
<?php
foreach ($stores as $store) {
echo "<option value='{$store->id}'" . (isset($_GET['storeid']) && $_GET['storeid'] == $store->id ? " selected=\"selected\"" : "") . ">{$store->name}</option>";
}
?>
</select>
<input type="submit" value="Aceptar"/>
</form>