本文整理汇总了PHP中FormLib::getDate方法的典型用法代码示例。如果您正苦于以下问题:PHP FormLib::getDate方法的具体用法?PHP FormLib::getDate怎么用?PHP FormLib::getDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormLib
的用法示例。
在下文中一共展示了FormLib::getDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetch_report_data
function fetch_report_data()
{
global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
$dbc = FannieDB::get($FANNIE_OP_DB);
$warehouseDB = $FANNIE_PLUGIN_SETTINGS['WarehouseDatabase'] . $dbc->sep();
$query = '
SELECT COUNT(*) AS numTransactions,
AVG(-tenderTotal) AS avgTenderTotal,
AVG(retailQty+nonRetailQty) AS avgItemQty,
AVG(retailTotal+nonRetailtotal) AS avgItemTotal,
AVG(retailQty) AS avgRetailQty,
AVG(retailTotal) AS avgRetailTotal,
m.memDesc,
m.custdataType
FROM ' . $warehouseDB . 'transactionSummary AS t
LEFT JOIN memtype AS m ON t.memType=m.memType
WHERE date_id BETWEEN ? AND ?
GROUP BY t.memType,
m.memDesc,
m.custdataType';
$prep = $dbc->prepare($query);
$date1 = FormLib::getDate('date1', date('Ymd'), 'Ymd');
$date2 = FormLib::getDate('date2', date('Ymd'), 'Ymd');
$result = $dbc->execute($prep, array($date1, $date2));
$report = array();
while ($w = $dbc->fetch_row($result)) {
$report[] = array($w['memDesc'], $w['custdataType'] == 'PC' ? 'Yes' : 'No', sprintf('%d', $w['numTransactions']), sprintf('%.2f', $w['avgTenderTotal']), sprintf('%.2f', $w['avgItemQty']), sprintf('%.2f', $w['avgItemTotal']), sprintf('%.2f', $w['avgRetailQty']), sprintf('%.2f', $w['avgRetailTotal']));
}
return $report;
}
示例2: testFormLib
public function testFormLib()
{
$val = FormLib::get('someKey');
$this->assertEquals('', $val);
$val = FormLib::get('someKey', 'someVal');
$this->assertEquals('someVal', $val);
$val = FormLib::get('otherVal', 'someVal');
$this->assertEquals('someVal', $val);
$val = FormLib::getDate('someKey');
$this->assertEquals('', $val);
$val = FormLib::getDate('someKey', '2000-01-01');
$this->assertEquals('2000-01-01', $val);
$val = FormLib::getDate('someKey', '1/1/2000', 'n/j/Y');
$this->assertEquals('1/1/2000', $val);
}
示例3: SaveFormData
public function SaveFormData($upc)
{
$local = $this->db();
$upc = BarcodeLib::padUPC($upc);
$pu = new ProductUserModel($local);
$pu->upc($upc);
$pu->enableOnline(FormLib::get('u_online') == 1 ? 1 : 0);
$pu->soldOut(FormLib::get('u_soldout') == 1 ? 1 : 0);
$pu->save();
include dirname(__FILE__) . '/../../src/Credentials/OutsideDB.tunneled.php';
$remote = $dbc;
$pu->load();
if ($pu->enableOnline() && $remote->isConnected()) {
$pu->setConnection($remote);
$pu->save();
$prod = new ProductsModel($local);
$prod->upc($upc);
$prod->load();
$prod->setConnection($remote);
$prod->save();
} elseif (FormLib::get('u_already_online') && $remote->isConnected()) {
$prod = new ProductsModel($remote);
$prod->upc($upc);
$prod->delete();
}
if ($local->tableExists('productExpires')) {
$e = new ProductExpiresModel($local);
$e->upc($upc);
$e->expires(FormLib::getDate('u_expires', date('Y-m-d')));
$e->save();
if ($e->expires() && $remote->isConnected()) {
$e->setConnection($remote);
$e->save();
}
}
}