load->database(); $this->load->helper('date'); $this->load->model('Projets_model'); } public function mod_listprojetsproduit($record=0,$listactif) { // $recordCount = $this->Clients_model->getRecordCount(); //$client_list=$this->Config_model->conf_getprojetsclients($record); $client_list=$this->Projets_model->mod_getRecords_produits_fournisseur($record,$listactif); // creation du tableau // prepare header //$mem_link_new=anchor('clients/form/0' , ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-plus-sign" '); // $mem_link_new=' '; $mem_link_new=''; //$mem_link_projet=anchor('projets/createRecord/0/'.$record, ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-briefcase" '); $mem_link_projet=''; $header=array( '', 'Numero', 'Nom', 'Client', 'Date de début', '' ); // prépare les donnés du tableau $nbitem=0; foreach($client_list as $row) { $nbitem++; // faire le link pour edit $mem_link_edit=anchor('projets/form/'.$row['proj_id'], ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-edit" '); // '; $data_row = array(); $data_row[] = array('data'=> $mem_link_edit, 'align' => 'left', 'width' => '2'); $data_row[] = array('data'=>$row['proj_numero'], 'align' => 'left', 'width' => '2'); $data_row[] = array('data'=>$row['des_nom_fr'], 'align' => 'left'); $data_row[] = array('data'=>$row['com_compagnie_client'], 'align' => 'left'); $data_row[] = array('data'=>$row['proj_date_debut'], 'align' => 'left'); $tabular_data[] = $data_row; } $template = array( 'table_open' => '', 'thead_open' => '', 'thead_close' => '', 'heading_row_start' => '', 'heading_row_end' => '', 'heading_cell_start' => '', 'tbody_open' => '', 'tbody_close' => '', 'row_start' => '', 'row_end' => '', 'cell_start' => '', 'row_alt_start' => '', 'row_alt_end' => '', 'cell_alt_start' => '', 'table_close' => '
', 'heading_cell_end' => '
', 'cell_end' => '
', 'cell_alt_end' => '
' ); $this->table->set_template($template); $this->table->set_heading($header); if(!isset($tabular_data)) $tabular_data=array(); $tableau_sortie= $this->table->generate($tabular_data); return $tableau_sortie; } public function mod_loadData_list($record=0,$filtre1='',$filtre2='',$filtre3='', $listactif, $model='') { $filtre1=($filtre1=='null'?'':$filtre1); $filtre2=($filtre2=='null'?'':$filtre2); if ($model == "liste") $recordPerPage = 10; else $recordPerPage = 5; $config["cur_page"] = $record; if($record != 0){ $record = ($record-1) * $recordPerPage; } $recordCount2 = $this->Fournisseursprojets_model->mod_getRecordCount(); $recordCount = $this->Fournisseursprojets_model->mod_getRecordCountfilter($filtre1,$filtre2,$filtre3); $client_list = $this->Fournisseursprojets_model->mod_getRecords($record,$recordPerPage,$filtre1,$filtre2,$filtre3); $config['base_url'] = base_url().'index.php/Fournisseursprojets/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'] = '
'; $config['first_link'] = '« First'; $config['first_tag_open'] = ''; $config['last_link'] = 'Last »'; $config['last_tag_open'] = ''; $config['next_link'] = 'Next →'; $config['next_tag_open'] = ''; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = ''; $config['cur_tag_open'] = '
  • '; $config['cur_tag_close'] = '
  • '; $config['num_tag_open'] = '
  • '; $config['num_tag_close'] = '
  • '; $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links(); $data['recordCount']=$recordCount2; // creation du tableau // prepare header if ($model == 'projets'){ $mem_link_new=''; }else{ $mem_link_new=anchor('fournisseursprojets/form/0' , ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-pencil" '); } $data['model']=$model; $header=array($mem_link_new, 'Compagnie', 'Ville', 'Type', 'Téléphone '); $nbitem=0; // filter global $mem_data; $data_row = array(); $data_row[]=array('data'=>'Filtre', 'align' => 'left'); // ------------------------------------------------------------------------- // $mem_champ='filtre_fournisseurs_1'; // $mem_value=trim($filtre1); // $this->FxForm_model->fxinputtxt($mem_champ,$mem_value,'','','','filtre_fournisseurs_1'); // $mem_filtre=form_input($mem_data['input'][$mem_champ]); // $data_row[]=array('data'=>$mem_filtre, 'align' => 'left'); // ------------------------------------------------------------------------- $mem_champ='filtre_fournisseurs_2'; $mem_value=trim($filtre2); $this->FxForm_model->fxinputtxt($mem_champ,$mem_value,'','','','filtre_fournisseurs_2'); $mem_filtre=form_input($mem_data['input'][$mem_champ]); $data_row[]=array('data'=>$mem_filtre, 'align' => 'left'); // ------------------------------------------------------------------------- $data_row[]=array('data'=>"", 'align' => 'left'); // ------------------------------------------------------------------------- if ($model == "liste"){ $mem_champ='filtre_fournisseurs_3'; $mem_value=$filtre3; $mem_data['select'][$mem_champ]['choix']=$this->Config_model->conf_getGenresFournisseur('fr',true); // value multipli select //$mem_value = explode(',', $mem_value); $mem_filtre=form_dropdown($mem_champ,$mem_data['select'][$mem_champ]['choix'],$mem_value,'class="filtre_fournisseurs_3"'); $data_row[]=array('data'=>$mem_filtre, 'align' => 'left'); } // echo form_dropdown($mem_champ,$select[$mem_champ]['choix'],$select[$mem_champ]['value']); // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // prépare les donnés du tableau $tabular_data[] = $data_row; foreach($client_list as $row) { $nbitem++; // faire le link pour edit $mem_link_edit=""; if ($model == "liste"){ $mem_link_edit=anchor('fournisseursprojets/form/'.$row['com_id'], ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-edit" '); }else{ $databtn = array( 'name' => 'button_fou', 'id' => 'button_fou', 'value' => $row['com_id'], 'class' => 'btn btn-success btn-circle glyphicon glyphicon-plus-sign' ); $mem_link_edit = form_button($databtn); $mem_link_delete = ''; } // '; $data_row = array(); $data_row[] = array('data'=> $mem_link_edit, 'align' => 'left'); // $data_row[] = array('data'=>$row['com_num_client'], 'align' => 'left'); $data_row[] = array('data'=>$row['com_compagnie'], 'align' => 'left'); $data_row[] = array('data'=>$row['com_ville'], 'align' => 'left'); $data_row[] = array('data'=>$row['list_type'], 'align' => 'left'); // $data_row[] = array('data'=>$row['rep_prenom']." ".$row['rep_nom'], 'align' => 'left'); $data_row[] = array('data'=>$row['com_telephone'], 'align' => 'left'); $tabular_data[] = $data_row; // print_r( $row); $mem_projets=$this->mod_listprojetsproduit($row['com_id'],$listactif); // $mem_projets=$this->mod_listprojetsproduit(74); // $projets=$this->Config_model->conf_getprojetsclients($row['com_id']); // $mem_projets=""; // $mem_projets_client=''; // foreach($projets as $value){ // $mem_link_edit=anchor('projets/form/'.$value['proj_id'], ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-edit statut_'.$value['proj_etape'].'"' ); // $mem_projets=$mem_projets. $mem_link_edit; // $mem_projets=$mem_projets.' '.$value['proj_numero'].' '.$value['proj_nom'].'
    '; // $mem_projets_client=' Création de projet
    '; // } $data_row = array(); $data_row[] = array('data'=>'' ); $data_row[] = array('data'=>$mem_projets,'colspan' => 6 ); $tabular_data[] = $data_row; } $template = array( 'table_open' => '', 'thead_open' => '', 'thead_close' => '', 'heading_row_start' => '', 'heading_row_end' => '', 'heading_cell_start' => '', 'tbody_open' => '', 'tbody_close' => '', 'row_start' => '', 'row_end' => '', 'cell_start' => '', 'row_alt_start' => '', 'row_alt_end' => '', 'cell_alt_start' => '', 'table_close' => '
    ', 'heading_cell_end' => '
    ', 'cell_end' => '
    ', 'cell_alt_end' => '
    ' ); $this->table->set_template($template); $this->table->set_heading($header); $this->table->set_heading($header); $tableau_sortie= $this->table->generate($tabular_data); $data['list'] = $tableau_sortie; return $data ; } public function mod_getRecords($rowno, $rowperpage, $filtre1 = "", $filtre2 = "", $filtre3 = "", $langue = 'fr') { // list la bb client $this->db->select('*,usa_usagers.usa_prenom as rep_prenom,usa_usagers.usa_nom as rep_nom,config_pays.pay_nom_' . $langue . ' as com_pay,config_provinces.pro_nom_' . $langue . ' as com_pro '); $this->db->from('fou_compte'); $this->db->join('config_pays', 'fou_compte.com_pay_id=config_pays.pay_id', 'left'); $this->db->join('config_provinces', 'fou_compte.com_pro_id=config_provinces.pro_id', 'left'); $this->db->join('usa_usagers', 'usa_usagers.usa_id=fou_compte.com_representant_id', 'left'); if ($filtre1 != "") $this->db->where("com_num_client LIKE '%$filtre1%'"); if ($filtre2 != "") $this->db->where("com_compagnie LIKE '%$filtre2%'"); if ($filtre3 != 0) $this->db->where("FIND_IN_SET (" . $filtre3 . ",com_ref_type)"); $this->db->limit($rowperpage, $rowno); $this->db->order_by('com_compagnie'); $query = $this->db->get(); $four = $query->result_array(); // ajouter la liste des type for ($x = 0; $x < count($four); $x++) { $replist = explode(",", $four[$x]['com_ref_type']); $mem_type = ""; foreach ($replist as $key => $value) { $this->db->select('*'); $this->db->from('fou_genres'); $this->db->where('gen_id', $value); $query2 = $this->db->get(); $row = $query2->row_array(); $mem_type = $mem_type . $row['gen_nom_fr'] . '
    '; } $mem_type = substr($mem_type, 0, -4); $four[$x]['list_type'] = $mem_type; } return $four; } public function mod_getRecords_contacts($id, $langue = 'fr') { // list la bb client $this->db->select('*,fou_contacts_roles.rol_nom as role'); $this->db->from('fou_contacts'); $this->db->join('fou_contacts_roles', 'fou_contacts_roles.rol_id=fou_contacts.con_role_id', 'left'); $this->db->where('fou_contacts.ref_id', $id); $this->db->where('fou_contacts.con_actif', 1); $query = $this->db->get(); return $query->result_array(); } public function mod_getRecord($id, $langue = 'fr') { // trouve un enregiestrement $this->db->select('*,config_pays.pay_nom_' . $langue . ' as com_pay,config_provinces.pro_nom_' . $langue . ' as com_pro '); $this->db->from('fou_compte'); $this->db->join('config_pays', 'fou_compte.com_pay_id=config_pays.pay_id', 'left'); $this->db->join('config_provinces', 'fou_compte.com_pro_id=config_provinces.pro_id', 'left'); $this->db->where('com_id=' . $id); $this->db->limit(1); $this->db->order_by('com_num_client desc'); $query = $this->db->get(); return $query->row(); } public function mod_saveRecordbd($id, $data, $pref) { // creation de la chaine de save $mem_data = array(); // ajoute les checkbox if (!isset($data['com_actif'])) $data['com_actif'] = 0; foreach ($data as $key => $value) { if (substr($key, 0, strlen($pref)) == $pref) { switch ($key) { case 'com_ref_type': $mem_value = ''; foreach ($data['com_ref_type'] as $key2 => $value2) { $mem_value = $mem_value . $value2 . ','; } $mem_value = rtrim($mem_value, ","); $mem_data['com_ref_type'] = $mem_value; break; default: $mem_data[$key] = $value; } } } $mem_data['com_modif'] = date("Y-m-d H:i:s"); $mem_where = "com_id =" . $id; $str = $this->db->update('fou_compte', $mem_data, $mem_where); $ok = true; return $ok; } public function mod_createRecordbd($data, $pref) { if (!isset($data['com_actif'])) $data['com_actif'] = 0; // creation de la chaine de save $mem_data = array(); foreach ($data as $key => $value) { if (substr($key, 0, strlen($pref)) == $pref) { switch ($key) { case 'com_ref_type': $mem_value = ''; foreach ($data['com_ref_type'] as $key2 => $value2) { $mem_value = $mem_value . $value2 . ','; } $mem_value = rtrim($mem_value, ","); $mem_data['com_ref_type'] = $mem_value; break; default: $mem_data[$key] = $value; } } } $mem_data['com_creation'] = date("Y-m-d H:i:s"); $mem_data['com_actif'] = 1; $str = $this->db->insert('fou_compte', $mem_data); $ok = true; return $this->db->insert_id(); } public function mod_editRecordbdcontact($data,$pref,$ref_id) { $mem_data=array(); foreach($data as $key => $value ) { if (substr($key,0,strlen($pref))==$pref){ $mem_data[$key]=$value; } } $mem_where = "con_id =".$ref_id; $str = $this->db->update('fou_contacts', $mem_data, $mem_where); $ok=true; return ; } public function mod_createRecordbdcontact($data, $pref, $ref_id) { $mem_data = array(); foreach ($data as $key => $value) { if (substr($key, 0, strlen($pref)) == $pref) { $mem_data[$key] = $value; } } $mem_data['ref_id'] = $ref_id; $mem_data['con_creation'] = date("Y-m-d H:i:s"); $mem_data['con_actif'] = 1; $str = $this->db->insert('fou_contacts', $mem_data); $ok = true; return; } public function mod_deleteRecordbdcontact($id) { $mem_data['con_actif'] = 0; $mem_where = "con_id =" . $id; $str = $this->db->update('fou_contacts', $mem_data, $mem_where); $ok = true; return; } public function mod_getRecordCount() { $this->db->select('count(*) as allcount'); $this->db->from('fou_compte'); $query = $this->db->get(); $result = $query->result_array(); return $result[0]['allcount']; } public function mod_getRecordCountfilter($filtre1 = "", $filtre2 = "", $filtre3 = "") { $this->db->select('count(*) as allcount'); $this->db->from('fou_compte'); if ($filtre1 != "") $this->db->where("com_num_client LIKE '%$filtre1%'"); if ($filtre2 != "") $this->db->where("com_compagnie LIKE '%$filtre2%'"); if ($filtre3 != 0) $this->db->where("FIND_IN_SET (" . $filtre3 . ",com_ref_type)"); $query = $this->db->get(); $result = $query->result_array(); return $result[0]['allcount']; } public function mod_listcontact($record = 0) { // $recordCount = $this->Fournisseurs_model->getRecordCount(); $client_list = $this->mod_getRecords_contacts($record); // creation du tableau // prepare header //$mem_link_new=anchor('clients/form/0' , ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-plus-sign" '); $mem_link_new = ' '; $header=array('','Prénom', 'Nom', 'Téléphone bureau', 'Ext', 'Cellulaire', 'Courriel', 'Role',''); // prépare les donnés du tableau $nbitem = 0; foreach ($client_list as $row) { $nbitem++; // faire le link pour edit $mem_link_edit = anchor('fournisseursprojets/deletecontact/' . $row['con_id'] . '/' . $record, ' ', 'class="btn btn-primary btn-circle glyphicon glyphicon-trash" '); // '; $mem_link_save=' '; $data_row = array(); $data_row[] = array('data'=> $mem_link_edit, 'align' => 'left'); // $data_row[] = array('data'=>$row['con_prenom'], 'align' => 'left'); // $data_row[] = array('data'=>$row['con_nom'], 'align' => 'left'); // $data_row[] = array('data'=>$row['con_telephone'], 'align' => 'left'); // $data_row[] = array('data'=>$row['con_ext'],'width'=>'5', 'align' => 'left'); // $data_row[] = array('data'=>$row['con_telephone2'], 'align' => 'left'); // $data_row[] = array('data'=>$row['con_courriel'], 'align' => 'left'); // $data_row[] = array('data'=>$row['role'], 'align' => 'left'); $data_row[] = array('data'=> form_input(array('value' =>$row['con_prenom'],'name' => $row['con_id'].'/con_prenom' ,'size'=>15))); $data_row[] = array('data'=> form_input(array('value' =>$row['con_nom'],'name' => $row['con_id'].'/con_nom' ,'size'=>15))); $data_row[] = array('data'=> form_input(array('value' =>$row['con_telephone'],'name' => $row['con_id'].'/con_telephone' ,'size'=>10))); $data_row[] = array('data'=> form_input(array('value' =>$row['con_ext'],'name' => $row['con_id'].'/con_ext' ,'size'=>5))); $data_row[] = array('data'=> form_input(array('value' =>$row['con_telephone2'],'name' => $row['con_id'].'/con_telephone2' ,'size'=>10))); $data_row[] = array('data'=> form_input(array('value' =>$row['con_courriel'],'name' => $row['con_id'].'/con_courriel' ,'size'=>15))); $mem_choix = $this->Config_model->conf_getRolesContactsFournisseur(); $mem_roles=form_dropdown($row['con_id'].'/con_role_id',$mem_choix,$row['con_role_id']) ; $data_row[] = array('data'=>$mem_roles , 'align' => 'left'); $data_row[] = array('data'=>$mem_link_save , 'align' => 'left'); $tabular_data[] = $data_row; } $data_row = array(); $data_row[] = array('data'=> $mem_link_new); $data_row[] = array('data'=> form_input(array('name' => '0/con_prenom','size'=>15))); $data_row[] = array('data'=> form_input(array('name' => '0/con_nom','size'=>15))); $data_row[] = array('data'=> form_input(array('name' => '0/con_telephone','size'=>10))); $data_row[] = array('data'=> form_input(array('name' => '0/con_ext','size'=>5))); $data_row[] = array('data'=> form_input(array('name' => '0/con_telephone2','size'=>10))); $data_row[] = array('data'=> form_input(array('name' => '0/con_courriel','size'=>15))); $mem_choix = $this->Config_model->conf_getRolesContactsFournisseur(); $mem_roles = form_dropdown('0/con_role_id', $mem_choix); $data_row[] = array('data' => $mem_roles, 'align' => 'left'); $tabular_data[] = $data_row; $template = array( 'table_open' => '', 'thead_open' => '', 'thead_close' => '', 'heading_row_start' => '', 'heading_row_end' => '', 'heading_cell_start' => '', 'tbody_open' => '', 'tbody_close' => '', 'row_start' => '', 'row_end' => '', 'cell_start' => '', 'row_alt_start' => '', 'row_alt_end' => '', 'cell_alt_start' => '', 'table_close' => '
    ', 'heading_cell_end' => '
    ', 'cell_end' => '
    ', 'cell_alt_end' => '
    ' ); $this->table->set_template($template); $this->table->set_heading($header); $tableau_sortie = $this->table->generate($tabular_data); return $tableau_sortie; } public function mod_getforminfo($id) { global $mem_data, $validation; $this->load->model('Config_model'); $this->load->model('FxForm_model'); // vas chercher les info de la fiche if ($id != 0) $info = $this->mod_getRecord($id); // prepare info pour chaque champs utilisé // input $mem_data['mem_id'] = $id; $mem_champ = 'com_compagnie'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Compagnie', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- //$mem_champ = 'com_num_client'; //$mem_value = ($id == 0 ? '' : $info->$mem_champ); // $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Numéro Fournisseur', ''); // $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_ref_type'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $mem_data['select'][$mem_champ]['choix'] = $this->Config_model->conf_getGenresFournisseur(); // value multipli select $mem_value = explode(',', $mem_value); $mem_data['select'][$mem_champ]['value'] = $mem_value; $mem_data['label'][$mem_champ] = 'Type'; $mem_data['icon'][$mem_champ] = ''; // ------------------------------------------------------------------------- $mem_champ = 'com_langue'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $mem_data['select'][$mem_champ]['choix'] = $this->Config_model->conf_getLangues(); // value multipli select $mem_value = explode(',', $mem_value); $mem_data['select'][$mem_champ]['value'] = $mem_value; $mem_data['label'][$mem_champ] = 'Langue'; $mem_data['icon'][$mem_champ] = ''; // ------------------------------------------------------------------------- // $mem_champ = 'com_representant_id'; // $mem_value = ($id == 0 ? '' : $info->$mem_champ); // $mem_data['select'][$mem_champ]['choix'] = $this->Config_model->conf_getRepresentantsClient(); // $mem_data['select'][$mem_champ]['value'] = $mem_value; // $mem_data['label'][$mem_champ] = 'Représentant'; // $mem_data['icon'][$mem_champ] = ''; // ------------------------------------------------------------------------- $mem_champ = 'com_actif'; $mem_value = ($id == 0 ? true : ($info->$mem_champ == 1 ? true : false)); $mem_data['checkbox'][$mem_champ] = array( 'name' => $mem_champ, 'value' => 1, 'checked' => $mem_value, ); $mem_data['label'][$mem_champ] = 'Actif'; $mem_data['icon'][$mem_champ] = ' '; // ------------------------------------------------------------------------- $mem_champ = 'com_nom'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Nom', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_prenom'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Prénom', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_courriel'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'E-Mail', ''); $mem_rule = " " . $mem_champ . " : { required : true, email : true }"; $mem_message = " " . $mem_champ . " : { required : 'Champ obligatoire', email : ' Le E-Mail est pas valide' }"; $this->FxForm_model->fxvaliderequired($mem_champ, $mem_rule, $mem_message); // ------------------------------------------------------------------------- $mem_champ = 'com_telephone'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Téléphone', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_telephone_ext'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Extension', ''); // $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_ville'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Ville', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_pro_id'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $mem_data['select'][$mem_champ]['choix'] = $this->Config_model->conf_getProvinces(); $mem_data['select'][$mem_champ]['value'] = $mem_value; $mem_data['label'][$mem_champ] = 'Province'; $mem_data['icon'][$mem_champ] = ''; // ------------------------------------------------------------------------- $mem_champ = 'com_pay_id'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $mem_data['select'][$mem_champ]['choix'] = $this->Config_model->conf_getPays(); $mem_data['select'][$mem_champ]['value'] = $mem_value; $mem_data['label'][$mem_champ] = 'Pays'; $mem_data['icon'][$mem_champ] = ''; // ------------------------------------------------------------------------- $mem_champ = 'com_codepostal'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Code postal', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_adresse'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Adresse', ''); $this->FxForm_model->fxvaliderequired($mem_champ); // ------------------------------------------------------------------------- $mem_champ = 'com_notes'; $mem_value = ($id == 0 ? '' : $info->$mem_champ); $this->FxForm_model->fxinputtxt($mem_champ, $mem_value, 'Notes', '', 'Notes'); $mem_data['validation'] = $this->FxForm_model->fxValidation($validation['rule'], $validation['message']); return $mem_data; } public function mod_selectcontact($fournisseur_id,$langue='fr',$choix_vide=true) { $contacts=$this->Fournisseursprojets_model->mod_getRecords_contacts($fournisseur_id); // list la bb client $mem_sortie=array(); if ($choix_vide) $mem_sortie[0]=''; foreach ($contacts as $pro ){ $mem_sortie[$pro['con_id']]=$pro['con_prenom']." ".$pro['con_nom']." (".$pro['rol_nom'].")"; } return $mem_sortie; } }