本文整理汇总了PHP中Inventory::getAllReagents方法的典型用法代码示例。如果您正苦于以下问题:PHP Inventory::getAllReagents方法的具体用法?PHP Inventory::getAllReagents怎么用?PHP Inventory::getAllReagents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Inventory
的用法示例。
在下文中一共展示了Inventory::getAllReagents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<form name='new_test_form' id='new_test_form' action='inventory/add_new_stock.php' method='post'>
<input type='hidden' name='count' value='1' id='count' />
<div class="pretty_box" style="width:500px;">
<table>
<tr>
<td>
<?php
echo LangUtil::$pageTerms['Reagent'];
?>
</td>
<td> </td>
<td>
<?php
$reagents_list = Inventory::getAllReagents($lid);
//echo "<pre>";
//print_r($reagents_list);
//echo "</pre>";
$unittt = "hi";
echo "<select id='reagent' name='reagent' style='width: 205px' onchange='javascript:display_unit()'>";
foreach ($reagents_list as $reagent) {
$r_id = $reagent['id'];
$r_name = $reagent['name'];
if ($r_id != 2) {
echo "<option value='{$r_id}'>{$r_name}</option>";
} else {
echo "<option value='{$r_id}' selected='selected'>{$r_name}</option>";
}
}
echo "</select>";
示例2: get_inventory
public function get_inventory()
{
//print_r($_SESSION);
/*
$chk = check_api_token($tok);
if($chk != 1)
return $chk;
*/
if ($_SESSION['level'] < 2 || $_SESSION['level'] > 4) {
$user = get_user_by_id($_SESSION['user_id']);
$lid = $user->labConfigId;
}
if ($lid == null) {
$lid = get_lab_config_id_admin($_SESSION['user_id']);
}
$reagents_list = Inventory::getAllReagents($lid);
$cc = 1;
foreach ($reagents_list as $reagent) {
$quant = Inventory::getQuantity($lid, $reagent['id']);
// $uni = $reagent['unit'];
$spec[$cc]['id'] = $reagent['id'];
$spec[$cc]['name'] = $reagent['name'];
$spec[$cc]['unit'] = $reagent['unit'];
$spec[$cc]['remarks'] = $reagent['remarks'];
$spec[$cc]['quantity'] = $quant;
$cc++;
}
//$spec = get_specimen_by_id($specimen_id);
if (count($spec) > 0) {
$ret = $spec;
} else {
$ret = 0;
}
return $ret;
}