function doPost() { $storeName = $_POST['storeName']; if (!empty($_POST['btnOK'])) { $store = getStore($storeName); $job_queue = $store->get_job_queue(); $response = $job_queue->schedule_reset_data(); $content = ''; if ($response->is_success()) { $jobUri = $response->headers['location']; $message = 'Scheduled reset job'; $content .= 'Reset job details<p>'; $content .= '<div class="findResults">'; $content .= '<ul>'; $content .= '<li><span class="lnkShowItem" ><a href="' . $jobUri . '">' . $jobUri . '</a></span></li>'; $content .= '</ul>'; $content .= '</div>'; } else { $message = 'Failed to schedule reset job'; $content .= 'Response details<p>'; $content .= '<pre>'; $content .= $response->to_string(); $content .= '</pre>'; } renderPage($storeName, null, $message, $content); } else { header('Location: find.php?storeName=' . $storeName . '&resourceUri='); } }
function &getConsumer() { /** * Create a consumer object using the store object created * earlier. */ $store = getStore(); $consumer = new Auth_OpenID_Consumer($store); return $consumer; }
function doPost() { set_time_limit(120); $storeName = $_POST['storeName']; $fileName = basename($_FILES['uploadedfile']['name']); $tmpFile = $_FILES['uploadedfile']['tmp_name']; $rdfxml = file_get_contents($tmpFile); $store = getStore($storeName); $info = pathinfo($fileName); if ($info['extension'] == 'ttl') { $response = $store->get_metabox()->submit_turtle($rdfxml); } else { $response = $store->get_metabox()->submit_rdfxml($rdfxml); } if ($response->is_success()) { $message = 'Upload succeeded'; $error = null; } else { $message = 'Upload failed'; $error = $response->to_string(); } render($storeName, $message, $error); }
function getOAIArray($storeName, $token, $from, $to) { $from = $from . 'T00:00:00Z'; $to = $to . 'T00:00:00Z'; $store = getStore($storeName); $oai = $store->get_oai_service(); $xml = $oai->list_records($token, $from, $to); if (!empty($xml->body)) { return $oai->parse_oai_xml($xml->body); } return array(); }
function allocateStockToJob($jobcard_id, $stock_id, $units = 1) { $refnum = getRefnum(); $sysdate = date("Y-m-d"); $stock_wh = getStore($stock_id); $production_wh = getProductionStore(); $sql = "SELECT * FROM cubit.stock WHERE stkid='{$stock_id}'"; $stock_rslt = db_exec($sql) or errDie("Unable to retrieve stock."); $stock_data = pg_fetch_array($stock_rslt); // Do we have this stock in the production store already $sql = "SELECT stkid FROM cubit.stock WHERE stkcod='{$stock_data['stkcod']}' AND whid='{$production_wh}'"; $production_rslt = db_exec($sql) or errDie("Unable to retrieve production stock."); $production_id = pg_fetch_result($production_rslt, 0); if (!pg_num_rows($production_rslt)) { $sql = "\n\t\t\tINSERT INTO cubit.stock (\n\t\t\t\tstkcod, stkdes, prdcls, csamt, units, \n\t\t\t\tbuom, suom, rate, \n\t\t\t\tminlvl, whid, shelf, row, \n\t\t\t\ttype, catname, classname, \n\t\t\t\tcom, csprice, serd, \n\t\t\t\tlcsprice, vatcode, supplier1, \n\t\t\t\tsupplier2, supplier3, rfidfreq, \n\t\t\t\trfidrate, size, post_production, \n\t\t\t\ttreatment, div\n\t\t\t) VALUES (\n\t\t\t\t'{$stock_data['stkcod']}', '{$stock_data['stkdes']}', '{$stock_data['prdcls']}', '0', '0', \n\t\t\t\t'{$stock_data['buom']}', '{$stock_data['suom']}', '{$stock_data['rate']}', \n\t\t\t\t'{$stock_data['minlvl']}', '{$production_wh}', '{$stock_data['shelf']}', '{$stock_data['row']}', \n\t\t\t\t'{$stock_data['type']}', '{$stock_data['catname']}', '{$stock_data['classname']}', \n\t\t\t\t'{$stock_data['com']}', '{$stock_data['csprice']}', '{$stock_data['serd']}', \n\t\t\t\t'{$stock_data['lcsprice']}', '{$stock_data['vatcode']}', '{$stock_data['supplier1']}', \n\t\t\t\t'{$stock_data['supplier2']}', '{$stock_data['supplier3']}', '{$stock_data['rfidfreq']}', \n\t\t\t\t'{$stock_data['rfidrate']}', '{$stock_data['size']}', '{$stock_data['post_production']}', \n\t\t\t\t'{$stock_data['treatment']}', '" . USER_DIV . "'\n\t\t\t)"; db_exec($sql) or errDie("Unable to create in stock store."); $production_id = pglib_lastid("cubit.stock", "stkid"); for ($i = 1; $i <= 12; $i++) { $sql = "\n\t\t\t\tINSERT INTO \"{$i}\".stkledger (\n\t\t\t\t\tstkid, stkcod, stkdes, trantype, \n\t\t\t\t\tedate, qty, csamt, balance, bqty, details, div, yrdb\n\t\t\t\t) VALUES (\n\t\t\t\t\t'{$production_id}', '{$stock_data['stkcod']}', '{$stock_data['stkdes']}', 'bal', \n\t\t\t\t\t'{$sysdate}', '0', '0', '0', '0','Balance', '" . USER_DIV . "','" . YR_DB . "'\n\t\t\t\t)"; db_exec($sql) or errDie("Unable to create ledger entries."); } } $details = "Stock allocated to job {$jobcard_id}"; reduceStock($stock_id, $units, $details); increaseStock($production_id, $units, $details); $production_acc = qryAccountsName("Inventory in Production"); $production_acc = $production_acc["accid"]; $inventory_acc = qryAccountsName("Inventory"); $inventory_acc = $inventory_acc["accid"]; $amount = getStockCostPrice($stock_id) * $units; writetrans($production_acc, $inventory_acc, $sysdate, $refnum, $amount, $details); return; }
$ex = 'http://example.com/'; $descriptions = array($ex . 'a' => array($ex . 'name' => array("James")), $ex . 'b' => array($ex . 'name' => array("Angela")), $ex . 'c' => array($ex . 'name' => array("Dexter"))); $lineNumbers = $store->insertDescriptions($descriptions); expect($store->size())->to_equal(3); expect($lineNumbers)->to_equal(array($ex . 'a' => 0, $ex . 'b' => 1, $ex . 'c' => 2)); $more_descriptions = array($ex . 'd' => array($ex . 'name' => array("Delilah")), $ex . 'e' => array($ex . 'name' => array("Samson")), $ex . 'f' => array($ex . 'name' => array("Jake"))); $lineNumbers = $store->insertDescriptions($more_descriptions); expect($lineNumbers)->to_equal(array($ex . 'd' => 3, $ex . 'e' => 4, $ex . 'f' => 5)); }); it("should let you get a description by ids", function () { $store = getStore(); $ex = 'http://example.com/'; $description = array($ex . 'id' => array($ex . 'name' => array("James"))); $lineNumbers = $store->insertDescriptions($description); $actual = $store->getDescriptionsByIDs($lineNumbers[$ex . 'id']); expect($actual)->to_equal($description); }); it("should let you replace descriptions", function () { $store = getStore(); $ex = 'http://example.com/'; $description = array($ex . 'id' => array($ex . 'name' => array("James"))); $lineNumbers = $store->insertDescriptions($description); $id = $lineNumbers[$ex . 'id']; $newdescription = array($ex . 'id' => array($ex . 'name' => array("Jamie"))); $replacement = array($id => $newdescription); $store->replaceDescriptions($replacement); $actual = $store->getDescriptionsByIDs(array($id)); expect($actual)->to_equal($newdescription); }); }); //\pecs\run();
function getConsumer() { // {{{ /** * Create a consumer object using the store object created * earlier. */ $store = getStore(); return new Auth_OpenID_Consumer($store); } // }}}
<div class = "col-md-9"> <div id="map"></div><br> <div id="shopping_cart" align = "right"; style = "border: 2px #f05f40 solid;"> <span style = "font-size: 15px; padding: 5px; line-height: 30px;"> Welcome Guest! <b>Shopping Cart -</b> Total Items: <b><?php total_items(); ?> </b> Total Price: <b><?php total_price(); ?> </b> <a href = "cart.php"> View Cart </a> </span> </div><br> <div id = "content_box" class = "row"> <?php getStore(); ?> <?php getStoreService(); ?> </div> </div> </div> </div> <div class = "container"> <div class = "row row-offcanvas row-offcanvas-left"> <hr> <footer> <div class = "row"> <div class = "col-lg-12" align = "center"> <p> Copyright & Copy; Team Core 2016 </p>