$pid = $p['products_id']; $aid = $p['articles_id']; $a_nr = getANR($p['products_model'], $p['length']); //ACTIVE STATUS if ($p['active_status'] == '0' || $p['article_status'] == '0') { //Set inactive if either product / article is killed $active_status = '0'; } else { //Otherwise use catalog active status $active_status = $p['catalog_status']; } if (!isset($pri_data[$a_nr])) { $pri_data[$a_nr] = array(); $pri_data[$a_nr]['active_status'] = $active_status; //STOCK INFO $pri_data[$a_nr]['stock'] = getStock($p['stock'], $p['booking_active']); $pri_data[$a_nr]['price_data'] = array(); } else { //By default catalog active status of first channel is used. //If next catalog active status is different, only take the new //value to activate the article (not deactivating). //This means article is active if activated in at least 1 channel if ($pri_data[$a_nr]['active_status'] != $active_status && $active_status == '1') { $pri_data[$a_nr]['active_status'] = $active_status; } } //PRICE INFO $tb_channel = $sp_use_tb[$p['jng_sp_id']]['tb_channel']; $price_data = array(); $price_data['price'] = $p['price']; $price_data['price_old'] = $p['price_old'];
function product($id) { //get the product $data['product'] = $this->Product_model->get_product($id); $data['stock'] = getStock($data['product']->stock_id); if (!$data['product'] || $data['product']->enabled == 0) { show_404(); } $data['base_url'] = $this->uri->segment_array(); // load the digital language stuff $this->lang->load('digital_product'); $data['options'] = $this->Option_model->get_product_options($data['product']->id); $related = $data['product']->related_products; $data['related'] = array(); if ($this->session->userdata('daily_tips')) { $data['daily_tip'] = $this->session->userdata('daily_tips'); } else { $today = $this->Category_model->get_tip(); $data['daily_tip'] = $today[0]; $this->session->set_userdata('daily_tips', $data['daily_tip']); } $data['posted_options'] = $this->session->flashdata('option_values'); $data['page_title'] = $data['product']->name; $data['meta'] = $data['product']->meta; $data['seo_title'] = !empty($data['product']->seo_title) ? $data['product']->seo_title : $data['product']->name; if ($data['product']->images == 'false') { $data['product']->images = array(); } else { $data['product']->images = array_values((array) json_decode($data['product']->images)); } $data['gift_cards_enabled'] = $this->gift_cards_enabled; $this->load->view('product', $data); }
<td colspan="4"><strong><?php echo lang('grand_total'); ?> </strong></td> <td style="text-align:right"><?php echo format_currency($this->go_cart->total() + $delivery_charge); ?> </td> </tr> </tfoot> <tbody> <?php $subtotal = 0; foreach ($this->go_cart->contents() as $cartkey => $product) { $stocks = getStock($product['stock_id']); ?> <tr> <td><?php echo $product['sku']; ?> </td> <td><?php echo $product['name']; ?> </td> <td><?php echo format_currency($product['price']); echo empty($product['unit']) ? '' : '/' . $product['unit']; ?> </td>
break; case 2: //view all products viewAll(); break; case 3: //update a product update(); break; case 4: //get details of a product getProduct(); break; case 5: //sends sms to get stock level getStock(); break; case 6: //generate random id for transaction generate_random_password(5); break; case 7: //add sale to db addSale(); break; case 8: //all transaction to db addTransaction(); break; case 9: //get all purchases with a given transaction id
function getAuditDifferences($ITD, $AUDNUM, $LID) { $Aquant = getAuditItem($ITD, $AUDNUM, $LID); $Squant = getStock($ITD, $LID); $Fquant = $Squant - $Aquant; return $Fquant; }
<?php require "configuration.php"; getStock(1); function getStock($artikelid) { $tuCurl = curl_init(); curl_setopt($tuCurl, CURLOPT_URL, "http://statistik.uhr.se/api/GetJQueryDataTableResultModel"); curl_setopt($tuCurl, CURLOPT_POST, 1); curl_setopt($tuCurl, CURLOPT_RETURNTRANSFER, 1); //$stringToArray = implode("\",\"",$array); $data = '{"TableType":"SelectionRound1","ResultType":"AdmissionPoint","AdmissionRoundId":"HT2015","EducationOrgId":"SU","ProgKurs":"","Search":"","SelCriterionId":"","RecordStart":25,"RecordLength":100,"SortColumnIndex":0,"SortColumnDesc":false,"RequestNumber":93,"Paginate":true}'; curl_setopt($tuCurl, CURLOPT_POSTFIELDS, $data); curl_setopt($tuCurl, CURLOPT_HTTPHEADER, array("Content-Type: application/json;charset=utf-8", "Content-length: " . strlen($data))); $trueuData1 = curl_exec($tuCurl); $arr = json_decode($trueuData1, true); var_dump($arr); } /* $i =1; foreach ($arr as $key => $value) { if($value['StockTextShort'] != "-"){ var_dump($value); $i++; } } if(!curl_errno($tuCurl)){ $info = curl_getinfo($tuCurl); echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url']; } else {
?> </th> <th style="width:10%;"><?php echo lang('quantity'); ?> </th> <th style="width:10%; text-align: right"><?php echo lang('totals'); ?> </th> </tr> </thead> <tbody> <?php foreach ($content->contents as $key => $cc) { $stocks = getStock($cc['stock_id']); ?> <tr> <td><?php echo $cc['sku']; ?> </td> <td><?php echo $cc['name']; ?> </td> <td><?php echo $cc['price']; ?> </td> <td><div class="control-group">