summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyQuotas.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyQuotas.php')
-rw-r--r--admin/survey/classes/class.SurveyQuotas.php231
1 files changed, 115 insertions, 116 deletions
diff --git a/admin/survey/classes/class.SurveyQuotas.php b/admin/survey/classes/class.SurveyQuotas.php
index 7f71e73..4059521 100644
--- a/admin/survey/classes/class.SurveyQuotas.php
+++ b/admin/survey/classes/class.SurveyQuotas.php
@@ -154,37 +154,46 @@ class SurveyQuotas {
echo '<div class="popup_close"><a href="#" onClick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">✕</a></div>';
- echo '<div id="quota_editing_inner">';
+ echo '<div id="quota_editing_inner" class="podatki">';
$this->quota_editing_inner($condition, $vrednost);
echo '</div>';
- echo '<div id="bottom_space">';
+ echo '<div id="bottom_options">';
$row = Cache::srv_spremenljivka(-$condition);
- if ($condition < 0) {
- echo '<p style="float:left; padding:0; margin:0; margin-left:20px">'.$lang['srv_variable'].': <input type="text" id="variable_'.(-$condition).'" value="'.$row['variable'].'" onkeyup="quota_edit_variable(\''.-$condition.'\');" style="width:60px" /></p>';
+ if ($condition < 0) {
+ echo '<div class="setting_horizontal_wrapper">';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['srv_variable'].':</label>';
+ echo ' <input type="text" id="variable_'.(-$condition).'" class="large" value="'.$row['variable'].'" onkeyup="quota_edit_variable(\''.-$condition.'\');" />';
+ echo '</div>';
+
+ echo '</div>';
}
+ echo '</div>';
- echo '<div id="condition_editing_close">';
- // kvota kot spremenljivka (lahko jo zbrisemo)
- if ($condition < 0) {
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="brisi_spremenljivko(\''.(-$condition).'\'); return false;"><span>'.$lang['srv_anketadelete_txt'].'</span></a>';
- echo '</span>';
- }
+ echo '<div id="condition_editing_close" class="podatki">';
+ echo ' <div class="button_holder">';
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
+ // kalkulacija kot spremenljivka (lahko jo zbrisemo)
+ if ($condition < 0)
+ echo ' <button class="medium white-blue" onclick="brisi_spremenljivko(\''.(-$condition).'\'); return false;">'.$lang['srv_anketadelete_txt'].'</button>';
- echo '<span class="buttonwrapper floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
-
- echo '</div>';
+ echo ' <button class="medium white-blue" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium blue" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">'.$lang['srv_potrdi'].'</button>';
+
+ echo ' </div>';
echo '</div>';
+
+
+ ?><script>
+ $('#quota_editing_inner').sortable({items: 'form', handle: '.move', stop: function () {
+ quota_sort(<?=$condition?>);
+ } });
+ </script><?
}
private function quota_editing_inner ($condition, $vrednost=0) {
@@ -192,23 +201,16 @@ class SurveyQuotas {
echo '<div class="quota_editing_preview">';
- echo '<h2>'.$lang['srv_quota'].'</h2>';
+ echo '<h2><span class="blue faicon edit"></span>'.$lang['srv_quota'].'</h2>';
echo '<div id="quota_editing_calculations">';
echo $this->quota_display($condition, 1);
echo '</div>';
+
echo '</div>';
- echo '<div class="condition_editing_body">';
- echo '<h2>'.$lang['srv_edit_quota'].'</h2>';
- echo '</div>';
-
- // Vrednost kvote
- /*$rowS = Cache::srv_spremenljivka(-$condition);
- echo '<div id="quota_value_holder">';
- echo $lang['srv_quota_value'].': ';
- echo ' <input type="text" name="value" id="quota_value" value="'.$rowS['vsota_limit'].'" style="width:50px" onkeypress="checkNumber(this, 6, 0);" onkeyup="checkNumber(this, 9, 0);" onBlur="quota_value_edit(\''.$rowS['id'].'\');">';
- echo '</div>';*/
-
+
+ echo '<div class="quota_editing_body">';
+
$sql = sisplet_query("SELECT id FROM srv_quota WHERE cnd_id = '$condition' ORDER BY vrstni_red");
if (mysqli_num_rows($sql) == 0) {
sisplet_query("INSERT INTO srv_quota (id, cnd_id, vrstni_red) VALUES ('', '$condition', '1')");
@@ -218,12 +220,14 @@ class SurveyQuotas {
$this->quota_edit($row['id'], $vrednost);
}
- echo '<p id="quota_editing_operators" style="margin-left:62px">'.$lang['srv_add_cond'].':
- <a href="#" onclick="quota_add(\''.$condition.'\', \'0\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;+&nbsp;</strong></a>,
- <a href="#" onclick="quota_add(\''.$condition.'\', \'1\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;-&nbsp;</strong></a>,
- <a href="#" onclick="quota_add(\''.$condition.'\', \'2\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;*&nbsp;</strong></a>,
- <a href="#" onclick="quota_add(\''.$condition.'\', \'3\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;/&nbsp;</strong></a>
- </p>';
+ echo '<p id="quota_editing_operators" class="div_quota_bottom">'.$lang['srv_add_cond'].':
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'0\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;+&nbsp;</strong></a>,
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'1\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;-&nbsp;</strong></a>,
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'2\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;*&nbsp;</strong></a>,
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'3\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;/&nbsp;</strong></a>
+ </p>';
+
+ echo '</div>';
}
/**
@@ -251,74 +255,76 @@ class SurveyQuotas {
if (!$sql_count) die();
$row_count = mysqli_fetch_array($sql_count);
- if ($row['vrstni_red'] == 1 && $row_count['count'] > 1) {
- echo '<table class="tbl_condition_editing">';
- echo '<tr>';
- echo '<th style="text-align:center; width:50px">'.$lang['srv_oklepaji'].'</th>'; // gumbi oklepaji
- echo '<th style="width:70px">&nbsp;</th>'; // logicni operatorji
- echo '<th style="width:50px">&nbsp;</th>'; // oklepaji
- echo '<th >&nbsp;</th>';
- echo '<th style="text-align:center; width:50px;">'.$lang['srv_zaklepaji'].'</th>'; // gumbi zaklepaji
- echo '<th style="text-align:center; width:60px">'.$lang['edit2'].'</th>'; // move
- echo '</tr>';
- echo '</table>';
-
- } elseif ($row['vrstni_red'] == 1) {
- echo '<table class="tbl_condition_editing"><tr><th>&nbsp;</th></tr></table>';
+
+ // operator
+ if ($row['vrstni_red'] > 1) {
+ echo '<div class="condition_editing_row operator">';
+
+ if ($row['operator']==0)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'1\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;+&nbsp;</a>';
+ if ($row['operator']==1)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'2\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;-&nbsp;</a>';
+ if ($row['operator']==2)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'3\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;*&nbsp;</a>';
+ if ($row['operator']==3)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'0\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;/&nbsp;</a>';
+
+ echo '</div>';
}
+
// form
echo '<form name="quota_'.$quota.'" id="quota_'.$quota.'" action="" method="post" onsubmit="quota_edit(\''.$quota.'\'); return false;">'."\n\r";
- echo '<table class="tbl_condition_editing" style="margin-bottom:10px; padding-bottom:10px; background-color:white">';
- echo '<tr>';
+
+ echo '<div class="condition_editing_row">';
+
+ // move
+ echo '<div class="move_holder">';
+ if ($row_count['count'] != 1 )
+ echo '<span class="faicon move_updown move" title="'.$lang['srv_move'].'"></span>';
+ echo '</div>';
+
+ // Srednji bel del
+ echo '<div class="white_holder">';
// left_bracket
+ echo '<div class="column bracket left">';
+
if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add small"></span></a>';
- if ($row['left_bracket'] > 0)
- echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon add small"></span></a>';
- else
- echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- }
- else {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- }
- echo '</td>';
- // operator
- echo '<td class="tbl_ce_tb white" style="width:77px; text-align:center">';
+ echo '<div class="bracket_icons">';
- if ($row['vrstni_red'] == 1) {
- // nimamo nic..
- } else {
+ echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ if ($row['left_bracket'] > 0)
+ echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
+ else
+ echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- if ($row['operator']==0)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'1\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;+&nbsp;</a>';
- if ($row['operator']==1)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'2\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;-&nbsp;</a>';
- if ($row['operator']==2)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'3\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;*&nbsp;</a>';
- if ($row['operator']==3)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'0\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;/&nbsp;</a>';
- }
+ echo '</div>';
- echo '</td>';
+ echo '<div class="bracket_text">'.$lang['srv_oklepaji'].'</div>';
+ }
+ echo '</div>';
// left_bracket
- echo '<td class="tbl_ce_tb white" style="width:40px; text-align:center">';
+ echo '<div class="column display_bracket left">';
+
for ($i=$row['left_bracket']; $i>0; $i--) {
- echo ' ( '; }
- echo '</td>';
+ echo ' ( ';
+ }
+
+ echo '</div>';
// spremenljivka
- echo '<td class="tbl_ce_tb white" style="width:auto">';
+ echo '<div class="column variable">';
+
if ($row['spr_id']==0) echo '<span class="red">'.$lang['srv_select_spr'].'!</span>';
- echo '<br />';
- echo '<select name="quota_spremenljivka_'.$quota.'" id="quota_spremenljivka_'.$quota.'" size="1" style="width:150px" onchange="javascript:quota_edit(\''.$quota.'\', \''.$vrednost.'\');">'."\n\r";
+
+ echo '<select name="quota_spremenljivka_'.$quota.'" id="quota_spremenljivka_'.$quota.'" class="dropdown medium" size="1" style="width:150px" onchange="javascript:quota_edit(\''.$quota.'\', \''.$vrednost.'\');">'."\n\r";
echo '<option value="0"></option>';
@@ -443,61 +449,54 @@ class SurveyQuotas {
echo '</select>';
-
- // Vrednost kvote
- /*echo ' <input type="text" name="value" id="quota_value_'.$quota.'" value="'.$row['value'].'" style="width:40px" >';
- echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
- echo '$(document).ready(function() {' .
- ' $("input#quota_value_'.$quota.'").bind("blur", {}, function(e) {' .
- ' quota_edit(\''.$quota.'\', \''.$vrednost.'\'); return false; ' .
- ' });' .
- '});';
- echo '</script>';*/
-
-
- echo '<br />&nbsp;'."\n\r";
- echo '</td>';
+ echo '</div>';
// right_bracket
- echo '<td class="tbl_ce_tb white" style="width:40px; text-align:center">';
+ echo '<div class="column display_bracket right">';
+
for ($i=$row['right_bracket']; $i>0; $i--) {
echo ' ) ';
}
- echo '</td>';
+
+ echo '</div>';
// right_bracket buttons
+ echo '<div class="column bracket right">';
+
if ($row_count['count'] != 1 || $row['right_bracket']>0 || $row['left_bracket']>0) {
- echo '<td class="tbl_ce_lor" style="width:50px; text-align:center" nowrap>';
+
+ echo '<div class="bracket_icons">';
+
if ($row['right_bracket'] > 0)
echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'right\', \'minus\'); return false;" title="'.$lang['srv_zaklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
else
echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add small"></span></a>';
+ echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ echo '</div>';
+
+ echo '<div class="bracket_text">'.$lang['srv_zaklepaji'].'</div>';
}
- else {
- echo '<td class="tbl_ce_lor white" style="width:50px; text-align:center" nowrap>';
- }
- echo '</td>';
- // move
- echo '<td class="tbl_ce_bck_blue white" style="text-align:right; width:30px">';
- if ($row_count['count'] != 1 )
- echo '<img src="img_0/move_updown.png" class="move" title="'.$lang['srv_move'].'" />';
- echo '</td>';
+ echo '</div>';
+
+ echo '</div>';
+
// remove
- echo '<td class="tbl_ce_bck_blue white" style="text-align:left; width:30px">';
+ echo '<div class="delete_holder">';
+
$sql3 = sisplet_query("SELECT id FROM srv_quota WHERE cnd_id='$row[cnd_id]'");
if (mysqli_num_rows($sql3) != 1 )
echo ' <a href="#" onclick="quota_remove(\''.$row['cnd_id'].'\', \''.$quota.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span class="faicon delete icon-grey_dark_link delte-if-block"></span></a>'."\n\r";
- echo '</td>';
+
+ echo '</div>';
- echo '</tr>';
- echo '</table>';
+ echo '</div>';
echo '</form>'."\n\r";
}