function create_recurrent_invoices($customer_id, $branch_id, $order_no, $tmpl_no, $date, $from, $to) { global $Refs; $doc = new Cart(ST_SALESORDER, array($order_no)); get_customer_details_to_order($doc, $customer_id, $branch_id); $doc->trans_type = ST_SALESORDER; $doc->trans_no = 0; $doc->document_date = $date; $doc->due_date = get_invoice_duedate($doc->payment, $doc->document_date); $doc->reference = $Refs->get_next($doc->trans_type); if ($doc->Comments != "") { $doc->Comments .= "\n"; } $doc->Comments .= sprintf(_("Recurrent Invoice covers period %s - %s."), $from, add_days($to, -1)); foreach ($doc->line_items as $line_no => $item) { $line =& $doc->line_items[$line_no]; $line->price = get_price($line->stock_id, $doc->customer_currency, $doc->sales_type, $doc->price_factor, $doc->document_date); } $cart = $doc; $cart->trans_type = ST_SALESINVOICE; $cart->reference = $Refs->get_next($cart->trans_type); $invno = $cart->write(1); if ($invno == -1) { display_error(_("The entered reference is already in use.")); display_footer_exit(); } update_last_sent_recurrent_invoice($tmpl_no, $to); return $invno; }
function getHTML($url, &$arr) { $m_url = $url; $m_html = file_get_html($m_url); $property = ""; $no_bed = get_no_bed($m_html); $no_bath = get_no_bath($m_html); $no_car = get_no_car($m_html); $address = get_address($m_html); $agency = get_agency($m_html); $agency_localDir = get_agency_localDir($m_html); $first_agent_name = get_first_agent_name($m_html); $first_agent_contact = get_first_agent_contact($m_html); $listing_type = ""; $price = get_price($m_html); $inspect_time = get_inspect_time($m_html); // $inspect_date = get_inspect_date ($m_html); // $inspect_hour = get_inspect_hour ($m_html); $auction_time = get_auction_time($m_html); $auction_date = get_auction_date($m_html); $auction_day = get_day($auction_date); $auction_hour = get_auction_hour($m_html); $auction_inspect_hour = get_auction_inspect_hour($m_html); $auction_string = get_auction_string($auction_date, $auction_hour, $auction_inspect_hour); $justlisted_string = get_justlisted_string($inspect_time); $arr = array('url' => $m_url, 'no_bed' => $no_bed, 'no_bath' => $no_bath, 'no_car' => $no_car, 'address' => $address, 'agency' => $agency, 'agency_localDir' => $agency_localDir, 'first_agent_name' => $first_agent_name, 'first_agent_contact' => $first_agent_contact, 'listing_type' => $listing_type, 'price' => $price, 'inspect_time' => $inspect_time, 'auction_time' => $auction_time, 'auction_date' => $auction_date, 'auction_day' => $auction_day, 'auction_hour' => $auction_hour, 'auction_inspect_hour' => $auction_inspect_hour, 'auction_string' => $auction_string, 'justlisted_string' => $justlisted_string); //print_r ($arr); }
function get_order_total(){ $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $prodid=$_SESSION['cart'][$i]['Prodid']; $q=$_SESSION['cart'][$i]['Quantity']; $price=get_price($prodid); $sum+=$price*$q; } return $sum; }
function get_order_total() { $max = count($_SESSION['cart']); $sum = 0; for ($i = 0; $i < $max; $i++) { $isbn = $_SESSION['cart'][$i]['productid']; $q = $_SESSION['cart'][$i]['qty']; $price = get_price($isbn); $sum += $price * $q; } return $sum; }
public function create($product, $product_count, $ticket_count) { $product = $this->db->get_where('product', array('id' => $product))->row_array(); if ($product_count > $product['count_max'] || $product_count < $product['count_min']) { echo json_encode(array('success' => 0, 'max' => $product['count_max'], 'min' => $product['count_min'])); return; } $tickets = array(); for ($i = 0; $i < $ticket_count; $i++) { $number = new_ticket_number($product['id']); $price = get_price($product['id'], $this->user['level']); $this->db->insert('ticket', array("number" => $number, "create_time" => time(), "credit" => $price * $product_count, "product_id" => $product['id'], "count" => $product_count, "state" => 0, "fulfill_time" => 0, "agent" => $this->user['id'])); $tickets[] = $number; } echo json_encode(array('success' => 1, 'tickets' => $tickets)); }
function print_cart() { global $in_cart; if (array_key_exists('игрушка детская велосипед', $in_cart)) { if (get_available($in_cart['игрушка детская велосипед']['количество заказано'], $in_cart['игрушка детская велосипед']['осталось на складе']) >= 3) { echo '<p>Поздравляем вас с участием в акции, вы купили товар "игрушка детская велосипед" в количестве более 3 штук, и получаете скидку в 30%</p>'; $in_cart['игрушка детская велосипед']['diskont'] = 'diskont3'; } else { echo 'Купив товар "игрушка детская велосипед" количеством более 3 штук вы получите скидку 30%!'; } $action_profit = get_profit($in_cart['игрушка детская велосипед']['количество заказано'], $in_cart['игрушка детская велосипед']['осталось на складе'], $in_cart['игрушка детская велосипед']['цена']); } $cart = '<table border="1"><tr>'; $cart .= '<td>№</td>' . '<td><b>Наименование</b></td>' . '<td><b>Цена</b></td>' . '<td><b>Скидка</b></td>'; $cart .= '<td><b>В заказе</b></td>' . '<td><b>На складе</b></td>' . '<td><b>Итого со скидкой</b></td></tr>'; static $total_goods = 0; static $total_cost = 0; static $count = 0; static $total_profit = 0; foreach ($in_cart as $key => $val) { $item_price = $val['цена']; $in_order = $val['количество заказано']; $in_stock = $val['осталось на складе']; $diskont = get_int($val['diskont']); $show_diskont = $diskont > 0 ? $diskont . '0%' : '0%'; //красивое число скидки в таблице $price = get_price($item_price, $diskont, $in_order, $key, $in_stock); $cart .= '<tr><td>' . ++$count . '</td>'; $cart .= '<td>' . $key . '</td>'; $cart .= '<td>' . $item_price . '</td>'; $cart .= '<td>' . $show_diskont . '</td>'; $cart .= '<td>' . $in_order . '</td>'; $cart .= '<td>' . $in_stock . '</td>'; $cart .= '<td>' . $price[0] . '</td>'; $cart .= '</tr>'; $total_goods += get_available($in_order, $in_stock); $total_cost += $price[0]; $total_profit += $price[1] - $price[0]; } $cart .= '</table>'; $cart .= $action_profit; $cart .= '<table style="border:1px solid gray;background:lightgray"><tr><td>ИТОГО в заказе:</td><td> - ' . $count . ' наименования,<br/>'; $cart .= '- ' . $total_goods . ' товаров,<br/> - ' . $total_cost . ' сумма к оплате,<br/> - ' . $total_profit . ' сэкономлено на скидках</td></tr></table>'; return $cart; }
function create_job($ticket, $values) { $CI =& get_instance(); $product = $ticket['product']; $to = $values['to']; $agent = get_user_by_id($ticket['agent']); $price = get_price($product['id'], $agent['level']); if (!change_credit($agent['id'], -$price, $ticket['number'])) { return 'INSUFFICIENT_BALANCE_FROM_AGENT'; } if ($product['cate'] == 4) { $this->load->helper('user'); $user = get_user(); if (!$user) { return 'LOGIN_REQUIRED'; } // hack self business here if ($product['subcate'] == 900) { // increase balance change_credit($user['id'], $product['norm_value'], $ticket['number']); } if ($product['subcate'] == 910) { // upgrade agent $from = $product['province'] % 10; $to = int($product['province'] / 10); if ($user['level'] != $from) { return 'INVALID_CURRENT_LEVEL'; } if ($user['parent'] && $user['parent'] != $ticket['agent']) { return 'PARENT_CONFLICTED'; } $this->db->update('agent', array('level' => $to, 'parent' => $ticket['agent']), array('name' => $username)); } } else { $this->db->insert('job', array('create_time' => time(), 'commit_time' => 0, 'ticket_number' => $ticket['number'], 'to' => $values['to'], 'area' => $values['area'], 'product_id' => $product['id'], 'locking_on' => NULL, 'retried' => 0, 'result' => 0, 'reason' => NULL)); } return 'SUCCESS'; }
//process filtering if set as part of the get request, this modifies the //auction_set if (isset($_POST['bottom']) && isset($_POST['top']) && isset($_POST['rating']) && isset($_POST['category']) && isset($_POST['auctionSet']) && isset($_POST['tokenChanged'])) { //initialize to empty array $auction_set = array(); if ($_POST['tokenChanged']) { //process search form $search_token = trim($_POST['token']); //process_search_form();//uses GET from inside the body //if processed search token is not empty if ($search_token) { //query database and modify result set with further queries $auction_set = query_select_auction_search($search_token); for ($i = 0; $i < sizeof($auction_set); $i++) { //enrich with price $current_price = get_price($auction_set[$i]['auctionId'], $auction_set[$i]['startingPrice']); $auction_set[$i]['currentPrice'] = $current_price; //once the current price is known, there is no further need for a //startingPrice field on the retrieved associative array unset($auction_set[$i]['startingPrice']); //enrich with rating $feedback_array = query_select_user_rating($auction_set[$i]['seller']); $auction_set[$i]['stars'] = $feedback_array['stars']; $auction_set[$i]['no_of_ratings'] = $feedback_array['occurrences']; } } } else { $auction_set = $_POST['auctionSet']; } $auction_set = process_filter_form($auction_set, $_POST['bottom'], $_POST['top'], $_POST['rating'], $_POST['category']); //begin constructing auction set display table, id value used by
$t['a1'] = 1; $t['p1'] = $t['price']; $t['a2'] = $t['a3'] = 0; $t['p2'] = $t['p3'] = 0.0; } $number = intval($v['number']); if ($number < $t['a1']) { $number = $t['a1']; } if ($number > $t['amount']) { $number = $t['amount']; } if ($number < 1) { $number = 1; } $price = get_price($number, $t['price'], $t['step']); $amount = $number * $price; $_note = convert(input_trim($v['note']), 'UTF-8', DT_CHARSET); $note = ''; $t['P1'] = get_nv($t['n1'], $t['v1']); $t['P2'] = get_nv($t['n2'], $t['v2']); $t['P3'] = get_nv($t['n3'], $t['v3']); $t['s1'] = $s1; $t['s2'] = $s2; $t['s3'] = $s3; $t['m1'] = isset($t['P1'][$t['s1']]) ? $t['P1'][$t['s1']] : ''; $t['m2'] = isset($t['P2'][$t['s2']]) ? $t['P2'][$t['s2']] : ''; $t['m3'] = isset($t['P3'][$t['s3']]) ? $t['P3'][$t['s3']] : ''; $t['m1'] = isset($t['P1'][$t['s1']]) ? $t['P1'][$t['s1']] : ''; $t['m2'] = isset($t['P2'][$t['s2']]) ? $t['P2'][$t['s2']] : ''; $t['m3'] = isset($t['P3'][$t['s3']]) ? $t['P3'][$t['s3']] : '';
public function details($member_id) { $billing_data = $accounts_list = $paymentslist = array(); $prev_ob = $months_delayed = $amount = $i = $count_months = 0; $payment_status = ''; $member_data = $this->member_model->get_member($member_id); $data['member'] = $member_data; $accounts = $this->account_model->get_reading($member_id, Null, 'ASC'); $data['privileges'] = getPrivileges(); $initial_ob = get_object_vars(array_pop($member_data)); $initialize_object = new stdClass(); $initialize_object->previous_reading = 0; $initialize_object->current_reading = 0; $initialize_object->date = 0; $initialize_object->meter_reading_id = 0; $initialize_object->added = ''; $initialize_object->member_id = $member_id; $accounts_list[] = array(0 => $initialize_object); foreach ($accounts as $key => $account_read) { $accounts_list[$account_read->date][$account_read->meter_reading_id] = $account_read; } $data['payments'] = $this->payment_model->get_payments($member_id); $outsanding_balance = $initial_ob['initial_ob']; $listpayments = create_payment_matrix($data['payments']); $paymentslist = $listpayments['list']; $total_bal_diff = $listpayments['grand_total'] - $outsanding_balance; $paymentslist_ids = array_keys($paymentslist); if (!empty($accounts_list)) { ksort($accounts_list); $accounts_list_ids = array_keys($accounts_list); foreach ($accounts_list_ids as $count => $bill_period_timestamp) { $account = $accounts_list[$bill_period_timestamp]; $current_reading = $previous_reading = 0; $wmm = WMM; $paymentD = []; foreach ($account as $account_loop) { $current_reading = $current_reading + $account_loop->current_reading; $previous_reading = $previous_reading + $account_loop->previous_reading; } $consumed_cubic = $current_reading - $previous_reading; $amount = get_price($consumed_cubic); if ($bill_period_timestamp == 0 && $consumed_cubic == 0) { $wmm = $amount = 0; } $total_discount = $total_basicpayment = $total_regular_discount = 0; $total_adjustment = $total_penalty = $total_wmm = $total_payment = $total_charges = 0; $total_current = $amount + $wmm + $outsanding_balance; $prev_ob = $outsanding_balance; $outsanding_balance = $prev_ob + $amount + $wmm; $ob_display = number_format($prev_ob, 2, '.', ','); if ($prev_ob < 0) { $ob_display = 'Excess of ' . $prev_ob * -1; } $due_time = strtotime(date('Y-m-t', $bill_period_timestamp) . ' + 15 days'); $nextMonth = strtotime(date('Y-m-t', $bill_period_timestamp) . ' + 1 month'); $billinPeriod = date('M d', $bill_period_timestamp) . ' - ' . date('t', $bill_period_timestamp); $billPeriod = $billinPeriod . ', ' . date('Y', $bill_period_timestamp); $curr_amount = $amount + $wmm; $due_date = date('M j Y', $due_time); if ($bill_period_timestamp == 0) { $billinPeriod = "Line Connection"; $due_date = '--'; } $isPaymentData = false; $date_of_payment = ''; $billing_data[] = fillBillingData($billinPeriod, $bill_period_timestamp, $member_id, $due_date, $current_reading, $previous_reading, $consumed_cubic, $amount, $wmm, $total_current, $date_of_payment, $isPaymentData, $total_payment, $total_regular_discount, $total_discount, $total_basicpayment, $total_penalty, $total_charges, $total_adjustment, $ob_display, $outsanding_balance); $total_bal_diff = $total_bal_diff - $curr_amount; $aging_calc = $bill_period_timestamp == 0 ? $outsanding_balance : $outsanding_balance - $prev_ob; $current = $bill_period_timestamp; $next = $accounts_list_ids[$count + 1]; if ($bill_period_timestamp == 0) { $valid_payments = array_filter($paymentslist_ids, function ($value) use($current, $next) { return $value < $next; }); } else { if (!isset($next)) { $valid_payments = array_filter($paymentslist_ids, function ($value) use($current, $next) { return $value >= $current; }); } else { $valid_payments = array_filter($paymentslist_ids, function ($value) use($current, $next) { return $value >= $current && $value < $next; }); } } if (empty($valid_payments)) { continue; } foreach ($valid_payments as $valid_payments_id) { $paymentD[$valid_payments_id] = $paymentslist[$valid_payments_id]; } foreach ($paymentD as $datepaid => $paymentdata) { krsort($paymentdata); foreach ($paymentdata as $key => $paymententry) { $total_discount = !empty($paymententry['discount']) ? $paymententry['discount'] : 0; $total_basicpayment = !empty($paymententry['basic_charge']) ? $paymententry['basic_charge'] : 0; $total_regular_discount = !empty($paymententry['regular_discount']) ? $paymententry['regular_discount'] : 0; $total_adjustment = !empty($paymententry['adjustment']) ? $paymententry['adjustment'] : 0; $total_penalty = !empty($paymententry['penalty']) ? $paymententry['penalty'] : 0; $total_charges = !empty($paymententry['total_charges']) ? $paymententry['total_charges'] : 0; $total_wmm = !empty($paymententry['wmm']) ? $paymententry['wmm'] : 0; $total_payment = !empty($paymententry['total']) ? $paymententry['total'] : 0; $date_paid = !empty($paymententry['date_paid']) ? $paymententry['date_paid'] : 0; $total_current = $total_penalty + $total_charges + $outsanding_balance - ($total_discount + $total_adjustment + $total_regular_discount); $prev_ob = $outsanding_balance; $outsanding_balance = $prev_ob + $total_penalty + $total_charges - ($total_payment + $total_discount + $total_adjustment + $total_regular_discount); $ob_display = number_format($prev_ob, 2, '.', ','); if ($prev_ob > 0) { $months_delayed++; } if ($prev_ob < 0) { $ob_display = 'Excess of ' . $prev_ob * -1; } $date_of_payment = date('M j Y', $date_paid); $billinPeriod = date('F', $account_id); $isPaymentData = true; $billing_data[] = fillBillingData($billinPeriod, $account_id, $member_id, $due_date, $current_reading, $previous_reading, $consumed_cubic, $amount, $wmm, $total_current, $date_of_payment, $isPaymentData, $total_payment, $total_regular_discount, $total_discount, $total_basicpayment, $total_penalty, $total_charges, $total_adjustment, $ob_display, $outsanding_balance); $total_bal_diff = $total_bal_diff + $total_discount + $total_adjustment + $total_regular_discount - ($total_penalty + $total_charges); } } if ($total_bal_diff < 0 && strtotime("now") > strtotime($due_date) && $due_date != '--') { $count_months++; $aging[] = $aging_calc; } $pay_stat = strtotime("now") > strtotime($due_date) ? 'Late' : 'On Time'; if ($account_id == 0) { $billPeriod = '--'; } } } $data['count_months'] = $count_months; $data['pay_stat'] = $pay_stat; $data['due_date'] = $due_date; $data['billinPeriod'] = $billPeriod; $data['current_amount'] = $curr_amount; $data['total_ob'] = $outsanding_balance; $account_aging = array_fill(0, 4, 0); $sumball = $outsanding_balance; foreach (array_reverse($aging) as $key => $value) { if ($key > 2) { $account_aging[3] = $sumball; break; } else { $account_aging[$key] = $value; $sumball = $sumball - $value; } } $data['accounts'] = array_reverse($billing_data); $data['account_aging'] = $account_aging; $this->load->view('transaction/details', $data, FALSE); }
if ($tags) { foreach ($data as $k => $v) { if (isset($tags[$v['itemid']])) { $r = $tags[$v['itemid']]; $r['key'] = $k; $r['s1'] = $v['s1']; $r['s2'] = $v['s2']; $r['s3'] = $v['s3']; $r['a'] = $v['a']; if ($r['a'] > $r['amount']) { $r['a'] = $r['amount']; } if ($r['a'] < $r['a1']) { $r['a'] = $r['a1']; } $r['price'] = get_price($r['a'], $r['price'], $r['step']); $r['m1'] = isset($r['P1'][$r['s1']]) ? $r['P1'][$r['s1']] : ''; $r['m2'] = isset($r['P2'][$r['s2']]) ? $r['P2'][$r['s2']] : ''; $r['m3'] = isset($r['P3'][$r['s3']]) ? $r['P3'][$r['s3']] : ''; $lists[] = $r; } } } } if ($lists) { $address = array(); $result = $db->query("SELECT * FROM {$DT_PRE}address WHERE username='******' ORDER BY listorder ASC,itemid ASC LIMIT 30"); while ($r = $db->fetch_array($result)) { if ($r['areaid']) { $r['address'] = area_pos($r['areaid'], '') . $r['address']; }
if ($this->view_it_name) { echo stripslashes($row['it_name']) . "\n"; } if ($this->href) { echo "</a></div>\n"; } if ($this->view_it_basic && $row['it_basic']) { echo "<div class=\"sct_basic\">" . stripslashes($row['it_basic']) . "</div>\n"; } if ($this->view_it_cust_price || $this->view_it_price) { echo "<div class=\"sct_cost\">\n"; if ($this->view_it_cust_price && $row['it_cust_price']) { echo "<strike>" . display_price($row['it_cust_price']) . "</strike>\n"; } if ($this->view_it_price) { echo display_price(get_price($row), $row['it_tel_inq']) . "\n"; } echo "</div>\n"; } if ($this->view_sns) { $sns_top = $this->img_height + 10; $sns_url = G5_SHOP_URL . '/item.php?it_id=' . $row['it_id']; $sns_title = get_text($row['it_name']) . ' | ' . get_text($config['cf_title']); echo "<div class=\"sct_sns\" style=\"top:{$sns_top}px\">"; echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_SHOP_SKIN_URL . '/img/sns_fb_s.png'); echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_SHOP_SKIN_URL . '/img/sns_twt_s.png'); echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_SHOP_SKIN_URL . '/img/sns_goo_s.png'); echo "</div>\n"; } echo "</li>\n"; }
function get_list_trendy($where, $order, $esLayout) { global $es_settings, $wpdb, $wp_query; $paged = isset($_GET['page_no']) ? $_GET['page_no'] : 0; if (empty($order)) { $order = get_order(); } $sql = "SELECT * FROM {$wpdb->prefix}estatik_properties {$where} {$order} LIMIT {$paged}, {$es_settings->no_of_listing}"; $es_my_listing = $wpdb->get_results($sql); if (!empty($es_my_listing)) { ?> <h1><?php echo $wp_query->post->post_title; ?> </h1> <div class="es_my_listing"> <div class="es_listing_change"> <?php if ($es_settings->view_first_on_off == 1) { include 'es_view_first.php'; } ?> </div> <ul class="clearfix <?php echo es_get_layout($esLayout); ?> "> <?php foreach ($es_my_listing as $list) { $photo_info = get_images($list->prop_id); $image_url = $photo_info[0]; // $uploaded_images_count = $photo_info[1]; ?> <li class="es_listing_item prop_id-<?php echo $list->prop_id; ?> "> <a href="<?php echo get_permalink($list->prop_id); ?> " class="es_my_list_in" style="background-image: url(<?php echo $image_url; ?> )"> </a> <div class="es_my_list_title"> <h3> <a href="<?php echo get_permalink($list->prop_id); ?> "> <?php echo es_excerpt($list->prop_address, 90); ?> </a> </h3> <h2><?php echo get_price($list->prop_price); ?> </h2> <div class="description"><?php echo es_excerpt($list->prop_description, 150); ?> </div> <?php show_specs($list, $photo_info[1], 'black'); ?> <div class="clearfix"></div> <?php show_props($list); ?> </div> <div class="hover"> <div class="overlay"> <div class="es_my_list_more clearfix"> <a href="<?php if ($list->prop_latitude != "" && $list->prop_longitude != "") { echo "{$list->prop_latitude}, {$list->prop_longitude}"; } ?> " class="es_button es_map_view"> <?php _e("View on map", 'es-plugin'); ?> </a> <a href="<?php echo get_permalink($list->prop_id); ?> " class="es_button es_detail_btn"> <?php _e("Details", 'es-plugin'); ?> </a> </div> <?php show_specs($list, $photo_info[1], 'white'); ?> </div> <div class="bottom"></div> </div> </li> <?php } } else { echo '<li class="es_no_record">' . __("No record found.", 'es-plugin') . '</li>'; } ?> </ul> <div id="es_content"> <div id="es_map_pop_outer"> <div id="es_map_pop"> <h2><?php _e("Map", 'es-plugin'); ?> <a id="es_closePop" href="javascript:void(0)">×</a></h2> <div id="es_map"></div> </div> </div> </div> <div id="es_more_pagi"> <?php es_pagination(array(), $where); ?> </div> </div> <?php }
<?php header("Content-Type:application/json"); include "functions.php"; if (!empty($_GET['name'])) { $name = $_GET['name']; $price = get_price($name); if (empty($price)) { deliver_response(200, "book not found", NULL); } else { deliver_response(200, "book found", $name); } } else { //throw invalid request deliver_response(400, 'Invalid request', null); } function deliver_response($status, $status_message, $data) { header("HTTP/1.1 {$status}.{$status_message}"); $response['status'] = $status; $response['status_message'] = $status_message; $response['data'] = $data; $json_response = json_encode($response); echo $json_response; }
public function add_to_cart($id) { print_r($_POST); if (isset($_POST['qty']) && !empty($_POST['qty'])) { $qty = $this->input->post('qty'); } else { $qty = 1; } $produs = $this->mysql->get_row('products', array('id' => $id)); $pret = get_price(unserialize($produs['prices']), 10); $insert = array('id' => $id, 'qty' => $qty, 'price' => $pret, 'name' => $produs['name_' . $this->lng], 'image' => $produs['photo'], 'parent' => $produs['parent']); $this->cart->insert($insert); $cart = $this->cart->contents(); //echo '<pre>'; print_r($insert); print_r($cart); if ($_SERVER['HTTP_REFERER']) { $url = $_SERVER['HTTP_REFERER']; } else { $url = "/" . $this->lng . "/product" . $produs[id]; } if ($_POST['to_cart']) { $url = "/" . $this->lng . "/cart"; } redirect($url); }
private function get_collectibles_tot() { $totalOb = 0; $members = $this->member_model->get_memberlist(); foreach ($members as $member) { $member_id = $member->member_id; $outsanding_balance = 0; $initial_balance = empty($member->initial_ob) ? 0 : $member->initial_ob; $consumed_cubic = $amount = $wmmPaid = $amtPaid = $discPaid = $penPaid = $adjPaid = $otherchargesPaid = $regdiscPaid = $total_reading_price = 0; $wmm = WMM; $accounts_list = array(); $accounts = $this->account_model->get_reading($member_id, Null, 'ASC'); foreach ($accounts as $key => $account_read) { $accounts_list[$account_read->date][$account_read->meter_reading_id] = $account_read; } foreach (array_keys($accounts_list) as $billing_period) { $current_reading = 0; $previous_reading = 0; foreach ($accounts_list[$billing_period] as $reading) { $current_reading = $current_reading + $reading->current_reading; $previous_reading = $previous_reading + $reading->previous_reading; } $consumed_cubic = $current_reading - $previous_reading; $total_reading_price = $total_reading_price + (get_price($consumed_cubic) + $wmm); } $payments = $this->payment_model->get_payments($member_id); foreach ($payments as $payment) { $wmmPaid = $wmmPaid + (empty($payment->wmm) ? 0 : $payment->wmm); $amtPaid = $amtPaid + (empty($payment->amount) ? 0 : $payment->amount); $discPaid = $discPaid + (empty($payment->discount) ? 0 : $payment->discount); $penPaid = $penPaid + (empty($payment->penalty) ? 0 : $payment->penalty); $adjPaid = $adjPaid + (empty($payment->adjustment) ? 0 : $payment->adjustment); $otherchargesPaid = $otherchargesPaid + (empty($payment->other_charges) ? 0 : $payment->other_charges); $regdiscPaid = $regdiscPaid + (empty($payment->regular_discount) ? 0 : $payment->regular_discount); } $outsanding_balance = $initial_balance + $total_reading_price - ($amtPaid + $discPaid + $adjPaid + $regdiscPaid + $wmmPaid); $members_data[$member_id] = array('first_name' => $member->first_name, 'last_name' => $member->last_name, 'account_number' => $member->account_number, 'serial_number' => $member->serial_number, 'zone' => $member->zone, 'purok' => $member->purok, 'address' => $member->address, 'nature' => $member->nature, 'status' => $member->status, 'total_ob' => $outsanding_balance); $totalOb = $totalOb + $outsanding_balance; } $members_data['total_ob'] = array('', '', '', '', '', '', '', '', 'Total', $totalOb); return $members_data; }
function woo_insert_update_data($post) { global $wpdb, $woocommerce; $_POST = $post; // Fix: PHP 5.4 $editable_fields = array('_billing_first_name', '_billing_last_name', '_billing_email', '_billing_address_1', '_billing_address_2', '_billing_city', '_billing_state', '_billing_country', '_billing_postcode', '_billing_phone', '_shipping_first_name', '_shipping_last_name', '_shipping_address_1', '_shipping_address_2', '_shipping_city', '_shipping_state', '_shipping_country', '_shipping_postcode', 'order_status'); $new_product = json_decode($_POST['edited']); $result = array('productId' => array()); // To get distinct meta_key for Simple Products. => Executed only once $post_meta_info = $wpdb->get_col("SELECT distinct postmeta.meta_key FROM {$wpdb->prefix}postmeta AS postmeta INNER JOIN {$wpdb->prefix}posts AS posts on posts.ID = postmeta.post_id WHERE posts.post_type='product' AND posts.post_status IN ('publish','draft')"); // To get distinct meta_key for Child Products i.e. Variations. => Executed only once $post_meta_info_variations = $wpdb->get_col("SELECT distinct postmeta.meta_key FROM {$wpdb->prefix}postmeta AS postmeta INNER JOIN {$wpdb->prefix}posts AS posts on posts.ID = postmeta.post_id WHERE posts.post_type='product_variation' AND posts.post_status IN ('publish','draft') AND posts.post_parent > 0"); // meta_key required for new products, that are entered through Smart Manager if (count($post_meta_info) <= 0 || count($post_meta_info) < 23) { $post_meta_info = array('_edit_last', '_edit_lock', '_regular_price', '_sale_price', '_weight', '_length', '_width', '_height', '_tax_status', '_tax_class', '_stock_status', '_visibility', '_featured', '_sku', '_product_attributes', '_downloadable', '_virtual', '_sale_price_dates_from', '_sale_price_dates_to', '_price', '_stock', '_manage_stock', '_backorders'); } if (is_foreachable($new_product)) { foreach ($new_product as $obj) { if ($_POST['active_module'] == 'Products') { $price = get_price($obj->_regular_price, $obj->_sale_price, $obj->_sale_price_dates_from, $obj->_sale_price_dates_to); if (isset($obj->id) && $obj->id != '') { $product_custom_fields = get_post_custom($obj->id); // woocommerce uses this method to load product's details before creating WooCommerce Product Object $post = get_post($obj->id); // woocommerce load posts from cache $terms = wp_get_object_terms($obj->id, 'product_type', array('fields' => 'names')); // woocommerce gets product_type using this method $product_type = isset($terms[0]) ? sanitize_title($terms[0]) : 'simple'; if ($product_type == 'variable') { // To unset price fields for Parent Products having variations $obj->_regular_price = ''; $obj->_sale_price = ''; $obj->_price = $price = $product_custom_fields['_min_variation_sale_price'][0] === '' || $product_custom_fields['_min_variation_regular_price'][0] < $product_custom_fields['_min_variation_sale_price'][0] ? $product_custom_fields['_min_variation_regular_price'][0] : $product_custom_fields['_min_variation_sale_price'][0]; } } else { //to not include current date for sales price for new product $obj->_sale_price_dates_from = ''; $obj->_sale_price_dates_to = ''; $price = get_price($obj->_regular_price, $obj->_sale_price, $obj->_sale_price_dates_from, $obj->_sale_price_dates_to); } if (!(empty($obj->post_parent) || $obj->post_parent == '')) { $id = $obj->post_parent; $product_type_parent = wp_get_object_terms($id, 'product_type', array('fields' => 'slugs')); } if ($_POST['SM_IS_WOO16'] == "true") { if ($obj->post_parent > 0 && $product_type_parent[0] != "grouped") { $price = $obj->_regular_price; } } // create an array to be used for updating product's details. add modified value from Smart Manager & rest same as in original post $postarr = array('ID' => isset($obj->id) ? $obj->id : '', 'post_author' => isset($post->post_author) ? $post->post_author : '', 'post_content' => isset($obj->post_content) ? $obj->post_content : '', 'post_title' => isset($obj->post_title) ? $obj->post_title : '', 'post_excerpt' => isset($obj->post_excerpt) ? $obj->post_excerpt : '', 'post_date' => isset($post->post_date) ? $post->post_date : '', 'post_date_gmt' => isset($post->post_date_gmt) ? $post->post_date_gmt : '', 'post_status' => isset($obj->post_status) ? $obj->post_status : '', 'comment_status' => isset($post->comment_status) ? $post->comment_status : 'open', 'ping_status' => isset($post->ping_status) ? $post->ping_status : 'open', 'post_parent' => isset($obj->post_parent) ? $obj->post_parent : $post->post_parent, 'guid' => isset($post->guid) ? $post->guid : site_url() . '/?post_type=product&p=' . $post->ID, 'menu_order' => isset($post->menu_order) ? $post->menu_order : 0, 'post_type' => isset($post->post_type) ? $post->post_type : 'product', 'comment_count' => isset($post->comment_count) ? $post->comment_count : 0, 'ancestors' => isset($post->ancestors) ? $post->ancestors : array(), 'filter' => isset($post->filter) ? $post->filter : 'raw', '_product_attributes' => isset($product_custom_fields['_product_attributes'][0]) ? $product_custom_fields['_product_attributes'][0] : serialize(array()), 'user_ID' => 1, 'action' => 'editpost', 'originalaction' => 'editpost', 'original_post_status' => 'auto-draft', 'auto_draft' => 1, 'post_ID' => $obj->id, 'hidden_post_status' => 'draft', 'hidden_post_visibility' => 'public', '_visibility' => isset($obj->_visibility) ? $obj->_visibility : 'visible', 'original_publish' => 'Publish', 'publish' => 'Publish', 'newproduct_cat' => 'New Product Category Name', 'newproduct_cat_parent' => -1, 'content' => isset($obj->post_content) ? $obj->post_content : $post->post_content, 'product-type' => isset($product_type) ? $product_type : 'simple', '_virtual' => isset($product_custom_fields['_virtual'][0]) ? $product_custom_fields['_virtual'][0] : 'no', '_downloadable' => isset($product_custom_fields['_downloadable'][0]) ? $product_custom_fields['_downloadable'][0] : 'no', '_featured' => isset($product_custom_fields['_featured'][0]) ? $product_custom_fields['_featured'][0] : 'no', '_sku' => isset($obj->_sku) ? $obj->_sku : '', '_price' => $price, '_regular_price' => isset($obj->_regular_price) ? $obj->_regular_price : '', '_sale_price' => isset($obj->_sale_price) ? $obj->_sale_price : '', '_sale_price_dates_from' => isset($obj->_sale_price_dates_from) ? strtotime($obj->_sale_price_dates_from) : '', '_sale_price_dates_to' => isset($obj->_sale_price_dates_to) ? strtotime($obj->_sale_price_dates_to) : '', '_weight' => isset($obj->_weight) ? $obj->_weight : '', '_length' => isset($obj->_length) ? $obj->_length : '', '_width' => isset($obj->_width) ? $obj->_width : '', '_height' => isset($obj->_height) ? $obj->_height : '', '_tax_status' => isset($obj->_tax_status) ? $obj->_tax_status : 'taxable', '_tax_class' => isset($product_custom_fields['_tax_class'][0]) ? $product_custom_fields['_tax_class'][0] : '', '_manage_stock' => isset($product_custom_fields['_manage_stock'][0]) ? $product_custom_fields['_manage_stock'][0] : '', '_stock_status' => isset($product_custom_fields['_stock_status'][0]) ? $product_custom_fields['_stock_status'][0] : '', '_stock' => isset($obj->_stock) ? $obj->_stock : '', '_backorders' => isset($product_custom_fields['_backorders'][0]) ? $product_custom_fields['_backorders'][0] : 'no', 'excerpt' => isset($obj->post_excerpt) ? $obj->post_excerpt : $post->post_excerpt, 'advanced_view' => 1); if ($obj->post_parent == 0 && $obj->product_type != 'variable' || $product_type_parent[0] == "grouped") { $post_id = wp_insert_post($postarr); $post_meta_key = $post_meta_info; } else { $parent_id = $postarr['post_parent']; $post_id = $postarr['ID']; $post_meta_key = $post_meta_info_variations; } array_push($result['productId'], $post_id); foreach ($post_meta_key as $object) { // ================================================================================================ // Code for enabling negative values for inline editing // ================================================================================================ // if ( $object == '_sale_price' || $object == '_price' || $object == '_regular_price' ) { // update_post_meta($wpdb->_real_escape($post_id), $wpdb->_real_escape($object), $wpdb->_real_escape($postarr[$object]) ); // continue; // } // ================================================================================================ if (isset($postarr[$object]) && $postarr[$object] > -1) { // to skip query for blank value //Code to handle the condition for the attribute visibility on product page issue while save action if ($object == '_product_attributes' && isset($product_custom_fields['_product_attributes'][0])) { continue; } if (empty($obj->id) || $obj->id == '') { $query = "INSERT INTO {$wpdb->prefix}postmeta(post_id,meta_key,meta_value) values(" . $wpdb->_real_escape($post_id) . ", '" . $wpdb->_real_escape($object) . "', '" . $wpdb->_real_escape($postarr[$object]) . "')"; $var = $wpdb->query($query); wp_set_object_terms($post_id, 'simple', 'product_type'); } else { //$query = "UPDATE {$wpdb->prefix}postmeta SET meta_value = '".$wpdb->_real_escape($postarr[$object])."' WHERE post_id = " . $wpdb->_real_escape($post_id) . " AND meta_key = '" . $wpdb->_real_escape($object) . "'"; update_post_meta($wpdb->_real_escape($post_id), $wpdb->_real_escape($object), $wpdb->_real_escape($postarr[$object])); } } } //Code For updating the parent price of the product if ($parent_id > 0) { variable_price_sync($parent_id); } } elseif ($_POST['active_module'] == 'Orders') { foreach ($obj as $key => $value) { if (in_array($key, $editable_fields)) { if ($key == 'order_status') { $term_taxonomy_id = get_term_taxonomy_id($value); $query = "UPDATE {$wpdb->prefix}term_relationships SET term_taxonomy_id = " . $wpdb->_real_escape($term_taxonomy_id) . " WHERE object_id = " . $wpdb->_real_escape($obj->id) . ";"; if ($value == 'processing' || $value == 'completed') { $order = new WC_Order($obj->id); $order->update_status($value); } } else { $query = "UPDATE {$wpdb->prefix}postmeta SET meta_value = '" . $wpdb->_real_escape($value) . "' WHERE post_id = " . $wpdb->_real_escape($obj->id) . " AND meta_key = '" . $wpdb->_real_escape($key) . "';"; } $wpdb->query($query); } } } elseif ($_POST['active_module'] == 'Customers') { //Query to get the email and customer_user for all the selected ids $query_email = "SELECT DISTINCT(GROUP_CONCAT( meta_value\n ORDER BY meta_id SEPARATOR '###' ) )AS meta_value,\n GROUP_CONCAT(distinct meta_key\n ORDER BY meta_id SEPARATOR '###' ) AS meta_key\n FROM {$wpdb->prefix}postmeta \n WHERE meta_key in ('_billing_email','_customer_user') \n AND post_id={$wpdb->_real_escape}({$obj->id})"; $result_email = $wpdb->get_results($query_email, 'ARRAY_A'); $email = ""; $users = ""; for ($i = 0; $i < sizeof($result_email); $i++) { $meta_key = explode("###", $result_email[$i]['meta_key']); $meta_value = explode("###", $result_email[$i]['meta_value']); $postmeta[$i] = array_combine($meta_key, $meta_value); $email[$i] = $postmeta[$i]['_billing_email']; $users[$i] = $postmeta[$i]['_customer_user']; unset($meta_key); unset($meta_value); } $email = "'" . implode("','", $email) . "'"; $users = implode(",", $users); //Query for getting al the post ids using the email id if ($users == 0) { $query_ids = "SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value = {$email}"; $id = implode(", ", $wpdb->get_col($query_ids)); } foreach ($obj as $key => $value) { if (in_array($key, $editable_fields)) { if ($users == 0) { $query = "UPDATE {$wpdb->prefix}postmeta SET meta_value = '" . $wpdb->_real_escape($value) . "' WHERE post_id IN ({$id}) AND meta_key = '" . $wpdb->_real_escape($key) . "';"; } elseif ($users > 0) { $key = substr($key, 1); //removing the first underscore from the column name as the columns for p_usermeta are different from that of wp_postmeta //Code for updating the email of the Customer in the wp_users Table if ($key == "billing_email") { $query = "UPDATE {$wpdb->prefix}users SET user_email = '" . $wpdb->_real_escape($value) . "' WHERE id IN ({$users}) ;"; $wpdb->query($query); } $query = "UPDATE {$wpdb->prefix}usermeta SET meta_value = '" . $wpdb->_real_escape($value) . "' WHERE user_id IN ({$users}) AND meta_key = '" . $wpdb->_real_escape($key) . "';"; } $wpdb->query($query); } } } if (empty($obj->id) || $obj->id == '') { if (!isset($result['inserted'])) { $result['inserted'] = 1; $result['insertCnt'] = 1; } else { $result['insertCnt']++; } } else { if (!isset($result['updated'])) { $result['updated'] = 1; $result['updateCnt'] = 1; } else { $result['updateCnt']++; } } } } else { $result = array('inserted' => 0, 'insertCnt' => 0, 'updated' => 0, 'updateCnt' => 0); } //Clearing the transients to handle the proper functioning of the widgets $woocommerce->clear_product_transients(); return $result; }
<th scope="col">삭제</th> </tr> </thead> <tbody> <?php $sql = " select a.wi_id, a.wi_time, b.* from {$g5['g5_shop_wish_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id ) "; $sql .= " where a.mb_id = '{$member['mb_id']}' order by a.wi_id desc "; $result = sql_query($sql); for ($i = 0; $row = mysql_fetch_array($result); $i++) { $out_cd = ''; $sql = " select count(*) as cnt from {$g5['g5_shop_item_option_table']} where it_id = '{$row['it_id']}' and io_type = '0' "; $tmp = sql_fetch($sql); if ($tmp['cnt']) { $out_cd = 'no'; } $it_price = get_price($row); if ($row['it_tel_inq']) { $out_cd = 'tel_inq'; } $image = get_it_image($row['it_id'], 70, 70); ?> <tr> <td class="td_chk"> <?php // 품절검사 if (is_soldout($row['it_id'])) { ?> 품절 <?php } else {
function update_price_meta($ids = '') { global $wpdb; if (!empty($ids)) { $where_price = !empty($ids) ? "post_id IN ({$ids}) AND " : ''; $query = "SELECT post_id,\n GROUP_CONCAT( meta_key ORDER BY meta_id SEPARATOR '##' ) AS meta_keys, \n GROUP_CONCAT( meta_value ORDER BY meta_id SEPARATOR '##' ) AS meta_values \n FROM {$wpdb->prefix}postmeta \n WHERE {$where_price} meta_Key IN ( '_regular_price', '_sale_price', '_sale_price_dates_from', '_sale_price_dates_to' ) \n GROUP BY post_id"; $results = $wpdb->get_results($query, 'ARRAY_A'); foreach ($results as $result) { $meta_keys = explode('##', $result['meta_keys']); $meta_values = explode('##', $result['meta_values']); if (count($meta_keys) == count($meta_values)) { $keys_values = array_combine($meta_keys, $meta_values); $from_date = isset($keys_values['_sale_price_dates_from']) ? $keys_values['_sale_price_dates_from'] : ''; $to_date = isset($keys_values['_sale_price_dates_to']) ? $keys_values['_sale_price_dates_to'] : ''; $price = get_price(trim($keys_values['_regular_price']), trim($keys_values['_sale_price']), $from_date, $to_date); $price = trim($price); // For handling when both price and sales price are null if (!empty($price)) { $update_query = "UPDATE {$wpdb->prefix}postmeta SET meta_value = {$price} WHERE meta_key = '_price' AND post_id = " . $result['post_id']; } else { $update_query = "UPDATE {$wpdb->prefix}postmeta SET meta_value = '' WHERE meta_key = '_price' AND post_id = " . $result['post_id']; } $wpdb->query($update_query); } } } }
if ($row['it_cust_price']) { echo "<span>" . round((1 - get_price($row) / $row['it_cust_price']) * 100, 0) . "%</span>\n"; } else { echo "<span class=\"sct_no_sale\">특별가</span>\n"; } echo "</div>\n"; echo "<div class=\"sct_cost\">\n"; if ($this->view_it_cust_price && $row['it_cust_price']) { echo "<strike>" . display_price($row['it_cust_price']) . "</strike>\n"; } //150824 나진수 시중 가격 없을때는 특별가로 처리 if ($this->view_it_price) { if ($row['it_cust_price']) { echo "<span>" . display_price(get_price($row), $row['it_tel_inq']) . "</span>\n"; } else { echo "<span class=\"it_no_tel_inq\">" . display_price(get_price($row), $row['it_tel_inq']) . "</span>\n"; } } echo "</div>\n"; } echo "</li></a>\n"; } if ($i > 0) { echo "</ul>\n"; } if ($i == 0) { echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\n"; } ?> <!-- } 상품진열 10 끝 -->
</td> <td><?php echo get_price($product_id); ?> </td> <td><input type="text" name="product<?php echo $product_id; ?> " value="<?php echo $quantity; ?> " maxlength="3" size="2"/> </td> <td>$ <?php echo get_price($product_id) * $quantity; ?> </td> <td><a href="javascript:del(<?php echo $product_id; ?> )">Remove</a></td> <?php } ?> </tr> </tbody> </table> </form>
<h3 style="text-transform:uppercase"><span><?php echo lang('produk'); ?> </span> <?php echo lang('ratinggi'); ?> </h3> </div> <? if($rate){?> <table class="list-produk1"> <tr> <? $ln3=0;$jml_data3=count($rate); foreach($rate as $lsrate){$ln3++; $gbr=unserialize($lsrate->gbr); #print_r($gbr); $ha=get_price($lsrate->ha_prop,$lsrate->hb_prop,$lsrate->ha_diskon,$lsrate->hb_diskon,'ha'); $hb=get_price($lsrate->ha_prop,$lsrate->hb_prop,$lsrate->ha_diskon,$lsrate->hb_diskon); if($ln3==5){ if($jml_data3<=8) echo '<tr class="not">'; else echo '<tr>'; }elseif($ln3==9) echo '<tr class="not">'; if(isset($gbr['intro'])){ $gb=$gbr['intro'];} elseif(isset($gbr['big'][1])){ $gb=$gbr['big'][1];} else $gb=false; ?> <td><br /><div class="ct"> <h5><a href="<?php echo site_url('home/detail/index/' . $lsrate->id . '/' . en_url_save($lsrate->nama_produk)); ?> "><?php echo $lsrate->nama_produk; ?>
function get_price_failure() { global $connection; $result_set = query_select_auction_search("different"); foreach ($result_set as $auction) { //assert((get_price($auction) == 10)); assert(get_price($auction['auctionId'], $auction['startingPrice']) == 10); } }
echo $ck->subkategori; ?> <br> <label><?php echo lang('berat'); ?> </label>: <? $cv=convert_unit($ck->berat);echo $cv['hasil'].' '.$cv['satuan'];?><br> <label><?php echo lang('berat_total'); ?> </label>: <? $bt=$ck->berat*$ck->qty; $cv2=convert_unit($bt);echo $cv2['hasil'].' '.$cv2['satuan'];?> </li> </td> <? $theprice = get_price($ck->ha_prop,$ck->hb_prop,$ck->ha_diskon,$ck->hb_diskon); if($theprice==0)$theprice = get_price($ck->ha_prop,$ck->hb_prop,$ck->ha_diskon,$ck->hb_diskon,'ha'); $jmlprice = $theprice*$ck->qty; ?> <td align="center"><?php echo $ck->qty; ?> </td> <td align="center">Rp <?php echo currency($theprice); ?> </td> <td align="center"><span class="rp">Rp <?php echo currency($jmlprice); ?> </span></td>
echo "<div class=\"sct_cost\">\n"; //150824 나진수 시중 가격 없을때는 특별가로 처리 if ($row['it_cust_price']) { echo "<div class=\"sct_sale\">" . round((1 - get_price($row) / $row['it_cust_price']) * 100, 0) . "% </div>\n"; } else { echo "<div class=\"sct_no_sale\" style=\"font-size\">특별가</div>\n"; } if ($this->view_it_cust_price && $row['it_cust_price']) { echo "<strike>" . display_price($row['it_cust_price']) . "</strike>\n"; } if ($this->view_it_price) { //150824 나진수 시중 가격 없을때는 특별가로 처리 if ($row['it_cust_price']) { echo "<div class=\"it_tel_inq\">" . display_price(get_price($row), $row['it_tel_inq']) . "</div>\n"; } else { echo "<div class=\"it_tel_no_inq\">" . display_price(get_price($row), $row['it_tel_inq']) . "</div>\n"; } } echo "</div>\n"; } if ($this->view_sns) { $sns_top = $this->img_height + 10; $sns_url = G5_SHOP_URL . '/item.php?it_id=' . $row['it_id']; $sns_title = get_text($row['it_name']) . ' | ' . get_text($config['cf_title']); echo "<div class=\"sct_sns\" style=\"top:{$sns_top}px\">"; echo get_sns_share_link('facebook', $sns_url, $sns_title, G5_SHOP_SKIN_URL . '/img/sns_fb_s.png'); echo get_sns_share_link('twitter', $sns_url, $sns_title, G5_SHOP_SKIN_URL . '/img/sns_twt_s.png'); echo get_sns_share_link('googleplus', $sns_url, $sns_title, G5_SHOP_SKIN_URL . '/img/sns_goo_s.png'); echo "</div>\n"; } echo "</li></a>\n";
include "includes/functions.php"; if ($_REQUEST['command'] == 'update') { $name = $_REQUEST['name']; $email = $_REQUEST['email']; $address = $_REQUEST['address']; $phone = $_REQUEST['phone']; $result = mysql_query("insert into customers values('','{$name}','{$email}','{$address}','{$phone}')"); $customerid = mysql_insert_id(); $date = date('Y-m-d'); $result = mysql_query("insert into orders values('','{$date}','{$customerid}')"); $orderid = mysql_insert_id(); $max = count($_SESSION['cart']); for ($i = 0; $i < $max; $i++) { $pid = $_SESSION['cart'][$i]['productid']; $q = $_SESSION['cart'][$i]['qty']; $price = get_price($pid); mysql_query("insert into order_detail values ({$orderid},{$pid},{$q},{$price})"); } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>UMKM-SBY</title> <link rel="shortcut icon" href="favicon1.ico"> <script language="javascript"> function validate(){ var f=document.form1; if(f.name.value==''){ alert('Kolom harus terisi semua (kolom nama)'); f.name.focus();
function relation_item($it_id, $width, $height, $rows = 3) { global $g5; $str = ''; if (!$it_id) { return $str; } $sql = " select b.it_id, b.it_name, b.it_price, b.it_tel_inq from {$g5['g5_shop_item_relation_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id2 = b.it_id ) where a.it_id = '{$it_id}' order by ir_no asc limit 0, {$rows} "; $result = sql_query($sql); for ($i = 0; $row = sql_fetch_array($result); $i++) { if ($i == 0) { $str .= '<span class="sound_only">관련 상품 시작</span>'; $str .= '<ul class="sct_rel_ul">'; } $it_name = get_text($row['it_name']); // 상품명 $it_price = get_price($row); // 상품가격 if (!$row['it_tel_inq']) { $it_price = display_price($it_price); } $img = get_it_image($row['it_id'], $width, $height); $str .= '<li class="sct_rel_li"><a href="' . G5_SHOP_URL . '/item.php?it_id=' . $row['it_id'] . '" class="sct_rel_a">' . $img . '</a></li>'; } if ($i > 0) { $str .= '</ul><span class="sound_only">관련 상품 끝</span>'; } return $str; }
echo $pname; ?> </td> <td>$ <?php echo get_price($pid); ?> </td> <td><input type="text" name="product<?php echo $pid; ?> " value="<?php echo $q; ?> " maxlength="3" size="2" /></td> <td>$ <?php echo get_price($pid) * $q; ?> </td> <td><a href="javascript:del(<?php echo $pid; ?> )">Remove</a></td></tr> <?php } ?> <tr><td><b>Order Total: $<?php echo get_order_total(); ?> </b></td><td colspan="5" align="right"><input type="button" value="Clear Cart" onclick="clear_cart()"><input type="button" value="Update Cart" onclick="update_cart()"><input type="button" value="Place Order" onclick="window.location='billing.php'"></td></tr> <?php } else {
</div><!-- /.property-row-picture --> <div class="property-row-content col-sm-6 col-md-6 col-lg-8"> <h3 class="property-row-title"> <a href="#">9115 Cinder Anchor Limits</a> </h3><!-- /.property-row-title --> <h4 class="property-row-subtitle"> <a href="#"><?php echo get_location(); ?> , 94108</a> </h4><!-- /.property-row-subtitle --> <div class="property-row-price"><?php echo get_price(); ?> </div><!-- /.property-row-price --> <p class="property-row-body"> In facilisis sem id quam dictum laoreet. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam fermentum urna nec bibendum hendrerit. Mauris nec ante sapien. </p><!-- /.property-row-body --> </div><!-- /.property-row-content --> </div><!-- /.row --> </div><!-- /.property-row --> </div><!-- /.property-rows --> <div class="center"> <ul class="pagination"> <li><a href="#">«</a></li> <li><a href="#">1</a></li>
echo display_price($it['it_cust_price']); ?> </td> </tr> <?php } ?> <tr> <th scope="row">판매가격</th> <td style="color:#ff455b"> <?php echo display_price(get_price($it)); ?> <input type="hidden" id="it_price" value="<?php echo get_price($it); ?> "> </td> </tr> <?php } } ?> <?php if ($it['it_maker'] && $it['it_origin']) { ?> <tr> <th scope="row">제조사/원산지</th> <td><?php