本文整理汇总了PHP中AdminController::reportPageGenerator方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::reportPageGenerator方法的具体用法?PHP AdminController::reportPageGenerator怎么用?PHP AdminController::reportPageGenerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::reportPageGenerator方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
//.........这里部分代码省略.........
});
});
$actualresult = $model->get();
$tattrs = array('width' => '100%', 'class' => 'table table-bordered table-striped');
$thead = array();
$thead[] = array(array('value' => 'No.', 'attr' => ''), array('value' => 'Zone', 'attr' => ''), array('value' => 'TOKO ONLINE', 'attr' => ''), array('value' => 'Type', 'attr' => ''), array('value' => 'Status', 'attr' => ''), array('value' => 'KEPADA', 'attr' => ''), array('value' => 'Total Price', 'attr' => ''), array('value' => 'Delivery Charge', 'attr' => ''), array('value' => 'COD Surcharge', 'attr' => ''), array('value' => 'Total Charge', 'attr' => ''), array('value' => 'ALAMAT', 'attr' => ''), array('value' => 'Phone', 'attr' => ''), array('value' => 'No Kode Penjualan Toko', 'attr' => ''), array('value' => 'PENERIMA PAKET', 'attr' => 'colspan="2"'));
$thead[] = array(array('value' => 'Mohon tunjukkan kartu identitas untuk di foto sebagai bagian bukti penerimaan', 'attr' => 'style="text-align:center;" colspan="13"'), array('value' => 'TANDA TANGAN', 'attr' => ''), array('value' => 'NAMA', 'attr' => 'class="bold center" style="width:50px" '));
$tabdata = array();
$seq = 1;
$total_billing = 0;
$total_delivery = 0;
$total_cod = 0;
$d = 0;
$gt = 0;
$lastdate = '';
$courier_name = '';
$counts = array('Delivery Only' => 0, 'COD' => 0, 'CCOD' => 0, 'PS' => 0, 'pending' => 0);
foreach ($actualresult as $r) {
$counts[$r->delivery_type] += 1;
if ($r->pending_count > 0) {
$counts['pending'] += 1;
}
$courier_name = $r->courier_name;
//$total = str_replace(array(',','.'), '', $r->total_price);
//$dsc = str_replace(array(',','.'), '', $r->total_discount);
//$tax = str_replace(array(',','.'), '',$r->total_tax);
//$dc = str_replace(array(',','.'), '',$r->delivery_cost);
//$cod = str_replace(array(',','.'), '',$r->cod_cost);
$total = $r->total_price;
$dsc = $r->total_discount;
$tax = $r->total_tax;
$dc = $r->delivery_cost;
$cod = $r->cod_cost;
$total = is_nan((double) $total) ? 0 : (double) $total;
$dsc = is_nan((double) $dsc) ? 0 : (double) $dsc;
$tax = is_nan((double) $tax) ? 0 : (double) $tax;
$dc = is_nan((double) $dc) ? 0 : (double) $dc;
$cod = is_nan((double) $cod) ? 0 : (double) $cod;
$payable = 0;
//$details = $this->db->
//where('delivery_id',$r->delivery_id)->order_by('unit_sequence','asc')->get($this->config->item('delivery_details_table'));
//$details = $details->result_array();
$details = Deliverydetail::where('delivery_id', '=', $r->delivery_id)->orderBy('unit_sequence', 'asc')->get()->toArray();
$d = 0;
$gt = 0;
foreach ($details as $value => $key) {
$u_total = $key['unit_total'];
$u_discount = $key['unit_discount'];
$gt += is_nan((double) $u_total) ? 0 : (double) $u_total;
$d += is_nan((double) $u_discount) ? 0 : (double) $u_discount;
}
if ($gt == 0) {
if ($total > 0 && $payable) {
$gt = $total;
}
}
$payable = $gt;
$total_delivery += (double) $dc;
$total_cod += (double) $cod;
$total_billing += (double) $payable;
$db = '';
if ($r->delivery_bearer == 'merchant') {
$dc = 0;
$db = 'M';
} else {
$db = 'B';
}
//force all DO to zero
$cb = '';
if ($r->cod_bearer == 'merchant') {
$cod = 0;
$cb = 'M';
} else {
$cb = 'B';
}
$codclass = '';
if ($r->delivery_type == 'COD' || $r->delivery_type == 'CCOD') {
$chg = $gt - $dsc + $tax + $dc + $cod;
//$chg = $gt + $dc + $cod;
$codclass = 'cod';
} else {
$dc = 0;
$cod = 0;
$chg = $dc;
}
$fcode = $r->fulfillment_code == '' ? '' : '<hr />' . $r->fulfillment_code;
$phone_dupe = $r->same_phone == 1 ? 'class="dupe"' : '';
$email_dupe = $r->same_email == 1 ? 'class="dupe"' : '';
$tabdata[] = array(array('value' => $seq, 'attr' => ''), array('value' => $r->buyerdeliveryzone, 'attr' => ''), array('value' => $r->merchant_name, 'attr' => ''), array('value' => $r->delivery_type, 'attr' => 'class="currency ' . $codclass . '" '), array('value' => $r->status . '<br /><br />' . $r->pickup_status . '<br /><br />' . $r->warehouse_status, 'attr' => ''), array('value' => $r->buyer_name, 'attr' => ''), array('value' => $payable == 0 ? 0 : Ks::idr($payable), 'attr' => 'class="currency ' . $codclass . '" '), array('value' => $dc == 0 ? 0 : Ks::idr($dc), 'attr' => 'class="currency ' . $codclass . '" style="position:relative;"'), array('value' => $cod == 0 ? 0 : Ks::idr($cod), 'attr' => 'class="currency ' . $codclass . '" style="position:relative;"'), array('value' => $chg == 0 ? 0 : Ks::idr($chg), 'attr' => 'class="currency ' . $codclass . '" '), array('value' => $r->shipping_address, 'attr' => ''), array('value' => '<span ' . $phone_dupe . ' >' . $this->split_phone($r->phone) . '<br />' . $this->split_phone($r->mobile1) . '<br />' . $this->split_phone($r->mobile2) . '</span>', 'attr' => ''), array('value' => $this->hide_trx($r->merchant_trans_id) . $fcode . '<br/>' . $this->date_did($r->delivery_id), 'attr' => 'class="currency cod"'), array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''));
$seq++;
}
$mtable = new HtmlTable($tabdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
if ($this->print == true || $this->pdf == true) {
return $tables;
} else {
return parent::reportPageGenerator();
}
}
示例2: getIndex
//.........这里部分代码省略.........
}
foreach ($budgetresult as $b) {
if (isset($tabdata[$b->ACCNT_CODE])) {
$tabdata[$b->ACCNT_CODE]->BAMT = $b->AMT;
} else {
$tabdata[$b->ACCNT_CODE] = $b;
$tabdata[$b->ACCNT_CODE]->BAMT = $b->AMT;
$tabdata[$b->ACCNT_CODE]->AMT = 0;
$tabdata[$b->ACCNT_CODE]->DAMT = 0;
$tabdata[$b->ACCNT_CODE]->PITDAMT = 0;
$tabdata[$b->ACCNT_CODE]->CITDAMT = 0;
}
}
foreach ($revbudgetresult as $d) {
if (isset($tabdata[$d->ACCNT_CODE])) {
$tabdata[$d->ACCNT_CODE]->DAMT = $d->AMT;
} else {
$tabdata[$d->ACCNT_CODE] = $d;
$tabdata[$d->ACCNT_CODE]->DAMT = $d->AMT;
$tabdata[$d->ACCNT_CODE]->AMT = 0;
$tabdata[$d->ACCNT_CODE]->BAMT = 0;
$tabdata[$d->ACCNT_CODE]->PITDAMT = 0;
$tabdata[$d->ACCNT_CODE]->CITDAMT = 0;
}
}
ksort($tabdata);
$tattrs = array('width' => '100%', 'class' => 'table table-bordered');
$thead = array();
$tdataclr = array();
$tdataexp = array();
$thead[] = array(array('value' => '#', 'attr' => 'rowspan=2'), array('value' => 'Account', 'attr' => 'colspan=2 rowspan=2 class="center"'), array('value' => 'Budget', 'attr' => 'colspan=2'), array('value' => 'Actual', 'attr' => 'colspan=3'), array('value' => 'Variance', 'attr' => 'colspan=2'));
$thead[] = array(array('value' => 'Original'), array('value' => 'Revised'), array('value' => 'Prior ITD'), array('value' => 'Current Month'), array('value' => 'Current Month ITD'), array('value' => '$'), array('value' => '%'));
$seq = 1;
$sumexp = new stdClass();
$sumclr = new stdClass();
$sumexp->BAMT = 0;
$sumexp->DAMT = 0;
$sumexp->BREV = 0;
$sumexp->PITDAMT = 0;
$sumexp->AMT = 0;
$sumexp->CITDAMT = 0;
$sumexp->VARIANCE = 0;
$sumexp->PCT = 0;
$sumclr->BAMT = 0;
$sumclr->DAMT = 0;
$sumclr->BREV = 0;
$sumclr->PITDAMT = 0;
$sumclr->AMT = 0;
$sumclr->CITDAMT = 0;
$sumclr->VARIANCE = 0;
$sumclr->PCT = 0;
foreach ($tabdata as $m) {
if ($m->DAMT > 0) {
$variance = $m->CITDAMT - $m->BAMT;
$pct = $variance / $m->BAMT * 100;
$brev = $m->DAMT - $m->BAMT;
} else {
$variance = 0;
$pct = 0;
$brev = 0;
}
if (preg_match('/^2009.*/', $m->ACCNT_CODE)) {
$tdataclr[] = array(array('value' => $seq), array('value' => $m->ACCNT_CODE), array('value' => $m->ADESCR), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => $m->PITDAMT, 'attr' => 'class="column-amt"'), array('value' => $m->AMT, 'attr' => 'class="column-amt"'), array('value' => $m->CITDAMT, 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'));
$sumclr->BAMT = '';
$sumclr->DAMT = '';
$sumclr->BREV = '';
$sumclr->PITDAMT += $m->PITDAMT;
$sumclr->AMT += $m->AMT;
$sumclr->CITDAMT += $m->CITDAMT;
$sumclr->VARIANCE = '';
$sumclr->PCT = '';
} else {
$tdataexp[] = array(array('value' => $seq), array('value' => $m->ACCNT_CODE), array('value' => $m->ADESCR), array('value' => $m->BAMT, 'attr' => 'class="column-amt"'), array('value' => $m->DAMT, 'attr' => 'class="column-amt"'), array('value' => $m->PITDAMT, 'attr' => 'class="column-amt"'), array('value' => $m->AMT, 'attr' => 'class="column-amt"'), array('value' => $m->CITDAMT, 'attr' => 'class="column-amt"'), array('value' => $variance, 'attr' => 'class="column-amt"'), array('value' => $pct, 'attr' => 'class="column-amt"'));
$sumexp->BAMT += $m->BAMT;
$sumexp->DAMT += $m->DAMT;
$sumexp->BREV += $brev;
$sumexp->PITDAMT += $m->PITDAMT;
$sumexp->AMT += $m->AMT;
$sumexp->CITDAMT += $m->CITDAMT;
$sumexp->VARIANCE += $variance;
$sumexp->PCT += $pct;
}
$seq++;
}
$tdataclr[] = array(array('value' => 'Total After Clearing', 'attr' => 'colspan=3 style="text-align:center;font-weight:bold;" '), array('value' => $sumclr->BAMT, 'attr' => 'class="column-amt"'), array('value' => $sumclr->DAMT, 'attr' => 'class="column-amt"'), array('value' => $sumclr->PITDAMT, 'attr' => 'class="column-amt"'), array('value' => $sumclr->AMT, 'attr' => 'class="column-amt"'), array('value' => $sumclr->CITDAMT, 'attr' => 'class="column-amt"'), array('value' => $sumclr->VARIANCE, 'attr' => 'class="column-amt"'), array('value' => $sumclr->PCT, 'attr' => 'class="column-amt"'));
$tdataexp[] = array(array('value' => 'Total Expenditure', 'attr' => 'colspan=3 style="text-align:center;font-weight:bold;" '), array('value' => $sumexp->BAMT, 'attr' => 'class="column-amt"'), array('value' => $sumexp->DAMT, 'attr' => 'class="column-amt"'), array('value' => $sumexp->PITDAMT, 'attr' => 'class="column-amt"'), array('value' => $sumexp->AMT, 'attr' => 'class="column-amt"'), array('value' => $sumexp->CITDAMT, 'attr' => 'class="column-amt"'), array('value' => $sumexp->VARIANCE, 'attr' => 'class="column-amt"'), array('value' => $sumexp->PCT, 'attr' => 'class="column-amt"'));
$tdata = array_merge($tdataexp, $tdataclr);
$mtable = new HtmlTable($tdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->sql_table_name = $company . '_b_salfldg';
$model = DB::connection($this->sql_connection)->table($this->sql_table_name);
$bresult = $model->where('ACCNT_CODE', 'like', '200%')->leftJoin($company . '_acnt', $company . '_b_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy('ACCNT_CODE')->get(array('ACCNT_CODE', DB::raw($company . '_acnt.DESCR AS ADESCR'), DB::raw('SUM(AMOUNT) as AMT')));
//print_r($bresult);
$this->table_raw = $tables;
if ($this->print == true) {
return $tables;
} else {
return parent::reportPageGenerator();
}
}
示例3: getIndex
//.........这里部分代码省略.........
$device = Input::get('device');
$courier = Input::get('courier');
$logistic = Input::get('logistic');
$position = Input::get('position');
$trip = Input::get('trip');
$status = Input::get('status');
$courierstatus = Input::get('courier-status');
if ($period_to == '' || is_null($period_to)) {
$period_to = date('Y0m', time());
}
$this->def_order_by = 'TRANS_DATETIME';
$this->def_order_dir = 'DESC';
$this->place_action = 'none';
$this->show_select = false;
/* Start custom queries */
$model = $this->model;
if ($status == '' || is_null($status)) {
$status = Config::get('jayon.manifest_default_status');
$status[] = Config::get('jayon.trans_status_mobile_return');
} else {
$status = explode(',', $status);
}
if (empty($status)) {
$exstatus = Config::get('jayon.manifest_default_excl_status');
if (!empty($exstatus)) {
$model = $model->whereNotIn('status', $exstatus);
}
} else {
$model = $model->whereIn('status', $status);
}
if ($courierstatus == '' || is_null($courierstatus)) {
$courierstatus = Config::get('jayon.manifest_default_courier_status');
} else {
$courierstatus = explode(',', $courierstatus);
}
if (empty($courierstatus)) {
$excrstatus = Config::get('jayon.manifest_default_excl_courier_status');
if (!empty($excrstatus)) {
$model = $model->whereNotIn('courier_status', $excrstatus);
}
} else {
$model = $model->whereIn('courier_status', $courierstatus);
}
if ($period_from == '' || is_null($period_from)) {
$def_from = date('Y-m-d', time());
$model = $model->where('pick_up_date', '=', new MongoDate(strtotime($def_from)));
} else {
$model = $model->where('pick_up_date', '=', new MongoDate(strtotime($period_from)));
}
if ($device == '' || is_null($device)) {
} else {
$model = $model->where('device_key', '=', $device);
}
if ($courier == '' || is_null($courier)) {
} else {
$model = $model->where('courier_id', '=', $courier);
}
if ($logistic == '' || is_null($logistic)) {
} else {
$model = $model->where('logistic', '=', $logistic);
}
if ($position == '' || is_null($position)) {
} else {
$model = $model->where('position', '=', $position);
}
if ($trip == '' || is_null($trip)) {
} else {
$model = $model->where(function ($t) use($trip) {
$t->where('trip', '=', intval($trip))->orWhere('trip', '=', strval($trip));
});
}
$actualresult = $model->get();
$tattrs = array('width' => '100%', 'class' => 'table table-bordered table-striped');
$thead = array();
//No. Kota Type Status KEPADA ALAMAT Phone Order ID Fulfillment ID Jumlah Box PENERIMA PAKET
//TANDA TANGAN NAMA
$thead[] = array(array('value' => '#', 'attr' => 'rowspan=2'), array('value' => 'Delivery Date', 'attr' => 'rowspan="2" '), array('value' => 'Kota', 'attr' => 'rowspan="2" class="center"'), array('value' => 'Type', 'attr' => 'rowspan="2" '), array('value' => 'Logistic', 'attr' => 'rowspan="2" '), array('value' => 'Device', 'attr' => 'rowspan="2" '), array('value' => 'Status', 'attr' => 'rowspan="2" '), array('value' => 'KEPADA / CUSTOMER', 'attr' => 'rowspan="2" '), array('value' => 'ALAMAT', 'attr' => 'rowspan="2" style="min-width:200px;"'), array('value' => 'Telepon', 'attr' => 'rowspan="2" '), array('value' => 'Order ID', 'attr' => 'rowspan="2" '), array('value' => 'Fulfillment ID', 'attr' => 'rowspan="2" '), array('value' => 'Nilai COD', 'attr' => 'rowspan="2" '), array('value' => 'Jumlah Paket', 'attr' => 'rowspan="2" '), array('value' => 'PENERIMA', 'attr' => 'colspan="4"'));
$thead[] = array(array('value' => 'JUMLAH DITERIMA DI HUB', 'attr' => ''), array('value' => 'TANGGAL / JAM TERIMA', 'attr' => ''), array('value' => 'TANDA TANGAN', 'attr' => ''), array('value' => 'NAMA', 'attr' => 'class="bold center" style="width:50px" '));
$seq = 1;
$tabdata = array();
foreach ($actualresult as $m) {
if ($m->pick_up_date instanceof MongoDate) {
$pick_up_date = date('Y-m-d H:i:s', $m->pick_up_date->sec);
$dattr = '';
} else {
$pick_up_date = $m->pick_up_date;
$dattr = 'class="red"';
}
$tabdata[] = array(array('value' => $seq, 'attr' => ''), array('value' => $pick_up_date, 'attr' => $dattr), array('value' => $m->consignee_olshop_city, 'attr' => ''), array('value' => $m->delivery_type, 'attr' => ''), array('value' => $m->logistic, 'attr' => ''), array('value' => $m->device_name, 'attr' => ''), array('value' => Prefs::translatestatus($m->status, 'delivery'), 'attr' => ''), array('value' => $m->consignee_olshop_name, 'attr' => ''), array('value' => $m->consignee_olshop_addr, 'attr' => ''), array('value' => $m->consignee_olshop_phone, 'attr' => ''), array('value' => $m->no_sales_order, 'attr' => ''), array('value' => $m->consignee_olshop_orderid, 'attr' => ''), array('value' => Ks::idr($m->cod), 'attr' => 'style="text-align:right;"'), array('value' => $m->number_of_package, 'attr' => ''), array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''));
$seq++;
}
$mtable = new HtmlTable($tabdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
if ($this->print == true || $this->pdf == true || $this->xls == true) {
return $tables;
} else {
return parent::reportPageGenerator();
}
}
示例4: getIndex
//.........这里部分代码省略.........
$seq = 1;
$totaltype = 0;
foreach ($m as $mc => $yr) {
$row = array();
$row[] = array('value' => $seq, 'attr' => '');
$row[] = array('value' => $mc, 'attr' => '');
$valrows = array();
$totalrows = 0;
foreach ($effdates2 as $yr => $w) {
foreach ($w as $wk => $dt) {
$val = 0;
if (isset($bymc[$t][$mc][$yr][$wk])) {
//print_r($bymc[$t][$mc][$yr][$wk]);
$vr = $bymc[$t][$mc][$yr][$wk];
foreach ($vr as $k => $v) {
$val += $v;
}
} else {
$val = 0;
}
$valrows[] = array('value' => $val, 'attr' => '');
$totalrows += $val;
}
$totaltype += $totalrows;
}
$row[] = array('value' => $totalrows, 'attr' => '');
$mrow = array_merge($row, $valrows);
$tarr[$t][] = $mrow;
$seq++;
}
// subhead
$head = array();
$head[] = array('value' => '', 'attr' => '');
$head[] = array('value' => strtoupper($t), 'attr' => 'style="text-align:right;"');
$head[] = array('value' => $totaltype, 'attr' => '');
for ($i = 1; $i < $weekspan; $i++) {
$head[] = array('value' => '', 'attr' => '');
}
$tharr[$t] = $head;
$thval[$t] = $totaltype;
}
$totalorder = 0;
foreach ($tharr as $t => $v) {
$tabdata[] = $tharr[$t];
$totalorder += $thval[$t];
foreach ($tarr[$t] as $tv) {
$tabdata[] = $tv;
}
}
$sumup[] = array('value' => '', 'attr' => '');
$sumup[] = array('value' => '<b>TOTAL</b>', 'attr' => 'style="text-align:right;"');
$sumup[] = array('value' => $totalorder, 'attr' => 'style="text-align:right;"');
for ($i = 1; $i < $weekspan; $i++) {
$sumup[] = array('value' => '', 'attr' => '');
}
$tabdata[] = $sumup;
//die();
$thead = array();
//$thead[] = $headvar1;
$thead[] = $headvar2;
$thead[] = $headvar3;
$thead[] = $headvar4;
$seq = 1;
$total_billing = 0;
$total_delivery = 0;
$total_cod = 0;
$d = 0;
$gt = 0;
$lastdate = '';
$courier_name = '';
$csv_data = array();
$dids = array();
$cntcod = 0;
$cntccod = 0;
$cntdo = 0;
$cntps = 0;
$cntreturn = 0;
$box_count = 0;
$weight_sum = 0;
//total per columns
$tcod = 0;
$tccod = 0;
$tdo = 0;
$tps = 0;
$treturn = 0;
$tbox = 0;
$tweight = 0;
$totalrow = array();
$mname = '';
$cd = '';
$mtable = new HtmlTable($tabdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
$report_header_data = array('cod' => $cntcod, 'ccod' => $cntccod, 'do' => $cntdo, 'ps' => $cntps, 'return' => $cntreturn, 'avg' => 0);
if ($this->print == true || $this->pdf == true) {
return array('tables' => $tables, 'report_header_data' => $report_header_data);
} else {
return parent::reportPageGenerator();
}
}
示例5: getIndex
//.........这里部分代码省略.........
$cntdo = 0;
$cntps = 0;
$cntreturn = 0;
$box_count = 0;
$weight_sum = 0;
//total per columns
$tcod = 0;
$tccod = 0;
$tdo = 0;
$tps = 0;
$treturn = 0;
$tbox = 0;
$tweight = 0;
$totalrow = array();
$mname = '';
$cd = '';
foreach ($bydc as $d => $c) {
foreach ($c as $ct => $zn) {
foreach ($zn as $z => $o) {
if ($d == $cd) {
$currddev = '';
$currdtotal = '';
$box_count = '';
$weight_sum = '';
} else {
$currddev = $d;
$currdtotal = $tpd[$d];
$box_count = $bpd[$d];
$weight_sum = $wpd[$d];
}
$tbox += $box_count;
$tweight += $weight_sum;
$cd = $d;
$row = array(array('value' => $seq, 'attr' => ''), array('value' => $currddev, 'attr' => ''));
$maxattr = $dmax == $currdtotal ? 'style="background-color:red;"' : '';
$row[] = array('value' => $currdtotal, 'attr' => $maxattr);
$maxattr = $bmax == $box_count ? 'style="background-color:red;"' : '';
$row[] = array('value' => $box_count, 'attr' => $maxattr);
$maxattr = $wmax == $weight_sum ? 'style="background-color:red;"' : '';
$row[] = array('value' => $weight_sum, 'attr' => $maxattr);
$row[] = array('value' => $ct, 'attr' => '');
$row[] = array('value' => $z, 'attr' => '');
$row[] = array('value' => count($o), 'attr' => '');
if (isset($bydc[$d][$ct][$z])) {
$mv = $bydc[$d][$ct][$z];
foreach ($bymc as $mcx => $mcv) {
$cod = 0;
$do = 0;
$p = 0;
foreach ($mv as $mo) {
//print $mo->merchant_name.' '.$mcx."/r/n";
if ($mo->merchant_name == $mcx) {
if ($mo->delivery_type == 'COD' || $mo->delivery_type == 'CCOD') {
$cod++;
}
if ($mo->delivery_type == 'Delivery Only' || $mo->delivery_type == 'DO') {
$do++;
}
if ($mo->status == 'pending') {
$p++;
}
}
}
$row[] = array('value' => $cod, 'attr' => '');
$row[] = array('value' => $do, 'attr' => '');
$row[] = array('value' => $p, 'attr' => '');
}
}
$tabdata[] = $row;
$seq++;
}
}
}
$totalrow = array(array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''), array('value' => $tbox, 'attr' => ''), array('value' => $tweight, 'attr' => ''), array('value' => '', 'attr' => ''));
$coloffset = 6;
$colc = 0;
foreach ($tabdata as $td) {
//print_r($td);
for ($ci = 0; $ci < count($td) - $coloffset; $ci++) {
if (isset($totalrow[$coloffset + $ci])) {
$totalrow[$coloffset + $ci] += $td[$coloffset + $ci]['value'];
} else {
$totalrow[$coloffset + $ci] = $td[$coloffset + $ci]['value'];
}
}
}
array_unshift($tabdata, $totalrow);
$avgdata = array(array('value' => 'Rata-rata<br />( dlm satuan hari )', 'attr' => 'colspan="6"'), array('value' => number_format($assign2deliverydays / $seq, 2, ',', '.'), 'attr' => 'style="font-size:18px;font-weight:bold;"'), array('value' => '', 'attr' => 'colspan="7"'));
//array_unshift($tabdata, $avgdata);
//array_push($tabdata, $avgdata);
$mtable = new HtmlTable($tabdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
$report_header_data = array('cod' => $cntcod, 'ccod' => $cntccod, 'do' => $cntdo, 'ps' => $cntps, 'return' => $cntreturn, 'avg' => number_format($assign2deliverydays / $seq, 2, ',', '.'));
if ($this->print == true || $this->pdf == true) {
return array('tables' => $tables, 'report_header_data' => $report_header_data);
} else {
return parent::reportPageGenerator();
}
}
示例6: getIndex
//.........这里部分代码省略.........
}
}
}
if (isset($prioryearset[$section][$key])) {
foreach ($prioryearset[$section][$key] as $data) {
if (isset($tabdata[$section][$key][$data->ACCNT_CODE])) {
$tabdata[$section][$key][$data->ACCNT_CODE]->PYAMT = $data->AMT;
} else {
$ndt = new stdClass();
$ndt->ADESCR = $data->ADESCR;
$ndt->AMT = 0;
$ndt->PMAMT = 0;
$ndt->CMITDAMT = $data->AMT;
$ndt->PYAMT = 0;
$tabdata[$section][$key][$data->ACCNT_CODE] = $ndt;
}
}
}
}
}
//print_r($tabdata);
//die();
//ksort($tabdata);
$period_year = substr($period_from, 0, 4);
$period_month = substr($period_from, 5, 2);
$period_month = date('F', strtotime($period_year . '-' . $period_month));
$tattrs = array('width' => '100%', 'class' => 'table table-bordered');
$thead = array();
$thead[] = array(array('value' => '<h2>' . $companyname . '<h2>', 'attr' => 'colspan="9"'));
$thead[] = array(array('value' => '<h2>' . $this->title . '<h2>', 'attr' => 'colspan="9"'));
$thead[] = array(array('value' => '<h2>' . $period_month . ' ' . $period_year . '<h2>', 'attr' => 'colspan="9"'));
$thead[] = array(array('value' => '', 'attr' => 'colspan=4'), array('value' => 'Prior Month ITD'), array('value' => 'Current Month'), array('value' => 'Current Month ITD'), array('value' => 'Prior Year ITD'), array('value' => 'Current YTD'));
/*
$thead[] = array(
array('value'=>'','attr'=>'colspan=4'),
array('value'=>'ITD'),
array('value'=>''),
array('value'=>'ITD'),
array('value'=>'ITD'),
array('value'=>'Movement')
);
*/
$seq = 1;
$tdata = array();
$ck = '';
//print_r($titlekeys);
//print_r($sectiontitle);
//print_r($tabdata);
//die();
foreach ($tabdata as $k => $dm) {
//print($k);
//print $k;
//if($ck != $k){
$tdata[] = array(array('value' => '<h2>' . $sectiontitle[$k] . '</h2>', 'attr' => 'colspan="4"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'));
//}
foreach ($dm as $ac => $md) {
$tdata[] = array(array('value' => ' '), array('value' => '<h3>' . $titlekeys[$k][$ac] . '</h3>', 'attr' => 'colspan="3"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'), array('value' => '', 'attr' => 'class="column-amt"'));
/*
$tdata[] = array(
array('value'=> $titlekeys[$k][$dm['key']], 'attr'=>'colspan="3"'),
array('value'=>'', 'attr'=>'class="column-amt"' ),
array('value'=>'', 'attr'=>'class="column-amt"' ),
array('value'=>'', 'attr'=>'class="column-amt"' ),
array('value'=>'', 'attr'=>'class="column-amt"' ),
array('value'=>'', 'attr'=>'class="column-amt"' )
);
*/
//print_r($md);
$sum = new stdClass();
$sum->PMAMT = 0;
$sum->AMT = 0;
$sum->CMITDAMT = 0;
$sum->PYAMT = 0;
$sum->movement = 0;
foreach ($md as $mk => $m) {
$movement = $m->CMITDAMT - $m->PYAMT;
$sum->PMAMT += (double) $m->PMAMT;
$sum->AMT += (double) $m->AMT;
$sum->CMITDAMT += (double) $m->CMITDAMT;
$sum->PYAMT += (double) $m->PYAMT;
$sum->movement += (double) $movement;
$movement = 0;
$tdata[] = array(array('value' => ' '), array('value' => ' '), array('value' => $mk), array('value' => $m->ADESCR), array('value' => $m->PMAMT, 'attr' => 'class="column-amt"'), array('value' => $m->AMT, 'attr' => 'class="column-amt"'), array('value' => $m->CMITDAMT, 'attr' => 'class="column-amt"'), array('value' => $m->PYAMT, 'attr' => 'class="column-amt"'), array('value' => $movement, 'attr' => 'class="column-amt"'));
$seq++;
}
}
$tdata[] = array(array('value' => '<h3> TOTAL ' . $sectiontitle[$k] . '</h3>', 'attr' => 'colspan="4"'), array('value' => $sum->PMAMT, 'attr' => 'class="column-amt total"'), array('value' => floatval($sum->AMT), 'attr' => 'class="column-amt total"'), array('value' => $sum->CMITDAMT, 'attr' => 'class="column-amt total"'), array('value' => $sum->PYAMT, 'attr' => 'class="column-amt total"'), array('value' => $sum->movement, 'attr' => 'class="column-amt total"'));
$tdata[] = array(array('value' => '', 'attr' => 'colspan="4"'), array('value' => '', 'attr' => 'class="column-amt total"'), array('value' => '', 'attr' => 'class="column-amt total"'), array('value' => '', 'attr' => 'class="column-amt total"'), array('value' => '', 'attr' => 'class="column-amt total"'), array('value' => '', 'attr' => 'class="column-amt total"'));
}
//print_r($tdata);
//die();
$mtable = new HtmlTable($tdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
if ($this->print == true) {
return $tables;
} else {
return parent::reportPageGenerator();
}
}
示例7: getIndex
//.........这里部分代码省略.........
$d = 0;
$gt = 0;
$cntcod = $r->delivery_type == 'COD' ? $cntcod + 1 : $cntcod;
$cntccod = $r->delivery_type == 'CCOD' ? $cntccod + 1 : $cntccod;
$cntdo = $r->delivery_type == 'Delivery Only' ? $cntdo + 1 : $cntdo;
$cntps = $r->delivery_type == 'PS' ? $cntps + 1 : $cntps;
$cntreturn = $r->status == 'returned' ? $return + 1 : $return;
//print_r($details);
/*
$notes = '';
foreach($details as $d )
{
$n = '';
$admin = true;
if($d['api_event'] == 'admin_change_status'){
$n = $d['req_note'];
}else{
if($d['notes'] != ''){
$n = $d['notes'];
}
$admin = false;
}
$isadmin = ($admin)?' [admin]':'';
if($n != '' && $d['status'] != 'syncnote'){
$notes .= $d['timestamp'].$isadmin.'<br />';
$notes .= '<b>'.$d['status'].'</b><br />';
$notes .= $n.'<br />';
}
}
*/
/*
if($gt == 0 ){
if($total > 0 && $payable)
$gt = $total;
}
$payable = $gt;
$total_delivery += (double)$dc;
$total_cod += (double)$cod;
$total_billing += (double)$payable;
$db = '';
if($r->delivery_bearer == 'merchant'){
$dc = 0;
$db = 'M';
}else{
$db = 'B';
}
//force all DO to zero
$cb = '';
if($r->cod_bearer == 'merchant'){
$cod = 0;
$cb = 'M';
}else{
$cb = 'B';
}
$codclass = '';
if($r->delivery_type == 'COD' || $r->delivery_type == 'CCOD'){
$chg = ($gt - $dsc) + $tax + $dc + $cod;
//$chg = $gt + $dc + $cod;
$codclass = 'cod';
}else{
$dc = 0;
$cod = 0;
$chg = $dc;
}
$fcode = ($r->fulfillment_code == '')?'':'<hr />'.$r->fulfillment_code;
$phone_dupe = ($r->same_phone == 1)?'class="dupe"':'';
$email_dupe = ($r->same_email == 1)?'class="dupe"':'';
*/
$tabdata[] = array(array('value' => $seq, 'attr' => ''), array('value' => $r->merchant_name, 'attr' => ''), array('value' => $r->delivery_type, 'attr' => ''), array('value' => $r->ordertime, 'attr' => ''), array('value' => $r->pickuptime, 'attr' => ''), array('value' => $r->assignment_date, 'attr' => ''), array('value' => $assignment_date->format('Y-m-d'), 'attr' => ''), array('value' => $pickup2delivery->d, 'attr' => ''), array('value' => $assign2delivery->d, 'attr' => ''), array('value' => $r->deliverytime, 'attr' => ''), array('value' => $r->status, 'attr' => ''), array('value' => $r->pending_count, 'attr' => ''), array('value' => $notes, 'attr' => ''), array('value' => $r->recipient_name . ' | ' . str_replace(array(",", '"', "\n", "\r"), '', $r->shipping_address) . ' ' . $this->split_phone($r->phone) . ' ' . $this->split_phone($r->mobile1) . ' ' . $this->split_phone($r->mobile2), 'attr' => ''), array('value' => $r->buyerdeliveryzone, 'attr' => ''), array('value' => $r->buyerdeliverycity, 'attr' => ''), array('value' => $r->delivery_id, 'attr' => ''), array('value' => $this->hide_trx($r->merchant_trans_id), 'attr' => ''), array('value' => $r->fulfillment_code, 'attr' => ''));
$seq++;
}
$valid_pickups = $valid_pickups > 0 ? $valid_pickups : 1;
$avgdata = array(array('value' => 'Rata-rata<br />( dlm satuan hari )', 'attr' => 'colspan="7"'), array('value' => number_format($pickup2deliverydays / $valid_pickups, 2, ',', '.'), 'attr' => 'style="font-size:18px;font-weight:bold;"'), array('value' => number_format($assign2deliverydays / $seq, 2, ',', '.'), 'attr' => 'style="font-size:18px;font-weight:bold;"'), array('value' => '', 'attr' => 'colspan="11"'));
array_unshift($tabdata, $avgdata);
array_push($tabdata, $avgdata);
$mtable = new HtmlTable($tabdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
$report_header_data = array('cod' => $cntcod, 'ccod' => $cntccod, 'do' => $cntdo, 'ps' => $cntps, 'return' => $return, 'avg' => number_format($assign2deliverydays / $seq, 2, ',', '.'));
if ($this->print == true || $this->pdf == true) {
return array('tables' => $tables, 'report_header_data' => $report_header_data);
} else {
return parent::reportPageGenerator();
}
}
示例8: getIndex
//.........这里部分代码省略.........
$years = array_unique($years);
/*
foreach($effweeks as $yr=>$wr){
foreach($wr as $ir){
$effdates[$yr][$ir] = $this->getEffDates($yr, $ir);
}
}
*/
print_r($effweeks);
//print_r($bymc);
print_r($effdates);
die;
$headvar0 = array(array('value' => 'No.', 'attr' => ''), array('value' => 'Merchant', 'attr' => ''), array('value' => 'Total', 'attr' => ''));
$headvar1 = array(array('value' => 'No.', 'attr' => ''), array('value' => 'Merchant', 'attr' => ''), array('value' => 'Total', 'attr' => ''));
$headvar2 = array(array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''), array('value' => '', 'attr' => ''));
foreach ($effdates as $yk => $wk) {
$span = 0;
foreach ($wk as $wt => $dt) {
$headvar1[] = array('value' => 'Week ' . $effweeks[$yk][$wt], 'attr' => '');
$headvar2[] = array('value' => $dt[0] . ' to ' . $dt[1], 'attr' => '');
$span++;
}
$headvar0[] = array('value' => $yk, 'attr' => 'colspan="' . $span . '"');
}
$thead = array();
$thead[] = $headvar0;
$thead[] = $headvar1;
$thead[] = $headvar2;
$seq = 1;
$total_billing = 0;
$total_delivery = 0;
$total_cod = 0;
$d = 0;
$gt = 0;
$lastdate = '';
$courier_name = '';
$order2assigndays = 0;
$assign2deliverydays = 0;
$order2deliverydays = 0;
$csv_data = array();
$dids = array();
foreach ($actualresult as $ar) {
$dids[] = $ar->delivery_id;
}
$tabdata = array();
$cntcod = 0;
$cntccod = 0;
$cntdo = 0;
$cntps = 0;
$cntreturn = 0;
$box_count = 0;
//total per columns
$tcod = 0;
$tccod = 0;
$tdo = 0;
$tps = 0;
$treturn = 0;
$totalrow = array();
$mname = '';
$cd = '';
$effweeks = array_keys($effdates);
foreach ($bymc as $t => $m) {
$pre = array();
$pre = array(array('value' => strtoupper($t), 'attr' => 'colspan="2"'), array('value' => '', 'attr' => ''));
$blanks = array();
foreach ($effweeks as $wk) {
$blanks[] = array('value' => '', 'attr' => '');
}
$tabdata[] = array_merge($pre, $blanks);
$seq = 1;
foreach ($m as $mn => $dt) {
$drow = array();
$tpm = 0;
foreach ($years as $y) {
}
foreach ($effweeks as $wk) {
foreach ($dt as $md) {
if (isset($md[$wk])) {
$drow[] = array('value' => $md[$wk], 'attr' => '');
$tpm += $md[$wk];
} else {
$drow[] = array('value' => 0, 'attr' => '');
}
}
}
$pre = array(array('value' => $seq, 'attr' => ''), array('value' => $mn, 'attr' => ''), array('value' => $tpm, 'attr' => ''));
$tabdata[] = array_merge($pre, $drow);
$seq++;
}
}
$mtable = new HtmlTable($tabdata, $tattrs, $thead);
$tables[] = $mtable->build();
$this->table_raw = $tables;
$report_header_data = array('cod' => $cntcod, 'ccod' => $cntccod, 'do' => $cntdo, 'ps' => $cntps, 'return' => $cntreturn, 'avg' => number_format($assign2deliverydays / $seq, 2, ',', '.'));
if ($this->print == true || $this->pdf == true) {
return array('tables' => $tables, 'report_header_data' => $report_header_data);
} else {
return parent::reportPageGenerator();
}
}