本文整理汇总了PHP中database4::selectLast方法的典型用法代码示例。如果您正苦于以下问题:PHP database4::selectLast方法的具体用法?PHP database4::selectLast怎么用?PHP database4::selectLast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类database4
的用法示例。
在下文中一共展示了database4::selectLast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
$ro4 = new database4();
$user = $ro->selectNow('registeredUser', 'username', 'employeeID', $_SESSION['employeeID']);
foreach ($endingNo as $end) {
$totalEnding += $ro->selectNow("endingInventory", "endingQTY", "endingNo", $end);
$endingNo1 = $end;
$ro->editNow("endingInventory", "endingNo", $end, "status", "encoded_" . $user);
}
if ($ro->selectNow("inventoryStockCard", "inventoryType", "stockCardNo", $ro->selectNow("endingInventory", "stockCardNo", "endingNo", $endingNo1)) == "medicine") {
$stockCardNo = $ro->selectNow("endingInventory", "stockCardNo", "endingNo", $endingNo1);
$genericName = $ro->selectNow("inventoryStockCard", "genericName", "stockCardNo", $stockCardNo);
$brandName = $ro->selectNow("inventoryStockCard", "description", "stockCardNo", $stockCardNo);
$preparation = $ro->selectNow("inventory", "preparation", "stockCardNo", $stockCardNo);
$qty = $totalEnding;
$unitcost = $ro->selectNow("endingInventory", "unitcost", "endingNo", $endingNo1);
//selectLast($table,$cols,$identifier,$identifierData,$ordering)
$opdPrice = $ro4->selectLast("inventory", "opdPrice", "stockCardNo", $stockCardNo, "inventoryCode");
$ipdPrice = $ro4->selectLast("inventory", "ipdPrice", "stockCardNo", $stockCardNo, "inventoryCode");
$expiration = $ro4->selectLast('inventory', 'expiration', 'stockCardNo', $stockCardNo, 'inventoryCode');
$remarks = "Ending inventory - " . date('Y-m-d');
$locked = "no";
$criticalLevel = "5";
$inventoryType = $ro->selectNow("inventoryStockCard", "inventoryType", "stockCardNo", $stockCardNo);
$inventoryLocation = $ro->selectNow("endingInventory", "inventoryLocation", "endingNo", $endingNo1);
$supplier = $ro4->selectLast("inventory", "supplier", "stockCardNo", $stockCardNo, "inventoryCode");
$dateAdded = date('Y-m-d');
$timeAdded = date('H:i:s');
$addedBy = $ro->selectNow("registeredUser", "username", "employeeID", $_SESSION['employeeID']);
$beginningQTY = $totalEnding;
$medicine = array("stockCardNo" => $stockCardNo, "genericName" => $genericName, "description" => $brandName, "preparation" => $preparation, "quantity" => $qty, "unitcost" => $unitcost, "opdPrice" => $opdPrice, "ipdPrice" => $ipdPrice, "expiration" => $expiration, "remarks" => $remarks, "locked" => $locked, "criticalLevel" => $criticalLevel, "inventoryType" => $inventoryType, "inventoryLocation" => $inventoryLocation, "supplier" => $supplier, "dateAdded" => $dateAdded, "timeAdded" => $timeAdded, "addedBy" => $addedBy, "beginningQTY" => $qty);
$ro4->insertNow("inventory", $medicine);
} else {
示例2: date
echo "<br>";
echo "lock: ".$lock;
*/
$counterDate = $ro->selectNow("counters", "counterdate", "id", "1");
$counter02 = $ro->selectNow("counters", "counter02", "id", "1");
$purchaseDate = date("Ymd");
if ($counterDate != $purchaseDate) {
$ro->editNow("counters", "id", "1", "counter02", "0");
} else {
$newCounter02 = $counter02 + 1;
$ro->editNow("counters", "id", "1", "counter02", $newCounter02);
}
if ($counter02 < 10) {
$refNo = $purchaseDate . "000" . $counter02;
} else {
if ($counter02 > 9 && $counter02 < 100) {
$refNo = $purchaseDate . "00" . $counter02;
} else {
if ($counter02 > 99 && $counter02 < 1000) {
$refNo = $purchaseDate . "0" . $counter02;
} else {
$refNo = $purchaseDate . $counter02;
}
}
}
$inventory = array("stockCardNo" => $stockCardNo, "description" => $brandName, "genericName" => $genericName, "preparation" => $preparation, "quantity" => $quantity + $freeGoods, "fgQuantity" => $freeGoods, "unitcost" => $unitcost, "opdPrice" => $opdPrice, "ipdPrice" => $ipdPrice, "expiration" => $expiration, "addedBy" => $ro->selectNow("registeredUser", "username", "employeeID", $_SESSION['employeeID']), "timeAdded" => date("H:i:s"), "dateAdded" => $dateAdded, "inventoryType" => "medicine", "inventoryLocation" => $inventoryLocation, "criticalLevel" => $criticalLevel, "supplier" => $supplier, "invoiceNo" => $invoiceNo, "remarks" => $remarks, "locked" => $lock, "autoDispense" => "no", "classification" => "inventory", "beginningQTY" => $quantity + $freeGoods);
$ro4->insertNow("inventory", $inventory);
//inventorycode nung last inserted
$inventoryCode = $ro4->selectLast("inventory", "inventoryCode", "stockCardNo", $stockCardNo, "inventoryCode");
$salesInvoiceItem = array("refNo" => $refNo, "siNo" => $siNo, "inventoryCode" => $inventoryCode, "description" => $brandName, "unit" => $preparation, "unitPrice" => $unitcost, "quantity" => $quantity + $freeGoods, "fgquantity" => $freeGoods, "type" => "medicine", "status" => "Active", "encodedBy" => $ro->selectNow("registeredUser", "username", "employeeID", $_SESSION['employeeID']), "dateEncoded" => date("YmdHi"));
$ro4->insertNow("salesInvoiceItems", $salesInvoiceItem);