當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormLib::getDate方法代碼示例

本文整理匯總了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;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:30,代碼來源:CWTransactionsReport.php

示例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);
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:15,代碼來源:ApiLibTest.php

示例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();
         }
     }
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:36,代碼來源:WfcWebModule.php


注:本文中的FormLib::getDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。