Beispiel #1
0
 function __construct()
 {
     parent::__construct();
     $this->load->model('visitorInfo_model');
     $this->load->helper('setupssl');
     use_ssl(false);
 }
Beispiel #2
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->load->library('message');
     $this->load->helper('form');
     $this->load->model('featuredpress_model');
     $this->load->model('cms');
     $this->load->helper('setupssl');
     use_ssl(false);
 }
Beispiel #3
0
 function update()
 {
     use_ssl(FALSE);
     $res = $this->db->get('countries_temp');
     $i = 1;
     foreach ($res->result() as $row) {
         $this->db->where('short_code', $row->short_code);
         $this->db->set('country_id', $i++);
         $this->db->update('countries_temp');
         echo $row->country_name . "<br/>";
     }
 }
Beispiel #4
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->load->library('email');
     $this->load->library('message');
     $this->load->helper('form');
     $this->load->library('email');
     $config['protocol'] = 'sendmail';
     $this->load->helper('setupssl');
     use_ssl(false);
 }
Beispiel #5
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     // $this->load->library('email');
     // $this->load->library('message');
     // $this->load->helper('form');
     $this->load->model('cms');
     // $this->load->model('visitorInfo_model');
     $this->load->helper('setupssl');
     $this->load->library('session');
     use_ssl(false);
 }
Beispiel #6
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->load->library('email');
     $this->load->library('message');
     $this->load->helper('formatting');
     $this->load->model('event_model');
     $this->load->model('cms');
     $this->load->helper('form');
     $this->load->helper('setupssl');
     use_ssl(false);
 }
Beispiel #7
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->load->helper('formatting');
     $this->load->library('message');
     $this->load->library('usps');
     $this->load->helper('form');
     $this->load->model('product_model');
     $this->load->model('cart_model');
     $this->load->helper('setupssl');
     $this->load->library('form_validation');
     use_ssl(false);
 }
Beispiel #8
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->load->helper('form');
     $this->load->helper('formatting');
     $this->load->library('message');
     $this->load->helper('setupssl');
     $this->load->library('form_validation');
     $this->load->library('usps');
     /*make sure the cart isnt empty*/
     if ($this->go_cart->total_items() == 0) {
         redirect('cart/viewCart');
     }
     if ($_SERVER['HTTP_HOST'] == 'www.farmersmarketla.com') {
         use_ssl();
     }
 }
Beispiel #9
0
 function tracking()
 {
     use_ssl(false);
     $this->form_validation->set_rules('order_number', 'Order Number', 'required');
     $this->form_validation->set_error_delimiters('<span class="error error_span">', '</span>');
     if ($this->form_validation->run() == FALSE) {
         if ($this->session->userdata('customer_id') && $this->session->userdata('customer_login') == true) {
             redirect('/myaccount/track');
         }
         $data['paths'] = array('Home' => path(), 'Customer Service' => path('support'), 'Order Tracking' => '');
         $data['page'] = $this->Pages_model->return_page('tracking');
         $this->load->view('signin-tracking', $data);
     } else {
         $this->load->model('Order_model');
         $orderid = $this->Order_model->getID($this->input->post('order_number'));
         $this->load->helper('htmldom');
         $data['paths'] = array('Home' => path(), 'Customer Service' => path('support'), 'Order Tracking' => '');
         $data['items'] = $this->Order_model->getTracking($this->input->post('order_number'));
         $data['order'] = $this->Order_model->get_order($orderid);
         $this->load->view('track-result', $data);
     }
 }
Beispiel #10
0
 function signup()
 {
     use_ssl(TRUE);
     $this->form_validation->set_rules('username', 'User Name', 'required|min_length[4]|max_length[45]|alpha_dash|is_unique[users.user_name]');
     $this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[45]');
     $this->form_validation->set_rules('password2', 'Confirm Password', 'required|matches[password]');
     $this->form_validation->set_rules('email', 'Email', 'required|valid_email|max_length[45]|is_unique[users.user_email]');
     $this->form_validation->set_rules('firstname', 'First Name', 'required|min_length[4]|max_length[45]|alpha_dash_space');
     $this->form_validation->set_rules('lastname', 'Last Name', 'required|min_length[4]|max_length[45]|alpha_dash_space');
     $this->form_validation->set_rules('business', 'Business', 'max_length[100]');
     $this->form_validation->set_rules('address1', 'Address', 'required|max_length[100]');
     $this->form_validation->set_rules('address2', 'Address Line 2', 'max_length[100]');
     $this->form_validation->set_rules('city', 'City', 'required|max_length[35]');
     $this->form_validation->set_rules('postalcode', 'Postalcode', 'max_length[10]|min_length[4]');
     $this->form_validation->set_rules('province', 'Province', 'max_length[45]|alpha_dash_space|callback_province_check');
     $this->form_validation->set_rules('country_id', 'Country', 'required|numeric');
     $this->form_validation->set_rules('dayphone', 'Day Phone', 'required|max_length[15]|callback_valid_phone_numer');
     $this->form_validation->set_rules('evephone', 'Day Phone', 'max_length[15]|callback_valid_phone_numer');
     $this->form_validation->set_error_delimiters('<span class="error error_span">', '</span>');
     if ($this->form_validation->run() == FALSE) {
         $this->load->model('Country_model');
         $this->load->model('Province_model');
         $data['p'] = (object) $_POST;
         $data['current_page'] = 'signup';
         $data['page'] = $this->Pages_model->return_page('signup');
         $data['countries'] = $this->Country_model->get_countries();
         $data['provinces'] = $this->Province_model->get_provinces_name('Canada', 'United States');
         $this->load->view('user-form', $data);
     } else {
         if ($id = $this->Customer_model->signup($this->input->post())) {
             $data['current_page'] = 'signup';
             $this->load->model('Email_model');
             $data['title'] = $this->Email_model->getTitle('signup', $this->input->post());
             $data['email'] = $this->Email_model->getMessage('signup', $this->input->post());
             $this->load->library('email');
             $this->email->from('*****@*****.**', '1-800-Flowers Canada');
             $this->email->to($this->input->post('emai'));
             $this->email->subject($data['title']);
             $this->email->message($data['email']);
             @$this->email->send();
             $this->session->set_userdata('customer_id', $id);
             $this->session->set_userdata('user_firstname', $this->input->post('firstname'));
             $this->session->set_userdata('user_lastname', $user->user_lastname);
             $this->session->set_userdata('username', $this->input->post('username'));
             $this->session->set_userdata('user_company', 0);
             $this->session->set_userdata('user_role', 'customer');
             $this->session->set_userdata('customer_login', true);
             redirect('/myaccount');
             exit;
         } else {
             die('<div id="error">' . lang('An unknown error happened. Please try later.') . '</div>');
             exit;
         }
     }
 }
Beispiel #11
0
 function checkout()
 {
     use_ssl(TRUE);
     $cart_id = $this->session->userdata('cart_id');
     if ($this->Order_model->is_cart_empty($cart_id)) {
         redirect('/shop/cart');
         exit;
     } elseif (!$this->Order_model->is_delivery_entered($cart_id)) {
         redirect('/shop/delivery');
         exit;
     } elseif (!$this->Order_model->is_billing_entered($cart_id)) {
         redirect('/shop/billing');
         exit;
     } else {
         $this->load->model('Group_model');
         $cart = $this->Order_model->get_fullcart($this->session->userdata('cart_id'));
         $totals = array('itemtotal' => 0, 'shipping' => 0, 'service' => 0, 'surcharge' => 0, 'tax' => 0, 'discount' => 0, 'coupon' => 0, 'coupon_code' => '', 'companyless' => 0, 'grandtotal' => 0);
         $order_items = '';
         $oformat = file_get_contents('assets/email_items.html');
         $aoformat = $itemformat = '';
         $aitemformat = '';
         $icnt = 0;
         $itemprc = 0;
         $this->load->model('Company_model');
         $this->load->model('Customer_model');
         $conversion = '';
         $cartitems = array();
         foreach ($cart as $item) {
             $itemprc = 0;
             $ptotal = $item->product_price;
             $icnt++;
             $itemf = $oformat;
             $itemf = str_replace('{counter}', $icnt, $itemf);
             $itemf = str_replace('{firstname}', $item->firstname, $itemf);
             $itemf = str_replace('{lastname}', $item->lastname, $itemf);
             $itemf = str_replace('{address1}', $item->address1, $itemf);
             $itemf = str_replace('{address2}', $item->address2, $itemf);
             $itemf = str_replace('{city}', $item->city, $itemf);
             $itemf = str_replace('{postalcode}', $item->postalcode, $itemf);
             $itemf = str_replace('{province}', $item->province, $itemf);
             $itemf = str_replace('{country}', $item->country_id, $itemf);
             $itemf = str_replace('{phone}', $item->dayphone . ' ' . $item->evephone, $itemf);
             $itemf = str_replace('{message}', $item->card_message, $itemf);
             // $itemf = str_replace('{delivery_date}',date('d M Y',strtotime($item->delivery_date)),$itemf);
             $itemf = str_replace('{delivery_date}', date('d M Y', strtotime($item->delivery_date)) . ' - ' . $item->delivery_time, $itemf);
             $itemf = str_replace('{shipping_method}', $item->infotext, $itemf);
             $itemf = str_replace('{delivery_info}', $item->delivery_description, $itemf);
             $itemf = str_replace('{product_image}', '<img src="' . $this->config->item('base_url') . img_format('productres/' . $item->product_picture, 'thumb') . '" />', $itemf);
             $itemf = str_replace('{product_code}', $item->product_code, $itemf);
             $itemf = str_replace('{product_name}', $item->product_name . '<br/><small>(' . $item->price_name . ')</small>', $itemf);
             $itemf = str_replace('{price}', '$' . number_format($item->product_price, 2), $itemf);
             $itemf = str_replace('{quantity}', '1', $itemf);
             $itemprc += $item->product_price;
             if ($item->delivery_method_id == 1) {
                 $itemf = str_replace('{delivery_by}', 'Delivery by Local', $itemf);
             } else {
                 $itemf = str_replace('{delivery_by}', 'This bouquet comes to via UPS.', $itemf);
             }
             $itemf = str_replace('{total}', '$' . number_format($item->product_price, 2), $itemf);
             $totals['itemtotal'] += $item->product_price;
             if (array_key_exists($item->product_id, $cartitems)) {
                 $cartitems[$item->product_id]['sku'] = $item->product_code;
                 $cartitems[$item->product_id]['qty'] = $cartitems[$item->product_id]['qty'] + 1;
                 $cartitems[$item->product_id]['amt'] = $cartitems[$item->product_id]['amt'] + $item->product_price * 100;
                 $cartitems[$item->product_id]['name'] = urlencode($item->product_name);
                 $cartitems[$item->product_id]['category'] = urlencode($item->category);
             } else {
                 $cartitems[$item->product_id]['sku'] = $item->product_code;
                 $cartitems[$item->product_id]['qty'] = 1;
                 $cartitems[$item->product_id]['amt'] = $item->product_price * 100;
                 $cartitems[$item->product_id]['name'] = urlencode($item->product_name);
                 $cartitems[$item->product_id]['category'] = urlencode($item->category);
             }
             $addontot = 0;
             if (count($item->addons)) {
                 $order_items = '';
                 foreach ($item->addons as $addon) {
                     $order_items .= '+(' . $addon->addon_name . " " . $addon->addon_quantity . 'x$' . number_format($addon->addon_price, 2) . ")   \$" . number_format($addon->addon_price * $addon->addon_quantity, 2) . "<br/>\n";
                     $totals['itemtotal'] += $addon->addon_price * $addon->addon_quantity;
                     $itemprc += $addon->addon_price * $addon->addon_quantity;
                     $addontot += $addon->addon_price * $addon->addon_quantity;
                     $ptotal += $addon->addon_price * $addon->addon_quantity;
                     if (array_key_exists($addon->addon_id, $cartitems)) {
                         $cartitems[$addon->addon_id]['sku'] = $addon->addon_id;
                         $cartitems[$addon->addon_id]['qty'] = $cartitems[$addon->addon_id]['qty'] + $addon->addon_quantity;
                         $cartitems[$addon->addon_id]['amt'] = $cartitems[$addon->addon_id]['amt'] + $addon->addon_price * 100;
                         $cartitems[$addon->addon_id]['name'] = urlencode($addon->addon_name);
                         $cartitems[$item->product_id]['category'] = urlencode($item->category);
                     } else {
                         $cartitems[$addon->addon_id]['sku'] = $addon->addon_id;
                         $cartitems[$addon->addon_id]['qty'] = $addon->addon_quantity;
                         $cartitems[$addon->addon_id]['amt'] = $addon->addon_price * 100;
                         $cartitems[$addon->addon_id]['name'] = urlencode($addon->addon_name);
                         $cartitems[$item->product_id]['category'] = urlencode($item->category);
                     }
                     //echo $order_items;
                 }
                 //echo $order_items;
             } else {
                 $order_items .= 'None';
             }
             $conversion .= 'bta.addConversionLegacy("$", "' . $item->product_name . '", "' . number_format($itemprc, 2) . '");' . "\n";
             $itemf = str_replace('{addons}', $order_items, $itemf);
             $itemf = str_replace('{addon_price}', '$' . number_format($addontot, 2), $itemf);
             $addition = $this->Order_model->get_add_charges($item->orderitem_id);
             if (!($waiver = $this->Company_model->checkWaiver($this->session->userdata('customer_id')))) {
                 $totals['shipping'] += $addition['shipping'];
                 $totals['service'] += $addition['service'];
                 $totals['surcharge'] += $addition['surcharge'];
             }
             $totals['tax'] += $addition['tax'] * $ptotal / 100;
             $aitemformat .= str_replace('{product_description}', '', $itemf);
             $itemf = str_replace('{product_description}', substr($item->product_description, 0, 50), $itemf);
             $itemformat .= $itemf;
         }
         $ggitems = '';
         foreach ($cartitems as $citem) {
             $productids[] = $citem['sku'] . ':' . str_replace('+', '', $citem['name']);
             $itemvalues[] = $citem['amt'];
             $units[] = $citem['qty'];
             $skulist[] = $citem['sku'];
             $qlist[] = $citem['qty'];
             $amtlist[] = $citem['amt'];
             $namelist[] = $citem['name'];
         }
         $coupon_discount = 0;
         if ($user_discount = $this->Customer_model->getDiscount($this->session->userdata('customer_id'))) {
             $totals['discount'] = $totals['itemtotal'] * $user_discount / 100;
         } else {
             if ($this->session->userdata('coupon')) {
                 $coupon = get_coupon_discount($this->session->userdata('coupon'), $totals['itemtotal']);
                 $totals['coupon_code'] = $coupon->discount_name;
                 $totals['coupon'] = $coupon->discount_amount ? $coupon->discount_amount : $coupon->discount_percentage * $totals['itemtotal'] / 100;
             }
             $totals['discount'] = get_discount($totals['itemtotal']);
             $totals['companyless'] = get_company_discount($totals['itemtotal'], $this->session->userdata('customer_id') ? $this->session->userdata('customer_id') : '0');
         }
         if ($totals['discount'] > 0) {
             $skulist[] = 'Discount';
             $qlist[] = 0;
             $amtlist[] = $totals['discount'] * -100;
             $namelist[] = 'Discount';
             $productids[] = 'Discount';
             $itemvalues[] = round($totals['discount'] * 100);
             $units[] = 1;
         } else {
             $productids[] = 'Discount';
             $itemvalues[] = 0;
             $units[] = 1;
         }
         $totals['grandtotal'] = $totals['itemtotal'] + $totals['shipping'] + $totals['service'] + $totals['surcharge'] + $totals['tax'] - $totals['discount'] - $totals['coupon'] - $totals['companyless'];
         $invoiceTotal = number_format($totals['grandtotal'], 2);
         $customer_id = $this->session->userdata('customer_id') ? $this->session->userdata('customer_id') : '0';
         $affiliate_id = $this->session->userdata('referer') ? $this->session->userdata('referer') : '';
         $this->form_validation->set_rules("cardnumber", 'Credit Card Number', 'required|numeric|min_length[15]|max_length[16]');
         $this->form_validation->set_rules("expiry_month", 'Expiry Month', 'required|min_length[2]|max_length[5]');
         $this->form_validation->set_rules("expiry_year", 'Expiry Year', 'required|min_length[2]|max_length[5]');
         $this->form_validation->set_rules("cvv", 'CVV2', 'required|min_length[3]|max_length[5]');
         $this->form_validation->set_error_delimiters('<span class="error error_span">', '</span>');
         if ($this->form_validation->run() == TRUE) {
             $eformat = file_get_contents('assets/email_format.html');
             $eheader = file_get_contents('assets/email_header.html');
             $this->load->library('plugnpay');
             $order = unserialize(base64_decode($_POST['data']));
             $country = $this->Country_model->get_country($order->country_id);
             $order->country = $country->country_name;
             $order->ipaddress = $_SERVER['REMOTE_ADDR'];
             $order->nameoncard = $this->input->post('nameoncard');
             $order->cardnumber = $this->input->post('cardnumber');
             $order->cvv = $this->input->post('cvv');
             $order->expiry = $this->input->post('expiry_month') . '/' . $this->input->post('expiry_year');
             $order->total = $totals['grandtotal'];
             $order->affiliate_id = $this->session->userdata('referer') ? $this->session->userdata('referer') : '0';
             $eheader = str_replace('{firstname}', $order->firstname, $eheader);
             $eformat = str_replace('{firstname}', $order->firstname, $eformat);
             $eformat = str_replace('{lastname}', $order->lastname, $eformat);
             $eformat = str_replace('{address1}', $order->address1, $eformat);
             $eformat = str_replace('{address2}', $order->address2, $eformat);
             $eformat = str_replace('{city}', $order->city, $eformat);
             $eformat = str_replace('{postalcode}', $order->postalcode, $eformat);
             $eformat = str_replace('{country}', $order->country, $eformat);
             $eformat = str_replace('{email}', $order->email, $eformat);
             $eformat = str_replace('{dayphone}', $order->dayphone, $eformat);
             $eformat = str_replace('{evephone}', $order->dayphone, $eformat);
             $eformat = str_replace('{product_price}', '$' . number_format($totals['itemtotal'], 2), $eformat);
             $eformat = str_replace('{delivery_charge}', '$' . number_format($totals['shipping'], 2), $eformat);
             $eformat = str_replace('{service_charge}', '$' . number_format($totals['service'], 2), $eformat);
             $eformat = str_replace('{surcharge}', '$' . number_format($totals['surcharge'], 2), $eformat);
             $eformat = str_replace('{discount}', '$' . number_format($totals['discount'] - $totals['coupon'] - $totals['companyless'], 2), $eformat);
             $eformat = str_replace('{tax}', '$' . number_format($totals['tax'], 2), $eformat);
             $eformat = str_replace('{grand_total}', '$' . number_format($totals['grandtotal'], 2), $eformat);
             if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' && ENVIRONMENT == 'development') {
                 $result['FinalStatus'] = 'success';
                 $payment_method = 'credit_card';
             } else {
                 $result = $this->plugnpay->pay($order);
                 /*
                 					echo 'Website on Test...<br/>';
                 					echo $result['MErrMsg'];
                 echo '<pre>';
                 					die(print_r($result));
                 echo '</pre>';
                 */
                 $payment_method = 'credit_card';
             }
             if ($result['FinalStatus'] == 'success') {
                 if ($oid = $this->Order_model->create_Order($this->session->userdata('cart_id'), $totals, $customer_id, $affiliate_id, $payment_method)) {
                     //$linkimg  = '<img src="http://track.linksynergy.com/
                     // ep?mid=xxxx&ord=xx&skulist=xxxx
                     // &qlist=xxx&amtlist=xxxx&cur=xxx&namelist=xxxxx">';
                     $cart_id = $this->session->userdata('cart_id');
                     $this->db->where('cart_id', $cart_id);
                     $this->db->update('carts', array('completed' => '1'));
                     $this->session->set_userdata('cart_id', '0');
                     $temptot = $totals['itemtotal'] - $totals['discount'] - $totals['coupon'];
                     $linkimg = '<img src="http://track.linksynergy.com/ep?mid=37609&ord=' . $oid;
                     $linkimg .= '&skulist=' . implode('|', $skulist);
                     $linkimg .= '&qlist=' . implode('|', $qlist);
                     $linkimg .= '&amtlist=' . implode('|', $amtlist);
                     $linkimg .= '&cur=CAD';
                     $linkimg .= '&namelist=' . implode('|', $namelist) . '">';
                     $tsa = '<script src="https://thesearchagency.net/tsawaypoint.php?siteid=855&wayid=7685&';
                     $tsa .= 'value=' . round($totals['grandtotal'] * 100);
                     $tsa .= '&units=1|' . implode('|', $units) . '|1';
                     $tsa .= '&productID=order|' . implode('|', $productids) . '|Shipping';
                     $tsa .= '&itemValues=' . round($totals['grandtotal'] * 100) . '|' . implode('|', $itemvalues) . '|' . ($totals['shipping'] + $totals['service'] + $totals['surcharge']) * 100;
                     $tsa .= '&backref=' . $oid . '" language="JavaScript" type="text/javascript"></script>';
                     $emlimg = '<img src="http://email.1800florists.ca/public/?q=direct_add&fn=Public_DirectAddForm&id=bvvqnvtvffundtrubmhhrsjocigpbmg&email=';
                     $emlimg .= $order->email . '&field1=lastorderdate,set,';
                     $emlimg .= date('Y-m-d', time()) . '&field2=lastordertotal,set,';
                     $emlimg .= number_format($temptot, 2) . '&list1=0bba03ec00000000000000000000000492e6" width="0" height="0" border="0" alt=""/>';
                     $ggtrans = 'pageTracker._addTrans(';
                     $ggtrans .= '"' . $oid . '",';
                     $ggtrans .= '"1-800-Flowers Canada",';
                     $ggtrans .= '"' . $temptot . '",';
                     $ggtrans .= '"' . number_format($totals['tax'], 2) . '",';
                     $ggtrans .= '"' . number_format($totals['shipping'] + $totals['service'] + $totals['surcharge'], 2) . '",';
                     $ggtrans .= '"Toronto",';
                     $ggtrans .= '"Ontario",';
                     $ggtrans .= '"Canada");';
                     $ggitems = '';
                     foreach ($cartitems as $citem) {
                         $skulist[] = $citem['sku'];
                         $qlist[] = $citem['qty'];
                         $amtlist[] = $citem['amt'];
                         $namelist[] = $citem['name'];
                         $ggitems .= 'pageTracker._addItem(';
                         $ggitems .= '"' . $oid . '",';
                         $ggitems .= '"' . $citem['sku'] . '",';
                         $ggitems .= '"' . $citem['name'] . '",';
                         $ggitems .= '"' . $citem['category'] . '",';
                         $ggitems .= '"' . number_format($citem['amt'] / 100, 2) . '",1';
                         $ggitems .= ');' . "\n";
                     }
                     $data['googlecode'] = $ggtrans . "\n\n" . $ggitems;
                     $data['linkimg'] = $linkimg;
                     $data['tsa'] = $tsa;
                     $data['emlimg'] = $emlimg;
                     $data['conversion'] = $conversion;
                     $data['invoiceTotal'] = $invoiceTotal;
                     $eformat = str_replace('{invoice_num}', $oid, $eformat);
                     $admin_format = $eformat;
                     $admin_format = str_replace('{items}', $aitemformat, $admin_format);
                     $admin_format = str_replace('{email_header}', 'User Type:' . strtoupper($this->session->userdata('user_role')), $admin_format);
                     $eformat = str_replace('{items}', $itemformat, $eformat);
                     $eformat = str_replace('{email_header}', $eheader, $eformat);
                     $this->load->library('email');
                     $email_config['mailtype'] = 'html';
                     $this->email->initialize($email_config);
                     $this->email->from('*****@*****.**', '1-800-Flowers');
                     //$this->email->to($order->email);
                     $this->email->to($order->email);
                     $this->email->subject('1-800-Flowers Order Confirmation');
                     $this->email->message($eformat);
                     if ($this->email->send()) {
                         $success = true;
                     }
                     $this->email->from('*****@*****.**', '1-800-Flowers');
                     $this->email->to('*****@*****.**');
                     $this->email->subject('1-800-Flowers Order Confirmation');
                     $this->email->message($admin_format);
                     if ($this->email->send()) {
                         $success = true;
                     }
                     $this->unset_cart();
                     $data['items'] = $this->Order_model->getDelivery($cart_id);
                     $data['message'] = 'Your order completed successfully';
                     $data['invoice_number'] = $oid;
                     $data['totals'] = $totals;
                     $data['billing'] = $this->Order_model->getBilling($cart_id);
                     $data['page'] = $this->Pages_model->return_page('order-thanks');
                     $data['paths'] = array('Home' => path(), 'Checkout' => '#', 'Thank you' => '');
                     $this->load->view('thankyou', $data);
                     exit;
                 }
             } else {
                 $elist = '<ul class="elist">';
                 if ($cerrors = explode('|', $result['MErrMsg'])) {
                     foreach ($cerrors as $ce) {
                         if (!empty($ce)) {
                             $elist .= '<li>' . $ce . '</li>';
                         }
                     }
                 } else {
                     $elist = '<li>' . $result['MErrMsg'] . '<li>';
                 }
                 $elist .= '</ul>';
                 $elist = '<div class="show_errors"><h3>' . 'Error in Payment' . '</h3>' . $elist . '</div>';
             }
         }
         $this->load->Model('Occasion_model');
         $data['elist'] = isset($elist) ? $elist : '';
         $data['countries'] = $this->Country_model->get_countries();
         $data['items'] = $this->Order_model->getDelivery($cart_id);
         $data['occasions'] = $this->Occasion_model->get_occasions_array();
         $data['billing'] = $this->Order_model->getBilling($cart_id);
         if ($this->session->userdata('user_role') == 'company') {
             $this->load->model('Company_model');
             $pmethod = $this->Company_model->get_pmethod($this->session->userdata('customer_id'));
             if ($pmethod == 1) {
                 $data['on_account'] = 1;
             } else {
                 $data['on_account'] = 0;
             }
         } else {
             $data['on_account'] = 0;
         }
         $data['encoded'] = base64_encode(serialize($data['billing']));
         $data['totals'] = $totals;
         $data['current_page'] = 'revieworder';
         $data['page'] = $this->Pages_model->return_page('checkout');
         $data['paths'] = array('Home' => path(), 'Checkout' => '#', 'Review & Pay' => '');
         $this->load->View('checkout', $data);
     }
 }
Beispiel #12
0
 function vase_collections()
 {
     parse_str($_SERVER['QUERY_STRING'], $_GET);
     $vaseID = isset($_GET['vaseId']) ? $_GET['vaseId'] : '';
     $status = isset($_GET['status']) ? $_GET['status'] : '';
     if ($status == 'complete') {
         $this->session->set_userdata('vaseID', $vaseID);
         $this->session->set_userdata('vaseImage', 'http://cdn.vaseexpressions.com/renders/' . $vaseID . 'z.png');
         $this->session->set_userdata('vaseImageThumb', 'http://cdn.vaseexpressions.com/renders/' . $vaseID . 'c.png');
         $this->session->set_userdata('vaseImageSmall', 'http://cdn.vaseexpressions.com/renders/' . $vaseID . 't.png');
     } else {
         $this->session->set_userdata('vaseID', '0');
         $this->session->set_userdata('vaseImage', 'http://cdn.vaseexpressions.com/renders/' . $vaseID . 'z.png');
         $this->session->set_userdata('vaseImageThumb', 'http://cdn.vaseexpressions.com/renders/' . $vaseID . 'c.png');
         $this->session->set_userdata('vaseImageSmall', 'http://cdn.vaseexpressions.com/renders/' . $vaseID . 't.png');
     }
     use_ssl(FALSE);
     $category = 'custom-vase';
     $name = str_replace('-', ' ', xss_clean($category));
     $this->load->model('Category_model');
     if ($cat = $this->Category_model->get_category_byname($name)) {
         $data['rec'] = $cat;
         $data['path'] = $category;
         if ($page = $this->Pages_model->get_page($cat->page_id)) {
             $data['page'] = $page;
         } else {
             $page = $this->Pages_model->return_page('category-products');
             $page->page_title = str_replace('%s', ucwords($name), $page->page_title);
             $page->page_title_fr = str_replace('%s', ucwords(lang($name)), $page->page_title_fr);
             $page->h1 = str_replace('%s', ucwords($name), $page->h1);
             $page->h1_fr = str_replace('%s', ucwords(lang($name)), $page->h1_fr);
             $data['page'] = $page;
         }
         $data['title'] = $cat->category_name;
         $data['paths'] = array('Home' => path(), ucwords($category) . '' => '');
         $data['products'] = $this->Product_model->get_catalog_products(100, array('category' => $category));
         $this->load->view('products', $data);
     } else {
         $this->notfound();
     }
 }
Beispiel #13
0
 function page($handle)
 {
     use_ssl(FALSE);
     if (!empty($handle)) {
         $this->load->Model('Pages_model');
         if ($data['page'] = $this->Pages_model->return_page($handle)) {
             $data['current_page'] = $data['page']->page_handle;
             $data['paths'] = array('Home' => path(), $data['page']->page_name . '' => '');
             $this->load->view('page', $data);
         } else {
             $data['page'] = $this->Pages_model->return_page('404');
             set_status_header('404');
             $this->load->view('404.php', $data);
         }
     } else {
         $this->index();
     }
 }
/**
 * Gets the asset host URL for the specified file
 * 
 * @param   string    URL path for requested file
 * @return  string    Full path to file, including asset host and protocol.
 *                    Returns original file path if ASSET_HOST is not defined.
 */
function asset_host_url($file)
{
    if (!defined('ASSET_HOST')) {
        return $file;
    }
    $asset_host = preg_replace('|^https?://|', '', ASSET_HOST);
    $protocol = use_ssl() ? 'https' : 'http';
    return "{$protocol}://{$asset_host}{$file}";
}