From e12c2938465ac5722437559ee261eda9373d3a12 Mon Sep 17 00:00:00 2001 From: Ulrich Block Date: Sun, 17 Aug 2014 22:33:31 +0200 Subject: [PATCH] #30 New theme based on Bootstrap3 --- web/ajax.php | 68 ++++++++++++++----- web/js/adminlte/easy-wi.js | 51 ++++++++++++++ web/stuff/methods/functions.php | 2 +- web/stuff/user/userpanel_tickets.php | 4 +- web/stuff/user/userpanel_voice_usage.php | 2 +- .../ajax/ajax_userpanel_ticket_category.tpl | 3 + web/template/adminlte/general.tpl | 7 ++ .../global_gserver_file_template_add.tpl | 59 +++++++++------- .../global_gserver_file_template_dl.tpl | 31 +++++---- .../global_gserver_file_template_list.tpl | 2 +- .../global_gserver_file_template_md.tpl | 58 +++++++++------- 11 files changed, 199 insertions(+), 88 deletions(-) create mode 100644 web/template/adminlte/ajax/ajax_userpanel_ticket_category.tpl create mode 100644 web/template/adminlte/general.tpl diff --git a/web/ajax.php b/web/ajax.php index 53e55e72..576259ba 100644 --- a/web/ajax.php +++ b/web/ajax.php @@ -130,6 +130,9 @@ if ($ui->smallletters('w', 9, 'get') == 'datatable') { } } + // When searching a table combination that should provide a server and userĀ“s loginname, firstname, lastname. First do a search at usertable and get IDs. + // This IDs should be used for doing a `ID` IN (implode(',', $foundIDs)) as it will be faster. + die(json_encode($array)); } else if (isset($admin_id) and $pa['dedicatedServer'] and $ui->smallletters('d', 7, 'get') == 'freeips' and $reseller_id == 0) { @@ -178,23 +181,6 @@ if ($ui->smallletters('w', 9, 'get') == 'datatable') { die; -} else if (isset($user_id) and $pa['voiceserverStats'] and $ui->smallletters('d', 14, 'get') == 'uservoicestats' and $ui->st('w', 'get')) { - - $data = array(); - - if ($ui->st('w', 'get') == 'se') { - - $query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,m.`usedns` FROM `voice_server` v INNER JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`userid`=? AND v.`resellerid`=? AND v.`active`='Y' AND m.`active`='Y' ORDER BY v.`ip`,v.`port`"); - $query->execute(array($user_id, $resellerLockupID)); - foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { - $data[] = ''; - } - } - - require_once IncludeTemplate($template_to_use,'ajax_userpanel_voice_stats.tpl', 'ajax'); - - die; - } else if (isset($admin_id) and $pa['voiceserverStats'] and $ui->smallletters('d', 15, 'get') == 'adminvoicestats' and $ui->st('w', 'get')) { $data = array(); @@ -226,7 +212,53 @@ if ($ui->smallletters('w', 9, 'get') == 'datatable') { require_once IncludeTemplate($template_to_use,'ajax_admin_voice_stats.tpl', 'ajax'); + die; + +} else if (isset($user_id) and $pa['voiceserverStats'] and $ui->smallletters('d', 14, 'get') == 'uservoicestats' and $ui->st('w', 'get')) { + + $data = array(); + + if ($ui->st('w', 'get') == 'se') { + $query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,m.`usedns` FROM `voice_server` v INNER JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`userid`=? AND v.`resellerid`=? AND v.`active`='Y' AND m.`active`='Y' ORDER BY v.`ip`,v.`port`"); + $query->execute(array($user_id, $resellerLockupID)); + foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { + $data[] = ''; + } + } + + require_once IncludeTemplate($template_to_use,'ajax_userpanel_voice_stats.tpl', 'ajax'); + + die; + +} else if (isset($user_id) and $pa['usertickets'] and $ui->w('d', 20, 'get') == 'userTicketCategories' and $ui->id('topicName', 10, 'get')) { + + $table = array(); + + $query = $sql->prepare("SELECT * FROM `ticket_topics` WHERE `maintopic`=? AND `maintopic`!=`id` AND `resellerid`=? ORDER BY `id`"); + $query2 = $sql->prepare("SELECT `text` FROM `translations` WHERE `type`='ti' AND `lang`=? AND `transID`=? AND `resellerID`=? LIMIT 1"); + + $query->execute(array($ui->id('topicName', 10, 'get'), $reseller_id)); + foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) { + + $query2->execute(array($user_language, $row['id'], $reseller_id)); + $topic = $query2->fetchColumn(); + + if (empty($topic)) { + + $query2->execute(array($default_language, $row['id'], $reseller_id)); + $topic = $query2->fetchColumn(); + + if (empty($topic)) { + $topic = $row['topic']; + } + } + + $table[$row['id']] = $topic; + } + + require_once IncludeTemplate($template_to_use,'ajax_userpanel_ticket_category.tpl', 'ajax'); + die; } -die('No Access'); \ No newline at end of file +die('No Access:'.$ui->smallletters('d', 200, 'get')); \ No newline at end of file diff --git a/web/js/adminlte/easy-wi.js b/web/js/adminlte/easy-wi.js index 956b3660..110d12f5 100644 --- a/web/js/adminlte/easy-wi.js +++ b/web/js/adminlte/easy-wi.js @@ -52,4 +52,55 @@ function getdetails(file, str, id) { xmlhttp2.open("GET", file, true); xmlhttp2.send(); +} + +function SwitchShowHideRows (Element, change, showNotIfEmpty) { + + var TheRest = document.getElementsByTagName('div'); + var amount = TheRest.length; + var ElementLenght = Element.length; + var foundAmount = 0; + + if(typeof(change)==='undefined') { + change = 'switch'; + } + + for(var x=0; xtopic . ' #' . $shorten; + $value = $sprache['topic'] . ' #' . $shorten; $topic = $value; } diff --git a/web/stuff/user/userpanel_tickets.php b/web/stuff/user/userpanel_tickets.php index 0bca8544..d077e50b 100644 --- a/web/stuff/user/userpanel_tickets.php +++ b/web/stuff/user/userpanel_tickets.php @@ -172,7 +172,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) { $default_language = $rSA['language']; $query = $sql->prepare("SELECT * FROM `tickets` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1"); - $query2 = $sql->prepare("SELECT t.*,u.`cname`,u.`name`,u.`vname` FROM `tickets_text` t LEFT JOIN `userdata` u ON t.`userID`=u.`id` WHERE t.`ticketID`=? AND t.`resellerID`=? ORDER BY t.`writeDate`"); + $query2 = $sql->prepare("SELECT t.*,u.`cname`,u.`name`,u.`vname` FROM `tickets_text` t LEFT JOIN `userdata` u ON t.`userID`=u.`id` WHERE t.`ticketID`=? AND t.`resellerID`=? ORDER BY t.`writeDate` DESC"); $query3 = $sql->prepare("SELECT `text` FROM `translations` WHERE `type`='ti' AND `lang`=? AND `transID`=? AND `resellerID`=? LIMIT 1"); $query4 = $sql->prepare("SELECT `topic` FROM `ticket_topics` WHERE `id`=? AND `resellerid`=? LIMIT 1"); @@ -181,7 +181,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) { $userPriority = $row['userPriority']; - $query2->execute(array($id,$reseller_id)); + $query2->execute(array($id, $reseller_id)); foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) { $table[] = array('writedate' => ($user_language == 'de') ? date('d.m.Y H:i:s',strtotime($row2['writeDate'])) : $row2['writeDate'], 'ticket' => nl2br(htmlspecialchars(stripslashes($row2['message']))),'writer' => (trim($row2['vname'] . ' ' . $row2['name']) != '') ? trim($row2['vname'] . ' ' . $row2['name']) : $row2['cname']); } diff --git a/web/stuff/user/userpanel_voice_usage.php b/web/stuff/user/userpanel_voice_usage.php index dbb57612..30bcd42b 100644 --- a/web/stuff/user/userpanel_voice_usage.php +++ b/web/stuff/user/userpanel_voice_usage.php @@ -95,7 +95,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) { $query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,m.`usedns` FROM `voice_server` v INNER JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`id`=? AND v.`userid`=? AND v.`resellerid`=? LIMIT 1"); $query->execute(array($ui->id('serverID', 30, 'post'), $user_id, $reseller_id)); foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) { - $display = $sprache->server . ' ' . $row['ip'] . ':' . $row['port']; + $display = $row['ip'] . ':' . $row['port']; } $query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,m.`usedns` FROM `voice_server` v INNER JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`userid`=? AND v.`resellerid`=? ORDER BY v.`ip`,v.`port`"); diff --git a/web/template/adminlte/ajax/ajax_userpanel_ticket_category.tpl b/web/template/adminlte/ajax/ajax_userpanel_ticket_category.tpl new file mode 100644 index 00000000..cc867e75 --- /dev/null +++ b/web/template/adminlte/ajax/ajax_userpanel_ticket_category.tpl @@ -0,0 +1,3 @@ +$v){ ?> +> + \ No newline at end of file diff --git a/web/template/adminlte/general.tpl b/web/template/adminlte/general.tpl new file mode 100644 index 00000000..9dc0ed56 --- /dev/null +++ b/web/template/adminlte/general.tpl @@ -0,0 +1,7 @@ +
+
+
+ +
+
+
\ No newline at end of file diff --git a/web/template/adminlte/global_gserver_file_template_add.tpl b/web/template/adminlte/global_gserver_file_template_add.tpl index 72d70141..ea1c912c 100644 --- a/web/template/adminlte/global_gserver_file_template_add.tpl +++ b/web/template/adminlte/global_gserver_file_template_add.tpl @@ -1,7 +1,7 @@

template.' '.$gsprache->add;?>

@@ -12,36 +12,43 @@
- 0){ ?> -
- -

errors;?>

- -
- -
- - -
- - + 0){ ?> +
+ +

errors;?>

+
-
- + + + + + + + +
+ + +
+ +
+ -
-
-
- - -
-
+
+ +
+ + +
+ +
+ + +
+
+
- - -
\ No newline at end of file diff --git a/web/template/adminlte/global_gserver_file_template_dl.tpl b/web/template/adminlte/global_gserver_file_template_dl.tpl index 64e5a982..7a8c9864 100644 --- a/web/template/adminlte/global_gserver_file_template_dl.tpl +++ b/web/template/adminlte/global_gserver_file_template_dl.tpl @@ -1,7 +1,7 @@

template.' '.$gsprache->del;?>