当前位置: 首页>>代码示例>>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;未经允许,请勿转载。