get('roleid'); $userId = $current_user->get('id'); $viewer = new Vtiger_Viewer(); $viewer->assign('MODULE', 'Home'); $viewer->assign('SELECTED_MENU_CATEGORY', 'MARKETING'); $viewer->assign('COMPANY_LOGO', Vtiger_CompanyDetails_Model::getInstanceById()->getLogo()); $viewer->assign('COMPANY_DETAILS_SETTINGS',new Settings_Vtiger_CompanyDetails_Model()); $viewer->assign('USER_MODEL', $current_user); $viewer->assign('CURRENT_USER_MODEL', $current_user); $viewer->assign('PAGETITLE','Ajouter Encaissement '); $viewer->view('CustomDashboard.tpl'); if(isset($_POST['saveEncaissement'])) { //uploaded File $lien = null; if($_FILES['image']['name'] != ""){ $file_name = $_FILES['image']['name']; $file_tmp =$_FILES['image']['tmp_name']; $ext = strtolower(pathinfo($file_name, PATHINFO_EXTENSION)); $datetime = date("Ymdhis"); $extensionToMinuscule = strtolower($ext); $lien="file_upload/".$datetime.".".$extensionToMinuscule; $valid_ext = array("png","jpeg","jpg" ,"gif"); if(in_array($ext, $valid_ext)){ move_uploaded_file($file_tmp,$lien); } } $dateTime_creation = date("Y-m-d h:i:s", strtotime('1 hour')); $commentaire = isset($_POST['commentaire']) ? $_POST['commentaire'] : null ; $sql3 = 'INSERT INTO `encaissement` (`code_client` , `type_encaissement`, `numero_transaction`, `banque`, `montant`,`date_reception`, `date_paiement`,`statut`,`image_lien`,`date_encaissement`,`user_id`,`dateTime_creation` , `commentaire`) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)'; $params3 = array($_POST['code_client'] , $_POST['type_encaissement'] , $_POST['numero_transaction'] , $_POST['banque'] , $_POST['montant'] , $_POST['date_reception'] , $_POST['date_paiement'] , $_POST['statut'] , $lien , $_POST['date_encaissement'] , $userId , $dateTime_creation , $commentaire ); $adb->pquery($sql3, $params3); $last_id = $adb->getLastInsertID(); $sql4 = 'INSERT INTO `encaissement_facture` (`code_encaissement` , `date_echeance`, `numero_facture`) VALUES(?,?,?)'; $params4 = array($last_id , $_POST['date_echeance'] , $_POST['numero_facture'] ); $adb->pquery($sql4, $params4); unset($_POST); header("Location: index.php?module=Encaissement&view=Encaissement"); } function getAllGrossiste(){ global $adb; $query5 = "SELECT accountid,accountname FROM `vtiger_account` WHERE `industry`='grossiste' "; $result5 =$adb->query($query5); $Grossistes=array(); while ($recordinfo = $adb->fetch_array($result5)) { $Grossistes[] = $recordinfo; } return $Grossistes; } echo'

Details Encaissement


* Client   *Type encaissement  
*N° Transaction  *Banque  
*Date réception   *Date paiement  
*Date échéance   *Date Encaissement  
*Statut   *N° facture  
*Montant  
Commentaire  
Image/Photo  
Télécharger
'; $viewer->view('CustomDashboardFooter.tpl'); ?>