379 lines
13 KiB
PHP
379 lines
13 KiB
PHP
|
|
<?php
|
||
|
|
set_time_limit(999999);
|
||
|
|
$year=$_GET['year'];
|
||
|
|
if(!$year)$year=(int)date("Y");
|
||
|
|
|
||
|
|
if($year==date(Y)){
|
||
|
|
$mmm=(int)date("m")-1;
|
||
|
|
}
|
||
|
|
else $mmm=12;
|
||
|
|
|
||
|
|
set_include_path('include/PHPExcel/');
|
||
|
|
|
||
|
|
include 'PHPExcel.php';
|
||
|
|
include 'PHPExcel/Writer/Excel2007.php';
|
||
|
|
include 'PHPExcel/IOFactory.php';
|
||
|
|
|
||
|
|
$objPHPExcel = new PHPExcel();
|
||
|
|
$objPHPExcel->getProperties()->setCreator("E5 CRM");
|
||
|
|
$objPHPExcel->getProperties()->setLastModifiedBy("E5 CRM");
|
||
|
|
$objPHPExcel->getProperties()->setTitle("Office 2007 PRICEBOOK");
|
||
|
|
$objPHPExcel->getProperties()->setSubject("Office 2007 PRICEBOOK");
|
||
|
|
$objPHPExcel->getProperties()->setDescription("PRICEBOOK");
|
||
|
|
|
||
|
|
$alf1="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||
|
|
for($i=0;$i<strlen($alf1);$i++)$alf[$i]=$alf1[$i];
|
||
|
|
$alf[26]="AA";
|
||
|
|
$alf[27]="AB";
|
||
|
|
$alf[28]="AC";
|
||
|
|
$alf[29]="AD";
|
||
|
|
$alf[30]="AE";
|
||
|
|
$alf[31]="AF";
|
||
|
|
$alf[32]="AG";
|
||
|
|
$alf[33]="AH";
|
||
|
|
$alf[34]="AI";
|
||
|
|
$alf[35]="AJ";
|
||
|
|
$alf[36]="AK";
|
||
|
|
$alf[37]="AL";
|
||
|
|
$alf[38]="AM";
|
||
|
|
$alf[39]="AN";
|
||
|
|
$alf[40]="AO";
|
||
|
|
$alf[41]="AP";
|
||
|
|
$alf[42]="AQ";
|
||
|
|
$alf[43]="AR";
|
||
|
|
$alf[44]="AS";
|
||
|
|
$alf[45]="AT";
|
||
|
|
$alf[46]="AU";
|
||
|
|
$alf[47]="AV";
|
||
|
|
$alf[48]="AW";
|
||
|
|
$alf[49]="AX";
|
||
|
|
$alf[50]="AY";
|
||
|
|
$alf[51]="AZ";
|
||
|
|
$alf[52]="BA";
|
||
|
|
$alf[53]="BB";
|
||
|
|
$alf[54]="BC";
|
||
|
|
$alf[55]="BD";
|
||
|
|
$alf[56]="BE";
|
||
|
|
$alf[57]="BF";
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(80);
|
||
|
|
|
||
|
|
for($i=3;$i<=54;$i++){
|
||
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension($alf[$i])->setWidth(20);
|
||
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension($alf[$i+1])->setWidth(20);
|
||
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension($alf[$i+2])->setWidth(20);
|
||
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension($alf[$i+3])->setWidth(20);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('A1','Name');
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('B1','Inventory');
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('C1','Inv value');
|
||
|
|
|
||
|
|
|
||
|
|
$months=array("01","02","03","04","05","06","07","08","09","10","11","12");
|
||
|
|
$months_names=array("01"=>"January","02"=>"February","03"=>"March","04"=>"April","05"=>"May","06"=>"June","07"=>"July","08"=>"August","09"=>"September","10"=>"October","11"=>"November","12"=>"December");
|
||
|
|
|
||
|
|
for($i=0;$i<12;$i++){
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[4*$i+3].'1',$months_names[$months[$i]]." ".$year);
|
||
|
|
}
|
||
|
|
$m=2;
|
||
|
|
for($i=0;$i<=12;$i++){
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[4*$i+3].'2','Qty');
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[4*$i+4].'2','Value');
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[4*$i+5].'2','Margin');
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[4*$i+6].'2','CBM');
|
||
|
|
}
|
||
|
|
|
||
|
|
mysql_query("set names utf8");
|
||
|
|
function sum($year,$c,$all,$acc){
|
||
|
|
global $mmm;
|
||
|
|
if($acc)$ah="ecminvoiceouts.parent_name like '".$acc."' and ";
|
||
|
|
else $ah="";
|
||
|
|
if($all)$wh="";
|
||
|
|
else $wh=" and product_category_id='".$c."'";
|
||
|
|
$w=mysql_query("select id from ecmproducts where deleted='0'".$wh);
|
||
|
|
while($r=mysql_fetch_array($w)){
|
||
|
|
$ww=mysql_query("select ecmproducts.carton_volume_meter as cvm,ecmproducts.pieces_per_carton as ppc,ecmproducts.carton_dimensions_1 as cd1,ecmproducts.carton_dimensions_2 as cd2,ecmproducts.carton_dimensions_3 as cd3,ecminvoiceouts.register_date as d,ecminvoiceoutitems.purchase_price as purchase_price,ecminvoiceoutitems.price as price,ecminvoiceoutitems.quantity as quantity,ecminvoiceoutitems.ecmproduct_id as ecmproduct_id from ecminvoiceoutitems inner join ecminvoiceouts on ecminvoiceouts.id=ecminvoiceoutitems.ecminvoiceout_id inner join ecmproducts on ecmproducts.id=ecminvoiceoutitems.ecmproduct_id where ".$ah."ecminvoiceouts.register_date like '".$year."%' and ecminvoiceoutitems.deleted='0' and ecminvoiceoutitems.ecmproduct_id='".$r['id']."' and ecminvoiceouts.type!='correct'");
|
||
|
|
while($rr=mysql_fetch_array($ww)){
|
||
|
|
$d=explode("-",$rr['d']);
|
||
|
|
$dat=$year."-".$d[1];
|
||
|
|
|
||
|
|
$sum['all']+=$rr['price']*$rr['quantity'];
|
||
|
|
$sum['all_qty']+=$rr['quantity'];
|
||
|
|
$sum['all_pur']+=$rr['purchase_price']*$rr['quantity'];
|
||
|
|
if($rr['ppc']>0)$sum['all_cbm']+=$rr['quantity']*($rr['cvm']/$rr['ppc']);
|
||
|
|
|
||
|
|
$sum[$dat]['all']+=$rr['price']*$rr['quantity'];
|
||
|
|
$sum[$dat]['all_qty']+=$rr['quantity'];
|
||
|
|
$sum[$dat]['all_pur']+=$rr['purchase_price']*$rr['quantity'];
|
||
|
|
if($rr['ppc']>0)$sum[$dat]['all_cbm']+=$rr['quantity']*($rr['cvm']/$rr['ppc']);
|
||
|
|
|
||
|
|
if(!$all){
|
||
|
|
$sum[$dat]['category_'.$c]+=$rr['price']*$rr['quantity'];
|
||
|
|
$sum[$dat]['category_qty_'.$c]+=$rr['quantity'];
|
||
|
|
$sum[$dat]['category_pur_'.$c]+=$rr['purchase_price']*$rr['quantity'];
|
||
|
|
if($rr['ppc']>0)$sum[$dat]['category_cbm_'.$c]+=$rr['quantity']*($rr['cvm']/$rr['ppc']);
|
||
|
|
|
||
|
|
$sum[$dat]['product_'.$rr['ecmproduct_id']]+=$rr['price']*$rr['quantity'];
|
||
|
|
$sum[$dat]['product_qty_'.$rr['ecmproduct_id']]+=$rr['quantity'];
|
||
|
|
$sum[$dat]['product_pur_'.$rr['ecmproduct_id']]+=$rr['purchase_price']*$rr['quantity'];
|
||
|
|
if($rr['ppc']>0)$sum[$dat]['product_cbm_'.$rr['ecmproduct_id']]+=$rr['quantity']*($rr['cvm']/$rr['ppc']);
|
||
|
|
|
||
|
|
$sum[$year]['category_sum_'.$c]+=$rr['price']*$rr['quantity'];
|
||
|
|
$sum[$year]['category_qty_sum_'.$c]+=$rr['quantity'];
|
||
|
|
$sum[$year]['category_pur_sum_'.$c]+=$rr['purchase_price']*$rr['quantity'];
|
||
|
|
if($rr['ppc']>0)$sum[$year]['category_cbm_sum_'.$c]+=$rr['quantity']*($rr['cvm']/$rr['ppc']);
|
||
|
|
|
||
|
|
$sum[$year]['product_sum_'.$rr['ecmproduct_id']]+=$rr['price']*$rr['quantity'];
|
||
|
|
$sum[$year]['product_qty_sum_'.$rr['ecmproduct_id']]+=$rr['quantity'];
|
||
|
|
$sum[$year]['product_pur_sum_'.$rr['ecmproduct_id']]+=$rr['purchase_price']*$rr['quantity'];
|
||
|
|
if($rr['ppc']>0)$sum[$year]['product_cbm_sum_'.$rr['ecmproduct_id']]+=$rr['quantity']*($rr['cvm']/$rr['ppc']);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
echo mysql_error();
|
||
|
|
return $sum;
|
||
|
|
}
|
||
|
|
|
||
|
|
if($_GET['category'])$cw=" and id='".$_GET['category']."'";
|
||
|
|
else $cw="";
|
||
|
|
$z="select name,id from ecmproductcategories where deleted='0'".$cw." order by name";
|
||
|
|
$w=mysql_query($z);
|
||
|
|
|
||
|
|
while($r=mysql_fetch_array($w)){
|
||
|
|
$m++;
|
||
|
|
$ems_qty_in_stock=0;
|
||
|
|
$stock_value=0;
|
||
|
|
$cat_arr[]=$m;
|
||
|
|
$sum=sum($year,$r['id'],0,$_REQUEST['account']);
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('A'.$m,$r['name']);
|
||
|
|
$zz="select ems_qty_in_stock,ems_price from ecmproducts where product_category_id='".$r['id']."' and deleted='0'";
|
||
|
|
$ww=mysql_query($zz);
|
||
|
|
while($rr=mysql_fetch_array($ww)){
|
||
|
|
$ems_qty_in_stock+=$rr['ems_qty_in_stock'];
|
||
|
|
$stock_value+=$rr['ems_qty_in_stock']*$rr['ems_price'];
|
||
|
|
}
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('B'.$m,$ems_qty_in_stock);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('C'.$m,$stock_value);
|
||
|
|
for($i=0;$i<count($months)*4;$i+=4){
|
||
|
|
$cat=$sum[$year."-".$months[($i/4)]]['category_'.$r['id']];
|
||
|
|
$cat_pur=$sum[$year."-".$months[($i/4)]]['category_pur_'.$r['id']];
|
||
|
|
$cat_qty=$sum[$year."-".$months[($i/4)]]['category_qty_'.$r['id']];
|
||
|
|
$cbm=$sum[$year."-".$months[($i/4)]]['category_cbm_'.$r['id']];
|
||
|
|
|
||
|
|
if($cat)$margin=100*($cat-$cat_pur)/$cat;
|
||
|
|
else $margin=0;
|
||
|
|
|
||
|
|
if(!$cat)$cat=0;
|
||
|
|
if(!$cat_qty)$cat_qty=0;
|
||
|
|
if(!$cbm)$cbm=0;
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+3].$m,$cat_qty);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+4].$m,$cat);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+5].$m,$margin);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+6].$m,$cbm);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if($sum[$year]['category_sum_'.$r['id']])$margin=100*($sum[$year]['category_sum_'.$r['id']]-$sum[$year]['category_pur_sum_'.$r['id']])/$sum[$year]['category_sum_'.$r['id']];
|
||
|
|
else $margin=0;
|
||
|
|
|
||
|
|
$cbm=$sum[$year]['category_cbm_sum_'.$r['id']];
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+3].$m,($sum[$year]['category_qty_sum_'.$r['id']]/$mmm));
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+4].$m,$sum[$year]['category_sum_'.$r['id']]);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+5].$m,$margin);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+6].$m,$cbm);
|
||
|
|
|
||
|
|
if(!$_GET['only_cat']){
|
||
|
|
$zz="select id,name,code,ems_qty_in_stock,ems_price from ecmproducts where product_category_id='".$r['id']."' and deleted='0' order by code asc";
|
||
|
|
$ww=mysql_query($zz);
|
||
|
|
while($rr=mysql_fetch_array($ww)){
|
||
|
|
$m++;
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('A'.$m,$rr['code'].' '.$rr['name']);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('B'.$m,$rr['ems_qty_in_stock']);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue('C'.$m,($rr['ems_qty_in_stock']*$rr['ems_price']));
|
||
|
|
|
||
|
|
for($i=0;$i<count($months)*4;$i+=4){
|
||
|
|
$p_pur=$sum[$year."-".$months[($i/4)]]['product_pur_'.$rr['id']];
|
||
|
|
$p_qty=$sum[$year."-".$months[($i/4)]]['product_qty_'.$rr['id']];
|
||
|
|
$p=$sum[$year."-".$months[($i/4)]]['product_'.$rr['id']];
|
||
|
|
$cbm=$sum[$year."-".$months[($i/4)]]['product_cbm_'.$rr['id']];
|
||
|
|
|
||
|
|
|
||
|
|
if($p)$margin=100*($p-$p_pur)/$p;
|
||
|
|
else $margin=0;
|
||
|
|
|
||
|
|
if(!$p)$p=0;
|
||
|
|
if(!$cbm)$cbm=0;
|
||
|
|
if(!$p_qty)$p_qty=0;
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+3].$m,$p_qty);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+4].$m,$p);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+5].$m,$margin);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+6].$m,$cbm);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
$s_pur=$sum[$year]['product_pur_sum_'.$rr['id']];
|
||
|
|
$s_qty=$sum[$year]['product_qty_sum_'.$rr['id']];
|
||
|
|
$s=$sum[$year]['product_sum_'.$rr['id']];
|
||
|
|
$cbm=$sum[$year]['product_cbm_'.$rr['id']];
|
||
|
|
|
||
|
|
if($s)$margin=100*($s-$s_pur)/$s;
|
||
|
|
else $margin=0;
|
||
|
|
|
||
|
|
if(!$cbm)$cbm=0;
|
||
|
|
if(!$s)$s=0;
|
||
|
|
if(!$s_qty)$s_qty=0;
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+3].$m,($s_qty/$mmm));
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+4].$m,$s);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+5].$m,$margin);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+6].$m,$cbm);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$m++;
|
||
|
|
$sum=sum($year,$_REQUEST['category'],1,$_REQUEST['account']);
|
||
|
|
for($i=0;$i<count($months)*4;$i+=4){
|
||
|
|
$cat=$sum[$year."-".$months[($i/4)]]['all'];
|
||
|
|
$cat_pur=$sum[$year."-".$months[($i/4)]]['all_pur'];
|
||
|
|
$cat_qty=$sum[$year."-".$months[($i/4)]]['all_qty'];
|
||
|
|
$cbm=$sum[$year."-".$months[($i/4)]]['all_cbm'];
|
||
|
|
|
||
|
|
if($cat)$margin=100*($cat-$cat_pur)/$cat;
|
||
|
|
else $margin=0;
|
||
|
|
|
||
|
|
if(!$cbm)$cbm=0;
|
||
|
|
if(!$cat)$cat=0;
|
||
|
|
if(!$cat_qty)$cat_qty=0;
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+3].$m,$cat_qty);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+4].$m,$cat);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+5].$m,$margin);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+6].$m,$cbm);
|
||
|
|
}
|
||
|
|
$m++;
|
||
|
|
$sa=$sum['all'];
|
||
|
|
$sa_pur=$sum['all_pur'];
|
||
|
|
$sa_qty=$sum['all_qty'];
|
||
|
|
$cbm=$sum['all_cbm'];
|
||
|
|
|
||
|
|
if($sa)$margin=100*($sa-$sa_pur)/$sa;
|
||
|
|
else $margin=0;
|
||
|
|
|
||
|
|
if(!$cbm)$cbm=0;
|
||
|
|
if(!$sa)$sa=0;
|
||
|
|
if(!$sa_qty)$sa_qty=0;
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+3].($m-1),($sa_qty/$mmm));
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+4].($m-1),$sa);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+5].($m-1),$margin);
|
||
|
|
$objPHPExcel->getActiveSheet()->SetCellValue($alf[$i+6].($m-1),$cbm);
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->setTitle('Simple');
|
||
|
|
$objPHPExcel->setActiveSheetIndex(0);
|
||
|
|
|
||
|
|
if(!$_GET['only_cat']){
|
||
|
|
foreach($cat_arr as $ca){
|
||
|
|
$objPHPExcel->getActiveSheet()->duplicateStyleArray(
|
||
|
|
array(
|
||
|
|
'fill' => array(
|
||
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||
|
|
'color' => array('argb' => 'FF00FF00')
|
||
|
|
),
|
||
|
|
'borders' => array(
|
||
|
|
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN),
|
||
|
|
'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
"A".$ca.":BC".$ca
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->duplicateStyleArray(
|
||
|
|
array(
|
||
|
|
'fill' => array(
|
||
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||
|
|
'color' => array('argb' => 'F0F0F0')
|
||
|
|
),
|
||
|
|
'borders' => array(
|
||
|
|
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN),
|
||
|
|
'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
"A".($m-1).":BC".($m-1)
|
||
|
|
);
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->duplicateStyleArray(
|
||
|
|
array(
|
||
|
|
'fill' => array(
|
||
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||
|
|
'color' => array('argb' => 'BBDDFF')
|
||
|
|
),
|
||
|
|
'borders' => array(
|
||
|
|
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN),
|
||
|
|
'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
"AZ1:BC".($m-1)
|
||
|
|
);
|
||
|
|
|
||
|
|
$objPHPExcel->getActiveSheet()->duplicateStyleArray(
|
||
|
|
array(
|
||
|
|
'fill' => array(
|
||
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||
|
|
'color' => array('argb' => '75BAFF')
|
||
|
|
),
|
||
|
|
'borders' => array(
|
||
|
|
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN),
|
||
|
|
'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
"AZ".($m-1).":BC".($m-1)
|
||
|
|
);
|
||
|
|
$objPHPExcel->getActiveSheet()->duplicateStyleArray(
|
||
|
|
array(
|
||
|
|
'fill' => array(
|
||
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||
|
|
'color' => array('argb' => 'FFCCFFCC')
|
||
|
|
),
|
||
|
|
'borders' => array(
|
||
|
|
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN),
|
||
|
|
'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
"A1:BC1"
|
||
|
|
);
|
||
|
|
foreach($cat_arr as $ca){
|
||
|
|
$objPHPExcel->getActiveSheet()->duplicateStyleArray(
|
||
|
|
array(
|
||
|
|
'fill' => array(
|
||
|
|
'type' => PHPExcel_Style_Fill::FILL_SOLID,
|
||
|
|
'color' => array('argb' => '75BAFF')
|
||
|
|
),
|
||
|
|
'borders' => array(
|
||
|
|
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN),
|
||
|
|
'right' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
"AZ".$ca.":BC".$ca
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||
|
|
chmod("cache/upload",0777);
|
||
|
|
$microtime=str_replace(".","",str_replace(" ","",microtime()));
|
||
|
|
$name="cache/upload/Report".$microtime.".xlsx";
|
||
|
|
$objWriter->save($name);
|
||
|
|
chmod($name,0777);
|
||
|
|
|
||
|
|
header("Location: ".$name);
|
||
|
|
?>
|