function export_xml() { $this->load->helper('download_helper'); $data['customers'] = (array) $this->Customer_model->get_customers(); force_download_content('customers.xml', $this->load->view($this->config->item('admin_folder') . '/customers_xml', $data, true)); //$this->load->view($this->config->item('admin_folder').'/customers_xml', $data); }
function export_xml() { $this->load->helper('download_helper'); $data['merchants'] = (array) $this->Merchant_model->get_merchants(); force_download_content('merchants.xml', $this->load->view($this->config->item('admin_folder') . '/merchants_xml', $data, true)); //$this->load->view($this->config->item('admin_folder').'/merchants_xml', $data); }
function export() { $this->load->model('customer_model'); $this->load->helper('download_helper'); $post = $this->input->post(null, false); $term = (object) $post; $data['orders'] = $this->Order_model->get_orders($term); foreach ($data['orders'] as &$o) { $o->items = $this->Order_model->get_items($o->id); } force_download_content('orders.xml', $this->load->view($this->config->item('admin_folder') . '/orders_xml', $data, true)); }
public function export() { \CI::load()->model('Customers'); \CI::load()->helper('download_helper'); $post = \CI::input()->post(null, false); $term = (object) $post; $data['orders'] = \CI::Orders()->getOrders($term); foreach ($data['orders'] as &$o) { $o->items = \CI::Orders()->getItems($o->id); } force_download_content('orders.xml', $this->view('orders_xml', $data, true)); }
function view($id = false, $sort_by = 'order_number', $sort_order = 'desc', $code = 0, $page = 0, $rows = 20) { if ($this->input->post('id')) { $id = $this->input->post('id'); } //if they submitted an export form do the export if ($this->input->post('submit') == 'export') { $this->load->model('Deal_type_model'); $this->load->helper('download_helper'); $post = $this->input->post(null, false); $term = (object) $post; $data['orders'] = $this->Order_model->get_orders($term); foreach ($data['orders'] as &$o) { $o->items = $this->Order_model->get_items($o->id); } force_download_content('orders.xml', $this->load->view($this->config->item('admin_folder') . '/orders_xml', $data, true)); //kill the script from here die; } $this->load->helper('form'); $this->load->helper('date'); $data['message'] = $this->session->flashdata('message'); $data['page_title'] = lang('orders'); $data['code'] = $code; $term = false; if ($this->input->post('id')) { //echo $this->input->post('id'); die; $data['orders'] = $this->Deal_type_model->get_orders($this->input->post('id'), $term, $sort_by, $sort_order, $rows, $page); } else { $post = $this->input->post(null, false); if ($post) { //if the term is in post, save it to the db and give me a reference $term = json_encode($post); $code = $this->Search_model->record_term($term); $data['code'] = $code; //reset the term to an object for use $term = (object) $post; } elseif ($code) { $term = $this->Search_model->get_term($code); $term = json_decode($term); } $data['term'] = $term; $data['orders'] = $this->Deal_type_model->get_orders($id, $term, $sort_by, $sort_order, $rows, $page); } $data['total'] = $this->Deal_type_model->get_orders_count($id); $data['deal_types'] = $this->Deal_type_model->get_deal_type($id); $data['tracking'] = $this->Deal_type_model->getcurrentorder($id); $data['allorders'] = $this->Deal_type_model->getcurrentorder($id); $this->load->library('pagination'); $config['base_url'] = site_url($this->config->item('admin_folder') . '/deal_types/view/' . $id . '/' . $sort_by . '/' . $sort_order . '/' . $code . '/'); $config['total_rows'] = $data['total']; $config['per_page'] = $rows; $config['uri_segment'] = 7; $config['first_link'] = 'First'; $config['first_tag_open'] = '<li>'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last'; $config['last_tag_open'] = '<li>'; $config['last_tag_close'] = '</li>'; $config['full_tag_open'] = '<div class="pagination"><ul>'; $config['full_tag_close'] = '</ul></div>'; $config['cur_tag_open'] = '<li class="active"><a href="#">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li>'; $config['num_tag_close'] = '</li>'; $config['prev_link'] = '«'; $config['prev_tag_open'] = '<li>'; $config['prev_tag_close'] = '</li>'; $config['next_link'] = '»'; $config['next_tag_open'] = '<li>'; $config['next_tag_close'] = '</li>'; $this->pagination->initialize($config); $data['sort_by'] = $sort_by; $data['sort_order'] = $sort_order; if ($this->input->post('id')) { $data['deal_type'] = $this->Deal_type_model->get_deal_type($this->input->post('id')); } else { $data['deal_type'] = $this->Deal_type_model->get_deal_type($id); } //if the deal_type does not exist, redirect them to the deal_type list with an error if (!$data['deal_type']) { $this->session->set_flashdata('error', lang('error_not_found')); redirect($this->config->item('admin_folder') . '/deal_types'); } $data['addresses'] = $this->Deal_type_model->get_address_list($id); //echo '<pre>'; print_r($data['addresses']); die; $data['wish_list'] = $this->Deal_type_model->get_wishproduct($id); $data['watch_list'] = $this->Deal_type_model->get_watchproduct($id); //echo '<pre>'; print_r($data['wish_list']); die; $data['page_title'] = sprintf(lang('view_for'), $data['deal_type']->firstname . ' ' . $data['deal_type']->lastname); $this->load->view($this->config->item('admin_folder') . '/deal_type_view', $data); }
function branch_point($sort_by = 'created', $sort_order = 'desc', $code = 0, $page = 0, $rows = 15) { $data['activemenu'] = $this->activemenu; //if they submitted an export form do the export if ($this->input->post('submit') == 'export') { $this->load->model('Point_model'); $this->load->helper('download_helper'); $post = $this->input->post(null, false); $term = (object) $post; $data['points'] = $this->Point_model->get_branch_point($term); force_download_content('points.xml', $this->load->view($this->config->item('admin_folder') . '/points_xml', $data, true)); //kill the script from here die; } $this->load->helper('form'); $this->load->helper('date'); $data['message'] = $this->session->flashdata('message'); $data['page_title'] = lang('points'); $data['code'] = $code; $term = false; $post = $this->input->post(null, false); if ($post) { //if the term is in post, save it to the db and give me a reference $term = json_encode($post); $code = $this->Search_model->record_term($term); $data['code'] = $code; //reset the term to an object for use $term = (object) $post; } elseif ($code) { $term = $this->Search_model->get_term($code); $term = json_decode($term); } $data['term'] = $term; $data['points'] = $this->Point_model->get_branch_points($term, $sort_by, $sort_order, $rows, $page); $data['total'] = $this->Point_model->get_branch_points_count($term); $this->load->library('pagination'); $config['base_url'] = site_url($this->config->item('admin_folder') . '/point/branch_point/' . $sort_by . '/' . $sort_order . '/' . $code . '/'); $config['total_rows'] = $data['total']; $config['per_page'] = $rows; $config['uri_segment'] = 7; $config['first_link'] = 'First'; $config['first_tag_open'] = ''; $config['first_tag_close'] = ''; $config['last_link'] = 'Last'; $config['last_tag_open'] = ''; $config['last_tag_close'] = ''; $config['full_tag_open'] = '<div class="btn-group">'; $config['full_tag_close'] = '</div>'; $config['cur_tag_open'] = '<a class="btn btn-white active" href="#">'; $config['cur_tag_close'] = '</a>'; $config['num_tag_open'] = ''; $config['num_tag_close'] = ''; $config['prev_link'] = '«'; $config['prev_tag_open'] = ''; $config['prev_tag_close'] = ''; $config['next_link'] = '»'; $config['next_tag_open'] = ''; $config['next_tag_close'] = ''; $this->pagination->initialize($config); $data['sort_by'] = $sort_by; $data['sort_order'] = $sort_order; $this->view($this->config->item('admin_folder') . '/branch_points', $data); }