public function index() { $order_sn = strim($_REQUEST['order_sn']); $time = isset($_REQUEST['time']) ? to_date(to_timespan($_REQUEST['time'], "Y-m-d"), "Y-m-d") : ""; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $condition = " 1=1 "; if ($order_sn != "") { $condition .= " and go.order_sn = '" . $order_sn . "' "; } if ($time != "") { $condition .= " and go.ex_date = '" . $time . "' "; $GLOBALS['tmpl']->assign('time', $time); } $user_id = $GLOBALS['user_info']['id']; $result = get_order($limit, $user_id, $condition); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("order_sn", $order_sn); $GLOBALS['tmpl']->assign("order_info", $result['list']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_goods_order.html"); $GLOBALS['tmpl']->display("page/uc.html"); }
function template_include($template) { $order = get_order(); // point the progress bar to the final step if the order is complete. // by default, it shows the gateway process step (options/pay) when the order is processed by the gateway if ($order && in_array($order->get_status(), array(APPTHEMES_ORDER_PAID, APPTHEMES_ORDER_COMPLETED, APPTHEMES_ORDER_ACTIVATED))) { add_filter('appthemes_form_progress_current_step', array($this, 'set_summary_step')); } return $template; }
public function index() { $root = array(); $email = strim($GLOBALS['request']['email']); //用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); //密码 $id = intval($GLOBALS['request']['id']); //$user_id = intval($GLOBALS['user_info']['id']); $page = intval($GLOBALS['request']['page']); //检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); if ($user_id > 0) { require APP_ROOT_PATH . 'app/Lib/deal.php'; require APP_ROOT_PATH . 'app/Lib/uc_goods_func.php'; $root['user_login_status'] = 1; $root['response_code'] = 1; $order_sn = strim($_REQUEST['order_sn']); $time = isset($_REQUEST['time']) ? to_date(to_timespan($_REQUEST['time'], "Y-m-d"), "Y-m-d") : ""; if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $condition = " 1=1 "; if ($order_sn != "") { $condition .= " and go.order_sn = '" . $order_sn . "' "; } if ($time != "") { $condition .= " and go.ex_date = '" . $time . "' "; $root['time'] = $time; } $root['user_id'] = $user_id; $orders = get_order($limit, $user_id, $condition); $root['page'] = array("page" => $page, "page_total" => ceil($orders['count'] / app_conf("DEAL_PAGE_SIZE")), "page_size" => app_conf("DEAL_PAGE_SIZE")); $root['order_sn'] = $order_sn; $root['order_info'] = $orders['list']; } else { $root['response_code'] = 0; $root['show_err'] = "未登录"; $root['user_login_status'] = 0; } $root['program_title'] = "我的兑现"; output($root); }
public function index($category = NULL, $term = NULL, $start = 0) { // Redirect if ($this->input->post('btnAction') == 'search') { $category = $this->input->post('category'); $term = $this->input->post('search'); unset($_POST); redirect('/search/' . $category . '/' . $term); } // Assign base variables $this->data->layout = $this->input->cookie('firesale_listing_style') ? $this->input->cookie('firesale_listing_style') : 'grid'; $this->data->order = get_order($this->input->cookie('firesale_listing_order') ? $this->input->cookie('firesale_listing_order') : 1); $this->data->categories = $this->search_m->get_cat_dropdown($category); $this->data->ordering = get_order(); $this->data->products = FALSE; $this->data->parent = 0; $this->data->current = $term; $this->data->cat = $category; // Check for search term if ($term !== NULL) { // Update search terms $this->search_m->update_terms($term); // Check for category match first if ($category != 'all' and $is_cat = $this->search_m->check_category($term)) { // Send there if we got exact match redirect('/category/' . $is_cat); } // Get search results $total_rows = $this->search_m->perform_search($category, $term, 0, 0, NULL, TRUE); $this->data->products = $this->search_m->perform_search($category, $term, $start, $this->perpage, $this->data->order); if ($total_rows > 1) { if ($total_rows > $this->perpage) { // Assign pagination $this->data->pagination = create_pagination("/search/{$category}/{$term}/", $total_rows, $this->perpage, 4); } // Get images foreach ($this->data->products as $key => $product) { $product['image'] = $this->products_m->get_single_image($product['id']); $product['description'] = strip_tags($product['description']); $this->data->products[$key] = $product; } // Assign current search $this->data->from = $start; $this->data->to = $start + $this->perpage; $this->data->total = $total_rows; } else { if ($total_rows == 1 and !$this->input->is_ajax_request()) { // Redirect to page with one result redirect('/product/' . $this->data->products[0]['slug']); } } } // Check for ajax if ($term !== NULL and $this->input->is_ajax_request()) { $results = array(); foreach ($this->data->products as $result) { $results[] = array('label' => $result['title'], 'value' => '/product/' . $result['slug']); } echo json_encode($results); exit; } else { // Build page $this->template->set_breadcrumb('Home', '/')->set_breadcrumb(lang('firesale:sections:search'), '/search')->append_css('module::search.css')->title(sprintf(lang('firesale:sections:search' . ($term != NUll ? '_results' : '')), $term))->build('search', $this->data); } }
$settr = strtotime("-{$days} day"); $wheresql .= " addtime> {$settr} "; } $state = intval($_GET['state']); if ($state > 0) { $state = $state - 1; $wheresql .= empty($wheresql) ? " WHERE " : " AND "; $wheresql .= " state={$state} "; } } $total_sql = "SELECT COUNT(*) AS num FROM " . table('shop_order') . $wheresql; $total = $db->get_total($total_sql); $page = new page(array('total' => $total, 'perpage' => $perpage)); $currenpage = $page->nowindex; $offset = ($currenpage - 1) * $perpage; $list = get_order($offset, $perpage, $wheresql . $oederbysql); $smarty->assign('list', $list); $smarty->assign('total', $total); $smarty->assign('page', $page->show(3)); $smarty->assign('pageheader', "积分商城"); $smarty->display('shop/admin_shop_order.htm'); } elseif ($act == 'order_show') { $id = intval($_GET['id']); $show = get_order_one($id); $smarty->assign('show', $show); $smarty->assign('pageheader', "积分商城"); $smarty->display('shop/admin_shop_order_show.htm'); } elseif ($act == "order_del") { $id = $_REQUEST['id'] ? $_REQUEST['id'] : adminmsg("请选择订单", 1); $num = order_del($id); if ($num > 0) {
$user_level = get_user_level($user->ID); if ($_SERVER['REQUEST_METHOD'] == "GET") { if (!isset($_GET['ivi']) || empty($_GET['ivi'])) { header("Location: " . NOT_FOUND_URL); exit; } elseif (!($invoice = validate_invoice($user, $_GET['ivi'])) && $user_level != 10) { header("Location: " . NOT_FOUND_URL); exit; } elseif ($invoice && $user->ID != $invoice->related_user() && $user_level != 10) { header("Location: " . NOT_FOUND_URL); exit; } elseif ($user_level == 10) { $invoice = Invoice::get_invoice_with_id(get_id($_GET['ivi'])); } //TODO get just title of order instead of all of that; $order = get_order($invoice->related_order(), $invoice->get_related_user_id()); // var_dump($order); $status_array = array(0 => "غیر فعال", 1 => "پرداخت نشده", 2 => "پرداخت شده", 3 => "منقضی"); } $persian_numbers = array(1 => "اول", 2 => "دوم", 3 => "سوم", 4 => "چهارم", 5 => "پنجم", 6 => "ششم", 7 => "هفتم", 8 => "هشتم", 9 => "نهم"); $first_name = portal_get_user_meta($invoice->get_related_user_id(), "first_name"); $last_name = portal_get_user_meta($invoice->get_related_user_id(), "last_name"); $phone = portal_get_user_meta($invoice->get_related_user_id(), "phone_number"); ?> <html> <head> <title>نمایش فاکتور · فاکتور <?php strval($invoice->get_id() * 100 + 365); ?>
if ($settr > 0) { $days = intval($settr); $settr = strtotime("-{$days} day"); $wheresql .= " AND addtime> {$settr} "; } $key = trim($_GET['key']); if (!empty($key)) { $wheresql .= " AND shop_title like '%{$key}%'"; } require_once QISHI_ROOT_PATH . 'include/page.class.php'; $total_sql = "SELECT COUNT(*) AS num FROM " . table('shop_order') . $wheresql; $total_val = $db->get_total($total_sql); $page = new page(array('total' => $total_val, 'getarray' => $_GET)); $perpage = 10; $offset = ($page->nowindex - 1) * $perpage; $smarty->assign('list', get_order($offset, $perpage, $wheresql)); if ($total_val > $perpage) { $smarty->assign('page', $page->show(3)); } $smarty->display($mypage['tpl'] . 'shop_order_list.htm'); } elseif ($act == 'order_add') { $key = trim($_GET["key"]); $id = intval($_GET['id']); $num = intval($_GET['num']); //兑换数目 $keystr = substr(md5($id . $_SESSION['username'] . $num), 8, 16); if ($key != $keystr) { showmsg('非法链接!', 1); } $shop_show = get_shop_one($id); $smarty->assign("show", $shop_show);
function send_to_complete_url() { $order = get_order(); wp_redirect(get_post_meta($order->get_id(), 'complete_url', true)); exit; }
$local_url = $_SERVER['PHP_SELF']; $is_enroll = 0; $enroll = 0; //检查是否已报名 $sql = "SELECT count(1) as count FROM m_atv_enroll WHERE mid = '{$user['mid']}' AND aid = '{$aid}'"; if ($db->query($sql)->fetchColumn()) { $is_enroll = 1; } else { //检查是否已经满额 $sql = "SELECT aid FROM m_activites WHERE aid = '{$aid}' AND enroll >= quota"; if ($db->query($sql)->fetchColumn()) { $enroll = 1; } } //获取用户是否支付成功 $my_order = get_order($user['mid'], $aid); //print_r($my_order); if ($_POST) { $res = array('flag' => 0); $time = time(); if ($_POST['phone'] && $_POST['phone'] != $user['phone']) { $sql = "UPDATE m_member SET phone = :phone WHERE mid = :mid"; $param = array(':phone' => $_POST['phone'], ':mid' => $user['mid']); $sth = $db->prepare($sql); $sth->execute($param); } //该活动报名人数更新 $sql = "UPDATE m_activites SET enroll = enroll+1 WHERE aid = '{$aid}' AND enroll < quota"; if ($db->exec($sql)) { $sql = "INSERT INTO m_atv_enroll SET mid = :mid, aid = :aid, addtime = '{$time}'"; $param = array(':aid' => $_POST['aid'], ':mid' => $user['mid']);
public function test_get_order() { $order = get_order(self::$order->get_id()); $this->assertEquals($order, self::$order); }
function validate_order($user, $ori) { $order = get_order(get_id($ori), $user->ID); return is_null($order) ? false : new Order($order); }
function template_include($template) { $order = get_order(); $currentuser = wp_get_current_user(); if ($order->get_author() != $currentuser->ID) { return locate_template('404.php'); } if (apply_filters('appthemes_order_summary_skip_checks', false) == true) { return locate_template('order-checkout.php'); } if ($order->get_total() == 0) { if (count($order->get_items()) > 0 && $order->get_status() != APPTHEMES_ORDER_ACTIVATED) { $order->complete(); } return locate_template('order-summary.php'); } if (!in_array($order->get_status(), array(APPTHEMES_ORDER_PENDING, APPTHEMES_ORDER_FAILED))) { return locate_template('order-summary.php'); } $gateway = $this->resolve_gateway($order); if (empty($gateway)) { return locate_template('order-checkout.php'); } else { return locate_template('order-gateway.php'); } }
<h2 class="single dotted"><?php echo sprintf(__('Pay with %s', APP_TD), $gateway); ?> </h2> <?php } ?> <div class="order-gateway"> <?php process_the_order(); // Retrieve updated order object $order = get_order(); if (in_array($order->get_status(), array(APPTHEMES_ORDER_COMPLETED, APPTHEMES_ORDER_ACTIVATED))) { $redirect_to = get_post_meta($order->get_id(), 'complete_url', true); echo html('a', array('href' => $redirect_to), __('Continue', APP_TD)); echo html('script', 'location.href="' . $redirect_to . '"'); } ?> </div> </div><!--/post--> </div><!-- /shadowblock --> </div><!-- /shadowblock_out -->
function route_post_order_action($local_id) { global $MC_Text; if (!preg_match('/^\\d+$/', $local_id)) { status(HTTP_NOT_FOUND); exit; } $member = authOpenAPIMember(); if ($member === FALSE) { status(HTTP_FORBIDDEN); exit; } $uid = $member['id']; $order = get_order($local_id); if ($order === FALSE) { status(HTTP_NOT_FOUND); exit; } $response = array(); $act = $_POST['act']; switch ($act) { case 'cancel': if ($order['uid'] != $member['id']) { status(HTTP_FORBIDDEN); exit; } if (($order['flags'] & FLAG_DELETED) == FLAG_DELETED) { return json_error('ORDER_CANCELLED'); } if (($order['flags'] & FLAG_REPLIED) == FLAG_REPLIED) { return json_error('ORDER_COMMITTED'); } // Start and lock 'reverse-order' transaction $temp = start_order_transaction($uid, -$order['amount']); if ($temp === FALSE) { return json_error('START_TRANS'); } // Set order 'DELETED' flag $res = $MC_Text->increment("flags-1_{$local_id}", FLAG_DELETED); if ($res === FALSE) { // Cancel transaction delete_temp_transaction($temp); return json_error('CANCEL_ORDER'); } // Commit 'reverse-order' transaction commit_transaction($temp); $response['ok'] = TRUE; // Send to common queue enqueue(array('cancel' => $local_id), ''); // Refresh balance $response['balance'] = formatBalance('USR', $uid); $response['order_balance'] = formatBalance('ORD', $uid); // Send to user's queue enqueue(array('cancel' => $local_id, 'balance' => $response['balance']), $uid); break; case 'commit': # Prevent from committing own orders #if ($order['uid'] == $member['id']) { # status(HTTP_FORBIDDEN); # exit; #} if (($order['flags'] & FLAG_DELETED) == FLAG_DELETED) { return json_error('ORDER_CANCELLED'); } if (($order['flags'] & FLAG_REPLIED) == FLAG_REPLIED) { return json_error('ORDER_COMMITTED'); } // Start and lock 'commit-order' transaction $temp = start_commit_order_transaction($uid, $order['uid'], $order['amount']); if ($temp === FALSE) { return json_error('START_TRANS'); } // Set order 'COMMITTED' flag $resp = $MC_Text->increment("flags-1_{$local_id}", FLAG_REPLIED); if ($resp === FALSE) { // Cancel transaction delete_temp_transaction($temp); return json_error('COMMIT_ORDER'); } // Commit 'commit-order' transaction $resp = commit_transaction($temp); # TODO: Store transaction id in the order $response['ok'] = TRUE; // Refresh balance $response['balance'] = formatBalance('USR', $uid); $response['order_balance'] = formatBalance('ORD', $uid); $author = $order['uid']; // Send to user's queue if ($uid != $author) { enqueue(array('commit' => $local_id, 'balance' => $response['balance']), $uid); } // Send to common queue enqueue(array('commit' => $local_id), ''); // Render author's html global $i; global $page; $i = get_order($local_id); $page = array('member' => array('id' => $author)); ob_start(); include 'templates/_order.php'; $html = ob_get_clean(); // Send to author's queue $data = array('commit' => $local_id, 'order' => $i, 'html' => $html); if ($author == $uid) { $data['balance'] = $response['balance']; } enqueue($data, $author); break; default: status(HTTP_BAD_REQUEST); exit; } send_header('Content-Type: application/json; charset=utf-8'); echo json_encode($response); }
/ command line script for updating file order in Scripto / takes one argument, which is item_id / example: php update_order.php {some_id} */ ini_set('display_errors', 'On'); error_reporting(E_ALL); require_once 'db_settings.php'; function get_order($original_filename) { $sort_order = str_replace(".jp2/full/full/0/native.jpg", "", $original_filename); $sort_order = ltrim(substr($sort_order, -8), "0"); return $sort_order; } if (empty($argv[1]) && !ctype_digit($argv[1])) { echo "We need a valid item..."; exit; } else { $item_id = $argv[1]; } // Run Query $q = "SELECT id,original_filename from files where item_id=" . $item_id; $result = dbQuery($q); if (dbNumRows($result) > 0) { while ($row = dbFetchAssoc($result)) { $rec_id = $row['id']; $order = get_order($row['original_filename']); $u = "UPDATE files SET `order`=" . $order . " where id=" . $rec_id; echo $u . "\n"; $rs = dbQuery($u); } }
/** * Sets the listing order cookie with a number of possible values as * defined in the get_order helper. * * @param integer $type The ID of the ordering method to use * @return void * @access public */ public function order($type) { $orders = get_order(); if (array_key_exists($type, $orders)) { $cookie = array('name' => 'listing_order', 'value' => $type, 'expire' => '86500', 'path' => '/', 'prefix' => 'firesale_', 'secure' => FALSE); $this->input->set_cookie($cookie); } redirect($_SERVER['HTTP_REFERER']); }
<?php require_once '../../util/main.php'; require_once '../../model/database.php'; require_once '../../model/order_db.php'; $orderID = ''; if (isset($_GET['orderID'])) { $orderID = $_GET['orderID']; $order = get_order($orderID); $orderLines = get_orderlines($orderID); $total = 0; } else { exit; } ?> <div class="modal-header"> <h3 class="modal-title"> Order detail #<?php echo $orderID; ?> - <?php echo $order['locationName']; ?> </h3> </div> <div class="modal-body"> <div class="row"> <div class="col-sm-12 col-md-12"> <form class="form-horizontal"> <fieldset> <div class="form-group">
<div class="col-1"> <table class="tab"> <div class="box-title"><h1>Pesanan Masuk</h1></div> <div class="m-top"> <ul> <li><a href="?redirect=order_batal" class="w-con">Pemesanan Batal (<?php echo batal(); ?> )</a></li> <li><a href="?redirect=order_proses" class="w-con">Menunggu Konfirmasi (<?php echo cek_orderpro(); ?> )</a></li> </ul> </div> <tr class="tr-h"> <th class="head-no">No</th> <th>Kode Pesan</th> <th>Tanggal Pesan</th> <th>Jam Pesan</th> <th>Status Pesan</th> <th colspan="2">Option</th> </tr> <?php get_order(); ?> </table> </div>
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 }
/** * Displays Continue button on order summary page. * * @return void */ function cp_payments_display_order_summary_continue_button() { $url = ''; $text = ''; $step = _appthemes_get_step_from_query(); if (!is_singular(APPTHEMES_ORDER_PTYPE) && (!empty($step) && 'order-summary' !== $step)) { return; } $order = get_order(); if ($membership = cp_get_membership_package_from_order($order)) { $package = cp_get_user_membership_package($order->get_author()); if ($package) { $url = CP_ADD_NEW_URL; $text = __('Post a new Ad', APP_TD); } else { $url = CP_DASHBOARD_URL; $text = __('Visit your dashboard', APP_TD); } } else { if ($listing_id = _cp_get_order_ad_id($order)) { $url = get_permalink($listing_id); $text = __('View ad listing', APP_TD); } } echo html('p', html('em', __('Thank you for your purchase!', APP_TD))); if ($url && $text) { if (!in_array($order->get_status(), array(APPTHEMES_ORDER_PENDING, APPTHEMES_ORDER_FAILED))) { echo html('p', html('em', __('Your order has been completed!', APP_TD))); } echo html('button', array('type' => 'submit', 'class' => 'btn_orange', 'onClick' => "location.href='" . $url . "';return false;"), $text); } }
function sendShippingConfirmEmail($order_id) { $customer = get_customer(get_customer_id($order_id)); $customer_name = $customer['firstName'] . ' ' . $customer['lastName']; $customer_email = $customer['emailAddress']; $order = get_order($order_id); $order_date = strtotime($order['orderDate']); $order_date = date('M j, Y', $order_date); $order_items = get_order_items($order_id); $ship_date = date('M j, Y', strtotime($order['shipDate'])); $shipping_address = get_address($order['shipAddressID']); $ship_line1 = $shipping_address['line1']; $ship_line2 = $shipping_address['line2']; $ship_city = $shipping_address['city']; $ship_state = $shipping_address['state']; $ship_zip = $shipping_address['zipCode']; $ship_phone = $shipping_address['phone']; $copyright_date = date("Y"); set_time_limit(0); $messageHTML = <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- the head section --> <head> <title>My Guitar Shop: Shipping Confirmation</title> <style> /* the styles for the HTML elements */ body { margin-top: 0; background-color: rgb(128, 141, 159); font-family: Arial, Helvetica, sans-serif; } h1 { font-size: 150%; margin: 0; padding: .5em 0 .25em; } h2 { font-size: 120%; margin: 0; padding: .5em 0 .25em; } h1, h2 { color: rgb(205, 163, 94); } ul { margin: 0 0 1em 0; padding: 0 0 0 2.5em; } li { margin: 0; padding: .25em; } a { color: rgb(69, 85, 106); font-weight: bold; } a:hover { color: blue; } p { margin: 0; padding: .25em 0; } form { margin: .5em 0; width: 100%; } label { width: 8em; padding-right: .5em; padding-bottom: .5em; text-align: right; float: left; } textarea { width: 25em; margin-bottom: .5em; } table { border-collapse: collapse; } td, th { margin: 0; padding: .15em 0; } br { clear: both; } /* the styles for the div tags that divide the page into sections */ #page { width: 850px; margin: 0 auto; background-color: white; border: 1px solid rgb(119, 75, 77); } #header { margin: 0; border-bottom: 2px solid rgb(119, 75, 77); padding: .5em 2em; } #header h1 { margin: 0; padding: .5em 0; color: black; } #main { margin: 0; padding: .5em 2em; } #sidebar { float: left; width: 170px; } #sidebar h2 { padding: 1em 0 .25em; } #sidebar ul { list-style-type: none; margin-left: 0; padding-left: 0; margin-bottom: 2em; } #sidebar li { margin: 0; padding-bottom: .25em; } #content { float: left; width: 580px; padding-bottom: 1.5em; } #left_column { float: left; width: 150px; padding-left: .5em; } #right_column { float: left; width: 300px; padding-left: 1em; } #footer { clear: both; margin-top: 1em; padding-right: 1em; border-top: 2px solid rgb(119, 75, 77); } #footer p { text-align: right; font-size: 80%; margin: 1em 0; } /******************************************************************** * styles for the classes ********************************************************************/ .right { text-align: right; } .left { text-align: left; } .cart_qty { text-align: right; width: 3em; } .button_form { margin: 0; padding: 0; float: left; } .inline { display: inline; margin-left: .5em; } /******************************************************************** * Styles for the Product Manager application ********************************************************************/ #category_table form { margin: 0; } #category_table td { margin: 0; padding: .15em .5em 0 0; } #add_category_form { margin: 0; } #add_category_form input { margin-right: .5em; } #add_admin_user_form label { width: 8.5em; } #edit_and_delete_buttons { margin-bottom: .5em; } #edit_and_delete_buttons form { display: inline; } #image_manager input { margin: .25em; } /******************************************************************** * Styles for the Product Catalog application ********************************************************************/ #product_image_column { width: 8em; text-align: center; } /*******************************************************************/ #add_to_cart_form { margin: .25em; } #add_to_cart_form input { float: none; } /*******************************************************************/ #cart { margin: 0; padding: 1em .25em; border-collapse: collapse; width: 100%; } #cart_header th { border-bottom: 2px solid black; } #cart_footer td { border-top: 2px solid black; font-style: bold; } #cart td { padding: .25em 0; } /*******************************************************************/ #login_form label { width: 5em; padding-right: 1em; } #login_form input[text] { } #payment_form label { width: 8em; padding-right: 1em; } #payment_form input[text] { width: 5em; margin: 0; padding-right: 1em; } #add_category label { text-align: left; width: 3em; } #add_category input { margin-right: .25em; } </style> </head> <!-- the body section --> <body> <div id="page"> <div id="header"> <h1>My Guitar Shop</h1> </div> <div id="main"> <div id="content"> <h2>Shipping Confirmation</h2> <p>Hello <b>{$customer_name}</b>,<br /><br /> Thank you for shopping with us. We thought you'd like to know that we shipped your item(s), and that this completes your order. Your order is on its way, and can no longer be changed. Please allow 5-7 business days for your order to arrive.</p> <h2>Shipping Details</h2> <p>Order #{$order_id}<br /> Placed on {$order_date}<br /> Shipped on {$ship_date}</p> <p> </p> <p><b>Your order was sent to:</b><br /> {$customer_name}<br /> {$ship_line1}<br /> HTML; if (strlen($ship_line2) > 0) { $messageHTML .= $ship_line2 . '<br />'; } $messageHTML .= <<<HTML {$ship_city}, {$ship_state} {$ship_zip} </p> <p> </p> <table id="cart"> <tr id="cart_header"> <th class="left">Item</th> <th class="right">List Price</th> <th class="right">Savings</th> <th class="right">Your Cost</th> <th class="right">Quantity</th> <th class="right">Line Total</th> </tr> HTML; $message = <<<TEXT My Guitar Shop Shipping Confirmation ------------------ Hello {$customer_name}, Thank you for shopping with us. We thought you'd like to know that we shipped your item(s), and that this completes your order. Your order is on its way, and can no longer be changed. Please allow 5-7 business days for your order to arrive. Shipping Details ---------------- Order #{$order_id} Placed on {$order_date} Shipped on {$ship_date} Your order was sent to: {$customer_name} {$ship_line1} TEXT; if (strlen($ship_line2) > 0) { $message .= $ship_line2 . ' '; } $message = <<<TEXT {$ship_city}, {$ship_state} {$ship_zip} TEXT; $subtotal = 0; $url = 'http://localhost/book_apps/guitar_shop/'; foreach ($order_items as $item) { $product_id = $item['productID']; $product_url = $url . 'catalog/?product_id=' . $product_id; $product = get_product($product_id); $item_name = $product['productName']; $list_price = $item['itemPrice']; $list_price_txt = sprintf('$%.2f', $list_price); $savings = $item['discountAmount']; $savings_txt = sprintf('$%.2f', $savings); $your_cost = $list_price - $savings; $your_cost_txt = sprintf('$%.2f', $your_cost); $quantity = $item['quantity']; $line_total = $your_cost * $quantity; $line_total_txt = sprintf('$%.2f', $line_total); $subtotal += $line_total; $messageHTML .= <<<HTML <tr> <td><a href="{$product_url}" target="_blank"> {$item_name}</a></td> <td class="right"> {$list_price_txt} </td> <td class="right"> {$savings_txt} </td> <td class="right"> {$your_cost_txt} </td> <td class="right"> {$quantity} </td> <td class="right"> {$line_total_txt} </td> </tr> HTML; $message .= <<<TEXT {$item_name} List Price: {$list_price_txt} Savings: {$savings_txt} Your Cost: {$your_cost_txt} Quantity: {$quantity} Line Total: {$line_total_txt} TEXT; } $order_url = $url . 'account/?action=view_order&order_id=' . $order_id; $subtotal_txt = sprintf('$%.2f', $subtotal); $tax_amount_txt = sprintf('$%.2f', $order['taxAmount']); $ship_amount_txt = sprintf('$%.2f', $order['shipAmount']); $total = $subtotal + $order['taxAmount'] + $order['shipAmount']; $total_txt = sprintf('$%.2f', $total); $messageHTML .= <<<HTML <tr id="cart_footer"> <td colspan="5" class="right">Subtotal:</td> <td class="right"> {$subtotal_txt} </td> </tr> <tr> <td colspan="5" class="right">{$ship_state} Tax:</td> <td class="right"> {$tax_amount_txt} </td> </tr> <tr> <td colspan="5" class="right">Shipping:</td> <td class="right"> {$ship_amount_txt} </td> </tr> <tr> <td colspan="5" class="right">Total:</td> <td class="right"> {$total_txt} </td> </tr> </table> <p> </p> <p>Thank you for shopping with us.<br /><b>My Guitar Shop</b></p> </div> </div><!-- end main --> <div id="footer"> <p class="copyright"> © {$copyright_date} My Guitar Shop, Inc. </p> </div><!-- end footer --> </div><!-- end page --> </body> </html> HTML; $message .= <<<TEXT -------------------------------------------- Subtotal: {$subtotal_txt} GA Tax: {$tax_amount_txt} Shipping: {$ship_amount_txt} Total: {$total_txt} Thank you for shopping with us. My Guitar Shop TEXT; $email = new PHPMailer(); $email->IsSMTP(); // $email->IsSendmail(); $email->Host = "smtp.gmail.com"; //Will need to be modified $email->SMTPAuth = true; $email->Port = 465; $email->SMTPDebug = 0; // enables SMTP debug information (for testing) //$email->SMTPSecure = 'tls'; $email->SMTPSecure = 'ssl'; $email->Username = "******"; // SMTP account username Will need to be modified $email->Password = "******"; // SMTP account password Will need to be modified $email->SetFrom('*****@*****.**', 'My Guitar Shop'); $email->SingleTo = true; // true allows that only one person will receive an email per array group $email->Subject = 'Your Order with My Guitar Shop has Shipped!'; // appears in subject of email $email->Body = $messageHTML; // the body will interpret HTML - $messageHTML identified above $email->AltBody = $message; // the AltBody will not interpret HTML - $message identified above $destination_email_address = "{$customer_email}"; // destination email address $destination_user_name = "{$customer_name}"; // Destination user name $email->AddAddress($destination_email_address, $destination_user_name); // AddAddress method identifies destination and sends email if (!$email->Send()) { return false; } else { return true; } }
$query = "select avg(COUNT(ip)) as visitdepth,AVG (max(GMT_DATETIME) - min(GMT_DATETIME)) * 24*3600 as avgtime from web_log_result where "; $query .= $time_rang . " and site_lang='{$key}' and WEBSITEID='{$v}' GROUP BY session_id"; $oracle_result = oci_parse($conn, $query); oci_execute($oracle_result); while ($row = oci_fetch_array($oracle_result, OCI_ASSOC + OCI_RETURN_NULLS)) { $query = "UPDATE day set visitdepth = '" . $row['VISITDEPTH'] . "',visittime='" . $row["AVGTIME"] . "' where lang ='" . $value . "' and time ='" . $s_timerang . "' and websiteid='{$v}'"; $mysql_insert_result = mysql_query($query, $web_statis_link); } } } oci_free_statement($oracle_result); //统计每天订单数及注册数和订单 echo "\n"; echo '----------------------------------------------------------------- @' . $s_timerang . '-- order products ---------------------------------------'; echo "\n"; $order_array = get_order($time_value, $acceptLangCookie); db_connect(); foreach ($order_array as $key => $value) { foreach ($value as $k => $v) { $sql = "update day set paynum='" . $v['pay'] . "',notpaynum='" . $v['notpay'] . "',member='" . $v['member'] . "',payproduct='" . $v['payproduct'] . "',paypostage='" . $v['paypostage'] . "' where lang='{$k}' and time='{$s_timerang}' and websiteid='{$key}'"; mysql_query($sql, $web_statis_link); } } //统计外链访问 echo "\n"; echo '----------------------------------------------------------------- @' . $s_timerang . '-- promotion ---------------------------------------------'; echo "\n"; $query = "select upper(promotionurl) as promotionurl,site_lang,WEBSITEID,COUNT(ip),COUNT(DISTINCT ip),COUNT(DISTINCT session_id) from web_log_result where "; $query .= $time_rang . " and promotionurl is not null and promotionurl!='-' GROUP BY upper(promotionurl),site_lang ,WEBSITEID"; $oracle_result = oci_parse($conn, $query); if (!$oracle_result) {
$ship_state = $shipping_address['state']; $ship_zip = $shipping_address['zipCode']; $ship_phone = $shipping_address['phone']; $billing_address = get_address($_SESSION['user']['billingAddressID']); $bill_line1 = $billing_address['line1']; $bill_line2 = $billing_address['line2']; $bill_city = $billing_address['city']; $bill_state = $billing_address['state']; $bill_zip = $billing_address['zipCode']; $bill_phone = $billing_address['phone']; $orders = get_orders_by_customer_id($_SESSION['user']['customerID']); include 'account_view.php'; break; case 'view_order': $order_id = $_GET['order_id']; $order = get_order($order_id); $order_date = strtotime($order['orderDate']); $order_date = date('M j, Y', $order_date); $order_items = get_order_items($order_id); $shipping_address = get_address($order['shipAddressID']); $ship_line1 = $shipping_address['line1']; $ship_line2 = $shipping_address['line2']; $ship_city = $shipping_address['city']; $ship_state = $shipping_address['state']; $ship_zip = $shipping_address['zipCode']; $ship_phone = $shipping_address['phone']; $billing_address = get_address($order['billingAddressID']); $bill_line1 = $billing_address['line1']; $bill_line2 = $billing_address['line2']; $bill_city = $billing_address['city']; $bill_state = $billing_address['state'];
/** * Returns an order complete url. * * @return string */ function get_complete_url() { $order = get_order(); return $order ? get_post_meta($order->get_id(), 'complete_url', true) : ''; }