load->database(); $this->load->helper('date'); $this->load->model('FxForm_model'); $this->load->model('Config_model'); $this->load->model('Lots_pdf_model'); } public function mod_getRecordCount() { $this->db->select('count(*) as allcount'); $this->db->from('proj_details_details'); $this->db->where('det_res_active',1); $query = $this->db->get(); $result = $query->result_array(); return $result[0]['allcount']; } public function mod_modiflot($id,$choix){ if ($choix==1){ $mem_data['det_res_creation'] = date("Y-m-d H:i:s"); $mem_data['det_res_active'] = $choix; }else{ $mem_data['det_res_creation'] = "0000-00-00 00:00:00"; $mem_data['det_res_active'] = $choix; } $mem_where = 'detail_id =' . $id; $str = $this->db->update('proj_details_details', $mem_data, $mem_where); return; } public function mod_modiflot_send_reservation($id,$lotnum){ $mem_data['det_res_envoi'] = date("Y-m-d H:i:s"); $mem_data['det_res_active'] = 0; $mem_data['det_res_lot_fait'] = 1; $mem_data['det_res_lot_numero'] = $lotnum; $mem_where = 'detail_id =' . $id; $str = $this->db->update('proj_details_details', $mem_data, $mem_where); return; } public function mod_modiflot_pdf_confirmation($id,$nom,$mem_lot,$proj_ent_id){ $mem_data['det_con_envoi'] = date("Y-m-d H:i:s"); $mem_data['det_con_lot_fait'] = 1; $mem_data['det_con_active'] = 0; $mem_data['det_con_pdf'] = utf8_encode($nom); $mem_data['det_con_lot_numero'] = $mem_lot; $mem_where = 'detail_id =' . $id; $str = $this->db->update('proj_details_details', $mem_data, $mem_where); // bd unique $mem_data2['proj_con_pdf_creation'] = date("Y-m-d H:i:s"); // $mem_data['det_con_envoi'] = date("Y-m-d H:i:s"); $mem_data2['proj_con_pdf'] = utf8_encode($nom); $mem_data2['proj_con_pdf_lot_numero'] = $mem_lot; $mem_data2['proj_con_pdf_detail_detail_id'] = $id; $mem_data2['proj_con_pdf_ent_id'] = $proj_ent_id; $str = $this->db->insert('proj_con_pdf', $mem_data2); return; } public function mod_modiflot_pdf_facturation($id,$nom,$mem_lot,$mem_montant=123){ $mem_data['det_fac_envoi'] = date("Y-m-d H:i:s"); $mem_data['det_fac_lot_fait'] = 1; $mem_data['det_fac_active'] = 0; $mem_data['det_fac_montant'] =$mem_montant; $mem_data['det_fac_pdf'] = utf8_encode($nom); $mem_data['det_fac_lot_numero'] = $mem_lot; $mem_where = 'detail_id =' . $id; $str = $this->db->update('proj_details_details', $mem_data, $mem_where); return; } public function mod_modiflot_pdf_facturation_montant($mem_lot,$mem_montant){ $mem_data=$mem_montant; $mem_where = 'det_fac_lot_numero =' . $mem_lot; $str = $this->db->update('proj_details_details', $mem_data, $mem_where); return; } public function mod_getRecordCountfilter($filtre1 = "", $filtre2 = "", $filtre3 = "", $listactif=1) { $this->db->select('count(*) as allcount'); $this->db->from('proj_details_details'); if ($listactif==1) $this->db->where('det_res_active', 1); else $this->db->where('det_res_lot_fait', 1); // if ($filtre1 != "") // $this->db->where("des_nom_fr LIKE '%$filtre1%'"); // if ($filtre2 != "") // $this->db->where("des_description_fr LIKE '%$filtre2%'"); // if ($filtre3 != "") // $this->db->where("des_ref_type = " . $filtre3); $query = $this->db->get(); $result = $query->result_array(); return $result[0]['allcount']; } public function mod_getRecords($rowno, $rowperpage, $filtre1 = "", $filtre2 = "", $filtre3 = "", $listactif = 1, $langue = 'fr') { // list la bb client $this->db->select('*,fou_compte.com_langue as fou_langue,cli_contacts.con_prenom as cli_contact_prenom,cli_contacts.con_nom as cli_contact_nom,fou_contacts.con_courriel as fou_contact_courriel,fou_contacts.con_prenom as fou_contact_prenom,fou_contacts.con_nom as fou_contact_nom,cli_compte.com_compagnie as com_compagnie_client,fou_compte.com_compagnie as com_compagnie_fou'); $this->db->from('proj_details_details'); $this->db->join('proj_details', 'proj_details.proj_det_id=proj_details_details.proj_det_id', 'left'); $this->db->join('proj_entete', 'proj_entete.proj_id=proj_details.proj_ent_id', 'left'); $this->db->join('fou_compte', 'fou_compte.com_id=proj_details.proj_fou_id', 'left'); $this->db->join('pro_descriptions', 'pro_descriptions.des_id=proj_details.proj_prod_id', 'left'); $this->db->join('fou_genres', 'fou_genres.gen_id=pro_descriptions.des_ref_type', 'left'); $this->db->join('cli_compte', 'cli_compte.com_id=proj_entete.proj_client_id', 'left'); $this->db->join('fou_contacts', 'fou_contacts.con_id=proj_details_details.det_res_contact_id', 'left'); $this->db->join('cli_contacts', 'cli_contacts.con_id=proj_entete.proj_contact_principale', 'left'); if ($listactif==1) $this->db->where('det_res_active', 1); else $this->db->where('det_res_lot_fait', 1); if ($filtre1 != "") $this->db->where("fou_compte.com_compagnie LIKE '%$filtre1%'"); if ($filtre2 != "") $this->db->where("des_description_fr LIKE '%$filtre2%'"); if ($filtre3 != "") $this->db->where("des_ref_type = " . $filtre3); $this->db->limit($rowperpage, $rowno); $this->db->order_by("fou_compte.com_id,proj_details_details.det_res_contact_id,proj_details_details.det_res_creation"); $query = $this->db->get(); return $query->result_array(); } public function mod_getRecords_lot($listafaire,$listactif=1) { if (isset($listafaire['go'])){ $liste = implode(',',$listafaire['go']); // list la bb client $this->db->select('*,fou_compte.com_langue as fou_langue,cli_contacts.con_prenom as cli_contact_prenom,cli_contacts.con_nom as cli_contact_nom,fou_contacts.con_courriel as fou_contact_courriel,fou_contacts.con_prenom as fou_contact_prenom,fou_contacts.con_nom as fou_contact_nom,cli_compte.com_compagnie as com_compagnie_client,fou_compte.com_compagnie as com_compagnie_fou'); $this->db->from('proj_details_details'); $this->db->join('proj_details', 'proj_details.proj_det_id=proj_details_details.proj_det_id', 'left'); $this->db->join('proj_entete', 'proj_entete.proj_id=proj_details.proj_ent_id', 'left'); $this->db->join('fou_compte', 'fou_compte.com_id=proj_details.proj_fou_id', 'left'); $this->db->join('pro_descriptions', 'pro_descriptions.des_id=proj_details.proj_prod_id', 'left'); $this->db->join('fou_genres', 'fou_genres.gen_id=pro_descriptions.des_ref_type', 'left'); $this->db->join('cli_compte', 'cli_compte.com_id=proj_entete.proj_client_id', 'left'); $this->db->join('fou_contacts', 'fou_contacts.con_id=proj_details_details.det_res_contact_id', 'left'); $this->db->join('cli_contacts', 'cli_contacts.con_id=proj_entete.proj_contact_principale', 'left'); if ($listactif==1) $this->db->where('det_res_active', 1); else $this->db->where('det_res_lot_fait', 1); $this->db->where('FIND_IN_SET(proj_details.proj_det_id ,"'. $liste.'") '); $this->db->order_by("fou_compte.com_id,proj_details_details.det_res_contact_id,proj_details_details.det_res_creation"); $query = $this->db->get(); return $query->result_array(); } } public function mod_loadData_list($record = 0, $filtre1 = '', $filtre2 = '', $filtre3 = '', $listactif = 1 ) { // $config['suffix'] = '/'.$filtre1.'/'. $filtre2.'/'.$filtre3.'/'. $listactif; $filtre1 = ($filtre1 == 'null' ? '' : $filtre1); $filtre2 = ($filtre2 == 'null' ? '' : $filtre2); $filtre3 = ($filtre3 == 'null' ? '' : $filtre3); //echo($listactif); $recordPerPage = 10000; $config["cur_page"] = $record; if ($record != 0) { $record = ($record - 1) * $recordPerPage; } $recordCount2 = $this->mod_getRecordCount(); $recordCount = $this->mod_getRecordCountfilter($filtre1, $filtre2, $filtre3, $listactif); $client_list = $this->mod_getRecords($record, $recordPerPage, $filtre1, $filtre2, $filtre3, $listactif); $config['base_url'] = base_url() . 'index.php/Lots/loadData_list'; $config['use_page_numbers'] = TRUE; $config['next_link'] = 'Next'; $config['prev_link'] = 'Previous'; $config['total_rows'] = $recordCount; $config['per_page'] = $recordPerPage; $choice = $config["total_rows"] / $config["per_page"]; $config["uri_segment"] = 2; $config["num_links"] = 2; $config['full_tag_open'] = '
| ', 'heading_cell_end' => ' | ', 'tbody_open' => '', 'tbody_close' => '', 'row_start' => '
|---|
| ', 'cell_end' => ' | ', 'row_alt_start' => '
| ', 'cell_alt_end' => ' | ', 'table_close' => '
".print_r($mem_list_lot,true).""); //$mem_email=$this->load->view('lots/email_fr', '', true); foreach ($mem_list_lot as $key => $value ){ // echo($this->lang->line('reservation')); // exit; if ($mem_fou_id!=$value['proj_fou_id'] || $mem_contact_id!=$value['det_res_contact_id']){ // valide si 1er lecture if ($mem_fou_id==0){ }else{ // echo($mem_langue.' a