本文整理汇总了PHP中product::select_all方法的典型用法代码示例。如果您正苦于以下问题:PHP product::select_all方法的具体用法?PHP product::select_all怎么用?PHP product::select_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product
的用法示例。
在下文中一共展示了product::select_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_reorder_level
public function check_reorder_level()
{
global $db;
global $auth_session;
$domain_id = domain_id::get($this->domain_id);
//sellect qty and reorder level
$inventory = new product();
$sth = $inventory->select_all('count');
$inventory_all = $sth->fetchAll(PDO::FETCH_ASSOC);
$email = "";
foreach ($inventory_all as $row) {
if ($row['quantity'] <= $row['reorder_level']) {
$message = "The quantity of Product: " . $row['description'] . " is " . siLocal::number($row['quantity']) . ", which is equal to or below its reorder level of " . $row['reorder_level'];
$return['row_' . $row['id']]['message'] = $message;
$email_message .= $message . "<br />\n";
}
}
//print_r($return);
#$attachment = file_get_contents('./tmp/cache/' . $pdf_file_name);
$email = new email();
$email->notes = $email_message;
$email->from = $email->get_admin_email();
$email->to = $email->get_admin_email();
#$email -> bcc = "justin@localhost";
$email->subject = "Simple Invoices reorder level email";
$email->send();
return $return;
}
示例2: isset
<?php
header("Content-type: text/xml");
//$start = (isset($_POST['start'])) ? $_POST['start'] : "0" ;
$dir = isset($_POST['sortorder']) ? $_POST['sortorder'] : "ASC";
$sort = isset($_POST['sortname']) ? $_POST['sortname'] : "description";
$rp = isset($_POST['rp']) ? $_POST['rp'] : "25";
$page = isset($_POST['page']) ? $_POST['page'] : "1";
$defaults = getSystemDefaults();
$smarty->assign("defaults", $defaults);
$products = new product();
$sth = $products->select_all('', $dir, $sort, $rp, $page);
$sth_count_rows = $products->select_all('count', $dir, $sort, $rp, $page);
$products_all = $sth->fetchAll(PDO::FETCH_ASSOC);
$count = $sth_count_rows->rowCount();
//echo sql2xml($customers, $count);
$xml .= "<rows>";
$xml .= "<page>{$page}</page>";
$xml .= "<total>{$count}</total>";
foreach ($products_all as $row) {
$xml .= "<row id='" . $row['iso'] . "'>";
$xml .= "<cell><![CDATA[\r\n\t\t\t<a class='index_table' title='{$LANG['view']} " . $row['description'] . "' href='index.php?module=products&view=details&id=" . $row['id'] . "&action=view'><img src='images/common/view.png' height='16' border='-5px' padding='-4px' valign='bottom' /></a>\r\n\t\t\t<a class='index_table' title='{$LANG['edit']} " . $row['description'] . "' href='index.php?module=products&view=details&id=" . $row['id'] . "&action=edit'><img src='images/common/edit.png' height='16' border='-5px' padding='-4px' valign='bottom' /></a>\r\n\t\t]]></cell>";
$xml .= "<cell><![CDATA[" . $row['description'] . "]]></cell>";
$xml .= "<cell><![CDATA[" . siLocal::number_clean($row['unit_price']) . "]]></cell>";
if ($defaults['inventory'] == '1') {
$xml .= "<cell><![CDATA[" . siLocal::number_trim($row['quantity']) . "]]></cell>";
}
if ($row['enabled'] == $LANG['enabled']) {
$xml .= "<cell><![CDATA[<img src='images/common/tick.png' alt='" . $row['enabled'] . "' title='" . $row['enabled'] . "' />]]></cell>";
} else {
$xml .= "<cell><![CDATA[<img src='images/common/cross.png' alt='" . $row['enabled'] . "' title='" . $row['enabled'] . "' />]]></cell>";