lang->load("pdf_lang","english"); else $this->lang->load("pdf_lang","french"); $this->load->library('PDF'); $pdf = new PDF(); $pdf->AddPage(); foreach ($data as $key => $value ) { // valide si fiche transporteur switch ($value['des_ref_type']) { // transport case 1: $pdf->SetLineWidth(.5); $pdf->Rect(10,$pdf->GetY() ,190,27) ; $pdf->Ln(5); $pdf->SetFont('Arial','B',17); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('reservation')); $pdf->Cell(150); $pdf->SetFont('Arial','',12); $pdf->Cell(5,5,$this->langx('projet').$this->u($value['proj_numero'])); $pdf->Ln(10); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->u($value['com_compagnie_fou'])); $pdf->Ln(5); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('contact')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$this->u($value['fou_contact_prenom'].' '.$value['fou_contact_nom'])); $pdf->Cell(55); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('email')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['fou_contact_courriel']); $pdf->SetFont('Arial','B',10); $pdf->Ln(10); $pdf->Cell(1); $pdf->Cell(30,5,$this->langx('client').$this->u($value['com_compagnie'])); $pdf->SetFont('Arial','',10); $pdf->Cell(80); $pdf->Cell(5,5,$this->langx('responsable')); $pdf->SetFont('Arial','',10); $pdf->Cell(22); $pdf->Cell(5,5,$this->u($value['cli_contact_prenom'].' '.$value['cli_contact_nom'])); $pdf->Ln(7); $pdf->SetFont('Arial','B',10); $pdf->Cell(1); $pdf->Cell(5,5,$this->u($value['des_nom_'.$mem_lang])); $pdf->Cell(80); $pdf->SetFont('Arial','',10); $pdf->Cell(5,5,$this->langx('qte')); $pdf->SetFont('Arial','',10); $pdf->Cell(15); $pdf->Cell(5,5,$value['det_qte']); $pdf->Cell(20); $pdf->SetFont('Arial','',10); $pdf->Cell(5,5,$this->langx('coutant')); $pdf->SetFont('Arial','',10); $pdf->Cell(15); $pdf->Cell(5,5,$value['det_coutant'].' $'); $pdf->Ln(12); $pdf->Cell(1); $pdf->SetFont('Arial','B',11); $pdf->Cell(5,5,$this->langx('embarquement')); $pdf->Ln(5); $pdf->Cell(1); $pdf->SetFont('Arial','',10); $pdf->Cell(5,5,$this->u($value['det_adress'])); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','',10); $pdf->Cell(5,5,$this->langx('datedepart')); $pdf->SetFont('Arial','',10); $pdf->Cell(80); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_depart']))); $pdf->Ln(15); $pdf->Cell(1); $pdf->SetFont('Arial','',10); $pdf->Cell(5,5,$this->langx('destination')); $pdf->Ln(5); $pdf->Cell(1); $pdf->SetFont('Arial','',10); $pdf->Cell(5,5,$this->u($value['det_destination'])); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','B',11); $pdf->Cell(5,5,$this->langx('datedestination')); $pdf->SetFont('Arial','',10); $pdf->Cell(80); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_retour']))); $pdf->Ln(10); //$pdf->Rect(10,$pdf->GetY() ,190,10) ; $pdf->Ln(3); $pdf->Cell(1); //$pdf->Cell(5,5,$this->langx('notes').$value['det_notes']); $pdf->MultiCell(190,5,$this->langx('notes').$this->u($value['det_notes']),1); $pdf->Ln(5); $pdf->SetLineWidth(1); $pdf->line(12,$pdf->GetY(),200,$pdf->GetY()) ; $pdf->SetLineWidth(.5); break; // hebergement case 2: $pdf->Rect(10,$pdf->GetY() ,190,27) ; $pdf->Ln(5); $pdf->SetFont('Arial','B',17); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('reservation')); $pdf->Cell(150); $pdf->SetFont('Arial','',12); $pdf->Cell(5,5,$this->langx('projet').$value['proj_numero']); $pdf->Ln(10); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->u($value['com_compagnie_fou'])); $pdf->Ln(5); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('contact')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$this->u($value['fou_contact_prenom'].' '.$value['fou_contact_nom'])); $pdf->Cell(55); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('email')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['fou_contact_courriel']); $pdf->Ln(15); $pdf->Cell(1); $pdf->Cell(5,5,$this->u($value['des_nom_'.$mem_lang])); $pdf->Cell(70); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('qte')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['det_qte']); $pdf->Ln(7); $pdf->Cell(1); $pdf->Cell(25,5,$this->u($value['com_compagnie'])); $pdf->Cell(80); $pdf->SetFont('Arial','B',10); $pdf->Cell(5,5,$this->langx('responsable')); $pdf->SetFont('Arial','',10); $pdf->Cell(22); $pdf->Cell(5,5,$this->u($value['cli_contact_prenom'].' '.$value['cli_contact_nom'])); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('datearrive')); $pdf->SetFont('Arial','',12); $pdf->Cell(70); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_depart']))); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('datedepart')); $pdf->SetFont('Arial','',12); $pdf->Cell(70); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_retour']))); $pdf->Ln(10); //$pdf->Rect(10,$pdf->GetY() ,190,10) ; $pdf->Ln(3); $pdf->Cell(1); //$pdf->Cell(5,5,$this->langx('notes').$value['det_notes']); $pdf->MultiCell(190,5,$this->langx('notes').$this->u($value['det_notes'],1)); $pdf->Ln(5); $pdf->SetLineWidth(1); $pdf->line(12,$pdf->GetY(),200,$pdf->GetY()) ; $pdf->SetLineWidth(.5); break; default: $pdf->Rect(10,$pdf->GetY() ,190,27) ; $pdf->Ln(5); $pdf->SetFont('Arial','B',17); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('reservation')); $pdf->Cell(150); $pdf->SetFont('Arial','',12); $pdf->Cell(5,5,$this->langx('projet').$value['proj_numero']); $pdf->Ln(10); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->u($value['com_compagnie_fou'])); $pdf->Ln(5); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('contact')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$this->u($value['fou_contact_prenom'].' '.$value['fou_contact_nom'])); $pdf->Cell(55); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('email')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$this->u($value['fou_contact_courriel'])); $pdf->Ln(15); $pdf->Cell(1); $pdf->Cell(5,5,$this->u($value['des_nom_'.$mem_lang])); $pdf->Cell(70); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('qte')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['det_qte']); $pdf->Ln(7); $pdf->Cell(1); $pdf->Cell(25,5,$this->u($value['com_compagnie'])); $pdf->Cell(80); $pdf->SetFont('Arial','B',10); $pdf->Cell(5,5,$this->langx('responsable')); $pdf->SetFont('Arial','',10); $pdf->Cell(22); $pdf->Cell(5,5,$this->u($value['cli_contact_prenom']).' '.$this->u($value['cli_contact_nom'])); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('datevisite')); $pdf->SetFont('Arial','',12); $pdf->Cell(70); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_depart']))); $pdf->Ln(10); //$pdf->Rect(10,$pdf->GetY() ,190,10) ; $pdf->Ln(3); $pdf->Cell(1); //$pdf->Cell(5,5,$this->langx('notes').$value['det_notes']); $pdf->MultiCell(190,5,$this->langx('notes').$this->u($value['det_notes']) ,1 ); $pdf->Ln(5); $pdf->SetLineWidth(1); $pdf->line(12,$pdf->GetY(),200,$pdf->GetY()) ; $pdf->SetLineWidth(.5); } $this->Lots_model->mod_modiflot_send_reservation($value['detail_id'],1); } // $pdf->Output(); $pdfdoc = $pdf->Output("", "S"); return $pdfdoc; } function mod_pdf_confirmation($data,$nom_fichier,$mem_lot,$mem_lang){ // require_once FCPATH.'fpdf/fpdf.php'; if ($mem_lang!='fr') $this->lang->load("pdf_lang","english"); else $this->lang->load("pdf_lang","french"); $this->load->library('PDF'); $pdf = new PDF(); $pdf->AddPage(); $pdf->Ln(1); $mem_entete=1; $mem_des_ref_type=0; $numItems = count($data); $i = 0; $counter=0; foreach ($data as $key => $value ) { // valide si fiche transporteur $mem_des_ref_type=$value['des_ref_type']; switch ($value['des_ref_type']) { // transport case 1: if ($mem_entete==1){ $pdf->Rect(10,$pdf->GetY() ,190,27) ; // print("
".print_r($value,true).""); // exit; $pdf->Ln(5); $pdf->SetFont('Arial','',12); $pdf->Cell(1); $pdf->Cell(20,0,$this->langx('confirmation')); $pdf->SetFont('Arial','',12); $pdf->Cell(120); $pdf->Cell(40,0,$this->langx('ent_numeroprojet_confirmation').$value['proj_numero'],0,0,'R'); $pdf->SetFont('Arial','B',12); $pdf->Ln(8); $pdf->Cell(1); $pdf->Cell(100,0,$this->u($value['com_compagnie'])); $pdf->SetFont('Arial','',12); $pdf->Ln(6); $pdf->Cell(1); $pdf->Cell(0,0,$this->langx('ent_date_confirmation').date("Y-m-d")); $pdf->SetFont('Arial','B',12); $pdf->Ln(6); $pdf->Cell(1); $pdf->Cell(100,0,$this->u($value['com_compagnie_fou'])); $pdf->SetFont('Arial','',9); $pdf->Ln(10); $pdf->Cell(1,5,$this->langx('ent_produit_tr_description',0,0,'L')); $pdf->Cell(100); $pdf->Cell(1,5,$this->langx('ent_produit_tr_qte',0,0,'L')); $pdf->Cell(15); $pdf->Cell(15,5,$this->langx('ent_produit_tr_depart'),0,0,'L'); $pdf->Cell(30); $pdf->Cell(15,5,$this->langx('ent_produit_tr_fin'),0,0,'L'); $pdf->Ln(5); $pdf->Cell(1); $pdf->SetLineWidth(0.5); $pdf->line(12,$pdf->GetY(),200,$pdf->GetY()) ; $num=1; $mem_entete=0; } $pdf->Ln(5); $pdf->SetFont('Arial','B',10); $pdf->Cell(1); $pdf->Cell(15,5,$this->u($value['des_nom_'.$mem_lang])); $pdf->Cell(85); $pdf->Cell(5,5,$value['det_qte']); $pdf->Cell(10); $pdf->Cell(15,5,date("Y-m-d H:i",strtotime($value['det_depart'])),0,0,'L'); $pdf->Cell(30); $pdf->Cell(15,5,date("Y-m-d H:i",strtotime($value['det_retour'])),0,0,'L'); $pdf->SetFont('Arial','',10); $pdf->Ln(6); $pdf->Cell(1); $pdf->Cell(1,5,$this->langx('ent_produit_tr_emb').$this->u($value['det_adress']),0,0,'L'); $pdf->Ln(5); $pdf->Cell(1); $pdf->Cell(1,5,$this->langx('ent_produit_tr_des').$this->u($value['det_destination']),0,0,'L'); $pdf->Ln(5); $pdf->Cell(1); $pdf->Cell(1,5,$this->langx('ent_produit_tr_res').$this->u($value['det_responsable']),0,0,'L'); $pdf->Ln(5); $pdf->Cell(1); $pdf->MultiCell(190,5,$this->langx('notes').$this->u($value['det_notes'],1)); $pdf->Ln(4); $pdf->SetLineWidth(1); $pdf->line(12,$pdf->GetY(),200,$pdf->GetY()) ; $pdf->SetLineWidth(.5); break; // pas bon case 99999: $pdf->Rect(10,$pdf->GetY() ,190,27) ; $pdf->Ln(5); $pdf->SetFont('Arial','B',17); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('confirmation')); $pdf->Cell(150); $pdf->SetFont('Arial','',12); $pdf->Cell(5,5,$this->langx('projet').$value['proj_numero']); $pdf->Ln(10); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->u($value['com_compagnie_fou'])); $pdf->Ln(5); $pdf->Cell(1); $pdf->Cell(5,5,$this->langx('contact')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['fou_contact_prenom'].' '.$value['fou_contact_nom']); $pdf->Cell(55); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('email')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['fou_contact_courriel']); $pdf->Ln(15); $pdf->Cell(1); $pdf->Cell(5,5,$value['des_nom_'.$mem_lang]); $pdf->Cell(70); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('qte')); $pdf->SetFont('Arial','',12); $pdf->Cell(15); $pdf->Cell(5,5,$value['det_qte']); $pdf->Ln(7); $pdf->Cell(1); $pdf->Cell(5,5,$value['com_compagnie']); $pdf->Cell(70); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('responsable')); $pdf->SetFont('Arial','',12); $pdf->Cell(30); $pdf->Cell(5,5,$value['cli_contact_prenom'].' '.$value['cli_contact_nom']); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('datearrive')); $pdf->SetFont('Arial','',12); $pdf->Cell(70); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_depart']))); $pdf->Ln(7); $pdf->Cell(1); $pdf->SetFont('Arial','B',12); $pdf->Cell(5,5,$this->langx('datedepart')); $pdf->SetFont('Arial','',12); $pdf->Cell(70); $pdf->Cell(5,5,date("Y-m-d H:i",strtotime($value['det_retour']))); $pdf->Ln(10); //$pdf->Rect(10,$pdf->GetY() ,190,10) ; $pdf->Ln(3); $pdf->Cell(1); //$pdf->Cell(5,5,$this->langx('notes').$value['det_notes']); $pdf->MultiCell(190,5,$this->langx('notes').$this->u($value['det_notes'],1)); $pdf->Ln(10); break; default: if ($mem_entete==1){ $pdf->Rect(10,$pdf->GetY() ,190,27) ; // print("
".print_r($value,true).""); // exit; $pdf->Ln(5); $pdf->SetFont('Arial','',12); $pdf->Cell(1); $pdf->Cell(20,0,$this->langx('confirmation')); $pdf->SetFont('Arial','',12); $pdf->Cell(120); $pdf->Cell(40,0,$this->langx('ent_numeroprojet_confirmation').$value['proj_numero'],0,0,'R'); $pdf->SetFont('Arial','B',12); $pdf->Ln(8); $pdf->Cell(1); $pdf->Cell(100,0,$this->u($value['com_compagnie'])); $pdf->SetFont('Arial','',12); $pdf->Ln(6); $pdf->Cell(1); $pdf->Cell(0,0,$this->langx('ent_date_confirmation').date("Y-m-d")); $pdf->SetFont('Arial','B',12); $pdf->Ln(6); $pdf->Cell(1); $pdf->Cell(100,0,$this->u($value['com_compagnie_fou'])); $pdf->SetFont('Arial','',9); $pdf->Ln(10); $pdf->Cell(1); $pdf->Cell(20,0,$this->langx('ent_num_confirmation'),0,0,'L'); $pdf->Cell(60,0,$this->langx('ent_produit_confirmation'),0,0,'L'); $pdf->Cell(20); $pdf->Cell(40,0,$this->langx('ent_datedebut_confirmation'),0,0,'L'); $pdf->Cell(25); $pdf->Cell(40,0,$this->langx('ent_qte_confirmation'),0,0,'L'); $num=1; $mem_entete=0; } $pdf->Ln(5); $pdf->SetFont('Arial','',10); $pdf->Cell(20,5, $num); $num= $num+1; // $pdf->Cell(25); $pdf->Cell(60,5,$this->u($value['des_nom_'.$mem_lang])); // $pdf->Cell(70); $pdf->Cell(25); $pdf->Cell(60,5,date("Y-m-d H:i" ,strtotime($value['det_depart']))); $pdf->Cell(15); $pdf->Cell(40,5,$value['det_qte']); // $pdf->Ln(3); // $pdf->Cell(1); //$pdf->Cell(5,5,$this->langx('notes').$value['det_notes']); // $pdf->MultiCell(190,10,$this->langx('notes').$this->u($value['det_notes']),1); // $pdf->Ln(10); } $this->Lots_model->mod_modiflot_pdf_confirmation($value['detail_id'],$nom_fichier,$mem_lot,$value['proj_ent_id']); if ($value['des_ref_type']<> $mem_des_ref_type || ++$i === $numItems){ if ($value['des_ref_type']<>1){ $pdf->Ln(60); $pdf->Cell(1); $pdf->SetFont('Arial','',10); $pdf->Cell(100,20,$this->langx('ent_fot_notea_confirmation')); $pdf->Image(FCPATH.'img/pdf/confirmationtable_'.$mem_lang.'.PNG',10,150,190); $pdf->SetY(-55); $pdf->SetFont('Arial','',10); $pdf->Cell(50,20,$this->langx('ent_fot_noteb_confirmation')); $pdf->Ln(5); $pdf->Cell(50,20,$this->langx('ent_fot_notebb_confirmation')); } } // changement page if ($pdf->GetY()>170 && $counter != count( $data ) - 1){ $pdf->AddPage(); $pdf->Ln(1); $mem_entete=1; } // a faire // changer pour confirmation $counter = $counter + 1; } // $pdf->Output(); $pdfdoc = $pdf->Output("", "S"); return $pdfdoc; } function mod_pdf_facturation_ajoutenumero($mem_pdf,$numero) { // require_once FCPATH.'fpdf/fpdf.php'; $mem_lang = 'fr'; //$this->load->library('PDF'); require_once( FCPATH.'fpdf/fpdf.php'); require_once( FCPATH.'fpdf/src/autoload.php'); $pdf = new \setasign\Fpdi\Fpdi(); // $pdf->AddPage(); $mem_pdf_path=FCPATH.'pdf/pdf2019/facturation/'.$mem_pdf; //Set the source PDF file $pagecount = $pdf->setSourceFile($mem_pdf_path); //Import the first page of the file // $tppl = $pdf->importPage(1); //Use this page as template // use the imported page and place it at point 20,30 with a width of 170 mm // $pdf->useTemplate($tppl); for ($pageNo = 1; $pageNo <= $pagecount; $pageNo++) { $tplIdx = $pdf->importPage($pageNo); // add a page $pdf->AddPage(); $pdf->SetFont('Arial','B',12); if($pageNo == 1) $pdf->Ln(26); else $pdf->Ln(0); $pdf->Cell(155); $pdf->Write(0,$this->langx('ent_facture').$numero); $pdf->useTemplate($tplIdx); } $pdf->Output($mem_pdf_path, "F"); } function mod_pdf_facturation($data,$nom_fichier,$mem_lot,$client,$mem_lang){ // require_once FCPATH.'fpdf/fpdf.php'; if ($mem_lang!='fr') $this->lang->load("pdf_lang","english"); else $this->lang->load("pdf_lang","french"); // print_r($data[0]); // exit; $this->load->library('PDF'); $pdf = new PDF(); $pdf->SetMargins(6, 6, 3); $pdf->AliasNbPages(); $pdf->AddPage(); // entete // print_r($client); //exit; $pdf->Rect(10,$pdf->GetY() ,190,27) ; $pdf->SetFont('Arial','B',13); $pdf->Ln(6); $pdf->Cell(5); $pdf->Cell(150,0,$this->u($client->com_compagnie)); $pdf->Cell(50); // $pdf->Cell(0,0,$mem_lot); $pdf->SetFont('Arial','',13); $pdf->Ln(5); $pdf->Cell(5); $pdf->Cell(100,0,$this->u($data[0]['con_prenom'].' '.$data[0]['con_nom'])); $pdf->Cell(50); $pdf->Cell(0,0,'Projet '.$this->u($data[0]['proj_numero'])); $pdf->SetFont('Arial','',13); $pdf->Ln(5); $pdf->Cell(5); $pdf->Cell(100,0,$this->u($client->com_adresse)); $pdf->Cell(50); $pdf->Cell(0,0,$this->u($client->com_telephone)); $pdf->Ln(5); $pdf->Cell(5); $pdf->Cell(100,0,$this->u($client->com_ville.','.$client->StateOrProvince.' '.$client->com_codepostal)); $pdf->SetFont('Arial','',9); $pdf->Cell(25); $pdf->Cell(0,0,$this->langx('ent_date_facturation').date("Y-m-d")); $pdf->Ln(3); $pdf->Cell(130); $pdf->Cell(0,0,$this->langx('ent_rep').$this->u($data[0]['usa_prenom'].' '.$data[0]['usa_nom'])); $pdf->SetFont('Arial','B',13); $pdf->Ln(13); $pdf->Cell(5); $pdf->Cell(150,0,$this->u($data[0]['proj_nom'])); $pdf->SetFont('Arial','',9); $pdf->Ln(5); $pdf->Cell(120); $pdf->Cell(20,0,$this->langx('ent_qte_facturation'),0,0,'R'); $pdf->Cell(25,0,$this->langx('ent_prix_facturation'),0,0,'R'); $pdf->Cell(25,0,$this->langx('ent_total_facturation'),0,0,'R'); $mem_total=0; $mem_sous_total=0; $mem_total_tps=0; $mem_total_tvq=0; $mem_total_tvh=0; $mem_total_opc=0; $mem_tot=0; $mem_depot=0; $mem_max=count($data); $max=1; $mem_page=1; foreach ($data as $key => $value ) { // valide si fiche transporteur // echo('-----