104 lines
4.0 KiB
PHP
104 lines
4.0 KiB
PHP
<?php
|
|
class TachesProjets extends CI_Controller {
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct('tachesprojets');
|
|
$this->load->helper('url');
|
|
$this->load->library('pagination');
|
|
$this->load->model('TachesProjets_model');
|
|
$this->lang->load('fournisseurs');
|
|
$this->load->model('Tache_model');
|
|
$this->load->library('table');
|
|
$this->load->helper('form');
|
|
$this->load->model('FxForm_model');
|
|
|
|
$this->load->model('Config_model');
|
|
$this->load->library('session');
|
|
}
|
|
public function index()
|
|
{
|
|
|
|
$mem_data['aqui'] = $this->Config_model->conf_getRepresentantsClient();
|
|
$mem_data['proj_etape']= $this->Config_model->conf_getGenresProjet('a','fr',true);
|
|
$mem_data['proj_type'] = $this->Config_model->conf_getGenresProjet('b','fr',true);
|
|
$mem_data['proj_dest'] = $this->Config_model->conf_getGenresProjet('c','fr',true);
|
|
|
|
$this->load->view('tachesprojets/header' );
|
|
$this->load->view('tachesprojets/list', $mem_data );
|
|
$this->load->view('tachesprojets/footer' );
|
|
}
|
|
public function form($mem_id,$error='',$facture="")
|
|
{
|
|
// $error['error']=array('type'=>'error','message'=>'test');
|
|
// $error['error']=$error;
|
|
|
|
|
|
|
|
// prépare tout les info pour la forme
|
|
$data=$this->TachesProjets_model->mod_getForminfo($mem_id);
|
|
$data['no_facture']=$facture;
|
|
|
|
$data_view= $this->load->view('tachesprojets/form',$data,true );
|
|
|
|
echo json_encode($data_view);
|
|
|
|
}
|
|
public function loadData_list($record=0,$aqui='',$mem_proj_etape='',$mem_proj_type='', $mem_proj_dest='',$date_debut,$date_fin,$mem_proj_num='',$mem_proj_compagnie='', $listactif = 1, $model='liste',$excel=0) {
|
|
if($mem_proj_num=='null')
|
|
$mem_proj_num='';
|
|
|
|
if( $mem_proj_compagnie=='null')
|
|
$mem_proj_compagnie='';
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','aqui',$aqui,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','date_debut',$date_debut,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','date_fin',$date_fin,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','proj_etape',$mem_proj_etape,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','proj_type',$mem_proj_type,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','proj_dest',$mem_proj_dest,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','proj_num',$mem_proj_num,1,0);
|
|
$this->Config_model->conf_getFiltreData($this->session->id,'list_tachesprojets','proj_compagnie',$mem_proj_compagnie,1,0);
|
|
|
|
|
|
$mem_proj_compagnie=urldecode($mem_proj_compagnie);
|
|
$filtre1='';
|
|
$filtre2='';
|
|
$filtre3='';
|
|
$data=$this->TachesProjets_model->mod_loadData_list(1,$aqui,$mem_proj_etape,$mem_proj_type,$mem_proj_dest,$date_debut,$date_fin,$mem_proj_num,$mem_proj_compagnie,$excel);
|
|
|
|
//$data=$this->TachesProjets_model->mod_loadData_list($record,$filtre1,$filtre2,$filtre3,'','');
|
|
|
|
echo json_encode($data);
|
|
}
|
|
public function saveRecord($id=0,$no_facture="")
|
|
{
|
|
|
|
|
|
|
|
$id=$this->TachesProjets_model->mod_createRecordbd($_POST,'pai_',$id,$no_facture);
|
|
|
|
$error['error']=array('type'=>'success','message'=>'Paiement créée');
|
|
|
|
redirect('/tachesprojets');
|
|
|
|
}
|
|
|
|
public function deletecontact($id,$con_id){
|
|
$this->Fournisseurs_model->mod_deleteRecordbdcontact($id);
|
|
$error=array('type'=>'success','message'=>'Contact effacé');
|
|
$this->form($con_id,$error);
|
|
}
|
|
|
|
public function saveRecordcontact($id)
|
|
{
|
|
|
|
|
|
$this->Fournisseurs_model->mod_createRecordbdcontact($_POST,'con_',$id);
|
|
|
|
$error=array('type'=>'success','message'=>'Nouvelle fiche créée');
|
|
|
|
|
|
|
|
$this->form($id,$error);
|
|
}
|
|
} |