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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
public function remplir_feuille_liste_dossier($feuille,$HistoriqueDetaillee){
$djt=DateModel::plageHoraire; //9*3600;
foreach($HistoriqueDetaillee as $i=>$demande){
$feuille->setCellValueByColumnAndRow(0, ($i+2), $demande['numdemande']);
$feuille->setCellValueByColumnAndRow(1, ($i+2), $demande['projet']);
$feuille->setCellValueByColumnAndRow(2, ($i+2), $demande['domaine']);
$feuille->setCellValueByColumnAndRow(3, ($i+2), $demande['resume']);
$feuille->setCellValueByColumnAndRow(4, ($i+2), $demande['typedemande']);
$feuille->setCellValueByColumnAndRow(5, ($i+2), $demande['severite']);
$feuille->setCellValueByColumnAndRow(6, ($i+2), $demande['impact']);
$feuille->setCellValueByColumnAndRow(7, ($i+2), $demande['statutActuel']);
$datecrea=new DateTime();
$datecrea->setTimestamp($demande['dateCreation']);
$feuille->setCellValueByColumnAndRow(8, ($i+2), $datecrea->format('d-m-Y H:i:s'));
if(isset($demande['last_up'])){
$datecrea=new DateTime();
$datecrea->setTimestamp($demande['last_up']);
$feuille->setCellValueByColumnAndRow(9, ($i+2), $datecrea->format('d-m-Y H:i:s'));
}else{
$feuille->setCellValueByColumnAndRow(9, ($i+2), ' ');
}
$feuille->setCellValueByColumnAndRow(10, ($i+2), $demande['user']);
if($demande['date_souhaiter'] > 0){
$datesh=new DateTime();
$datesh->setTimestamp($demande['date_souhaiter']);
$feuille->setCellValueByColumnAndRow(11, ($i+2), $datesh->format('d-m-Y H:i:s'));
}else{
$feuille->setCellValueByColumnAndRow(11, ($i+2), ' ');
}
if($demande['date_prevue'] > 0){
$datepr=new DateTime();
$datepr->setTimestamp($demande['date_prevue']);
$feuille->setCellValueByColumnAndRow(12, ($i+2), $datepr->format('d-m-Y H:i:s'));
}else{
$feuille->setCellValueByColumnAndRow(12, ($i+2), ' ');
}
$feuille->setCellValueByColumnAndRow(13, ($i+2), $demande['total_temps']);
$feuille->setCellValueByColumnAndRow(14, ($i+2), round($demande['total_temps']/$djt,2));
$feuille->setCellValueByColumnAndRow(15, ($i+2), $demande['total_tempsTMA']);
$feuille->setCellValueByColumnAndRow(16, ($i+2), round($demande['total_tempsTMA']*8/$djt,2));
$feuille->setCellValueByColumnAndRow(17, ($i+2), $demande['total_tempsClient']);
$feuille->setCellValueByColumnAndRow(18, ($i+2), round($demande['total_tempsClient']/$djt,2));
if($demande['total_temps']>0){
$feuille->setCellValueByColumnAndRow(19, ($i+2), round(100*$demande['total_tempsTMA']/$demande['total_temps'],2));
}else{
$feuille->setCellValueByColumnAndRow(19, ($i+2),'0');
}
if($demande['total_temps']>0){
$feuille->setCellValueByColumnAndRow(20, ($i+2), round(100*$demande['total_tempsClient']/$demande['total_temps'],2));
}else{
$feuille->setCellValueByColumnAndRow(20, ($i+2), '0');
}
$datecrea=new DateTime();
$datecrea->setTimestamp($demande['dateCreation']);
$dateMoisOuverture = date('d-m-Y',mktime(0,0,0,date('m',$datecrea->getTimestamp()),1,date('Y',$datecrea->getTimestamp())));
$feuille->setCellValueByColumnAndRow(22, ($i+2),$dateMoisOuverture);
if(isset($demande['last_up'])){
$datecrea->setTimestamp($demande['last_up']);
$dateMoisCloture = date('d-m-Y',mktime(0,0,0,date('m',$datecrea->getTimestamp()),1,date('Y',$datecrea->getTimestamp())));
$feuille->setCellValueByColumnAndRow(23, ($i+2), $dateMoisCloture );
}else{
$feuille->setCellValueByColumnAndRow(23, ($i+2), ' ');
}
$feuille->setCellValueByColumnAndRow(24, ($i+2),'=SI(E'.($i+2).'="" , GAUCHE(B'.($i+2).', 2 ), CONCATENER(RECHERCHEV(E'.($i+2).' ,Engagements!A$29:B$40 , 2 , FALSE ) , " " , F'.($i+2).'))');
$feuille->setCellValueByColumnAndRow(25,($i+2),'=SI(E'.($i+2).'="",GAUCHE(B'.($i+2).',2),RECHERCHEV(E'.($i+2).',Engagements!A$29:B$40,2,FALSE))');
$feuille->setCellValueByColumnAndRow(26,($i+2),'=SI(GAUCHE(B'.($i+2).',2)="SB","SB",RECHERCHEV(C'.($i+2).',Engagements!$A$49:$B$87,2,FALSE))');
$feuille->setCellValueByColumnAndRow(27, ($i+2), round($demande['total_tempsTMA']*8/$djt,2));
$feuille->setCellValueByColumnAndRow(28,($i+2),'=RECHERCHEV(Y'.($i+2).',Engagements!$A$8:$E$19,5,FALSE)');
$feuille->getStyle('AD'.($i+2).'')->applyFromArray(array(
'fill'=>array(
'type'=>PHPExcel_Style_Fill::FILL_SOLID,
'color'=>array(
'argb'=>'FFCC99'))));
$feuille->setCellValueByColumnAndRow(29,($i+2),'=SI(H'.($i+2).'="Fermé",SI(AB'.($i+2).'>AC'.($i+2).',"KO", "OK"),"N/A")');
}
return $feuille;
} |
Partager