540 lines
29 KiB
PHP
540 lines
29 KiB
PHP
<?php
|
|
|
|
|
|
|
|
require_once 'include/utils/utils.php';
|
|
|
|
require_once 'includes/Loader.php';
|
|
|
|
vimport ('includes.runtime.EntryPoint');
|
|
|
|
require_once 'SUtiles.php';
|
|
|
|
@session_start();
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
|
|
|
|
$current_user = Users_Record_Model::getCurrentUserModel();
|
|
|
|
$roleid = $current_user->get('roleid');
|
|
|
|
|
|
|
|
$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('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);
|
|
|
|
require_once 'libraries/csrf-magic/csrf-magic.php';
|
|
|
|
$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','Réporting');
|
|
|
|
$viewer->assign('LANGUAGE_STRINGS', Vtiger_Language_Handler::export('Home', 'jsLanguageStrings'));
|
|
|
|
$viewer->view('CustomDashboard.tpl');
|
|
|
|
|
|
|
|
|
|
|
|
$Reportings = array();
|
|
|
|
|
|
|
|
if(isset($_POST['Valider'])){
|
|
|
|
$NomWilaya = 'ALL';
|
|
|
|
$_SESSION['formulaireIDR'] = $_POST['formulaireID'];
|
|
|
|
$Reportings = getReporting($_POST['formulaireID'] ,$NomWilaya);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($_POST['NomWilaya'])){
|
|
|
|
$NomWilaya= $_POST['NomWilaya'];
|
|
|
|
$Reportings = getReporting($_SESSION['formulaireIDR'] ,$NomWilaya);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function result($Reporting , $AllChoix){
|
|
|
|
$type = explode("::",$Reporting['type_formulaire']);
|
|
|
|
$Reporting['type_formulaire'] = $type[0];
|
|
|
|
if($Reporting['type_formulaire'] == "CHOIXMULTIPLES" or $Reporting['type_formulaire'] == "CHOIXUNIQUE"
|
|
|
|
or $Reporting['type_formulaire'] == "PICKLISTGROSSISTE" or $Reporting['type_formulaire'] == "PARAGRAPHE"){
|
|
|
|
echo '<tr>
|
|
|
|
<td>'.$Reporting['first_name']." ".$Reporting['last_name'].'</td>
|
|
|
|
<td>'.$Reporting['accountname'].'</td>';
|
|
|
|
for ($d = 0; $d < sizeof($AllChoix); $d++) {
|
|
|
|
$reponse ="reponse".$AllChoix[$d][0];
|
|
|
|
echo '<td><center>'.$Reporting[$reponse].'</i></center></td>';
|
|
|
|
}
|
|
|
|
if($Reporting['type_formulaire'] == "CHOIXMULTIPLES" or $Reporting['type_formulaire'] == "CHOIXUNIQUE"){
|
|
|
|
echo '<td width="300">'.$Reporting['autres'].'</td>';
|
|
|
|
}
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
}else if($Reporting['type_formulaire'] == "POURCENTAGE" or $Reporting['type_formulaire'] == "NOMBRE"){
|
|
|
|
|
|
|
|
echo '<tr>
|
|
|
|
<td>'.$Reporting['first_name']." ".$Reporting['last_name'].'</td>
|
|
|
|
<td>'.$Reporting['accountname'].'</td>';
|
|
|
|
for ($m = 0; $m < sizeof($AllChoix); $m++) {
|
|
|
|
$reponse ="reponse".$AllChoix[$m][0];
|
|
|
|
if(!empty($Reporting[$reponse])){
|
|
|
|
echo '<td><center><b>'.$Reporting[$reponse];
|
|
|
|
if($Reporting['type_formulaire'] == "POURCENTAGE") echo'%';
|
|
|
|
echo '<b><center></td>';
|
|
|
|
}else{
|
|
|
|
echo '<td></td>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($Reporting['type_formulaire'] == "POURCENTAGE"){
|
|
|
|
echo '<td width="300">'.$Reporting['autres'].'</td>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tr>';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getListeFormulaires(){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
|
|
|
|
$query = "SELECT * FROM `formulaire`";
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$formulaire= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$formulaire[] = $recordinfo;
|
|
|
|
}
|
|
|
|
return $formulaire;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFormulaireQuestions($id_formulaire){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
|
|
|
|
$query = "SELECT id_ligne_formulaire , question FROM `lignes_formulaire` where id_formulaire = '".$id_formulaire."'";
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$questions= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$questions[] = $recordinfo;
|
|
|
|
}
|
|
|
|
return $questions;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getWilayas($id_formulaire){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
|
|
|
|
$query = "SELECT DISTINCT cf_992 FROM `result_lignes_formulaire` ,vtiger_accountscf
|
|
|
|
WHERE id_ligne_formulaire = '".$id_formulaire."'
|
|
|
|
and result_lignes_formulaire.accountId = vtiger_accountscf.accountid ORDER BY cf_992";
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$wilayas= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$wilayas[] = $recordinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $wilayas;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getReporting($id_formulaire , $wilaya){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
if($wilaya == "ALL"){
|
|
|
|
$sql = "";
|
|
|
|
}else{
|
|
|
|
$sql =" and vtiger_accountscf.cf_992 = '".$wilaya."'" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
$query = "SELECT * FROM lignes_formulaire , result_lignes_formulaire , vtiger_account , vtiger_users, vtiger_accountscf
|
|
|
|
where lignes_formulaire.id_ligne_formulaire = '".$id_formulaire."'
|
|
|
|
|
|
|
|
and lignes_formulaire.id_ligne_formulaire = result_lignes_formulaire.id_ligne_formulaire
|
|
|
|
and result_lignes_formulaire.accountId = vtiger_account.accountid
|
|
|
|
and vtiger_users.id = result_lignes_formulaire.user_id
|
|
|
|
and vtiger_account.accountid = vtiger_accountscf.accountid".$sql;
|
|
|
|
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$Reporting= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$Reporting[] = $recordinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $Reporting;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getSumAccount($id_formulaire){
|
|
|
|
global $adb;
|
|
|
|
$query = "SELECT COUNT(id) as sum FROM `result_lignes_formulaire` WHERE id_ligne_formulaire = '".$id_formulaire."'";
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$sum= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$sum[] = $recordinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $sum[0]['sum'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DataForPie($AllChoix , $type , $id_formulaire , $wilaya){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
|
|
|
|
if($wilaya == "ALL"){
|
|
|
|
$sql = "";
|
|
|
|
}else{
|
|
|
|
$sql =" and vtiger_accountscf.cf_992 = '".$wilaya."'" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($type == "POURCENTAGE" OR $type == "NOMBRE"){
|
|
|
|
$query = "SELECT
|
|
|
|
sum(CAST(`reponse1` as decimal(10))) as reponse1 ,
|
|
|
|
sum(CAST(`reponse2` as decimal(10))) as reponse2 ,
|
|
|
|
sum(CAST(`reponse3` as decimal(10))) as reponse3 ,
|
|
|
|
sum(CAST(`reponse4` as decimal(10))) as reponse4 ,
|
|
|
|
sum(CAST(`reponse5` as decimal(10))) as reponse5 ,
|
|
|
|
sum(CAST(`reponse6` as decimal(10))) as reponse6 ,
|
|
|
|
sum(CAST(`reponse7` as decimal(10))) as reponse7,
|
|
|
|
sum(CAST(`reponse8` as decimal(10))) as reponse8 ,
|
|
|
|
sum(CAST(`reponse9` as decimal(10))) as reponse9 ,
|
|
|
|
sum(CAST(`reponse10` as decimal(10))) as reponse10
|
|
|
|
FROM `result_lignes_formulaire` ,vtiger_accountscf
|
|
|
|
WHERE id_ligne_formulaire = '".$id_formulaire."'
|
|
|
|
and result_lignes_formulaire.accountId = vtiger_accountscf.accountid ".$sql;
|
|
|
|
|
|
|
|
|
|
|
|
}else if($type == "CHOIXMULTIPLES" or $type =='CHOIXUNIQUE' or $type =='PICKLISTGROSSISTE'){
|
|
|
|
$query ="SELECT
|
|
|
|
sum(IF(LENGTH(reponse1), 1, 0)) as reponse1,
|
|
|
|
sum(IF(LENGTH(reponse2), 1, 0)) as reponse2,
|
|
|
|
sum(IF(LENGTH(reponse3), 1, 0)) as reponse3,
|
|
|
|
sum(IF(LENGTH(reponse4), 1, 0)) as reponse4,
|
|
|
|
sum(IF(LENGTH(reponse5), 1, 0)) as reponse5,
|
|
|
|
sum(IF(LENGTH(reponse6), 1, 0)) as reponse6,
|
|
|
|
sum(IF(LENGTH(reponse7), 1, 0)) as reponse7,
|
|
|
|
sum(IF(LENGTH(reponse8), 1, 0)) as reponse8,
|
|
|
|
sum(IF(LENGTH(reponse9), 1, 0)) as reponse9,
|
|
|
|
sum(IF(LENGTH(reponse10), 1, 0)) as reponse10
|
|
|
|
FROM `result_lignes_formulaire` ,vtiger_accountscf
|
|
|
|
WHERE id_ligne_formulaire = '".$id_formulaire."'
|
|
|
|
and result_lignes_formulaire.accountId = vtiger_accountscf.accountid ".$sql;
|
|
|
|
}
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$Data= array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$Data[] = $recordinfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
$dataPie=array();
|
|
|
|
$dataPieFinal =array();
|
|
|
|
for ($m = 0; $m < sizeof($AllChoix); $m++) {
|
|
|
|
$reponse ="reponse".$AllChoix[$m][0];
|
|
|
|
array_push($dataPie,array(' '.$AllChoix[$m][1].' ', ($Data[0][$reponse]/getSumAccount($id_formulaire)) ));
|
|
|
|
}
|
|
|
|
|
|
|
|
array_push($dataPieFinal,$dataPie);
|
|
|
|
|
|
|
|
//print("<pre>".print_r($dataPieFinal,true)."</pre>");
|
|
|
|
return $dataPieFinal;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="main-container main-container-Accounts">
|
|
|
|
<div class="container-fluid" style="margin:15px 15px 15px 15px;">
|
|
|
|
|
|
|
|
<div class=" detailview-header-block">
|
|
|
|
<div class="row" >
|
|
|
|
<div class="col-md-6">
|
|
|
|
<form action="?module=QuestionnaireReporting&view=QuestionnaireReporting" method="post" enctype="multipart/form-data">
|
|
|
|
<label for="inputCity">Libellé Questionnaire</label>
|
|
|
|
<select class="js-example-templating js-states form-control select2-hidden-accessible" tabindex="-1" aria-hidden="true" name="formulaireID" required>
|
|
|
|
|
|
|
|
<option value=""></option>';
|
|
|
|
$formulaires = getListeFormulaires();
|
|
|
|
|
|
|
|
foreach ($formulaires as $formulaire) {
|
|
|
|
echo '<optgroup label="'.$formulaire['nom_formulaire'].' >>> '.$formulaire['specialite'].'">';
|
|
|
|
$questions = getFormulaireQuestions($formulaire['id_formulaire']);
|
|
|
|
foreach ($questions as $question) {
|
|
|
|
echo '<option value="'.$question['id_ligne_formulaire'].'"';
|
|
|
|
if(!empty($_SESSION['formulaireIDR'])){
|
|
|
|
if($_SESSION['formulaireIDR'] == $question['id_ligne_formulaire']) echo "selected";
|
|
|
|
}
|
|
|
|
echo'>'.$question['question'].'</option>';
|
|
|
|
}
|
|
|
|
echo '</optgroup>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-2">
|
|
|
|
<label for=""></label>
|
|
|
|
<button class="btn btn-default addButton" style="margin: 20px 0 0 0;" type="submit" name="Valider" value="Valider"> Valider</button>
|
|
|
|
</form >
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
|
|
|
|
if(!empty($Reportings) && isset($Reportings)){
|
|
|
|
|
|
|
|
echo' <div class=" detailview-header-block" style="margin-top:15px; width: 120%;">
|
|
|
|
<div class="fieldBlockContainer" data-block="LBL_ADDRESS_INFORMATION">
|
|
|
|
<h4 class="fieldBlockHeader">'.$Reportings[0]['question'].'</h4>
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<div class="row" >
|
|
|
|
<div class="col-md-3">
|
|
|
|
<form action="?module=QuestionnaireReporting&view=QuestionnaireReporting" method="post" enctype="multipart/form-data">
|
|
|
|
<label for="inputCity">Wilaya</label>
|
|
|
|
<select class="js-example-basic-single form-control" onchange="this.form.submit()" name="NomWilaya">
|
|
|
|
<option value="ALL">ALL</option>';
|
|
|
|
$wilayas = getWilayas($_SESSION['formulaireIDR']);
|
|
|
|
if(!isset($_POST['NomWilaya'])){
|
|
|
|
foreach ($wilayas as $wilaya) {
|
|
|
|
echo '<option value="'.$wilaya['cf_992'].'">'.$wilaya['cf_992'].'</option>';
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
foreach ($wilayas as $wilaya) {
|
|
|
|
echo '<option value="'.$wilaya['cf_992'].'"';
|
|
|
|
if($_POST['NomWilaya'] == $wilaya['cf_992']) echo "selected";
|
|
|
|
echo'>'.$wilaya['cf_992'].'</option>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row" style="margin: 5px 0px 0px 0px;">
|
|
|
|
<div class="col">
|
|
|
|
<table class="table table-bordered table-striped" id="reporting">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><center>Assigné à</center></th>
|
|
|
|
<th><center>Compte</center></th>';
|
|
|
|
$AllChoix=array();
|
|
|
|
for ($y = 1; $y <= 10; $y++) {
|
|
|
|
$choix ="choix".$y;
|
|
|
|
if(trim($Reportings[0][$choix ]) != ''){
|
|
|
|
array_push($AllChoix,array($y,$Reportings[0][$choix]));
|
|
|
|
echo'<th><center><i class="fa fa-sort customsort"></i> '.$Reportings[0][$choix].'</center></th>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($Reportings[0]['type_formulaire'] == "CHOIXMULTIPLES" or $Reportings[0]['type_formulaire'] == "CHOIXUNIQUE"
|
|
|
|
or $Reportings[0]['type_formulaire'] == "POURCENTAGE"){
|
|
|
|
echo '<th width="300"><center>Commentaire</center></th> ';
|
|
|
|
}
|
|
|
|
echo' </tr>
|
|
|
|
</thead>
|
|
|
|
<tbody id="values">';
|
|
|
|
$NbrComptes=0;
|
|
|
|
|
|
|
|
foreach ($Reportings as $Reporting) {
|
|
|
|
result($Reporting , $AllChoix);
|
|
|
|
$NbrComptes++;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '</tbody>
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<td colspan="'.(sizeof($AllChoix)+2).'"><b>Total : '.$NbrComptes.'<b></td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
if(sizeof($AllChoix) > 1 ){
|
|
|
|
$type = explode("::",$Reporting['type_formulaire']);
|
|
|
|
$Reporting['type_formulaire'] = $type[0];
|
|
|
|
if($Reporting['type_formulaire'] != "PICKLISTGROSSISTE" and $Reporting['type_formulaire'] != "PARAGRAPHE" ){
|
|
|
|
echo'<div class=" detailview-header-block" style="margin-top:15px;">
|
|
|
|
<div id="chart1" ></div>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
$data = DataForPie($AllChoix , $Reportings[0]['type_formulaire'] , $Reportings[0]['id_ligne_formulaire'] ,$NomWilaya);
|
|
|
|
//print("<pre>".print_r($AllChoix,true)."</pre>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo'</div>
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$viewer->view('CustomDashboardFooter.tpl');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- script pour liste déroulante -->
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.js-example-basic-single').select2();
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
//si les valeurs supérieur a 100 erreur
|
|
|
|
data1 = <?php echo json_encode($data); ?>;
|
|
|
|
|
|
|
|
var plot1 = jQuery.jqplot('chart1',
|
|
|
|
data1,
|
|
|
|
{
|
|
|
|
title: ' ',
|
|
|
|
stackSeries:true,
|
|
|
|
seriesDefaults: {
|
|
|
|
shadow: false,
|
|
|
|
renderer: jQuery.jqplot.PieRenderer,
|
|
|
|
rendererOptions: { padding: 5, sliceMargin: 5, showDataLabels: true ,startAngle: 180 }
|
|
|
|
},
|
|
|
|
grid:{
|
|
|
|
"background":"#F9F9F9","borderWidth":"1"
|
|
|
|
},
|
|
|
|
//seriesColors: [ "#67B7DC", "#6794DC", "#6794DC" ,"#8067DC" , "#A367DC" , "#C767DC" , "#DC67CE" ,"#DC67AB" ,"#DC6788"],
|
|
|
|
//seriesColors: [ "#4D4D4D", "#5DA5DA", "#FAA43A" ,"#60BD68" , "#F17CB0" , "#B2912F" , "#B276B2" ,"#DECF3F" ,"#F15854" ,"#67B7DC"],
|
|
|
|
legend: {
|
|
|
|
show: true,
|
|
|
|
location: 'w',
|
|
|
|
renderer: $.jqplot.EnhancedPieLegendRenderer,
|
|
|
|
fontSize : 15,
|
|
|
|
|
|
|
|
rendererOptions: {
|
|
|
|
numberColumns: 1
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
$('.jqplot-pie-series.jqplot-data-label').css('color', '#ffffff')
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
$(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 = $('#reporting').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();
|
|
|
|
//sophal
|
|
|
|
if(val1 != "")
|
|
|
|
val1 = parseInt(val1.replace("%", ""));
|
|
|
|
else
|
|
|
|
val1 = null;
|
|
|
|
if(val2 != "")
|
|
|
|
val2 = parseInt(val2.replace("%", ""));
|
|
|
|
else
|
|
|
|
val2 = null;
|
|
|
|
//sophal
|
|
|
|
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>
|
|
|
|
|
|
|
|
<link type='text/css' rel='stylesheet' href='libraries/jquery/jqplot/jquery.jqplot.css'>
|
|
|
|
<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(); });
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function formatState (state) {
|
|
|
|
if (!state.id) {
|
|
|
|
return state.text;
|
|
|
|
}
|
|
|
|
var baseUrl = "/user/pages/images/flags";
|
|
|
|
var $state = $(
|
|
|
|
'<span><img src="' + baseUrl + '/' + state.element.value.toLowerCase() + '.png" class="img-flag" /> ' + state.text + '</span>'
|
|
|
|
);
|
|
|
|
return $state;
|
|
|
|
};
|
|
|
|
|
|
|
|
$(".js-example-templating").select2({
|
|
|
|
templateResult: formatState
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</html>
|