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


PHP FormLib::get_form_value方法代碼示例

本文整理匯總了PHP中FormLib::get_form_value方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormLib::get_form_value方法的具體用法?PHP FormLib::get_form_value怎麽用?PHP FormLib::get_form_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FormLib的用法示例。


在下文中一共展示了FormLib::get_form_value方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: preprocess

 function preprocess()
 {
     if (FormLib::get_form_value('start', False) !== False) {
         $pdf = new FPDF('P', 'in', 'Letter');
         $pdf->SetMargins(0.5, 0.5, 0.5);
         $pdf->SetAutoPageBreak(False, 0.5);
         $pdf->AddPage();
         $start = FormLib::get_form_value('start');
         $x = 0.5;
         $y = 0.5;
         $pdf->AddFont('Gill', '', 'GillSansMTPro-Medium.php');
         $pdf->SetFont('Gill', '', 16);
         for ($i = 0; $i < 40; $i++) {
             $current = $start + $i;
             $pdf->SetXY($x, $y);
             $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
             $pdf->Cell(1.75, 0.5, $current, 0, 0, 'C');
             if ($i % 2 == 0) {
                 $x += 1.75 * 2 + 0.5;
             } else {
                 $x = 0.5;
                 $y += 0.5;
             }
         }
         $pdf->Close();
         $pdf->Output("mem stickers {$start}.pdf", "I");
         return False;
     }
     return True;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:30,代碼來源:MemberStickerPage.php

示例2: preprocess

 function preprocess()
 {
     global $FANNIE_OP_DB;
     $dbc = FannieDB::get($this->config->get('OP_DB'));
     $FANNIE_EMP_NO = $this->config->get('EMP_NO');
     $FANNIE_REGISTER_NO = $this->config->get('REGISTER_NO');
     $FANNIE_CORRECTION_DEPT = $this->config->get('PATRONAGE_DEPT');
     /**
       Use fannie settings if properly configured
     */
     if (is_numeric($FANNIE_EMP_NO)) {
         $this->CORRECTION_CASHIER = $FANNIE_EMP_NO;
     }
     if (is_numeric($FANNIE_REGISTER_NO)) {
         $this->CORRECTION_LANE = $FANNIE_REGISTER_NO;
     }
     if (is_numeric($FANNIE_CORRECTION_DEPT)) {
         $this->CORRECTION_DEPT = $FANNIE_CORRECTION_DEPT;
     }
     if (FormLib::get_form_value('submit1', False) !== false) {
         $this->mode = 'confirm';
     } elseif (FormLib::get_form_value('submit2', False) !== False) {
         $this->mode = 'finish';
     }
     // error check inputs
     if ($this->mode != 'init') {
         $this->date = FormLib::get_form_value('date');
         $this->tn = FormLib::get_form_value('trans_num');
         $this->cn2 = FormLib::get_form_value('memTo');
         if (!is_numeric($this->cn2)) {
             $this->errors .= "<div class=\"alert alert-danger\">Error: member given (" . $this->cn2 . ") isn't a number</div>" . "<br /><br />" . "<a href=\"\" onclick=\"back(); return false;\">Back</a>";
             return True;
         }
         $account = \COREPOS\Fannie\API\member\MemberREST::get($this->cn2);
         if ($account == false) {
             $this->errors .= "<div class=\"alert alert-success\">Error: no such member: " . $this->cn2 . "</div>" . "<br /><br />" . "<a href=\"\" onclick=\"back(); return false;\">Back</a>";
             return True;
         }
         foreach ($account['customers'] as $c) {
             if ($c['accountHolder']) {
                 $this->name2 = $c['firstName'] . ' ' . $c['lastName'];
                 break;
             }
         }
         $dlog = DTransactionsModel::selectDlog($this->date);
         $q = $dbc->prepare_statement("SELECT card_no FROM {$dlog} WHERE trans_num=? AND\n                tdate BETWEEN ? AND ?\n                ORDER BY card_no DESC");
         $r = $dbc->exec_statement($q, array($this->tn, $this->date . ' 00:00:00', $this->date . ' 23:59:59'));
         if ($dbc->num_rows($r) == 0) {
             $this->errors .= "<div class=\"alert alert-error\">Error: receipt not found: " . $this->tn . "</div>" . "<br /><br />" . "<a href=\"\" onclick=\"back(); return false;\">Back</a>";
             return True;
         }
         $w = $dbc->fetchRow($r);
         $this->cn1 = is_array($w) ? $w[0] : 0;
         $q = $dbc->prepare_statement("SELECT SUM(CASE WHEN trans_type in ('I','M','D') then total else 0 END)\n                FROM {$dlog} WHERE trans_num=? AND tdate BETWEEN ? AND ?");
         $r = $dbc->exec_statement($q, array($this->tn, $this->date . ' 00:00:00', $this->date . ' 23:59:59'));
         $w = $dbc->fetchRow($r);
         $this->amt = is_array($w) ? $w[0] : 0;
     }
     return True;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:60,代碼來源:PatronageTransferTool.php

示例3: saveFormData

 function saveFormData($memNum)
 {
     /* entry blank. do not save */
     $note = FormLib::get_form_value('Notes_text');
     if ($note == "") {
         return "";
     }
     /* entry has note changed. this means it's already
        in memberNotes as the most recent entry */
     $current = FormLib::get_form_value('Notes_current');
     if ($note == base64_decode($current)) {
         return "";
     }
     $dbc = $this->db();
     $insertNote = $dbc->prepare_statement("INSERT into memberNotes\n                (cardno, note, stamp, username)\n                VALUES (?, ?, " . $dbc->now() . ", 'Admin')");
     // convert newlines back to br tags
     // so displayed notes have user's
     // paragraph formatting
     $note = str_replace("\n", '<br />', $note);
     $test1 = $dbc->exec_statement($insertNote, array($memNum, $note));
     if ($test1 === False) {
         return "Error: problem saving Notes<br />";
     } else {
         return "";
     }
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:26,代碼來源:Notes.php

示例4: preprocess

 function preprocess()
 {
     global $FANNIE_OP_DB;
     if (FormLib::get_form_value('deptStart', False) !== false) {
         $start = FormLib::get_form_value('deptStart');
         $end = FormLib::get_form_value('deptEnd');
         $pageID = FormLib::get_form_value('sID', 0);
         $dbc = FannieDB::get($FANNIE_OP_DB);
         $prodP = $dbc->prepare_statement("\n                SELECT p.upc\n                FROM products AS p\n                WHERE p.department BETWEEN ? AND ?\n            ");
         $prodR = $dbc->exec_statement($prodP, array($start, $end));
         $tag = new ShelftagsModel($dbc);
         $product = new ProductsModel($dbc);
         while ($row = $dbc->fetch_row($prodR)) {
             $product->upc($row['upc']);
             $info = $product->getTagData();
             $tag->id($pageID);
             $tag->upc($row['upc']);
             $tag->setData($info);
             $tag->save();
         }
         $this->msgs = sprintf('<em>Created tags for departments #%d through #%d</em>
                 <br /><a href="ShelfTagIndex.php">Home</a>', $start, $end);
     }
     return true;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:25,代碼來源:CreateTagsByDept.php

示例5: fetch_report_data

 function fetch_report_data()
 {
     $date1 = $this->form->date1;
     $date2 = $this->form->date2;
     $exclude = FormLib::get_form_value('excludes', '');
     $ex = preg_split('/\\D+/', $exclude, 0, PREG_SPLIT_NO_EMPTY);
     $exCondition = '';
     $exArgs = array();
     foreach ($ex as $num) {
         $exCondition .= '?,';
         $exArgs[] = $num;
     }
     $exCondition = substr($exCondition, 0, strlen($exCondition) - 1);
     $ret = array();
     $dbc = $this->connection;
     $dbc->selectDB($this->config->get('OP_DB'));
     $query = "\n            SELECT \n                CASE WHEN m.zip='' THEN 'none' ELSE m.zip END as zipcode,\n                COUNT(*) as num \n            FROM meminfo AS m \n                INNER JOIN memDates AS d ON m.card_no=d.card_no \n            WHERE ";
     if (!empty($exArgs)) {
         $query .= "m.card_no NOT IN ({$exCondition}) AND ";
     }
     $query .= "d.start_date >= ?\n            GROUP BY zipcode\n            ORDER BY COUNT(*) DESC";
     $exArgs[] = $date1 . ' 00:00:00';
     $prep = $dbc->prepare_statement($query);
     $result = $dbc->exec_statement($prep, $exArgs);
     while ($row = $dbc->fetch_row($result)) {
         $record = array($row['zipcode'], $row['num']);
         $ret[] = $record;
     }
     return $ret;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:30,代碼來源:ZipCodeReport.php

示例6: saveFormData

 function saveFormData($memNum)
 {
     $dbc = $this->db();
     /**
       Use primary member for default column values
     */
     $account = self::getAccount();
     if (!$account) {
         return "Error: Problem saving household members<br />";
     }
     $json = array('cardNo' => $memNum, 'customerTypeID' => $account['customerTypeID'], 'memberStatus' => $account['memberStatus'], 'activeStatus' => $account['activeStatus'], 'customers' => array());
     $primary = array('discount' => 0, 'staff' => 0, 'lowIncomeBenefits' => 0, 'chargeAllowed' => 0, 'checksAllowed' => 0);
     foreach ($account['customers'] as $c) {
         if ($c['accountHolder']) {
             $primary = $c;
             break;
         }
     }
     $fns = FormLib::get_form_value('HouseholdMembers_fn', array());
     $lns = FormLib::get_form_value('HouseholdMembers_ln', array());
     $ids = FormLib::get('HouseholdMembers_ID', array());
     for ($i = 0; $i < count($lns); $i++) {
         $json['customers'][] = array('customerID' => $ids[$i], 'firstName' => $fns[$i], 'lastName' => $lns[$i], 'accountHolder' => 0, 'discount' => $primary['discount'], 'staff' => $primary['staff'], 'lowIncomeBenefits' => $primary['lowIncomeBenefits'], 'chargeAllowed' => $primary['chargeAllowed'], 'checksAllowed' => $primary['checksAllowed']);
     }
     $resp = \COREPOS\Fannie\API\member\MemberREST::post($memNum, $json);
     if ($resp['errors'] > 0) {
         return "Error: Problem saving household members<br />";
     }
     return '';
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:30,代碼來源:HouseholdMembers.php

示例7: saveFormData

 function saveFormData($memNum)
 {
     $dbc = $this->db();
     $formPref = FormLib::get_form_value('MemContactPref', -1);
     // Does a preference for this member exist?
     $infoQ = $dbc->prepare_statement("SELECT pref\n                FROM memContact\n                WHERE card_no=?");
     $infoR = $dbc->exec_statement($infoQ, array($memNum));
     // If no preference exists, add one if one was chosen.
     if ($dbc->num_rows($infoR) == 0) {
         if ($formPref > -1) {
             $upQ = $dbc->prepare_statement("INSERT INTO memContact (card_no, pref)\n                    VALUES (?, ?)");
             $upR = $dbc->exec_statement($upQ, array($memNum, $formPref));
             if ($upR === False) {
                 return "Error: problem adding Contact Preference.";
             } else {
                 return "";
             }
         }
     } else {
         $row = $dbc->fetch_row($infoR);
         $dbPref = $row['pref'];
         if ($formPref != $dbPref) {
             $upQ = $dbc->prepare_statement("UPDATE memContact SET pref = ?\n                    WHERE card_no = ?");
             $upR = $dbc->exec_statement($upQ, array($formPref, $memNum));
             if ($upR === False) {
                 return "Error: problem updating Contact Preference.";
             } else {
                 return "";
             }
         }
     }
     return "";
     // saveFormData
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:34,代碼來源:ContactPref.php

示例8: preprocess

 function preprocess()
 {
     global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
     $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
     $this->emp_no = FormLib::get_form_value('emp_no', 0);
     $this->periodID = FormLib::get_form_value('periodID', 0);
     if (!headers_sent() && ($this->emp_no == 0 || $this->periodID == 0 || $this->emp_no < 0)) {
         header('Location: TsAdminMain.php');
         return False;
     }
     if ($_GET['function'] == 'edit' && isset($_GET['submitted']) && isset($_GET['emp_no']) && isset($_GET['periodID']) && isset($_GET['id'])) {
         $oneP = $ts_db->prepare_statement("UPDATE timesheet\n                SET time_in=?, time_out=?, area=?\n                WHERE ID=?");
         $twoP = $ts_db->prepare_statement("UPDATE timesheet\n                SET time_in=?\n                WHERE ID=?");
         foreach ($_GET['id'] as $key => $id) {
             $area = (int) $_GET['area'][$id];
             $date = $_GET['date'][$id];
             $timein = $this->parseTime($_GET['time_in'][$id], $_GET['inmeridian'][$id]);
             $timeout = $this->parseTime($_GET['time_out'][$id], $_GET['outmeridian'][$id]);
             $result = False;
             if ($area != 0) {
                 $args = array($date . ' ' . $timein, $date . ' ' . $timeout, $area, $id);
                 $result = $ts_db->exec_statement($oneP, $args);
             } else {
                 $args = array('2008-01-01 ' . $timein, $id);
                 $result = $ts_db->exec_statement($twoP, $args);
             }
             if (!$result) {
                 $this->errors[] = "<p>Query: {$query}</p>";
                 $this->errors[] = "<p>MySQL Error: " . $ts_db->error() . "</p>";
             }
         }
     }
     return True;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:34,代碼來源:TsAdminView.php

示例9: preprocess

 function preprocess()
 {
     global $FANNIE_OP_DB;
     $this->title = _("Fannie") . ' : ' . _("Manufacturer Shelf Tags");
     $this->header = _("Manufacturer Shelf Tags");
     if (FormLib::get_form_value('manufacturer', False) !== false) {
         $manu = FormLib::get_form_value('manufacturer');
         $pageID = FormLib::get_form_value('sID', 0);
         $cond = "";
         if (is_numeric($_REQUEST['manufacturer'])) {
             $cond = " p.upc LIKE ? ";
         } else {
             $cond = " p.brand LIKE ? ";
         }
         $dbc = FannieDB::get($FANNIE_OP_DB);
         $prodP = $dbc->prepare_statement("\n                SELECT\n                    p.upc\n                FROM\n                    products AS p\n                WHERE {$cond}\n            ");
         $prodR = $dbc->exec_statement($prodP, array('%' . $manu . '%'));
         $tag = new ShelftagsModel($dbc);
         $product = new ProductsModel($dbc);
         while ($prodW = $dbc->fetch_row($prodR)) {
             $product->upc($prodW['upc']);
             $info = $product->getTagData();
             $tag->id($pageID);
             $tag->upc($prodW['upc']);
             $tag->setData($info);
             $tag->save();
         }
         $this->msgs = '<em>Created tags for manufacturer</em>
                 <br /><a href="ShelfTagIndex.php">Home</a>';
     }
     return true;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:32,代碼來源:CreateTagsByManu.php

示例10: post_id_handler

 function post_id_handler()
 {
     global $FANNIE_OP_DB;
     $dbc = FannieDB::get($FANNIE_OP_DB);
     $upc = BarcodeLib::padUPC($this->id);
     $model = new ProductsModel($dbc);
     $model->upc($upc);
     $model->store_id(1);
     $model->discounttype(0);
     $model->special_price(0);
     $model->modified(date('Y-m-d H:i:s'));
     $model->save();
     $batchID = FormLib::get_form_value('batchID');
     $batchUPC = FormLib::get_form_value('batchUPC');
     if ($batchID !== '' && $batchUPC !== '') {
         if (substr($batchUPC, 0, 2) != 'LC') {
             $batchUPC = BarcodeLib::padUPC($batchUPC);
         }
         $batchP = $dbc->prepare_statement('DELETE FROM batchList
                 WHERE upc=? AND batchID=?');
         $batchR = $dbc->exec_statement($batchP, array($batchUPC, $batchID));
     }
     require 'laneUpdates.php';
     updateProductAllLanes($upc);
     header('Location: ItemEditorPage.php?searchupc=' . $upc);
     return False;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:27,代碼來源:EndItemSale.php

示例11: preprocess

 function preprocess()
 {
     global $FANNIE_OP_DB;
     $id = FormLib::get_form_value('id', 0);
     $dbc = FannieDB::get($FANNIE_OP_DB);
     $tags = new ShelftagsModel($dbc);
     $tags->id($id);
     $current_set = $tags->find();
     if (count($current_set) == 0) {
         $this->messages = '<div class="alert alert-info">
             Barcode table is already empty. <a href="ShelfTagIndex.php">Click here to continue</a>
             </div>';
         return true;
     }
     if (FormLib::get('submit', false) === '1') {
         /**
           Shelftags are not actually delete immediately
           Instead, the id field is negated so they disappear
           from view but can be manually retreived by IT if 
           someone comes complaining that they accidentally
           delete their tags (not that such a thing would
           ever occur). They're properly deleted by the 
           nightly.clipboard cron job.
         
           If the same user deletes the same UPC from tags
           multiple times in a day, the above procedure creates
           a primary key conflict. So any negative-id records
           that will create conflicts must be removed first.
         */
         $new_id = -1 * $id;
         if ($id == 0) {
             $new_id = -999;
         }
         $clear = new ShelftagsModel($dbc);
         $clear->id($new_id);
         foreach ($current_set as $tag) {
             // delete existing negative id tag for upc
             $clear->upc($tag->upc());
             $clear->delete();
             // save tag as negative id
             $old_id = $tag->id();
             $tag->id($new_id);
             $tag->save();
             $tag->id($old_id);
             $tag->delete();
         }
         $this->messages = '<div class="alert alert-success">
             Barcode table cleared <a href="ShelfTagIndex.php">Click here to continue</a>
             </div>';
         return true;
     } else {
         $this->messages = '<div class="alert alert-danger">
             <a href="DeleteShelfTags.php?id=' . $id . '&submit=1">Click 
             here to clear barcodes</a></div>';
         return true;
     }
     return true;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:58,代碼來源:DeleteShelfTags.php

示例12: preprocess

 public function preprocess()
 {
     /* allow ajax calls */
     if (FormLib::get_form_value('action') !== '') {
         $this->ajax_response(FormLib::get_form_value('action'));
         return false;
     }
     return true;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:9,代碼來源:SubDeptEditor.php

示例13: preprocess

 public function preprocess()
 {
     $this->report_headers = array(_('Member'), '$Total Purchased', '$Average per Receipt', '#Receipts');
     $this->title = "Fannie : Patronage over Date Range Report";
     $this->header = "Patronage over Date Range Report";
     if (is_numeric(FormLib::get_form_value('top_n', 0))) {
         $this->top_n = FormLib::get_form_value('top_n', 0);
     }
     return parent::preprocess();
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:10,代碼來源:PatronageOverDatesReport.php

示例14: preprocess

 function preprocess()
 {
     $this->tpath = sys_get_temp_dir() . "/misc/";
     $this->mode = 'form';
     /* Is this a request-to-upload or an initial display of the form? */
     if (FormLib::get_form_value('MAX_FILE_SIZE') != '' && FormLib::get_form_value('doUpload') != '') {
         $this->mode = 'process';
     }
     return True;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:10,代碼來源:UploadAnyFile.php

示例15: get_id_handler

 protected function get_id_handler()
 {
     $this->card_no = $this->id;
     $my = FormLib::get_form_value('my', date('Ym'));
     $start = date("Y-m-d", mktime(0, 0, 0, substr($my, 4), 1, substr($my, 0, 4)));
     $end = date("Y-m-t", mktime(0, 0, 0, substr($my, 4), 1, substr($my, 0, 4)));
     $table = DTransactionsModel::selectDlog($start, $end);
     $this->__models['start'] = $start;
     $this->__models['end'] = $end;
     return True;
 }
開發者ID:phpsmith,項目名稱:IS4C,代碼行數:11,代碼來源:PIPurchasesPage.php


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