function postDownloads()
 {
     if ($this->access['is_excel'] == 0) {
         return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
     }
     $sort = !is_null(Input::get('sort')) ? Input::get('sort') : 'OrderID';
     $order = !is_null(Input::get('order')) ? Input::get('order') : 'desc';
     $data = DB::table('orders');
     if ($_POST['OrderID'] != '') {
         $data->where('OrderID', "LIKE", "%" . $_POST['OrderID'] . "%");
     }
     if ($_POST['name'] != '') {
         $data->where('name', "LIKE", "%" . $_POST['name'] . "%");
     }
     if ($_POST['email'] != '') {
         $data->where('email', "LIKE", "%" . $_POST['email'] . "%");
     }
     if ($_POST['phone'] != '') {
         $data->where('phone', "LIKE", "%" . $_POST['phone'] . "%");
     }
     if ($_POST['address'] != '') {
         $data->where('address', "=", $_POST['address']);
     }
     if ($_POST['status'] != '') {
         $data->where('status', "LIKE", "%" . $_POST['status'] . "%");
     }
     if ($_POST['provinceid'] != '') {
         $data->where('provinceid', "=", $_POST['provinceid']);
     }
     $data = $data->get();
     $content = $this->data['pageTitle'];
     $content .= '<table border="1">';
     $content .= '<tr>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_id') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_name') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_phone') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_email') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.sex') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_city') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_district') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_ward') . '</th>';
     $content .= '<th style="background:#f9f9f9;">' . Lang::get('core.table_date') . '</th>';
     $content .= '</tr>';
     foreach ($data as $item) {
         $content .= '<tr>';
         $content .= '<td>' . $item->OrderID . '</td>';
         $content .= '<td>' . $item->name . '</td>';
         $content .= '<td>' . $item->phone . '</td>';
         $content .= '<td>' . $item->email . '</td>';
         $content .= '<td>' . SiteHelpers::getSex($item->sex) . '</td>';
         $content .= '<td>' . SiteHelpers::getNameaddress($item->provinceid, 'province', "provinceid") . '</td>';
         $content .= '<td>' . SiteHelpers::getNameaddress($item->districtid, 'district', "districtid") . '</td>';
         $content .= '<td>' . SiteHelpers::getNameaddress($item->wardid, 'ward', "wardid") . '</td>';
         $content .= '<td>' . $item->OrderDate . '</td>';
         $content .= '</tr>';
     }
     $content .= '</table>';
     @header('Content-Type: application/ms-excel');
     @header('Content-Length: ' . strlen($content));
     @header('Content-disposition: inline; filename="' . $title . ' ' . date("d/m/Y") . '.xls"');
     echo $content;
     exit;
 }