1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| function afficheExcelC_A($type,$mag,$local,$dat,$date1)
{
include '../Excel/ClassExcel.php';
$workbook = new ClassExcel();
$sheet = $workbook->getActiveSheet();
$njr=10;
$sql1="........"
$desc_etabl=array();
$this->executeRqSql($sql);
if($this->rst)
{
$nbCols = odbc_num_fields($this->rst); /*nb colonne de la table */
/* Afficher le resultat tant qu il y a des elements dans tableau rst */
while (odbc_fetch_row($this->rst))
{
/* mettre le contenu de la ligne dans un tableau */
for($j=1 ; $j<= $nbCols ; $j++)
{
$desc_etabl[]=utf8_decode(odbc_result($this->rst, $j));
}
}
}
else {echo "<br>Erreur dans l'exécution de la 1ère requête<br>";}
$sheet->setCellValueByColumnAndRow(0,1,"CHIFFRE ".$type." D'".$local." ". utf8_decode(strtoupper(strftime('%B', strtotime($date_us))))." ".$mois1[2]);
$sheet->getRowDimension('5')->setRowHeight(70);
$sheet->setCellValueByColumnAndRow(0,5,'Jour');
for($a=0;$a<=$njr;$a++)
{
$day = date ("d/m/Y", mktime(0,0,0,$mois[1],$mois[0]+$a,$mois[2]));
$date_us2 = implode('-',array_reverse (explode('/',$day)));
setlocale(LC_TIME, 'french');
$sheet->getRowDimension(6+$a)->setRowHeight(70);
if(strftime('%a', strtotime($date_us2))=='dim.')
$sheet->setCellValueByColumnAndRow(0,6+$a, strtoupper(strftime('%a', strtotime($date_us2))));
else
$sheet->setCellValueByColumnAndRow(0,6+$a, strtoupper(strftime('%a', strtotime($date_us2))));
}
/* <-!---------------------------!> */
$sheet->setCellValueByColumnAndRow(1,3,'Stock MAXI');
$sheet->setCellValueByColumnAndRow(1,4,'stock jour');
$sheet->setCellValueByColumnAndRow(1,5,'DATE');
$z=0;
for($b=0;$b<=$njr;$b++)
{
$day = date ("d/m/Y", mktime(0,0,0,$mois[1],$mois[0]+$b,$mois[2]));
$sheet->setCellValueByColumnAndRow(1,6+$b,$day);
$z++;
}
$sheet->setCellValueByColumnAndRow(1,(6+$z),'CUMUL');
$sheet->setCellValueByColumnAndRow(1,(6+$z+1),'OBJECTIF');
$sheet->setCellValueByColumnAndRow(1,(6+$z+2),'CA MOYEN');
$sheet->setCellValueByColumnAndRow(1,(6+$z+3),'NBRE JOUR');
$sheet->setCellValueByColumnAndRow(1,(6+$z+4),'ROT STOCK');
$sheet->setCellValueByColumnAndRow(1,(6+$z+5),'CUMUL '.($mois[2]-1));
$sheet->setCellValueByColumnAndRow(1,(6+$z+6),'TAUX %'.($mois[2]-1));
$sheet->setCellValueByColumnAndRow(1,(6+$z+7),'CUMUL '.($mois[2]-2));
$sheet->setCellValueByColumnAndRow(1,(6+$z+8),'TAUX %'.($mois[2]-2));
..................................
$workbook->affiche('Excel2007','ETAT'); |
Partager