public function export()
 {
     import("ORG.Io.Excel");
     alogs("DaystockAction", 0, 1, '执行了所有天天盈交易中导出导出操作!');
     //管理员操作日志
     $map['s.type_id'] = 1;
     $map['s.status'] = array("in", "2,6");
     $list = M("shares_apply s")->field("s.*,m.user_phone")->join("lzh_members m ON m.id = s.uid")->where($map)->select();
     $row = array();
     $row[0] = array("ID", "用户名", "本金", "管理费", "所获配资金额", "订单号", "平仓线", "警戒线", "添加时间", "期限");
     $i = 1;
     foreach ($list as $key => $v) {
         $row[$i]['id'] = $v['id'];
         $row[$i]['u_name'] = $v['u_name'];
         $row[$i]['principal'] = $v['principal'];
         $row[$i]['manage_fee'] = $v['manage_fee'];
         $row[$i]['shares_money'] = $v['shares_money'];
         $row[$i]['order'] = $v['order'];
         $row[$i]['open'] = $v['open'];
         $row[$i]['alert'] = $v['alert'];
         $row[$i]['add_time'] = date("Y-m-d", $v['add_time']);
         $row[$i]['duration'] = $v['duration'];
         $row[$i]['user_phone'] = $v['user_phone'];
         $i++;
     }
     $xls = new Excel_XML('UTF-8', false, 'datalist');
     $xls->addArray($row);
     $xls->generateXML("datalistcard");
 }
Example #2
0
function excel_create($data, $filename = '', $stream = TRUE)
{
    require_once "excel/class-excel-xml.inc.php";
    $excel = new Excel_XML();
    $excel->addArray($data);
    $excel->generateXML($filename);
}
Example #3
0
function export_excel($data, $title)
{
    require_once 'export_excel/php-excel.class.php';
    $xls = new Excel_XML('UTF-8', true, 'Sheet1');
    $xls->addArray($data);
    $xls->generateXML($title . date('Ymd'));
}
Example #4
0
 public function get_transactions()
 {
     $this->load->helper('php-excel');
     $ins_status = $this->transaction_models->get_Transactions();
     $data_array[] = array("Transaction Id", "Deal Tag", "User id", "User Name", "Done On", "E-Mail", "Gross Amount", "Payment Status");
     foreach ($ins_status as $list) {
         $data_array[] = array($list->txn_id, $list->deal_tag, $list->login_id, ucwords($list->first_name) . ' ' . ucwords($list->lastname), date("d-m-Y H:i:s", strtotime($list->payment_date)), $list->login_email, $list->gross_amt, $list->payment_status);
     }
     $xls = new Excel_XML();
     $xls->addArray($data_array);
     $xls->generateXML(time());
 }
 /**
  * 导出名单
  */
 public function export()
 {
     $activeid = intval($_GET['activeid']);
     $data[0] = array('姓名', '手机', '邮箱', '报名时间');
     $members = $this->t('activedata')->where(array('activeid' => $activeid))->select();
     foreach ($members as $k => $member) {
         $data[] = array($member['username'], $member['mobile'], $member['email'], formatTime($member['dateline'], 'Y-m-d H:i:s'));
     }
     //printr($data);exit();
     include ROOT_PATH . '/core/library/class.php_excel.php';
     $xls = new Excel_XML();
     $xls->addArray($data);
     $xls->generateXML(random(10));
 }
Example #6
0
 public function export()
 {
     if ($this->data['users']->role != "admin") {
         exit;
     }
     $data = array(1 => array('Full Name', 'User Name', 'E-mail', 'Gender', 'Address', 'Phone No', 'Mobile No', 'birthday', 'password', 'activated'));
     $student = User::where('role', 'teacher')->get();
     foreach ($student as $value) {
         $data[] = array($value->fullName, $value->username, $value->email, $value->gender, $value->address, $value->phoneNo, $value->mobileNo, $value->birthday, "", $value->activated);
     }
     $xls = new Excel_XML('UTF-8', false, 'Teachers Sheet');
     $xls->addArray($data);
     $xls->generateXML('Teachers-Sheet');
     exit;
 }
Example #7
0
 public function export()
 {
     if ($this->data['users']->role != "admin") {
         exit;
     }
     $classArray = array();
     $classes = classes::get();
     foreach ($classes as $class) {
         $classArray[$class->id] = $class->className;
     }
     $data = array(1 => array('Roll', 'Full Name', 'User Name', 'E-mail', 'Gender', 'Address', 'Phone No', 'Mobile No', 'Class', 'password', 'activated', 'birthday', 'Class ID'));
     $student = User::where('role', 'student')->get();
     foreach ($student as $value) {
         $data[] = array($value->studentRollId, $value->fullName, $value->username, $value->email, $value->gender, $value->address, $value->phoneNo, $value->mobileNo, isset($classArray[$value->studentClass]) ? $classArray[$value->studentClass] : "", $value->password, $value->activated, $value->birthday, $value->studentClass);
     }
     $xls = new Excel_XML('UTF-8', false, 'Payments Sheet');
     $xls->addArray($data);
     $xls->generateXML('Students Sheet');
     exit;
 }
 public function export()
 {
     $this->load->model('sale/return');
     $returns = array();
     $data = array();
     $results = $this->model_sale_return->getReturns($data);
     foreach ($results as $result) {
         $returns[] = array('return_id' => $result['return_id'], 'order_id' => $result['order_id'], 'customer' => $result['customer'], 'product' => $result['product'], 'model' => $result['model'], 'status' => $result['status'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])), 'selected' => isset($this->request->post['selected']) && in_array($result['return_id'], $this->request->post['selected']));
     }
     $returns_data = array();
     $returns_column = array();
     $returns_column = array('Return ID', 'Order ID', 'Customer', 'Product', 'Model', 'Date Added', 'Date Modified');
     $returns_data[0] = $returns_column;
     foreach ($returns as $returns_row) {
         $returns_data[] = $returns_row;
     }
     require_once DIR_SYSTEM . 'library/excel_xml.php';
     $xls = new Excel_XML('UTF-8', false, 'Product Returns List');
     $xls->addArray($returns_data);
     $xls->generateXML('product_returns_list_' . date('Y-m-d _ H:i:s'));
 }
 public function export()
 {
     $this->load->model('report/return');
     $returns = array();
     $data = array();
     $results = $this->model_report_return->getReturns($data);
     foreach ($results as $result) {
         $returns[] = array('date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])), 'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])), 'returns' => $result['returns']);
     }
     $returns_data = array();
     $returns_column = array();
     $returns_column = array('Start Date', 'End Date', 'No. Returns');
     $returns_data[0] = $returns_column;
     foreach ($returns as $returns_row) {
         $returns_data[] = $returns_row;
     }
     require_once DIR_SYSTEM . 'library/excel_xml.php';
     $xls = new Excel_XML('UTF-8', false, 'Sales Returns Report');
     $xls->addArray($returns_data);
     $xls->generateXML('sales_returns_report_' . date('Y-m-d _ H:i:s'));
 }
 public function export()
 {
     $this->load->model('report/sale');
     $orders = array();
     $data = array();
     $results = $this->model_report_sale->getShipping($data);
     foreach ($results as $result) {
         $orders[] = array('date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])), 'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])), 'title' => $result['title'], 'orders' => $result['orders'], 'total' => $this->currency->format($result['total'], $this->config->get('config_currency')));
     }
     $orders_data = array();
     $orders_column = array();
     $orders_column = array('Start Date', 'End Date', 'Shipping Title', 'No. Orders', 'Total');
     $orders_data[0] = $orders_column;
     foreach ($orders as $orders_row) {
         $orders_data[] = $orders_row;
     }
     require_once DIR_SYSTEM . 'library/excel_xml.php';
     $xls = new Excel_XML('UTF-8', false, 'Sales Shipping Report');
     $xls->addArray($orders_data);
     $xls->generateXML('sales_shipping_report_' . date('Y-m-d _ H:i:s'));
 }
Example #11
0
 public function export()
 {
     import("ORG.Io.Excel");
     $map = array();
     $map['uid'] = $this->uid;
     if ($_GET['start_time'] && $_GET['end_time']) {
         $_GET['start_time'] = strtotime($_GET['start_time'] . " 00:00:00");
         $_GET['end_time'] = strtotime($_GET['end_time'] . " 23:59:59");
         if ($_GET['start_time'] < $_GET['end_time']) {
             $map['add_time'] = array("between", "{$_GET['start_time']},{$_GET['end_time']}");
             $search['start_time'] = $_GET['start_time'];
             $search['end_time'] = $_GET['end_time'];
         }
     }
     if (!empty($_GET['log_type'])) {
         $map['type'] = intval($_GET['log_type']);
         $search['log_type'] = intval($_GET['log_type']);
     }
     $list = getMoneyLog($map, 100000);
     $logtype = C('MONEY_LOG');
     $row = array();
     $row[0] = array('序号', '发生日期', '类型', '影响金额', '可用余额', '冻结金额', '待收金额', '说明');
     $i = 1;
     foreach ($list['list'] as $v) {
         $row[$i]['i'] = $i;
         $row[$i]['uid'] = date("Y-m-d H:i:s", $v['add_time']);
         $row[$i]['card_num'] = $v['type'];
         $row[$i]['card_pass'] = $v['affect_money'];
         $row[$i]['card_mianfei'] = $v['account_money'];
         $row[$i]['card_mianfei0'] = $v['freeze_money'];
         $row[$i]['card_mianfei1'] = $v['collect_money'];
         $row[$i]['card_mianfei2'] = $v['info'];
         $i++;
     }
     $xls = new Excel_XML('UTF-8', false, 'moneyLog');
     $xls->addArray($row);
     $xls->generateXML("moneyLog");
 }
Example #12
0
 public function trasaction_reportsEXL()
 {
     $this->load->helper('php-excel');
     $gefr = $this->uri->segment(3);
     $geto = $this->uri->segment(4);
     $val = $this->uri->segment(5);
     $data['users'] = $this->report_model->trasaction_reports($gefr, $geto, $val);
     $data['profile'] = $this->report_model->profile($val);
     $data_array[] = array("Done By", "Track Number", "Amount", "Type", "Balance", "Date & Time", "Remarks");
     foreach ($data['users'] as $row) {
         if ($row->type == 1) {
             $val = "Credited";
         } else {
             if ($row->type == 2) {
                 $val = "Debited";
             } else {
                 $val = "N/A";
             }
         }
         $data_array[] = array($data['profile']->first_name . ' ' . $data['profile']->last_name, "SCT-0" . $row->trans_id, $row->trans_amt, $val, $row->cur_amount, $row->trans_date, $row->trans_remark);
     }
     $xls = new Excel_XML();
     $xls->addArray($data_array);
     $xls->generateXML("trasactionDetails");
 }
Example #13
0
 public function excel()
 {
     Vendor('Excel.php-excel');
     $map['id'] = array('in', $_REQUEST['id']);
     $orders = $this->dao->where($map)->select();
     $xls = array();
     $xls[0][0] = "编号";
     $xls[0][1] = "金额";
     $xls[0][2] = "运输方式";
     $xls[0][3] = "运费";
     $xls[0][4] = "手续费";
     $xls[0][5] = "保险金";
     $xls[0][6] = "付款方式";
     $xls[0][7] = "购买时间";
     $xls[0][8] = "附加留言";
     $xls[0][9] = "IP地址";
     $xls[0][10] = "邮箱";
     $xls[0][11] = "姓";
     $xls[0][12] = "名";
     $xls[0][13] = "地址";
     $xls[0][14] = "电话";
     $xls[0][15] = "邮编";
     $xls[0][16] = "城市";
     $xls[0][17] = "省份";
     $xls[0][18] = "国家";
     $xls[0][19] = "订单状态";
     $xls[0][20] = "快递方式";
     $xls[0][21] = "重量";
     $i = 1;
     foreach ($orders as $o) {
         $xls[$i][0] = $o['sn'];
         $xls[$i][1] = $o['orders_total'];
         $xls[$i][2] = $o['shipping_method'];
         $xls[$i][3] = $o['shippingmoney'];
         $xls[$i][4] = $o['paymoney'];
         $xls[$i][5] = $o['insurance'];
         $xls[$i][6] = $o['payment_module_code'];
         $xls[$i][7] = toDate($o['dateline']);
         $xls[$i][8] = $o['BuyNote'];
         $xls[$i][9] = $o['ip_address'] . "(" . get_ip_area($o['ip_address']) . ")";
         $xls[$i][10] = $o['delivery_email'];
         $xls[$i][11] = $o['delivery_firstname'];
         $xls[$i][12] = $o['delivery_lastname'];
         $xls[$i][13] = $o['delivery_address'];
         $xls[$i][14] = $o['delivery_telephone'];
         $xls[$i][15] = $o['delivery_zip'];
         $xls[$i][16] = $o['delivery_city'];
         $xls[$i][17] = $o['delivery_state'];
         $xls[$i][18] = $o['delivery_country'];
         $xls[$i][19] = L('orders_status_' . $o['orders_status']);
         $xls[$i][20] = $o['shipping_method'];
         $xls[$i][21] = $o['total_weight'];
         $i++;
     }
     $xls_obj = new Excel_XML('UTF-8', false, 'SOP订单列表');
     $xls_obj->addArray($xls);
     $xls_obj->generateXML("SOP");
 }
<?php

/**
 * @file views-export-xls-view-xls.tpl.php
 * Template to display a view as an xls file.
 *
 * - $title : The title of this group of rows.  May be empty.
 * - $rows: An array of row items. Each row is an array of content
 *   keyed by field ID.
 * - $header: an array of haeaders(labels) for fields.
 * - $themed_rows: a array of rows with themed fields.
 * @ingroup views_templates
 */

  $path = drupal_get_path('module', 'views_export_xls');

  if (!isset($filename) || empty($filename)) {
    $filename = $view->name . '.xls';
  }

  // include xls generatator class
  require_once './' . $path . '/libs/php-excel.class.php';

  $xls = new Excel_XML('UTF-8', false, $view->name);
  $themed_rows = array_merge(array($header), $themed_rows);
  $xls->addArray($themed_rows);
  $xls->generateXML($file_name, true);
Example #15
0
 function generate_xls()
 {
     $this->load->helper('php-excel');
     $this->db->group_by(array('status_cat1', 'in_cid'));
     $query = $this->db->get('client');
     $fields = $field_array[] = array("Client ID", "Name", "Fathers Name", "Gender", "DOB", "Company Name", "Company Start Date", "Legal Structure", "Business Category", "Registration No.", "Email ID", "Office Address", "District", "State", "PIN", "Residence Address", "District", "State", "PIN", "Phone Numbers", "Personnel PAN", "Company PAN", "Digital auth name", "Digital Auth Expiry Date", "IT Username", "IT Password", "Sales Tax Username", "Sales Tax Password", "Team assigned", "Status of filling", "Last date of Visit", "Bank Name", "Account No", "MICR Code", "IFSC Code", "Branch Name", "DSC Index No.", "Signing Authority PAN", "Signing Authority's Father Name", "Carry Forward Lossess Details", "Last year of Filling", "VAT Audit Applicable");
     foreach ($query->result() as $row) {
         $data_array[] = array($row->status_cat1[0] . $row->in_cid, $row->name, $row->fatname, $this->getGender($row->sex), $row->dob, $row->cmpname, $row->cmpdob, $row->status_cat1, $row->bus_cat2, $row->regno, $row->email, $row->addr1_gn, $row->addr1_ds, $row->addr1_st, $row->addr1_pin, $row->addr2_gn, $row->addr2_ds, $row->addr2_st, $row->addr2_pin, $row->phnos, $row->pan, $row->cmppan, $row->da_name, $row->da_exp, $row->it_uname, $row->it_pass, $row->st_uname, $row->st_pass, $row->tid, $this->yesNo($row->stat_filing), $row->lvdate, $row->bank_name, $row->acno, $row->micr, $row->ifsc, $row->branch, $row->dscindex, $row->signingauth_pan, $row->signingauth_fat_name, $row->carry_fwd_losses, $row->last_year_of_filing, $this->yesNo($row->vat_audit_applicable));
     }
     $xls = new Excel_XML();
     $xls->addArray($field_array);
     if (isset($data_array)) {
         $xls->addArray($data_array);
     }
     $xls->generateXML("client_list");
 }
    $data[] = array($empleado['nombre'] . " " . $empleado['apellido_p'] . " " . $empleado['apellido_m'], $empleado['puesto_name']);
}
$data[] = array('Abastecimiento', '');
$abastecimiento = dameEmpleados_monitor_op_por_dep(9);
foreach ($abastecimiento as $empleado) {
    $data[] = array($empleado['nombre'] . " " . $empleado['apellido_p'] . " " . $empleado['apellido_m'], $empleado['puesto_name']);
}
$data[] = array('RH', '');
$rh = dameEmpleados_monitor_op_por_dep(13);
foreach ($rh as $empleado) {
    $data[] = array($empleado['nombre'] . " " . $empleado['apellido_p'] . " " . $empleado['apellido_m'], $empleado['puesto_name']);
}
$data[] = array('Juridico', '');
$juridico = dameEmpleados_monitor_op_por_dep(16);
foreach ($juridico as $empleado) {
    $data[] = array($empleado['nombre'] . " " . $empleado['apellido_p'] . " " . $empleado['apellido_m'], $empleado['puesto_name']);
}
$data[] = array('Sistemas', '');
$sistemas = dameEmpleados_monitor_op_por_dep(3);
foreach ($sistemas as $empleado) {
    $data[] = array($empleado['nombre'] . " " . $empleado['apellido_p'] . " " . $empleado['apellido_m'], $empleado['puesto_name']);
}
$data[] = array('Limpieza', '');
$limpieza = dameEmpleados_monitor_op_por_dep(11);
foreach ($limpieza as $empleado) {
    $data[] = array($empleado['nombre'] . " " . $empleado['apellido_p'] . " " . $empleado['apellido_m'], $empleado['puesto_name']);
}
// generate file (constructor parameters are optional)
$xls = new Excel_XML('UTF-8', false, 'Monitor de Empleados');
$xls->addArray($data);
$xls->generateXML('Monitor de Empleados');
 public function export()
 {
     $data = array();
     $this->load->model('sale/coupon');
     $coupon_total = $this->model_sale_coupon->getTotalCoupons();
     $results = $this->model_sale_coupon->getCoupons($data);
     $coupons = array();
     foreach ($results as $result) {
         $coupons[] = array('coupon_id' => $result['coupon_id'], 'name' => $result['name'], 'code' => $result['code'], 'discount' => $result['discount'], 'date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])), 'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])), 'status' => $result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled'));
     }
     $coupons_data = array();
     $coupons_column = array();
     $coupons_column = array('Coupon ID', 'Coupon Name', 'Coupon Code', 'Discount', 'Start Date', 'End Date', 'Status');
     $coupons_data[0] = $coupons_column;
     foreach ($coupons as $coupons_row) {
         $coupons_data[] = $coupons_row;
     }
     require_once DIR_SYSTEM . 'library/excel_xml.php';
     $xls = new Excel_XML('UTF-8', false, 'Coupons List');
     $xls->addArray($coupons_data);
     $xls->generateXML('coupons_list_' . date('Y-m-d _ H:i:s'));
 }
 public function export()
 {
     import("ORG.Io.Excel");
     alogs("CapitalDetail", 0, 1, '执行了会员资金明细列表导出操作!');
     //管理员操作日志
     $map = array();
     if ($_REQUEST['uid'] && $_REQUEST['uname']) {
         $map['l.uid'] = $_REQUEST['uid'];
         $search['uid'] = $map['l.uid'];
         $search['uname'] = urldecode($_REQUEST['uname']);
     }
     if ($_REQUEST['uname'] && !$search['uid']) {
         $map['m.user_name'] = array("like", urldecode($_REQUEST['uname']) . "%");
         $search['uname'] = urldecode($_REQUEST['uname']);
     }
     if ($_REQUEST['target_uname']) {
         $map['l.target_uname'] = urldecode($_REQUEST['target_uname']);
         $search['target_uname'] = $map['l.target_uname'];
     }
     if (isset($_REQUEST['type']) && $_REQUEST['type'] != '') {
         $map['l.type'] = intval($_REQUEST['type']);
         $search['type'] = $map['l.type'];
     }
     if (!empty($_REQUEST['bj']) && !empty($_REQUEST['money'])) {
         $map['l.affect_money'] = array($_REQUEST['bj'], $_REQUEST['money']);
         $search['bj'] = $_REQUEST['bj'];
         $search['money'] = $_REQUEST['money'];
     }
     if (!empty($_REQUEST['start_time']) && !empty($_REQUEST['end_time'])) {
         $timespan = strtotime(urldecode($_REQUEST['start_time'])) . "," . strtotime(urldecode($_REQUEST['end_time']));
         $map['l.add_time'] = array("between", $timespan);
         $search['start_time'] = urldecode($_REQUEST['start_time']);
         $search['end_time'] = urldecode($_REQUEST['end_time']);
     } elseif (!empty($_REQUEST['start_time'])) {
         $xtime = strtotime(urldecode($_REQUEST['start_time']));
         $map['l.add_time'] = array("gt", $xtime);
         $search['start_time'] = $xtime;
     } elseif (!empty($_REQUEST['end_time'])) {
         $xtime = strtotime(urldecode($_REQUEST['end_time']));
         $map['l.add_time'] = array("lt", $xtime);
         $search['end_time'] = $xtime;
     }
     if (session('admin_is_kf') == 1) {
         $map['m.customer_id'] = session('admin_id');
     }
     $field = 'l.id,l.add_time,m.user_name,l.affect_money,l.freeze_money,l.collect_money,(l.account_money+l.back_money) account_money,l.target_uname,l.type,l.info';
     $list = M('member_moneylog l')->field($field)->join("{$this->pre}members m ON m.id=l.uid")->where($map)->limit($Lsql)->select();
     $type = C('MONEY_LOG');
     $row = array();
     $row[0] = array('序号', '用户ID', '用户名', '交易对方', '交易类型', '影响金额', '可用余额', '冻结金额', '待收金额', '发生时间', '备注');
     $i = 1;
     foreach ($list as $v) {
         $row[$i]['i'] = $i;
         $row[$i]['uid'] = $v['id'];
         $row[$i]['card_num'] = $v['user_name'];
         $row[$i]['card_pass'] = $v['target_uname'];
         $row[$i]['card_mianfei'] = $type[$v['type']];
         $row[$i]['card_mianfei0'] = $v['affect_money'];
         $row[$i]['card_mianfei1'] = $v['account_money'];
         $row[$i]['card_mianfei2'] = $v['freeze_money'];
         $row[$i]['card_mianfei3'] = $v['collect_money'];
         $row[$i]['card_timelimit'] = date("Y-m-d H:i:s", $v['add_time']);
         $row[$i]['info'] = $v['info'];
         $i++;
     }
     $xls = new \Excel_XML('UTF-8', false, 'datalist');
     $xls->addArray($row);
     $xls->generateXML("datalistcard");
 }
Example #19
0
 function ExportToExcel()
 {
     $id = intval($this->Get['id']);
     if ($id < 1 || MEMBER_ID < 1 || 'admin' !== MEMBER_ROLE_TYPE) {
         $this->Messager('您不能导出该内容');
     }
     $list = array();
     load::logic('event');
     $EventLogic = new EventLogic();
     $param = array('where' => " a.id = '{$id}' ");
     $return = $EventLogic->getEventInfo($param);
     $event = $return['event_list'][$id];
     if (empty($event)) {
         $this->Messager('您要导出的内容已经不存在了');
     }
     $list[0][0] = '标题:';
     $list[0][1] = $event['title'];
     $list[1][0] = '时间:';
     $list[1][1] = $event['fromt'] . "-" . $event['tot'];
     $list[2][0] = '地点:';
     $list[2][1] = $event['province'] . $event['city'] . $event['area'] . $event['address'];
     $list[3][0] = '发起人:';
     $list[3][1] = $event['nickname'];
     $list[4][0] = '参与人数:';
     $list[4][1] = $event['play_num'] . "人";
     $list[5] = array();
     $list[6][0] = '申请者';
     $j = 1;
     foreach (unserialize($event['need_app_info']) as $value) {
         $list[6][$j] = $value['name'];
         $j++;
     }
     $list[6][$j] = '留言';
     $i = 7;
     $param = array('where' => " id = '{$id}' and play = 1 ", 'order' => " order by a.play_time ");
     $member = $EventLogic->getAllUser($param);
     $member_list = (array) $member['member'];
     foreach ($member_list as $member) {
         $app_info = (array) unserialize($member['app_info']);
         $list[$i][0] = $member['nickname'];
         $k = 1;
         foreach ($app_info as $value) {
             $list[$i][$k] = $value;
             $k++;
         }
         $i++;
     }
     jext('php-excel');
     $xls = new Excel_XML($this->Config['charset']);
     $xls->addArray($list);
     $xls->generateXML('event-' . date("YmdHis"));
     exit;
 }
<?php

require_once '../includes/inc_checa_sessao.php';
require_once "../includes/inc_database.php";
require_once '../includes/inc_funcoeslib.php';
require_once '../includes/plugins/php-excel.class.php';
$data = array('ID', 'Nome', 'Email');
$newsletter = $app->getServiceManager()->getService('DataHelper')->retornoRegistroPadrao('tbl_sys_newsletter', '', 1, 0, ' ', 'id');
if (empty($newsletter['registros'])) {
    die('Nenhum email cadastrado');
}
array_unshift($newsletter['registros'], $data);
$xls = new Excel_XML('UTF-8', false, 'Newsletter');
$xls->addArray($newsletter['registros']);
$xls->generateXML('newsletter');
Example #21
0
 function onhelp_export()
 {
     $hasHelpExportPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "helpExport");
     if ($hasHelpExportPrivilege['return']) {
         require TIPASK_ROOT . '/lib/php_excel.class.php';
         $export = array();
         $export_header = array("问题ID", "申请人", "协助人", "状态 ", "协助时间", "协助完成时间", "逾期");
         array_push($export, $export_header);
         $_help = $_SESSION['help_session'];
         $where_search = $_ENV['help']->getWhere($_help['start'], $_help['end_time'], $_help['status'], $_help['qid'], $_help['department'], $_help['aid_id'], $_help['overdue']);
         $export_arr = $_ENV['help']->getList('', '', $where_search, false);
         foreach ($export_arr as $val) {
             if ($val['status'] == 1) {
                 $status = "已回复";
             } else {
                 $status = "授理中";
             }
             if ($val['overdue'] == 1) {
                 $overdue = "已逾期";
             } else {
                 $overdue = "未逾期";
             }
             $export[] = array($val['qid'], $val['applicant'], $val['aid'], $status, $val['start'], $val['back_time'], $overdue);
         }
         $xls = new Excel_XML('UTF-8', false, 'My Sheet');
         $xls->addArray($export);
         $xls->generateXML('help' . date('Ymd'));
     } else {
         $hasHelpExportPrivilege['url'] = "?admin_question/help";
         __msg($hasHelpExportPrivilege);
     }
 }
Example #22
0
 public function export_excel_them()
 {
     $ckq = $this->CheckQuyen(4);
     $req = -1;
     if ($ckq == true) {
         $export_excel = $this->m_voucher->export_excel_them();
         if (count($export_excel) > 0) {
             $this->load->file("public/php-excel.class.php");
             //echo $sql_ex;die;
             // create a simple 2-dimensional array
             $arr_re = array();
             $i = 0;
             $arr_re[$i][] = "Mã voucher";
             $arr_re[$i][] = "Mã phát sinh";
             $arr_re[$i][] = "Ngày bắt đầu";
             $arr_re[$i][] = "Ngày hết hạn";
             $arr_re[$i][] = "Giá tiền thẻ";
             $arr_re[$i][] = "UserID";
             $arr_re[$i][] = "Loại thẻ";
             $arr_re[$i][] = "Trạng thái";
             $arr_re[$i][] = "Áp dụng";
             $arr_re[$i][] = "Giá tối thiểu áp dụng";
             foreach ($export_excel as $row) {
                 $i++;
                 $arr_re[$i][] = $row->VoucherID;
                 //ma phieu
                 $arr_re[$i][] = $row->GeneratedID;
                 $datefrom = $row->ValidForm;
                 $datefrom = explode(" ", $datefrom);
                 $datefrom = explode("-", $datefrom[0]);
                 $datefrom = $datefrom[2] . "-" . $datefrom[1] . "-" . $datefrom[0];
                 $dateto = $row->ValidTo;
                 $dateto = explode(" ", $dateto);
                 $dateto = explode("-", $dateto[0]);
                 $dateto = $dateto[2] . "-" . $dateto[1] . "-" . $dateto[0];
                 $arr_re[$i][] = $datefrom;
                 $arr_re[$i][] = $dateto;
                 $arr_re[$i][] = $row->Discount;
                 $arr_re[$i][] = $row->RefUserID;
                 $arr_re[$i][] = $row->VoucherType;
                 if ($row->Status == 1 || $row->Status == "1") {
                     $trangthai = "Đang dùng";
                 } else {
                     $trangthai = "Đã huỷ";
                 }
                 $arr_re[$i][] = $trangthai;
                 if ($row->AppliedForAll == 1 || $row->AppliedForAll == "1") {
                     $apdung = "Tất cả";
                 } else {
                     if ($row->AppliedForAll == 2 || $row->AppliedForAll == "2") {
                         $apdung = "Tất cả, cả khuyến mãi";
                     } else {
                         $apdung = "Một số sản phẩm";
                     }
                 }
                 $arr_re[$i][] = $apdung;
                 $arr_re[$i][] = $row->PriceMin;
             }
             // generate file (constructor parameters are optional)
             $xls = new Excel_XML('UTF-8', false, 'Workflow Management');
             $xls->addArray($arr_re);
             $xls->generateXML('datavoucher');
         } else {
             echo "<span style=\"color:red;font-weight:bold;\">Không có dữ liệu để export</span>";
         }
     }
 }
 public function integralexport()
 {
     import("ORG.Io.Excel");
     $map = array();
     $map['uid'] = $this->uid;
     if ($_GET['start_time'] && $_GET['end_time']) {
         $_GET['start_time'] = strtotime($_GET['start_time'] . " 00:00:00");
         $_GET['end_time'] = strtotime($_GET['end_time'] . " 23:59:59");
         if ($_GET['start_time'] < $_GET['end_time']) {
             $map['add_time'] = array("between", "{$_GET['start_time']},{$_GET['end_time']}");
             $search['start_time'] = $_GET['start_time'];
             $search['end_time'] = $_GET['end_time'];
         }
     }
     if (!empty($_GET['log_type'])) {
         $map['type'] = intval($_GET['log_type']);
         $search['log_type'] = intval($_GET['log_type']);
     }
     $list = getIntegralLog($map, 100000);
     $logtype = C('INTEGRAL_LOG');
     $row = array();
     $row[0] = array('序号', '发生日期', '类型', '影响积分', '剩余活跃积分', '总积分', '说明');
     $i = 1;
     foreach ($list['list'] as $v) {
         $row[$i]['i'] = $i;
         $row[$i]['uid'] = date("Y-m-d H:i:s", $v['add_time']);
         $row[$i]['card_num'] = $v['type'];
         $row[$i]['card_pass'] = $v['affect_integral'];
         $row[$i]['card_pass2'] = $v['active_integral'];
         $row[$i]['card_mianfei'] = $v['account_integral'];
         $row[$i]['card_mianfei2'] = $v['info'];
         $i++;
     }
     $xls = new Excel_XML('UTF-8', false, 'IntegralLog');
     $xls->addArray($row);
     $xls->generateXML("IntegralLog");
 }
 public function export()
 {
     $proid = (int) $_REQUEST['id'];
     $proinfo = M('promote')->find($proid);
     if (empty($proinfo)) {
         $this->error('数据错误');
     }
     import("ORG.Io.Excel");
     alogs("CapitalAccount", 0, 1, '执行了所有会员资金列表导出操作!');
     //管理员操作日志
     $map = array();
     if ($_REQUEST['uname']) {
         $map['m.user_name'] = array("like", urldecode($_REQUEST['uname']) . "%");
         $search['uname'] = urldecode($_REQUEST['uname']);
     }
     if ($_REQUEST['realname']) {
         $map['mi.real_name'] = urldecode($_REQUEST['realname']);
         $search['realname'] = $map['mi.real_name'];
     }
     if (!empty($_REQUEST['bj']) && !empty($_REQUEST['lx']) && !empty($_REQUEST['money'])) {
         if ($_REQUEST['lx'] == 'allmoney') {
             if ($_REQUEST['bj'] == 'gt') {
                 $bj = '>';
             } else {
                 if ($_REQUEST['bj'] == 'lt') {
                     $bj = '<';
                 } else {
                     if ($_REQUEST['bj'] == 'eq') {
                         $bj = '=';
                     }
                 }
             }
             $map['_string'] = "(mm.account_money+mm.back_money) " . $bj . $_REQUEST['money'];
         } else {
             $map[$_REQUEST['lx']] = array($_REQUEST['bj'], $_REQUEST['money']);
         }
         $search['bj'] = $_REQUEST['bj'];
         $search['lx'] = $_REQUEST['lx'];
         $search['money'] = $_REQUEST['money'];
     }
     $map['m.tid'] = $proid;
     //分页处理
     import("ORG.Util.Page");
     $count = M('members m')->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->count('m.id');
     $p = new Page($count, C('ADMIN_PAGE_SIZE'));
     $page = $p->show();
     $Lsql = "{$p->firstRow},{$p->listRows}";
     //分页处理
     $pre = $this->pre;
     $field = 'm.id,m.reg_time,m.user_email,m.user_phone,m.user_name,m.user_type,mi.real_name,mm.money_freeze,mm.money_collect,(mm.account_money+mm.back_money) total_money,mm.account_money,mm.back_money';
     $list = M('members m')->field($field)->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->order("m.id DESC")->select();
     foreach ($list as $key => $v) {
         $uid = $v['id'];
         //$umoney = M('members')->field('account_money,reward_money')->find($uid);
         //待确认投标
         $investing = M()->query("select sum(investor_capital) as capital from {$pre}borrow_investor where investor_uid={$uid} AND status=1");
         //待收金额
         $invest = M()->query("select sum(investor_capital-receive_capital) as capital,sum(reward_money) as jiangli,sum(investor_interest-receive_interest) as interest from {$pre}borrow_investor where investor_uid={$uid} AND status =4");
         //$invest = M()->query("SELECT sum(capital) as capital,sum(interest) as interest FROM {$pre}investor_detail WHERE investor_uid={$uid} AND `status` =7");
         //待付金额
         $borrow = M()->query("select sum(borrow_money-repayment_money) as repayment_money,sum(borrow_interest-repayment_interest) as repayment_interest from {$pre}borrow_info where borrow_uid={$uid} AND borrow_status=6");
         $withdraw0 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=0")->sum('withdraw_money');
         //待提现
         $withdraw1 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=1")->sum('withdraw_money');
         //提现处理中
         $withdraw2 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=2")->sum('withdraw_money');
         //已提现
         $withdraw3 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=0")->sum('second_fee');
         //待提现手续费
         $withdraw4 = M('member_withdraw')->where("uid={$uid} AND withdraw_status=1")->sum('second_fee');
         //处理中提现手续费
         $borrowANDpaid = M()->query("select status,sort_order,borrow_id,sum(capital) as capital,sum(interest) as interest from {$pre}investor_detail where borrow_uid={$uid} AND status in(1,2,3)");
         $investEarn = M('borrow_investor')->where("investor_uid={$uid} and status in(4,5,6)")->sum('receive_interest');
         $investPay = M('borrow_investor')->where("investor_uid={$uid} status<>2")->sum('investor_capital');
         $investEarn1 = M('borrow_investor')->where("investor_uid={$uid} and status in(4,5,6)")->sum('invest_fee');
         //投资者管理费
         $payonline = M('member_payonline')->where("uid={$uid} AND status=1")->sum('money');
         //累计支付佣金
         $commission1 = M('borrow_investor')->where("investor_uid={$uid}")->sum('paid_fee');
         $commission2 = M('borrow_info')->where("borrow_uid={$uid} AND borrow_status in(2,4)")->sum('borrow_fee');
         $uplevefee = M('member_moneylog')->where("uid={$uid} AND type=2")->sum('affect_money');
         $adminop = M('member_moneylog')->where("uid={$uid} AND type=7")->sum('affect_money');
         $txfee = M('member_withdraw')->where("uid={$uid} AND withdraw_status=2")->sum('second_fee');
         $czfee = M('member_payonline')->where("uid={$uid} AND status=1")->sum('fee');
         $interest_needpay = M()->query("select sum(borrow_interest-repayment_interest) as need_interest from {$pre}borrow_info where borrow_uid={$uid} AND borrow_status=6");
         $interest_willget = M()->query("select sum(investor_interest-receive_interest) as willget_interest from {$pre}borrow_investor where investor_uid={$uid} AND status=4");
         $interest_jiliang = M('borrow_investor')->where("borrow_uid={$uid}")->sum('reward_money');
         //累计支付投标奖励
         $moneylog = M("member_moneylog")->field("type,sum(affect_money) as money")->where("uid={$uid}")->group("type")->select();
         $listarray = array();
         foreach ($moneylog as $vs) {
             $listarray[$vs['type']]['money'] = $vs['money'] > 0 ? $vs['money'] : $vs['money'] * -1;
         }
         //$money['kyxjje'] = $umoney['account_money'];//可用现金金额
         $money['kyxjje'] = $v['account_money'];
         //可用现金金额
         $money['dsbx'] = floatval($invest[0]['capital'] + $invest[0]['interest']);
         //待收本息
         $money['dsbj'] = $invest[0]['capital'];
         //待收本金
         $money['dslx'] = $invest[0]['interest'];
         //待收利息
         $money['dfbx'] = floatval($borrow[0]['repayment_money'] + $borrow[0]['repayment_interest']);
         //待付本息
         $money['dfbj'] = $borrow[0]['repayment_money'];
         //待付本金
         $money['dflx'] = $borrow[0]['repayment_interest'];
         //待付利息
         $money['dxrtb'] = $investing[0]['capital'];
         //待确认投标
         $money['dshtx'] = $withdraw0 + $withdraw3;
         //待审核提现
         $money['clztx'] = $withdraw1 + $withdraw4;
         //处理中提现
         //$money['jzlx'] = $investEarn;//净赚利息
         $money['jzlx'] = $investEarn - $investEarn1;
         //净赚利息
         $money['jflx'] = $borrowANDpaid[0]['interest'];
         //净付利息
         $money['ljjj'] = $umoney['reward_money'];
         //累计收到奖金
         $money['ljhyf'] = $uplevefee;
         //累计支付会员费
         $money['ljtxsxf'] = $txfee;
         //累计提现手续费
         $money['ljczsxf'] = $czfee;
         //累计充值手续费
         $money['total_2'] = $money['jzlx'] - $money['jflx'] - $money['ljhyf'] - $money['ljtxsxf'] - $money['ljczsxf'];
         $money['ljtzje'] = $investPay;
         //累计投资金额
         $money['ljjrje'] = $borrowANDpaid[0]['borrow_money'];
         //累计借入金额
         $money['ljczje'] = $payonline;
         //累计充值金额
         $money['ljtxje'] = $withdraw2;
         //累计提现金额
         $money['ljzfyj'] = $commission1 + $commission2;
         //累计支付佣金
         $money['glycz'] = $listarray['7']['money'];
         //管理员操作资金
         //
         $money['dslxze'] = $interest_willget[0]['willget_interest'];
         //待收利息总额
         $money['dflxze'] = $interest_needpay[0]['need_interest'];
         //待付利息总额
         $money['ljtbjl'] = $listarray['20']['money'];
         //累计投标奖励
         $list[$key]['xmoney'] = $money;
     }
     $row = array();
     //	$row[0]=array('ID','用户名','真实姓名','总余额','可用余额','冻结金额','待收本息金额','待收本金金额','待收利息金额','待付本息金额','待付本金金额','待付利息金额','待确认投标','待审核提现+手续费','处理中提现+手续费','累计提现手续费','累计充值手续费','累计提现金额','累计充值金额','累计支付佣金','累计投标奖励','净赚利息','净付利息','管理员操作资金');
     $row[0] = array('ID', '用户名', '会员类型', '注册来源', '会员邮箱', '会员手机', '可用余额', '冻结金额', '待收本息', '注册时间');
     $i = 1;
     foreach ($list as $v) {
         $row[$i]['uid'] = $v['id'];
         $row[$i]['card_num'] = $v['user_name'];
         //$row[$i]['card_pass'] = $v['real_name'];
         if ($v['user_type'] == 1) {
             $row[$i]['user_type'] = '普通会员';
         } else {
             $row[$i]['user_type'] = 'VIP会员';
         }
         $row[$i]['user_aaad'] = $proinfo['title'];
         $row[$i]['user_email'] = $v['user_email'];
         $row[$i]['user_phone'] = $v['user_phone'];
         $row[$i]['account_money'] = $v['account_money'];
         $row[$i]['money_freeze'] = $v['money_freeze'];
         $row[$i]['dsbx'] = $v['money_collect'];
         $row[$i]['tjsj'] = date('Y-m-d H:i:s', $v['reg_time']);
         $i++;
     }
     $xls = new Excel_XML('UTF-8', false, 'datalist');
     $xls->addArray($row);
     $xls->generateXML("membersInfo");
 }
Example #25
0
 public function export_excel()
 {
     $ckq = $this->CheckQuyen(4);
     $req = -1;
     if ($ckq == true) {
         $export_excel = $this->m_bookingpayment->export_excel();
         if (count($export_excel) > 0) {
             $this->load->file("public/php-excel.class.php");
             //echo $sql_ex;die;
             // create a simple 2-dimensional array
             $arr_re = array();
             $i = 0;
             $arr_re[$i][] = "Tên Spa";
             $arr_re[$i][] = "Tên Dịch vụ";
             $arr_re[$i][] = "Tổng tiền";
             $arr_re[$i][] = "Thời gian bắt đầu";
             $arr_re[$i][] = "Thời gian kết thúc";
             $arr_re[$i][] = "Trạng thái thanh toán";
             $arr_re[$i][] = "Địa chỉ thanh toán";
             foreach ($export_excel as $row) {
                 $i++;
                 $arr_re[$i][] = $row->spaName;
                 //ma phieu
                 $arr_re[$i][] = $row->Name;
                 $arr_re[$i][] = $row->desc1;
                 if ($row->Status == 1 || $row->Status == "1") {
                     $trangthai = "Hoạt động";
                 } else {
                     $trangthai = "Đã huỷ";
                 }
                 $arr_re[$i][] = $trangthai;
                 $arr_re[$i][] = $row->ProductTypeName;
                 $arr_re[$i][] = $row->Duration;
                 $arr_re[$i][] = $row->CurrentVouchers;
                 $arr_re[$i][] = $row->MaxProductatOnce;
                 $datefrom = $row->ValidTimeFrom;
                 $datefrom = explode(" ", $datefrom);
                 $datefrom = explode("-", $datefrom[0]);
                 $datefrom = $datefrom[2] . "-" . $datefrom[1] . "-" . $datefrom[0];
                 $dateto = $row->ValidTimeTo;
                 $dateto = explode(" ", $dateto);
                 $dateto = explode("-", $dateto[0]);
                 $dateto = $dateto[2] . "-" . $dateto[1] . "-" . $dateto[0];
                 $arr_re[$i][] = $datefrom;
                 $arr_re[$i][] = $dateto;
             }
             // generate file (constructor parameters are optional)
             $xls = new Excel_XML('UTF-8', false, 'Workflow Management');
             $xls->addArray($arr_re);
             $xls->generateXML('listproducts');
         } else {
             echo "<span style=\"color:red;font-weight:bold;\">Vui long tim kiem danh sach de xuat duoc file excel</span>";
         }
     }
 }
Example #26
0
 function export($type)
 {
     if ($this->data['users']->role != "admin") {
         exit;
     }
     if ($type == "excel") {
         $classArray = array();
         $classes = classes::get();
         foreach ($classes as $class) {
             $classArray[$class->id] = $class->className;
         }
         $data = array(1 => array('Title', 'Description', 'Student', 'Amount', 'Date', 'Status'));
         $payments = \DB::table('payments')->leftJoin('users', 'users.id', '=', 'payments.paymentStudent')->select('payments.id as id', 'payments.paymentTitle as paymentTitle', 'payments.paymentDescription as paymentDescription', 'payments.paymentAmount as paymentAmount', 'payments.paymentStatus as paymentStatus', 'payments.paymentDate as paymentDate', 'payments.paymentStudent as studentId', 'users.fullName as fullName')->get();
         foreach ($payments as $value) {
             if ($value->paymentStatus == 1) {
                 $paymentStatus = "PAID";
             } else {
                 $paymentStatus = "UNPAID";
             }
             $data[] = array($value->paymentTitle, $value->paymentDescription, $value->fullName, $value->paymentAmount, $value->paymentDate, $paymentStatus);
         }
         $xls = new Excel_XML('UTF-8', false, 'Students Sheet');
         $xls->addArray($data);
         $xls->generateXML('Students-Sheet');
     } elseif ($type == "pdf") {
         $classArray = array();
         $classes = classes::get();
         foreach ($classes as $class) {
             $classArray[$class->id] = $class->className;
         }
         $header = array('Title', 'Description', 'Student', 'Amount', 'Date', 'Status');
         $data = array();
         $payments = \DB::table('payments')->leftJoin('users', 'users.id', '=', 'payments.paymentStudent')->select('payments.id as id', 'payments.paymentTitle as paymentTitle', 'payments.paymentDescription as paymentDescription', 'payments.paymentAmount as paymentAmount', 'payments.paymentStatus as paymentStatus', 'payments.paymentDate as paymentDate', 'payments.paymentStudent as studentId', 'users.fullName as fullName')->get();
         foreach ($payments as $value) {
             if ($value->paymentStatus == 1) {
                 $paymentStatus = "PAID";
             } else {
                 $paymentStatus = "UNPAID";
             }
             $data[] = array($value->paymentTitle, $value->paymentDescription, $value->fullName, $value->paymentAmount, $value->paymentDate, $paymentStatus);
         }
         $pdf = new FPDF();
         $pdf->SetFont('Arial', '', 10);
         $pdf->AddPage();
         // Header
         foreach ($header as $col) {
             $pdf->Cell(40, 7, $col, 1);
         }
         $pdf->Ln();
         // Data
         foreach ($data as $row) {
             foreach ($row as $col) {
                 $pdf->Cell(40, 6, $col, 1);
             }
             $pdf->Ln();
         }
         $pdf->Output();
     }
     exit;
 }
 public function export()
 {
     import("ORG.Io.Excel");
     $map = array();
     if ($_REQUEST['uname']) {
         $map['m.user_name'] = array("like", urldecode($_REQUEST['uname']) . "%");
         $search['uname'] = urldecode($_REQUEST['uname']);
     }
     if ($_REQUEST['realname']) {
         $map['mi.real_name'] = urldecode($_REQUEST['realname']);
         $search['realname'] = $map['mi.real_name'];
     }
     if (!empty($_REQUEST['bj']) && !empty($_REQUEST['lx']) && !empty($_REQUEST['money'])) {
         $map[$_REQUEST['lx']] = array($_REQUEST['bj'], $_REQUEST['money']);
         $search['bj'] = $_REQUEST['bj'];
         $search['lx'] = $_REQUEST['lx'];
         $search['money'] = $_REQUEST['money'];
     }
     if (session('admin_is_kf') == 1) {
         $map['m.customer_id'] = session('admin_id');
     }
     $field = 'm.id,m.reg_time,m.user_name,mi.real_name,mm.money_freeze,mm.money_collect,mm.account_money';
     $list = M('members m')->field($field)->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->where($map)->select();
     $row = array();
     $row[0] = array('序号', '用户ID', '用户名', '真实姓名', '总余额', '可用余额', '冻结金额', '待收金额', '注册时间');
     $i = 1;
     foreach ($list as $v) {
         $row[$i]['i'] = $i;
         $row[$i]['uid'] = $v['id'];
         $row[$i]['card_num'] = $v['user_name'];
         $row[$i]['card_pass'] = $v['real_name'];
         $row[$i]['card_mianfei'] = $v['money_freeze'] + $v['account_money'] + $v['money_collect'];
         $row[$i]['card_mianfei1'] = $v['account_money'];
         $row[$i]['card_mianfei2'] = $v['money_freeze'];
         $row[$i]['card_mianfei3'] = $v['money_collect'];
         $row[$i]['card_timelimit'] = date("Y-m-d", $v['reg_time']);
         $i++;
     }
     $xls = new Excel_XML('UTF-8', false, 'datalist');
     $xls->addArray($row);
     $xls->generateXML("memberlist");
 }
Example #28
0
function exportFleetScoreUpdates()
{
    require_once BASE . 'basefunctions/baseapis/PHPExcel/php-excel.class.php';
    $manager = new TableManager("fleet_scores");
    $data = __sanitizeData($_GET);
    $where = (string) "1=1";
    if (isset($data["fleet"]) && $data["fleet"]) {
        $where .= $manager->quoteString(" AND `fleetid`=?", (int) $data["fleet"]);
    }
    if (isset($data["start"]) && $data["start"]) {
        $where .= $manager->quoteString(" AND `date`>=?", (int) unixDate($data["start"]));
    }
    if (isset($data["end"]) && $data["end"]) {
        $where .= $manager->quoteString(" AND `date`<=?", (int) unixDate($data["end"]));
    }
    $manager->setWhere($where);
    $manager->setOrderBy(array("column" => "date"));
    $records = $manager->selectMultiple();
    $rows = returnFleetTruckCount();
    $xlsdata = (array) array();
    $fleetdayobj = new fleetDayHandler();
    $tempfleetlist = $fleetdayobj->getIncomeFleets();
    $fleetlist = array();
    foreach ($tempfleetlist as $tempkey => $tempval) {
        $fleetlist[$tempval["id"]] = $tempval;
    }
    unset($tempfleetlist);
    unset($fleetdayobj);
    $row = (array) array("Date", "Fleet", "Income budget", "Income", "Contribution budget", "Contribution", "Truck count", "Kms", "Ave. Kms per truck", "Budget Ave. Kms per truck");
    $xlsdata[] = $row;
    foreach ($records as $val) {
        $row = (array) array(date("Y-m-d", $val["date"]), $fleetlist[$val["fleetid"]]["name"], $val["budget"], $val["income"], $val["budgetcontrib"], $val["contrib"], $rows[$val["fleetid"]]["count"], $val["kms"], round($val["kms"] / (isset($rows[$val["fleetid"]]) && isset($rows[$val["fleetid"]]["count"]) ? $rows[$val["fleetid"]]["count"] : 1), 2), round($val["budkms"] / (isset($rows[$val["fleetid"]]) && isset($rows[$val["fleetid"]]["count"]) ? $rows[$val["fleetid"]]["count"] : 1), 2));
        $xlsdata[] = $row;
    }
    $xls = new Excel_XML('UTF-8', TRUE);
    $xls->addArray($xlsdata);
    $xls->generateXML('fleet_score_data');
}
Example #29
0
            $state = $details["detail1"]["state"];
            $district = $details["detail1"]["district"];
            $mobile = $details["detail1"]["mobile"];
            $email = $details["detail1"]["email"];
            $acnumber = $details["detail1"]["acnumber"];
            $nbank = $details["detail1"]["nbank"];
            $nbranch = $details["detail1"]["nbranch"];
            $ifsc = $details["detail1"]["ifsc"];
            $pan = $details["detail1"]["pan"];
            $referral_id = $details["detail1"]["referral"];
            $ref_user_name = $obj_sponser->IdToUserName($referral_id);
            $ref_full_name = $obj_sponser->getFullName($referral_id);
            $doc[$i][0] = $j + 1;
            $doc[$i][1] = $user_name;
            $doc[$i][2] = $name;
            $doc[$i][3] = $ref_user_name;
            $doc[$i][4] = $ref_full_name;
            $doc[$i][5] = $mobile;
            $doc[$i][6] = $email;
            $j = $j + 1;
            $k = $k + 1;
        }
        // For loop ends
        $now = date("Y-W");
        $xls = new Excel_XML();
        $xls->addArray($doc);
        $xls->generateXML("weekly_report-{$now}");
    }
    // End of if
    // generate excel file
}
Example #30
0
 public function export()
 {
     import("ORG.Io.Excel");
     $map = array();
     $map['m.user_phone'] = array('neq', "");
     if ($_REQUEST['uname']) {
         $map['m.user_name'] = array("like", urldecode($_REQUEST['uname']) . "%");
         $search['uname'] = urldecode($_REQUEST['uname']);
     }
     if ($_REQUEST['realname']) {
         $map['mi.real_name'] = urldecode($_REQUEST['realname']);
         $search['realname'] = $map['mi.real_name'];
     }
     if ($_REQUEST['user_phone']) {
         $map['m.user_phone'] = urldecode($_REQUEST['user_phone']);
         $search['user_phone'] = $map['m.user_phone'];
     }
     if (isset($_REQUEST['status'])) {
         $map['ms.phone_status'] = $_REQUEST['status'];
         $search['status'] = $map['ms.phone_status'];
     }
     if (!empty($_REQUEST['bj']) && !empty($_REQUEST['lx']) && !empty($_REQUEST['money'])) {
         if ($_REQUEST['lx'] == 'allmoney') {
             if ($_REQUEST['bj'] == 'gt') {
                 $bj = '>';
             } else {
                 if ($_REQUEST['bj'] == 'lt') {
                     $bj = '<';
                 } else {
                     if ($_REQUEST['bj'] == 'eq') {
                         $bj = '=';
                     }
                 }
             }
             $map['_string'] = "(mm.account_money+mm.back_money) " . $bj . $_REQUEST['money'];
         } else {
             $map[$_REQUEST['lx']] = array($_REQUEST['bj'], $_REQUEST['money']);
         }
         $search['bj'] = $_REQUEST['bj'];
         $search['lx'] = $_REQUEST['lx'];
         $search['money'] = $_REQUEST['money'];
     }
     //if(session('admin_is_kf')==1 && m.customer_id!='')	$map['m.customer_id'] = session('admin_id');
     $field = 'm.id,m.user_phone,m.reg_time,m.user_name,mi.real_name,mm.money_freeze,mm.money_collect,(mm.account_money+mm.back_money) account_money,ms.phone_status,ms.uid';
     $list = M('members m')->field($field)->join("{$this->pre}member_money mm ON mm.uid=m.id")->join("{$this->pre}member_info mi ON mi.uid=m.id")->join("{$this->pre}members_status ms ON ms.uid=m.id")->where($map)->limit($Lsql)->order('m.id DESC')->select();
     $row = array();
     $row[0] = array('序号', '用户ID', '用户名', '真实姓名', '认证手机', '总余额', '可用余额', '冻结金额', '待收金额', '注册时间');
     $i = 1;
     foreach ($list as $v) {
         $row[$i]['i'] = $i;
         $row[$i]['uid'] = $v['id'];
         $row[$i]['card_num'] = $v['user_name'];
         $row[$i]['card_pass'] = $v['real_name'];
         $row[$i]['card_pass1'] = "{$v['user_phone']}";
         $row[$i]['card_mianfei'] = $v['money_freeze'] + $v['account_money'] + $v['money_collect'];
         $row[$i]['card_mianfei1'] = $v['account_money'];
         $row[$i]['card_mianfei2'] = $v['money_freeze'];
         $row[$i]['card_mianfei3'] = $v['money_collect'];
         $row[$i]['card_timelimit'] = date("Y-m-d", $v['reg_time']);
         $i++;
     }
     $xls = new Excel_XML('UTF-8', false, 'datalist');
     $xls->addArray($row);
     $xls->generateXML("datalistcard");
 }