summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyParaGraph.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyParaGraph.php')
-rw-r--r--admin/survey/classes/class.SurveyParaGraph.php128
1 files changed, 83 insertions, 45 deletions
diff --git a/admin/survey/classes/class.SurveyParaGraph.php b/admin/survey/classes/class.SurveyParaGraph.php
index 891af1b..e20ee5b 100644
--- a/admin/survey/classes/class.SurveyParaGraph.php
+++ b/admin/survey/classes/class.SurveyParaGraph.php
@@ -39,13 +39,13 @@ class SurveyParaGraph{
$paraData = $this->collectParaGraphDataNew();
- echo '<p>'.$lang['srv_para_graph_text'].'</p>';
+ //echo '<p>'.$lang['srv_para_graph_text'].'</p>';
// PC, tablica, mobi
echo '<fieldset><legend>'.$lang['srv_para_graph_device'].'</legend>';
- // Filter po napravi
+ /* Filter po napravi
echo '<div style="margin:5px 0 15px 5px;">';
echo '<label>'.$lang['srv_analiza_filter'].': </label>';
echo '<label for="paraGraph_filter_pc"><input type="checkbox" id="paraGraph_filter_pc" '.($this->paraGraph_filter['pc']==1 ? ' checked="checked"' : '').' onClick="changeParaGraphFilter();">'.$lang['srv_para_graph_device0'].'</label>';
@@ -53,32 +53,43 @@ class SurveyParaGraph{
echo ' <label for="paraGraph_filter_tablet"><input type="checkbox" id="paraGraph_filter_tablet" '.($this->paraGraph_filter['tablet']==1 ? ' checked="checked"' : '').' onClick="changeParaGraphFilter();">'.$lang['srv_para_graph_device2'].'</label>';
echo ' <label for="paraGraph_filter_robot"><input type="checkbox" id="paraGraph_filter_robot" '.($this->paraGraph_filter['robot']==1 ? ' checked="checked"' : '').' onClick="changeParaGraphFilter();">'.$lang['srv_para_graph_device3'].'</label>';
echo '&nbsp;&nbsp;&nbsp;<label>('.$lang['srv_para_graph_filteredCnt'].' '.$paraData['allCount'].')</label>';
- echo '</div>';
+ echo '</div>';/*/
- echo '<table style="width:100%">';
+ echo '<table class="parapodatki_table">';
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_device0'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['pcCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['pcCount'].'</span></span>';
+ echo '<th>'.$lang['srv_para_graph_device'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_para_graph_device0'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['pcCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['pcCount'].'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_device1'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['mobiCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['mobiCount'].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_device1'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['mobiCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['mobiCount'].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_device2'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['tabletCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['tabletCount'].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_device2'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['tabletCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['tabletCount'].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
@@ -87,7 +98,7 @@ class SurveyParaGraph{
echo '<th nowrap>'.$lang['srv_para_graph_device3'].'</th>';
echo '<td style="width:100%">';
echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['robotCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['robotCount'].'</span></span>';
+ echo ' <span >'.$paraData['robotCount'].'</span>';
echo '</td>';
echo '</tr>';
@@ -102,7 +113,12 @@ class SurveyParaGraph{
// Browser
echo '<fieldset><legend>'.$lang['srv_para_graph_browser'].'</legend>';
- echo '<table style="width:100%">';
+ echo '<table class="parapodatki_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_para_graph_browser'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
if(count($paraData['browser']) > 0){
if(count($paraData['browser']) > 1)
@@ -112,10 +128,12 @@ class SurveyParaGraph{
if($key != $lang['srv_para_graph_other_slo'] && $key != $lang['srv_para_graph_other_ang']){
echo '<tr>';
- echo '<th nowrap>'.$key.'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $browserCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$browserCnt.'</span></span>';
+ echo '<td>'.$key.'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $browserCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$browserCnt.'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
}
@@ -123,20 +141,24 @@ class SurveyParaGraph{
if(isset($paraData['browser'][$lang['srv_para_graph_other_slo']]) && $paraData['browser'][$lang['srv_para_graph_other_slo']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['browser'][$lang['srv_para_graph_other_slo']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['browser'][$lang['srv_para_graph_other_slo']].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
}
if(isset($paraData['browser'][$lang['srv_para_graph_other_ang']]) && $paraData['browser'][$lang['srv_para_graph_other_ang']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['browser'][$lang['srv_para_graph_other_ang']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['browser'][$lang['srv_para_graph_other_ang']].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
}
@@ -153,7 +175,12 @@ class SurveyParaGraph{
// Operacijski sistem
echo '<fieldset><legend>'.$lang['srv_para_graph_os'].'</legend>';
- echo '<table style="width:100%">';
+ echo '<table class="parapodatki_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_para_graph_os'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
if(count($paraData['os']) > 0){
if(count($paraData['os']) > 1)
@@ -163,10 +190,12 @@ class SurveyParaGraph{
if($key != $lang['srv_para_graph_other_slo'] && $key != $lang['srv_para_graph_other_ang']){
echo '<tr>';
- echo '<th nowrap>'.$key.'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $osCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$osCnt.'</span></span>';
+ echo '<td>'.$key.'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $osCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$osCnt.'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
@@ -174,20 +203,24 @@ class SurveyParaGraph{
if(isset($paraData['os'][$lang['srv_para_graph_other_slo']]) && $paraData['os'][$lang['srv_para_graph_other_slo']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['os'][$lang['srv_para_graph_other_slo']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['os'][$lang['srv_para_graph_other_slo']].'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
if(isset($paraData['os'][$lang['srv_para_graph_other_ang']]) && $paraData['os'][$lang['srv_para_graph_other_ang']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['os'][$lang['srv_para_graph_other_ang']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['os'][$lang['srv_para_graph_other_ang']].'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
@@ -236,7 +269,7 @@ class SurveyParaGraph{
'os' => array()
);
- $detect = New Mobile_Detect();
+ $detect = New \Detection\MobileDetect;
// Loop cez vse ustrezne respondente
while($rowu = mysqli_fetch_array($sqlu)){
@@ -382,13 +415,18 @@ class SurveyParaGraph{
function paraGraphFixOld(){
global $lang;
+ // Ce ni nastavljen broscap, ne naredimo nicesar
+ if(!get_cfg_var('browscap'))
+ return;
+
if(isset($_GET['refresh']) && $_GET['refresh'] == 1)
$sqlu = sisplet_query("SELECT id, useragent FROM srv_user WHERE ank_id='".$this->anketa."' AND last_status>'2' AND useragent!='' AND preview='0' AND deleted='0'");
else
$sqlu = sisplet_query("SELECT id, useragent FROM srv_user WHERE ank_id='".$this->anketa."' AND last_status>'2' AND useragent!='' AND browser='' AND preview='0' AND deleted='0'");
+
if(mysqli_num_rows($sqlu) > 0){
- $detect = New Mobile_Detect();
+ $detect = New \Detection\MobileDetect;
$cnt = 0;
while($rowu = mysqli_fetch_array($sqlu)){