- Enabled SMTP debugging in PHPMailer for better error tracking. - Added a "Test send email" link in the Inventory Detail View for quick email testing. - Implemented automatic PDF generation and email sending upon Sales Order creation. - Created a new action for sending Sales Order emails with attached PDFs. - Added a new AJAX action for testing outgoing email server configurations. - Updated outgoing server settings to use new SMTP credentials. - Improved email templates for better user experience. - Added test scripts for validating PDF generation and email sending.
1233 lines
32 KiB
PHP
1233 lines
32 KiB
PHP
<?php
|
|
|
|
|
|
|
|
require_once 'include/utils/utils.php';
|
|
|
|
require_once 'includes/Loader.php';
|
|
|
|
require_once 'SUtiles.php';
|
|
|
|
require_once 'libraries/csrf-magic/csrf-magic.php';
|
|
|
|
vimport ('includes.runtime.EntryPoint');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $current_user;
|
|
|
|
$current_user = Users_Record_Model::getCurrentUserModel();
|
|
|
|
$roleid = $current_user->get('roleid');
|
|
|
|
if(isTopDG($roleid) && !$dbvp){$roleid="H8";}
|
|
|
|
|
|
|
|
//get year
|
|
|
|
$year = (new DateTime())->format("Y");
|
|
|
|
|
|
|
|
|
|
|
|
$viewer = new Vtiger_Viewer();
|
|
|
|
$viewer->assign('CURRENTDATE', Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j')));
|
|
|
|
$viewer->assign('MODULE', 'Home');
|
|
|
|
$viewer->assign('MODULE_NAME', 'Home');
|
|
|
|
$viewer->assign('QUALIFIED_MODULE', 'Home');
|
|
|
|
$viewer->assign('PARENT_MODULE', '');
|
|
|
|
$viewer->assign('VIEW', 'DashBoard');
|
|
|
|
|
|
|
|
$menuModelsList = Vtiger_Menu_Model::getAll(true);
|
|
|
|
$menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, 'Home');
|
|
|
|
uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
|
|
|
|
|
|
|
|
$viewer->assign('SELECTED_MENU_CATEGORY', 'MARKETING');
|
|
|
|
$viewer->assign('SELECTED_MENU_CATEGORY_LABEL', 'Tableau de bord');
|
|
|
|
//$viewer->assign('SELECTED_CATEGORY_MENU_LIST', $menuGroupedByParent['MARKETING']);
|
|
|
|
$viewer->assign('MENUS', $menuModelsList);
|
|
|
|
$viewer->assign('QUICK_CREATE_MODULES', Vtiger_Menu_Model::getAllForQuickCreate());
|
|
|
|
$viewer->assign('MENU_STRUCTURE', $menuStructure);
|
|
|
|
$viewer->assign('MENU_SELECTED_MODULENAME', 'Home');
|
|
|
|
$viewer->assign('MENU_TOPITEMS_LIMIT', $menuStructure->getLimit());
|
|
|
|
$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('HOME_MODULE_MODEL', Vtiger_Module_Model::getInstance('Home'));
|
|
|
|
$viewer->assign('HEADER_LINKS', Vtiger_Header_View::getHeaderLinks());
|
|
|
|
$viewer->assign('ANNOUNCEMENT', Vtiger_Header_View::getAnnouncement());
|
|
|
|
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
|
|
|
|
$viewer->assign('INVENTORY_MODULES', getInventoryModules());
|
|
|
|
$viewer->assign('PAGETITLE','Tableau de bord');
|
|
|
|
$viewer->assign('LANGUAGE_STRINGS', Vtiger_Language_Handler::export('Home', 'jsLanguageStrings'));
|
|
|
|
|
|
|
|
$viewer->view('CustomDashboard.tpl');
|
|
|
|
|
|
|
|
/*
|
|
|
|
function getMonitoringMainBarCompte($roleid) {
|
|
|
|
|
|
|
|
$string = '<div class="dashBoardContainer clearfix">
|
|
|
|
<div class="tabContainer">
|
|
|
|
<ul class="nav nav-tabs tabs sortable container-fluid">
|
|
|
|
<li class="dashboardTab" ><a href="index.php?module=MonitoringVMPlanning&view=MonitoringVMPlanning"><div><strong>Planning</strong></div></a></li>';
|
|
|
|
if(!isVM($roleid)){
|
|
|
|
$string = $string.'<li class="dashboardTab" ><a href="index.php?module=MonitoringVM&view=MonitoringVM"><div><strong>Visite</strong></div></a></li>';
|
|
|
|
}
|
|
|
|
$string = $string.'<li class="dashboardTab" ><a href="index.php?module=MonitoringVmPotentialite&view=MonitoringVmPotentialite"><div><strong>Potentialité</strong></div></a></li>
|
|
|
|
<li class="dashboardTab" ><a href="index.php?module=PrescriptionVMProduit&view=PrescriptionVMProduit"><div><strong>Prescription</strong></div></a></li>
|
|
|
|
<li class="dashboardTab active" ><a href="index.php?module=MonitoringVmCompte&view=MonitoringVmCompte"><div><strong>Compte Géolocalisé</strong></div></a></li>';
|
|
|
|
if(!isVM($roleid) && !isPharma($roleid) && !isGro($roleid))
|
|
|
|
$string = $string.'<li class="dashboardTab" ><a href="index.php?module=MonitoringSuperviseurWilaya&view=MonitoringSuperviseurWilaya"><div><strong>Superviseur</strong></div></a></li>';
|
|
|
|
$string = $string.'</ul>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
return $string;
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
function getMonitoringMainBar($active,$roleid) {
|
|
|
|
|
|
|
|
$active1 = "";
|
|
|
|
$active2 = "";
|
|
|
|
$active3 = "";
|
|
|
|
$active4 = "";
|
|
|
|
$active5 = "";
|
|
|
|
$active6 = "";
|
|
|
|
if($active == 1) $active1 = 'active';
|
|
|
|
if($active == 2) $active2 = 'active';
|
|
|
|
if($active == 3) $active3 = 'active';
|
|
|
|
if($active == 4) $active4 = 'active';
|
|
|
|
if($active == 5) $active5 = 'active';
|
|
|
|
if($active == 6) $active6 = 'active';
|
|
|
|
|
|
|
|
$string = '<div class="dashBoardContainer clearfix">
|
|
|
|
<div class="tabContainer">
|
|
|
|
<ul class="nav nav-tabs tabs sortable container-fluid">
|
|
|
|
<li class="dashboardTab font-large-2 '.$active1.'" ><a href="index.php?module=MonitoringVMPlanning&view=MonitoringVMPlanning"><div><strong>Planning</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active2.'" ><a href="index.php?module=MonitoringVM&view=MonitoringVM"><div><strong>Visite</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active4.'" ><a href="index.php?module=MonitoringVmPotentialite&view=MonitoringVmPotentialite"><div><strong>Potentialité</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active5.'" ><a href="index.php?module=PrescriptionVMProduit&view=PrescriptionVMProduit"><div><strong>Prescription</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active3.'" ><a href="index.php?module=MonitoringVmCompte&view=MonitoringVmCompte"><div><strong>Compte Géolocalisé</strong></div></a></li>';
|
|
|
|
if(!isVM($roleid) && !isPharma($roleid) && !isGro($roleid))
|
|
|
|
$string = $string.'<li class="dashboardTab font-large-2 '.$active6.'" ><a href="index.php?module=MonitoringSuperviseurWilaya&view=MonitoringSuperviseurWilaya"><div><strong>Superviseur</strong></div></a></li>';
|
|
|
|
$string = $string.'</ul>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
return $string;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getMonitoringMainBarVP($active) {
|
|
|
|
|
|
|
|
$active1 = "";
|
|
|
|
$active2 = "";
|
|
|
|
$active3 = "";
|
|
|
|
$active4 = "";
|
|
|
|
$active5 = "";
|
|
|
|
$active6 = "";
|
|
|
|
$active7 = "";
|
|
|
|
$active8 = "";
|
|
|
|
$active9 = "";
|
|
|
|
if($active == 1) $active1 = 'active';
|
|
|
|
if($active == 2) $active2 = 'active';
|
|
|
|
if($active == 3) $active3 = 'active';
|
|
|
|
if($active == 4) $active4 = 'active';
|
|
|
|
if($active == 5) $active5 = 'active';
|
|
|
|
if($active == 6) $active6 = 'active';
|
|
|
|
if($active == 7) $active7 = 'active';
|
|
|
|
if($active == 8) $active8 = 'active';
|
|
|
|
if($active == 9) $active9 = 'active';
|
|
|
|
if($active == 10) $active10 = 'active';
|
|
|
|
|
|
|
|
return '<div class="dashBoardContainer clearfix">
|
|
|
|
<div class="tabContainer">
|
|
|
|
<ul class="nav nav-tabs tabs sortable container-fluid">
|
|
|
|
<li class="dashboardTab font-large-2 '.$active1.'" ><a href="index.php?module=MonitoringVpBCTotal&view=MonitoringVpBCTotal"><div><strong>Total Bons de Commande</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active2.'" ><a href="index.php?module=MonitoringVPBCWilaya&view=MonitoringVPBCWilaya"><div><strong>CA / Wilaya</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active3.'" ><a href="index.php?module=MonitoringVpBC&view=MonitoringVpBC"><div><strong>Nombre Bons de Commande</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active4.'" ><a href="index.php?module=MonitoringVPProduits&view=MonitoringVPProduits"><div><strong>Par Produit</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active5.'" ><a href="index.php?module=MonitoringVPGrossistes&view=MonitoringVPGrossistes"><div><strong>Par Grossiste</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active6.'" ><a href="index.php?module=MonitoringVPVisite&view=MonitoringVPVisite"><div><strong>Visite</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active7.'" ><a href="index.php?module=MonitoringVPCompte&view=MonitoringVPCompte"><div><strong>Compte Géolocalisé</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active8.'" ><a href="index.php?module=MonitoringVpObjective&view=MonitoringVpObjective"><div><strong>Objective</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active9.'" ><a href="index.php?module=PharmexObjective&view=PharmexObjective&event=Saidalya"><div><strong>Salon SIPHAL</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active10.'" ><a href="index.php?module=PharmexObjective&view=PharmexObjective&event=November"><div><strong>Offres SIPHAL</strong></div></a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getMonitoringVisiteSubBar($active, $roleid) {
|
|
|
|
|
|
|
|
$active1 = "";
|
|
|
|
$active2 = "";
|
|
|
|
$active3 = "";
|
|
|
|
$active4 = "";
|
|
|
|
$active5 = "";
|
|
|
|
$active6 = "";
|
|
|
|
$active7 = "";
|
|
|
|
$active8 = "";
|
|
|
|
if($active == 1) $active1 = 'active';
|
|
|
|
if($active == 2) $active2 = 'active';
|
|
|
|
if($active == 3) $active3 = 'active';
|
|
|
|
if($active == 4) $active4 = 'active';
|
|
|
|
if($active == 5) $active5 = 'active';
|
|
|
|
if($active == 6) $active6 = 'active';
|
|
|
|
if($active == 7) $active7 = 'active';
|
|
|
|
if($active == 8) $active8 = 'active';
|
|
|
|
|
|
|
|
$string = '<div class="dashBoardContainer clearfix">
|
|
|
|
|
|
|
|
<div class="tabContainer">
|
|
|
|
<ul class="nav nav-tabs tabs sortable container-fluid">
|
|
|
|
<li class="dashboardTab font-large-2 '.$active1.'" ><a href="index.php?module=MonitoringVM&view=MonitoringVM"><div><strong>Par Visite</strong></div></a></li>';
|
|
|
|
if(!isVM($roleid))
|
|
|
|
$string = $string.'<li class="dashboardTab font-large-2 '.$active2.'" ><a href="index.php?module=MonitoringVMVisiteDuo&view=MonitoringVMVisiteDuo"><div><strong>Par Visite Duo</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active3.'" ><a href="index.php?module=MonitoringVmTypeActivite&view=MonitoringVmTypeActivite"><div><strong>Par Type d’activité</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active4.'" ><a href="index.php?module=MonitoringVmVisiteSpecialite&view=MonitoringVmVisiteSpecialite"><div><strong>Par Spécialité</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active5.'" ><a href="index.php?module=MonitoringVMSpecialite&view=MonitoringVMSpecialite"><div><strong>Par Spécialité / Visiteur</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active6.'" ><a href="index.php?module=MonitoringVmProduit&view=MonitoringVmProduit"><div><strong>Par Produit</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active7.'" ><a href="index.php?module=MonitoringVmVisiteProduitSpecialite&view=MonitoringVmVisiteProduitSpecialite"><div><strong>Par (Produit/Spécialité)</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active8.'" ><a href="index.php?module=MonitoringVmVisiteWilayaSpecialite&view=MonitoringVmVisiteWilayaSpecialite"><div><strong>Par (Wilaya/Spécialité)</strong></div></a></li>';
|
|
|
|
$string = $string.'</ul>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
return $string;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getMonitoringSuperviseurSubBar($active) {
|
|
|
|
|
|
|
|
$active1 = "";
|
|
|
|
$active2 = "";
|
|
|
|
if($active == 1) $active1 = 'active';
|
|
|
|
if($active == 2) $active2 = 'active';
|
|
|
|
|
|
|
|
return '<div class="dashBoardContainer clearfix">
|
|
|
|
|
|
|
|
<div class="tabContainer">
|
|
|
|
<ul class="nav nav-tabs tabs sortable container-fluid">
|
|
|
|
<li class="dashboardTab font-large-2 '.$active1.'" ><a href="index.php?module=MonitoringVM&view=MonitoringVM"><div><strong>Wilaya/Mois</strong></div></a></li>
|
|
|
|
<li class="dashboardTab font-large-2 '.$active2.'" ><a href="index.php?module=MonitoringSuperviseurReseau&view=MonitoringSuperviseurReseau"><div><strong>Reseau</strong></div></a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getTopTextSelect($title, $year,$submit=false) {
|
|
|
|
|
|
|
|
$year1 = "";
|
|
|
|
$year2 = "";
|
|
|
|
$year3 = "";
|
|
|
|
$year4 = "";
|
|
|
|
$year5 = "";
|
|
|
|
$year6 = "";
|
|
|
|
if($year == 2020) $year1 = "selected";
|
|
|
|
if($year == 2021) $year2 = "selected";
|
|
|
|
if($year == 2022) $year3 = "selected";
|
|
|
|
if($year == 2023) $year4 = "selected";
|
|
|
|
if($year == 2024) $year5 = "selected";
|
|
|
|
if($year == 2025) $year6 = "selected";
|
|
|
|
|
|
|
|
$astring = '<div style="text-align: center ;margin-top: 20px;height:50px">
|
|
|
|
<div style="display: inline; text-align: center ;font-size: 22px; float: left;margin-left: 280px;">'.$title.'</div>
|
|
|
|
<div style="display: inline; float: left; margin-left: 20px;">
|
|
|
|
<form style="display: inline" method="post">
|
|
|
|
<select id="year" class="form-control" name="year" onchange="this.form.submit()" style="display: inline; font-size: 16px; font-weight: bold;">
|
|
|
|
<option value="2020" '.$year1.'>2020</option>
|
|
|
|
<option value="2021" '.$year2.'>2021</option>
|
|
|
|
<option value="2022" '.$year3.'>2022</option>
|
|
|
|
<option value="2023" '.$year4.'>2023</option>
|
|
|
|
<option value="2024" '.$year5.'>2024</option>
|
|
|
|
<option value="2025" '.$year6.'>2025</option>
|
|
|
|
</select>';
|
|
|
|
if(!$submit)$astring = $astring.'</form>';
|
|
|
|
|
|
|
|
return $astring.'</div></div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getRegionSelectSubmit($roleid,$submit) {
|
|
|
|
|
|
|
|
$astring = '<div class="form-group col-md-4">
|
|
|
|
<label for="inputState">Région</label>';
|
|
|
|
if($submit)
|
|
|
|
$astring = $astring.'<select id="region" class="form-control" name="region" onchange="this.form.submit()">';
|
|
|
|
else
|
|
|
|
$astring = $astring.'<select id="region" class="form-control" name="region" onchange="regionChange(this.value)">';
|
|
|
|
if(isOuestVMVP($roleid))
|
|
|
|
$astring = $astring.'<option value="OUEST" selected>OUEST</option>';
|
|
|
|
else if(isEstVMVP($roleid))
|
|
|
|
$astring = $astring.'<option value="EST">EST</option>';
|
|
|
|
else if(isCentreVMVP($roleid))
|
|
|
|
$astring = $astring.'<option value="CENTRE" selected>CENTRE</option>';
|
|
|
|
else {
|
|
|
|
$astring = $astring.'<option selected>All</option>
|
|
|
|
<option value="EST">EST</option>
|
|
|
|
<option value="CENTRE">CENTRE</option>
|
|
|
|
<option value="OUEST">OUEST</option>';
|
|
|
|
}
|
|
|
|
$astring = $astring.'</select></div>';
|
|
|
|
|
|
|
|
if($submit) $astring = $astring.'</form>';
|
|
|
|
|
|
|
|
return $astring;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getRolesSelect() {
|
|
|
|
return '<div class="form-group col-md-4">
|
|
|
|
<label for="role">Poste</label>
|
|
|
|
<select id="role" class="form-control" name="role" onchange="roleChange(this.value)">
|
|
|
|
<option>All</option>
|
|
|
|
<option value="DIRECTEUR DE LA PROMOTION MEDICALE">DIRECTEUR DE LA PROMOTION MEDICALE</option>
|
|
|
|
<option value="DIRECTEUR REGIONAL">DIRECTEUR REGIONAL</option>
|
|
|
|
<option value="SUPERVISEUR">SUPERVISEUR</option>
|
|
|
|
<option selected value="DELEGUE MEDICAL">DELEGUE MEDICAL</option>
|
|
|
|
</select>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
function getRolesSelectVP() {
|
|
|
|
return '<div class="form-group col-md-4">
|
|
|
|
<label for="role">Rôles</label>
|
|
|
|
<select id="role" class="form-control" name="role" onchange="roleChange(this.value)">
|
|
|
|
<option>All</option>
|
|
|
|
<option value="RESPONSABLE COMMERCIAL">RESPONSABLE COMMERCIAL</option>
|
|
|
|
<option value="KEY ACCOUNT MANAGER">KEY ACCOUNT MANAGER</option>
|
|
|
|
<option selected value="DELEGUE COMMERCIAL">DELEGUE COMMERCIAL</option>
|
|
|
|
</select>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
function getDateSelect($datedeb, $datefin) {
|
|
|
|
|
|
|
|
$astring = '<div class= "divselection">
|
|
|
|
<form method="post">
|
|
|
|
<input id="datedeb" name="datedeb" type="date" value="'.$datedeb.'">
|
|
|
|
<input id="datefin" name="datefin" type="date" value="'.$datefin.'">
|
|
|
|
<input type="submit" value="Valider" class="btn addButton btn-default module-buttons">
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
return $astring;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getMonthSelect($monthp,$year) {
|
|
|
|
|
|
|
|
$months = array("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre");
|
|
|
|
$monthNumber = date('m');
|
|
|
|
|
|
|
|
$astring = '<div class= "divselection">
|
|
|
|
<form method="post">
|
|
|
|
<label for="month">Mois</label>
|
|
|
|
<select id="month" name="month" onchange="this.form.submit()">';
|
|
|
|
$i = 0;
|
|
|
|
foreach($months as $month) {
|
|
|
|
$i++;
|
|
|
|
if(($monthp == '' && $monthNumber == $i) || $i == $monthp)
|
|
|
|
$astring = $astring.'<option selected value = "'.$i.'">'.$month.'</option>';
|
|
|
|
else
|
|
|
|
$astring = $astring.'<option value = "'.$i.'">'.$month.'</option>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$year1 = "";
|
|
|
|
$year2 = "";
|
|
|
|
$year3 = "";
|
|
|
|
$year4 = "";
|
|
|
|
if($year == 2020) $year1 = "selected";
|
|
|
|
if($year == 2021) $year2 = "selected";
|
|
|
|
if($year == 2022) $year3 = "selected";
|
|
|
|
if($year == 2023) $year4 = "selected";
|
|
|
|
if($year == 2024) $year5 = "selected";
|
|
|
|
if($year == 2025) $year6 = "selected";
|
|
|
|
$astring = $astring.'</select></div>
|
|
|
|
<div class= "divselection2">
|
|
|
|
<label for="month">Année</label>
|
|
|
|
<select id="year" style="display: inline font-size: 16px; font-weight: bold;" name="year" onchange="this.form.submit()">
|
|
|
|
<option value="2020" '.$year1.'>2020</option>
|
|
|
|
<option value="2021" '.$year2.'>2021</option>
|
|
|
|
<option value="2022" '.$year3.'>2022</option>
|
|
|
|
<option value="2023" '.$year4.'>2023</option>
|
|
|
|
<option value="2024" '.$year5.'>2023</option>
|
|
|
|
<option value="2025" '.$year6.'>2023</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<br>';
|
|
|
|
|
|
|
|
return $astring;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getUniteType() {
|
|
|
|
return '<div class= "grid-container">
|
|
|
|
<label for="unit">Unité</label>
|
|
|
|
<select id="unit" name="unit" onchange="unitChange(this.value)">
|
|
|
|
<option selected value="Boite">Boite</option>
|
|
|
|
<option value="DA">DA</option>
|
|
|
|
</select>
|
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWilayaSelect($wilayas,$pwilaya) {
|
|
|
|
|
|
|
|
$astring = '<div class= "divselection">
|
|
|
|
<form action="?module=MonitoringVmPotentialite&view=MonitoringVmPotentialite" method="post" enctype="multipart/form-data">
|
|
|
|
<label for="inputCity">Wilaya</label>
|
|
|
|
<select class="js-example-basic-single " onchange="this.form.submit()" name="NomWilaya">
|
|
|
|
<option value="ALL">ALL</option>';
|
|
|
|
foreach ($wilayas as $wilaya) {
|
|
|
|
if($pwilaya){
|
|
|
|
$astring = $astring.'<option value="'.$wilaya['wilaya'].'"';
|
|
|
|
if($pwilaya == $wilaya['wilaya']) $astring = $astring.' selected';
|
|
|
|
$astring = $astring.'>'.strtoupper($wilaya['wilaya']).'</option>';
|
|
|
|
}else
|
|
|
|
$astring = $astring.'<option value="'.$wilaya['wilaya'].'">'.strtoupper($wilaya['wilaya']).'</option>';
|
|
|
|
}
|
|
|
|
$astring = $astring.'</select>
|
|
|
|
</div></form>
|
|
|
|
';
|
|
|
|
return $astring;
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkVM($data, $roleid) {
|
|
|
|
|
|
|
|
global $current_user;
|
|
|
|
|
|
|
|
$retData = $data;
|
|
|
|
|
|
|
|
if(isVM($roleid)) {
|
|
|
|
$fullname = $current_user->get('first_name').' '.$current_user->get('last_name');
|
|
|
|
|
|
|
|
$newresult = array();
|
|
|
|
foreach($data as $value){
|
|
|
|
if($value['fullname'] == $fullname)
|
|
|
|
$newresult[] = $value;
|
|
|
|
}
|
|
|
|
$retData = $newresult;
|
|
|
|
}
|
|
|
|
return $retData;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.font-large-2 {
|
|
|
|
font-size: 1.2rem!important;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
:root {
|
|
|
|
--gray-color: rgb(220, 220, 220);
|
|
|
|
--light-gray-color: rgb(240, 240, 240);
|
|
|
|
--my-color: rgb(20, 160, 217);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
table
|
|
|
|
{
|
|
|
|
width: 100%;
|
|
|
|
border-collapse : collapse;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.convention {
|
|
|
|
margin-top: 20px;
|
|
|
|
border: 1px solid var(--gray-color);
|
|
|
|
border: 1px solid #E2E2E4;
|
|
|
|
height: 70%;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.grid-container {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: auto;
|
|
|
|
margin-left: 230px;
|
|
|
|
padding: 20px;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.divselection {
|
|
|
|
margin-left: 230px;
|
|
|
|
padding: 20px;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.divselection2 {
|
|
|
|
margin-left: 5px;
|
|
|
|
padding: 20px;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
#scrollbar::-webkit-scrollbar {
|
|
|
|
width: 10px;
|
|
|
|
height: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#scrollbar::-webkit-scrollbar-thumb {
|
|
|
|
background: #aaa;
|
|
|
|
border-radius: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#scrollbar::-webkit-scrollbar-track {
|
|
|
|
background: #F0F0F0;
|
|
|
|
border-radius: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#scrollbar::-webkit-scrollbar-thumb:horizontal:hover,
|
|
|
|
|
|
|
|
#scrollbar::-webkit-scrollbar-thumb:vertical:hover {
|
|
|
|
background: #999999;
|
|
|
|
border-radius: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tr {
|
|
|
|
border-bottom: 1px solid var(--gray-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
th, td {
|
|
|
|
padding-left: 3px;
|
|
|
|
padding-right: 3px;
|
|
|
|
height: 35px;
|
|
|
|
min-width: 80px;
|
|
|
|
text-align : center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.center {
|
|
|
|
text-align : center;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="SUtiles.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
function myFormatNumber(val) {
|
|
|
|
|
|
|
|
return val.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,').replace(".", "-").replace(/,/g, " ").replace("-", ",");
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
$('th').each(function (col) {
|
|
|
|
|
|
|
|
$(this).hover(
|
|
|
|
|
|
|
|
function () {
|
|
|
|
|
|
|
|
$(this).addClass('focus');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
function () {
|
|
|
|
|
|
|
|
$(this).removeClass('focus');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
$(this).click(function () {
|
|
|
|
|
|
|
|
if ($(this).is('.asc')) {
|
|
|
|
|
|
|
|
$(this).removeClass('asc');
|
|
|
|
|
|
|
|
$(this).addClass('desc selected');
|
|
|
|
|
|
|
|
sortOrder = -1;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$(this).addClass('asc selected');
|
|
|
|
|
|
|
|
$(this).removeClass('desc');
|
|
|
|
|
|
|
|
sortOrder = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$(this).siblings().removeClass('asc selected');
|
|
|
|
|
|
|
|
$(this).siblings().removeClass('desc selected');
|
|
|
|
|
|
|
|
var arrData = $('#tabcenter').find('tbody >tr:has(td)').get();
|
|
|
|
|
|
|
|
arrData.sort(function (a, b) {
|
|
|
|
|
|
|
|
var val1 = $(a).children('td').eq(col).text().toUpperCase();
|
|
|
|
|
|
|
|
var val2 = $(b).children('td').eq(col).text().toUpperCase();
|
|
|
|
|
|
|
|
if ($.isNumeric(val1) && $.isNumeric(val2))
|
|
|
|
|
|
|
|
return sortOrder == 1 ? val1 - val2 : val2 - val1;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return (val1 < val2) ? -sortOrder : (val1 > val2) ? sortOrder : 0;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$.each(arrData, function (index, row) {
|
|
|
|
|
|
|
|
$('#values').append(row);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="layouts/v7/lib/jquery/purl.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/select2/select2.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.class.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery-ui-1.11.3.custom/jquery-ui.js"></script><script type="text/javascript" src="layouts/v7/lib/todc/js/bootstrap.min.js"></script><script type="text/javascript" src="libraries/jquery/jstorage.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery-validation/jquery.validate.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.slimscroll.min.js"></script><script type="text/javascript" src="libraries/jquery/jquery.ba-outside-events.min.js"></script><script type="text/javascript" src="libraries/jquery/defunkt-jquery-pjax/jquery.pjax.js"></script><script type="text/javascript" src="libraries/jquery/multiplefileupload/jquery_MultiFile.js"></script><script type="text/javascript" src="resources/jquery.additions.js"></script><script type="text/javascript" src="layouts/v7/lib/bootstrap-notify/bootstrap-notify.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/websockets/reconnecting-websocket.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery-play-sound/jquery.playSound.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/malihu-custom-scrollbar/jquery.mousewheel.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/malihu-custom-scrollbar/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/autoComplete/jquery.textcomplete.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.qtip.custom/jquery.qtip.js"></script><script type="text/javascript" src="libraries/jquery/jquery-visibility.min.js"></script><script type="text/javascript" src="layouts/v7/lib/momentjs/moment.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/daterangepicker/moment.min.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/daterangepicker/jquery.daterangepicker.js"></script><script type="text/javascript" src="layouts/v7/lib/jquery/jquery.timeago.js"></script><script type="text/javascript" src="libraries/jquery/ckeditor/ckeditor.js"></script><script type="text/javascript" src="libraries/jquery/ckeditor/adapters/jquery.js"></script><script type='text/javascript' src='layouts/v7/lib/anchorme_js/anchorme.min.js'></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Class.js?v=7.1.0"></script><script type='text/javascript' src="layouts/v7/resources/helper.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/resources/application.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Utils.js?v=7.1.0"></script><script type='text/javascript' src="layouts/v7/modules/Vtiger/resources/validation.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/bootbox/bootbox.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Base.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Vtiger.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Calendar/resources/TaskManagement.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Import/resources/Import.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Emails/resources/EmailPreview.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Base.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Google/resources/Settings.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/CkEditor.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Documents/resources/Documents.js?v=7.1.0"></script><script type="text/javascript" src="libraries/bootstrap/js/eternicode-bootstrap-datepicker/js/bootstrap-datepicker.js?v=7.1.0"></script><script type="text/javascript" src="libraries/bootstrap/js/eternicode-bootstrap-datepicker/js/locales/bootstrap-datepicker.fr.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/jquery/timepicker/jquery.timepicker.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/lazyYT/lazyYT.min.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Header.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Edit.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Popup.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Field.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jquery_windowmsg.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/BasicSearch.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceFilter.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/SearchAdvanceFilter.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceSearch.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/BaseList.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/List.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/AdvanceSearchList.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/RecordSelectTracker.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Pagination.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Import/resources/Popup.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Emails/resources/MassEdit.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/EmailsRelatedPopup.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/jquery/sadropdown.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/languages/jquery.validationEngine-fr.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Vtiger.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jquery.stickytableheaders.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/gridster/jquery.gridster.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/jquery.jqplot.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasTextRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.pieRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.barRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.categoryAxisRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.pointLabels.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.funnelRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/jqplot/plugins/jqplot.logAxisRenderer.min.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/VtJqplotInterface.js?v=7.1.0"></script><script type="text/javascript" src="libraries/jquery/vtchart.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/jquery/gridster/jquery.gridster.min.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/DashBoard.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/dashboards/Widget.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/Detail.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Reports/resources/Detail.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Reports/resources/ChartDetail.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/modules/Vtiger/resources/CkEditor.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/bootstrap-daterangepicker/moment.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/lib/bootstrap-daterangepicker/daterangepicker.js?v=7.1.0"></script><script type="text/javascript" src="layouts/v7/resources/v7_client_compat.js?v=7.1.0"></script>
|
|
|
|
<!-- Added in the end since it should be after less file loaded --><script type="text/javascript" src="libraries/bootstrap/js/less.min.js"></script>
|
|
|
|
<!-- Enable tracking pageload time --><script type="text/javascript">var _REQSTARTTIME = "1589749969";jQuery(document).ready(function() { window._PAGEREADYAT = new Date(); });</script>
|
|
|
|
<script type="text/javascript">CsrfMagic.end();</script>
|
|
|
|
<!-- Enable tracking pageload time -->
|
|
|
|
<script type="text/javascript">var _REQSTARTTIME = "1589749969";jQuery(document).ready(function() { window._PAGEREADYAT = new Date(); });
|
|
|
|
|
|
|
|
jQuery(window).load(function() {
|
|
|
|
|
|
|
|
window._PAGELOADAT = new Date();
|
|
|
|
|
|
|
|
window._PAGELOADREQSENT = false;
|
|
|
|
|
|
|
|
// Transmit the information to server about page render time now.
|
|
|
|
|
|
|
|
if (typeof _REQSTARTTIME != 'undefined') {
|
|
|
|
|
|
|
|
// Work with time converting it to GMT (assuming _REQSTARTTIME set by server is also in GMT)
|
|
|
|
|
|
|
|
var _PAGEREADYTIME = _PAGEREADYAT.getTime() / 1000.0; // seconds
|
|
|
|
|
|
|
|
var _PAGELOADTIME = _PAGELOADAT.getTime() / 1000.0; // seconds
|
|
|
|
|
|
|
|
var data = { page_request: _REQSTARTTIME, page_ready: _PAGEREADYTIME, page_load: _PAGELOADTIME };
|
|
|
|
|
|
|
|
data['page_xfer'] = (_PAGELOADTIME - _REQSTARTTIME).toFixed(3);
|
|
|
|
|
|
|
|
data['client_tzoffset']= -1*_PAGELOADAT.getTimezoneOffset()*60;
|
|
|
|
|
|
|
|
data['client_now'] = JSON.parse(JSON.stringify(new Date()));
|
|
|
|
|
|
|
|
if (!window._PAGELOADREQSENT) {
|
|
|
|
|
|
|
|
// To overcome duplicate firing on Chrome
|
|
|
|
|
|
|
|
window._PAGELOADREQSENT = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|