die; } if (isset($_GET["domains-show"])) { domains_show(); exit; } if (isset($_GET["domains-show-list"])) { domains_show_list(); exit; } if (isset($_GET["domain-info"])) { domain_info(); exit; } if (isset($_GET["groups"])) { groups(); exit; } if (isset($_GET["groups-show-list"])) { groups_list(); exit; } if (isset($_GET["members-js"])) { members_js(); exit; } if (isset($_GET["members-table"])) { members_table(); exit; } if (isset($_GET["members-show-list"])) {
function groupDispatch($op) { if (isset($_POST['undo'])) { $op = 'groups'; } if (isset($_POST['cancelselector'])) { $op = 'groups'; } if (isset($_POST['okselector'])) { $op = 'savemembers'; } switch ($op) { case "groups": groups(); break; case "subscribe": subscribe(); break; case "savemembers": savemembers(); break; case "editgroup": editgroup(); break; case "savegroup": savegroup(); break; case "delgroup": delgroup(); break; } }
function items() { include_once dirname(__FILE__) . "/ressources/class.squid.inc"; $tpl = new templates(); $squid = new squidbee(); $MyPage = CurrentPageName(); $q = new mysql_squid_builder(); $t = $_GET["t"]; $search = '%'; $table = "transparent_networks"; $page = 1; $FORCE_FILTER = null; $total = 0; $SSL = $squid->SSL_BUMP; if (!$q->TABLE_EXISTS("transparent_networks")) { $q->CheckTables(null, true); } if (isset($_POST["sortname"])) { if ($_POST["sortname"] != null) { $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}"; } } if (isset($_POST['page'])) { $page = $_POST['page']; } $searchstring = string_to_flexquery(); if ($searchstring != null) { $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER} {$searchstring}"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $total = $ligne["TCOUNT"]; } else { $total = $q->COUNT_ROWS($table); } if (isset($_POST['rp'])) { $rp = $_POST['rp']; } $pageStart = ($page - 1) * $rp; if (is_numeric($rp)) { $limitSql = "LIMIT {$pageStart}, {$rp}"; } $sql = "SELECT * FROM `{$table}` WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}"; $results = $q->QUERY_SQL($sql); $no_rule = $tpl->_ENGINE_parse_body("{no_item}"); $data = array(); $data['page'] = $page; $data['total'] = $total; $data['rows'] = array(); $fontsize = "18"; $color = "black"; $check32 = "<img src='img/check-32.png'>"; $arrow_right = "<img src='img/arrow-right-32.png'>"; $AllSystems = $tpl->_ENGINE_parse_body("{AllSystems}"); $AllDestinations = $tpl->_ENGINE_parse_body("{all_destinations}"); $local_proxy = $tpl->_ENGINE_parse_body("{local_proxy}"); $proxy = $local_proxy; $port = $tpl->_ENGINE_parse_body("{port}"); if (!$q->ok) { json_error_show($q->mysql_error . "<br>{$sql}", 1); } if (mysql_num_rows($results) == 0) { $data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>0</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>HTTP</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllSystems}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$arrow_right}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllDestinations} {$port} 80<div style='font-size:12px;text-align:right'>{$proxy}</div></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>")); if ($SSL == 0) { $color = "#8a8a8a"; $check32 = "<img src='img/check-32-grey.png'>"; $arrow_right = "<img src='img/arrow-right-32-grey.png'>"; } $data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>0</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>HTTPS</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllSystems}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$arrow_right}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>* - {$AllDestinations} {$port} 443<div style='font-size:12px;text-align:right'>{$proxy}</div></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'> </span>")); $data['total'] = 1; echo json_encode($data); return; } $all = $tpl->_ENGINE_parse_body("{all}"); $fontsize = "18"; $color = "black"; $check32 = "<img src='img/check-32.png'>"; $local_proxy = $tpl->_ENGINE_parse_body("{local_proxy}"); $redirect_to = $tpl->_ENGINE_parse_body("{redirect_to}"); $not = $tpl->_ENGINE_parse_body("{not} "); $AVAILABLE_MACROS["google"] = true; $AVAILABLE_MACROS["teamviewer"] = true; $AVAILABLE_MACROS["office365"] = true; $AVAILABLE_MACROS["skype"] = true; $AVAILABLE_MACROS["dropbox"] = true; while ($ligne = mysql_fetch_assoc($results)) { $color = "black"; $check32 = "<img src='img/check-32.png'>"; $check32T = "<img src='img/cloud-filtered-42.png'>"; $arrow_right = "<img src='img/arrow-right-32.png'>"; $proxy = $local_proxy; $ligne["remote_proxy"] = trim($ligne["remote_proxy"]); if (!preg_match("#^(.+?):(.+)#", $ligne["remote_proxy"])) { $ligne["remote_proxy"] = null; } $eth = $ligne["eth"]; if (is_numeric($eth)) { $eth = null; } if ($eth != null) { $eth = "{$eth}:"; } $isnot = null; if ($ligne["destination_port"] == 443) { $ligne["ssl"] = 1; } if ($ligne["destination_port"] == 80) { $ligne["ssl"] = 0; } if ($ligne["destination_port"] == 0) { $ligne["destination_port"] = 80; if ($ligne["ssl"] == 1) { $ligne["destination_port"] == 443; } } $proto = "HTTP"; $destination_port = "{$port} {$ligne["destination_port"]}"; if ($ligne["ssl"] == 1) { $proto = "HTTPS"; $destination_port = "{$port} {$ligne["destination_port"]}"; if ($SSL == 0) { $ligne["enabled"] = 0; } } if ($ligne["enabled"] == 0) { $color = "#8a8a8a"; $check32 = "<img src='img/check-32-grey.png'>"; $check32T = "<img src='img/cloud-filtered-42-grey.png'>"; if ($ligne["block"] == 1) { $check32T = "<img src='img/webpage-settings-32-grey.png'>"; } $arrow_right = "<img src='img/arrow-right-32-grey.png'>"; } if ($ligne["transparent"] == 0) { $check32T = "<img src='img/cloud-goto-42.png'>"; $proxy = null; } $delete = imgsimple("delete-32.png", null, "Loadjs('{$MyPage}?delete-js={$ligne["ID"]}&t={$_GET["t"]}',true)"); $pattern = $ligne["pattern"]; if ($ligne["remote_proxy"] == "*") { $ligne["remote_proxy"] = null; } if ($ligne["remote_proxy"] != null) { $proxy = "{$redirect_to} {$ligne["remote_proxy"]}"; } $link = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$MyPage}?item-js=yes&ID={$ligne["ID"]}&t={$_GET["t"]}',true)\"\n\t\tstyle='font-size:{$fontsize}px;font-weight:normal;color:{$color};text-decoration:underline'>"; if ($ligne["destination_port"] > 0) { $destination_port = "{$port} {$ligne["destination_port"]}"; } if ($ligne["destination"] == "*") { $ligne["destination"] = null; } $destination_clean = trim(strtolower($ligne["destination"])); if (isset($AVAILABLE_MACROS[$destination_clean])) { $ligne["destination"] = $tpl->javascript_parse_text("{macro}: {$destination_clean} {websites}"); } if ($ligne["destination"] == null) { $ligne["destination"] = "{$AllDestinations} {$destination_port}"; $proxy = null; } if ($ligne["isnot"] == 1) { $isnot = $not; } $up = imgsimple("arrow-up-32.png", null, "Loadjs('{$MyPage}?move-item-js=yes&ID={$ligne["ID"]}&dir=0&t={$_GET["t"]}')"); $down = imgsimple("arrow-down-32.png", null, "Loadjs('{$MyPage}?move-item-js=yes&ID={$ligne["ID"]}&dir=1&t={$_GET["t"]}')"); $groups = groups($ligne["ID"]); if ($groups[0] != null) { $ligne["pattern"] = $groups[0]; } if ($groups[1] != null) { $ligne["destination"] = $groups[1]; } if ($ligne["block"] == 1) { $check32T = "<img src='img/cloud-deny-42.png'>"; if ($ligne["enabled"] == 0) { $check32T = "<img src='img/cloud-deny-42-grey.png'>"; } } if ($ligne["pattern"] == null) { $ligne["pattern"] = "* - {$AllSystems}"; } if ($ligne["pattern"] == "*") { $ligne["pattern"] = "* - {$AllSystems}"; } $data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$ligne["zOrder"]}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$proto}</span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$isnot}{$link}{$eth}{$ligne["pattern"]}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$arrow_right}</a></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$ligne["destination"]}</a><div style='font-size:12px;text-align:right'>{$proxy}</div></span></span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32T}</span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$check32}</span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$up}</span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$down}</span>", "<span style='font-size:{$fontsize}px;font-weight:normal;color:{$color}'>{$delete}</span>")); } echo json_encode($data); }
if (is_null($params = parseParams($argc, $argv))) { usage(basename(__FILE__)); } if ($params['help']) { help(); exit; } $config = isset($params['c']) ? $params['c'] : 'test.xml'; include_once dirname(__FILE__) . '/../setup.php'; if (isset($params['t'])) { switch ($params['t']) { case 'period': $qty = count(periods()); break; case 'report': $qty = count(groups()); break; case 'basis': $qty = count(basis()); break; default: usage(basename(__FILE__)); } print $qty; exit; } if (!isset($params['f'])) { print "No input file given\n"; usage(basename(__FILE__)); } $dir = dirname(__FILE__);
$output .= ' </td> </tr> </table> </center>'; } //############################################################################# // MAIN //############################################################################# // error variable reserved for future use //$err = (isset($_GET['error'])) ? $_GET['error'] : NULL; //unset($err); $lang_group = lang_group(); $output .= ' <div class="top"> <h1>' . $lang_group['groups'] . '</h1> </div>'; // $_GET and SECURE $action = isset($_GET['action']) ? $_GET['action'] : NULL; // define functions to be called by actions if ('groups' == $action) { groups($sqlc); } elseif ('party' == $action) { party($sqlc); } else { groups($sqlc); } unset($action); unset($action_permission); unset($lang_group); require_once 'footer.php';
$sensor = $row['name']; echo "<span id='sens" . $id . "'><strong class='text-info'>" . $i . ".</strong> <big class=''>{$sensor} </big> <a class='text-muted glyphicon glyphicon-pencil' data-toggle='tooltip' title='Edit device type' href='javascript:editName({$id}, 0)'></a> <a class='text-danger glyphicon glyphicon-remove-circle' data-toggle='tooltip' title='Delete' href=" . "javascript:dels('{$sensor}')" . "></a></span><hr>"; $i++; } } else { echo "</br><div class='notice'><b>No Sensors added yet.</b></div>"; } } } if ($deviceId != null and $switchId != null) { mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT name FROM devices WHERE deviceId='{$deviceId}'"; $devnames = mysql_query($query); $devrow = mysql_fetch_assoc($devnames); $name = $devrow['name']; echo "<label> Name</label> <input type='text' id='dname' name='dname' placeholder='name the device' value='{$name}' required/> " . groups($switchId) . "<button class='btn btn-danger' id='{$deviceId}' type='button' onclick=" . "update('{$deviceId}','{$switchId}')" . ">Update</button> <button class='btn btn-info' id='{$deviceId}' type='button' onclick=" . "update(0,0)" . ">Cancel</button>"; } if ($updatedev != null and $updateswi != null) { mysql_select_db($dbname) or die(mysql_error()); if ($updatedev == 0 and $updateswi == 0) { display(); } if ($gid != null and $dname != null and ($updatedev != 0 and $updateswi != 0)) { //update only if both fields are not empty $query = "SELECT name FROM groups WHERE id='{$gid}'"; $grps = mysql_query($query); $grp = mysql_fetch_assoc($grps); $name = $grp['name']; if ($updateswi == 0) { //simply the device $query = "UPDATE devices SET devices.groupId = '{$gid}', devices.status=0, devices.name='{$dname}' WHERE devices.deviceId = '{$updatedev}'";
$_SESSION["after"] = isset($_SESSION["after"]) ? $_SESSION["after"] : ""; $_SESSION["count"] = isset($_SESSION["count"]) ? $_SESSION["count"] : 0; $_SESSION["page"] = isset($_SESSION["page"]) ? $_SESSION["page"] : 1; $_SESSION["query"] = isset($_SESSION["query"]) ? $_SESSION["query"] : ""; $_SESSION["action"] = isset($_SESSION["action"]) ? $_SESSION["action"] : ""; $request["action"] = isset($request["action"]) ? $request["action"] : ""; switch ($request["action"]) { case "login": login($request["username"], $request["password"]); break; case "logout": session_destroy(); header("Location: index.php"); break; case "groups": groups($request); break; default: if (!isset($_REQUEST["q"]) || $_REQUEST["q"] == "") { frontpage(); } else { search($_REQUEST); } break; } function frontpage() { global $useragent; /*if (loggedin()) { $header='<div id="navbarmenu"> <div id="navbarmenuicon"></div>
function groups($group_id = false) { global $db; $goods_groups_all = array(); // Загрузка групп товаров; $sql = "SELECT `id`, `name`, `new`, `seo_keywords`, `seo_description`, `update` FROM `goods_groups` WHERE " . ($group_id ? "`group_id` = '" . $group_id . "'" : "`group_id` IS NULL") . " AND `status` = '1' ORDER BY `position` ASC"; if ($groups = $db->all($sql)) { foreach ($groups as $key => $value) { // Загрузка вложенных групп; $value['groups'] = groups($value['id']); // Проверка вложенных групп; if (!$value['groups']) { unset($value['groups']); } // Добавление группы в список; $goods_groups_all[$value['id']] = $value; } } return $goods_groups_all; }
function groups($parent_id) { global $ausgabeformat, $global_counter, $local_counter, $question_type, $eval_id, $evalgroup_id; $query = "SELECT group_type FROM eval_group_template WHERE evalgroup_id = ?"; $type_statement = DBManager::get()->prepare($query); $query = "SELECT LOCATE('Freitext', `text`) > 0 FROM evalquestion WHERE evalquestion_id = ?"; $freetext_statement = DBManager::get()->prepare($query); $query = "SELECT evalquestion_id, `text`, type FROM evalquestion WHERE parent_id = ? ORDER BY position"; $questions_statement = DBManager::get()->prepare($query); $query = "SELECT COUNT(DISTINCT user_id)\n FROM evalanswer\n JOIN evalanswer_user USING(evalanswer_id)\n WHERE parent_id = ?"; $question_users_statement = DBManager::get()->prepare($query); $query = "SELECT evalgroup_id, child_type, title, template_id FROM evalgroup WHERE parent_id = ? ORDER BY position"; $statement = DBManager::get()->prepare($query); $statement->execute(array($parent_id)); while ($group = $statement->fetch(PDO::FETCH_ASSOC)) { // Heraussuchen, ob es sich um ein Freitext-Template handelt... $freetext_statement->execute(array($group['template_id'])); $freetype = $freetext_statement->fetchColumn(); $freetext_statement->closeCursor(); if ($group['child_type'] == 'EvaluationGroup') { $global_counter += 1; $local_counter = 0; echo " <tr><td class=\"" . ($ausgabeformat == 1 ? "table_header_bold" : "blank") . "\" align=\"LEFT\" colspan=\"2\">\n"; if (do_template("show_group_headline")) { echo " <b>" . $global_counter . ". " . formatReady($group['title']) . "</b> \n"; } else { echo " "; } } else { $local_counter += 1; $type_statement->execute(array($group['evalgroup_id'])); $group_type = $type_statement->fetchColumn() ?: 'normal'; $type_statement->closeCursor(); echo " <tr><td class=\"" . ($ausgabeformat == 1 ? "table_row_odd" : "blank") . "\" colspan=\"2\">\n"; if (do_template("show_questionblock_headline")) { echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"left\"><b>" . $global_counter . "." . $local_counter . ". " . formatReady($group['title']) . "</b></td>"; echo "<td align=\"RIGHT\">"; if ($ausgabeformat == 1 && !$freetype) { if ($group_type === 'normal') { echo '<a href="' . URLHelper::getLink('?eval_id=' . $eval_id . '&evalgroup_id=' . $group['evalgroup_id'] . '&group_type=table&cmd=change_group_type#anker') . '">'; echo Icon::create('vote-stopped', 'clickable', ['title' => sprintf(_('Zum Darstellungstyp %s wechseln'), _('Tabelle'))])->asImg(); echo '</a>'; } else { echo '<a href="' . URLHelper::getLink('?eval_id=' . $eval_id . '&evalgroup_id=' . $group['evalgroup_id'] . '&group_type=normal&cmd=change_group_type#anker') . '">'; echo Icon::create('vote', 'clickable', ['title' => sprintf(_('Zum Darstellungstyp %s wechseln'), _('Normal'))])->asImg(); } } else { echo ' '; } echo "</td>"; echo "</tr></table>\n"; } if ($evalgroup_id == $group['evalgroup_id']) { echo " <a name=\"anker\"></a>\n"; } } echo " </td></tr>"; if ($group['child_type'] == 'EvaluationQuestion') { echo " <tr><td class=\"blank\" colspan=\"2\">\n"; echo "<table border=\"" . ($group_type == "normal" || $ausgabeformat == 1 ? "0" : "1") . "\" width=\"100%\" cellspacing=\"0\">\n"; $local_question_counter = 0; $answer_arr = array(); $questions_statement->execute(array($group['evalgroup_id'])); while ($question = $questions_statement->fetch(PDO::FETCH_ASSOC)) { $question_type = $question['type']; $question_users_statement->execute(array($question['evalquestion_id'])); $question_users = $question_users_statement->fetchColumn(); $question_users_statement->closeCursor(); $local_question_counter += 1; if (do_template("show_questions") && $group_type == "normal") { echo " <tr><td class=\"blank\" colspan=\"2\">\n"; echo " <b>" . $global_counter . "." . $local_counter . "." . $local_question_counter . ". " . formatReady($question['text']) . "</b></font>\n"; echo " </td></tr>\n"; } if (!$freetype) { // Keine Freitext-Eingabe $ret = answers($question['evalquestion_id'], $question_users, $question['type']); $ret["frage"] = $question['text']; array_push($answer_arr, $ret); if ($group_type == "normal") { echo $ret["txt"]; } } else { // Freitext freetype_answers($question['evalquestion_id'], $question_users); } } $questions_statement->closeCursor(); if (!$freetype && $group_type == "table") { $antworten_angezeigt = FALSE; $i = 0; $has_residual = 0; foreach ($answer_arr as $k1 => $questions) { // Oberste Ebene, hier sind die Questions abgelegt if (!$antworten_angezeigt) { $i = 1; echo " <tr class=\"table_row_even\"><td><font size=\"-1\"> </font></td>"; foreach ($questions["antwort_texte"] as $k2 => $v2) { // 1. Unterebene, hier sind die Antworttexte abgelegt echo "<td><font size=\"-1\">" . $v2 . "</font></td>"; } echo "<td align=\"center\"><font size=\"-1\"><b>∑</b></font></td><td align=\"center\"><font size=\"-1\"><b>∅</b></font></td><td align=\"center\"><font size=\"-1\">" . _("Teilnehmer") . "</font></td>"; echo "</tr>"; $antworten_angezeigt = TRUE; } echo "<tr " . ($i == 1 ? 'class="content_body"' : '') . ">"; echo " <td><font size=\"-1\">" . $questions["frage"] . "</font></td>"; foreach ($questions["auswertung"] as $k3 => $v3) { echo "<td width=\"10%\" valign=\"TOP\"><font size=\"-1\">"; echo $v3[0] . " (" . $v3[1] . "%)"; // 2. Unterebene, hier sind die Zahlen abgelegt if ($v3[2]) { echo " (" . $v3[2] . "%)<b>*</b>"; } echo "</font></td>"; } $i = 0; if ($questions["has_residual"]) { $has_residual = 1; } echo "<td align=\"center\" width=\"3%\" valign=\"TOP\"><font size=\"-1\">" . $questions["summe_antworten"] . "</font></td><td align=\"center\" width=\"3%\" valign=\"TOP\"><font size=\"-1\">" . $questions["antwort_durchschnitt"] . ($questions["has_residual"] ? "<b>*</b>" : "") . "</font></td><td align=\"center\" width=\"6%\" valign=\"TOP\"><font size=\"-1\">" . $questions["anzahl_teilnehmer"] . "</font></td>"; echo "</tr>"; } if ($has_residual) { echo "<tr><td><font size=\"-1\"><b>*</b>" . _("Werte ohne Enthaltungen") . ".</font></td></tr>"; } } echo "</table>\n"; echo "</td></tr>\n"; } groups($group['evalgroup_id']); } }
function groups($parent_id) { global $cssSw, $ausgabeformat, $fo_file, $auth, $global_counter, $local_counter, $tmp_path_export, $pattern, $replace; $query = "SELECT group_type FROM eval_group_template WHERE evalgroup_id = ?"; $type_statement = DBManager::get()->prepare($query); $query = "SELECT LOCATE('Freitext', `text`) > 0 FROM evalquestion WHERE evalquestion_id = ?"; $freetext_statement = DBManager::get()->prepare($query); $query = "SELECT evalquestion_id, `text`, type FROM evalquestion WHERE parent_id = ? ORDER BY position"; $questions_statement = DBManager::get()->prepare($query); $query = "SELECT COUNT(DISTINCT user_id)\n FROM evalanswer\n JOIN evalanswer_user USING(evalanswer_id)\n WHERE parent_id = ?"; $question_users_statement = DBManager::get()->prepare($query); $query = "SELECT evalgroup_id, child_type, title, template_id FROM evalgroup WHERE parent_id = ? ORDER BY position"; $statement = DBManager::get()->prepare($query); $statement->execute(array($parent_id)); while ($group = $statement->fetch(PDO::FETCH_ASSOC)) { // Heraussuchen, ob es sich um ein Freitext-Template handelt... $freetext_statement->execute(array($group['template_id'])); $freetype = $freetext_statement->fetchColumn(); $freetext_statement->closeCursor(); if ($group['child_type'] == 'EvaluationGroup') { $global_counter += 1; $local_counter = 0; fputs($fo_file, " <!-- Groupblock -->\n"); fputs($fo_file, " <fo:block font-variant=\"small-caps\" font-weight=\"bold\" text-align=\"start\" space-after.optimum=\"2pt\" background-color=\"lightblue\" space-before.optimum=\"10pt\">\n"); if (do_template("show_group_headline")) { fputs($fo_file, " " . $global_counter . ". " . xml_escape($group['title']) . "\n"); } fputs($fo_file, " </fo:block>\n"); } else { $local_counter += 1; $type_statement->execute(array($group['evalgroup_id'])); $group_type = $type_statement->fetchColumn() ?: 'normal'; $type_statement->closeCursor(); fputs($fo_file, " <!-- Questionblock -->\n"); fputs($fo_file, " <fo:block font-variant=\"small-caps\" font-weight=\"bold\" text-align=\"start\" background-color=\"grey\" color=\"white\" space-after.optimum=\"10pt\">\n"); if (do_template("show_questionblock_headline")) { fputs($fo_file, " " . $global_counter . "." . $local_counter . ". " . xml_escape($group['title']) . "\n"); } fputs($fo_file, " </fo:block>\n"); } if ($group['child_type'] == 'EvaluationQuestion') { $local_question_counter = 0; $answer_arr = array(); $questions_statement->execute(array($group['evalgroup_id'])); while ($question = $questions_statement->fetch(PDO::FETCH_ASSOC)) { $question_users_statement->execute(array($question['evalquestion_id'])); $question_users = $question_users_statement->fetchColumn(); $question_users_statement->closeCursor(); if ($group_type == "normal") { $local_question_counter += 1; fputs($fo_file, " <!-- Question -->\n"); fputs($fo_file, " <fo:block text-align=\"start\" font-weight=\"bold\" space-before.optimum=\"10pt\" space-after.optimum=\"10pt\">\n"); if (do_template("show_questions")) { fputs($fo_file, " " . $global_counter . "." . $local_counter . "." . $local_question_counter . ". " . xml_escape($question['text']) . "\n"); } fputs($fo_file, " </fo:block>\n"); fputs($fo_file, " <!-- table start -->\n"); fputs($fo_file, " <fo:table table-layout=\"fixed\" border-width=\".1mm\" space-after.optimum=\"10pt\">\n"); if (!$freetype) { fputs($fo_file, " <fo:table-column column-width=\"100mm\"/>\n"); fputs($fo_file, " <fo:table-column column-width=\"60mm\"/>\n"); } else { fputs($fo_file, " <fo:table-column column-width=\"160mm\"/>\n"); } fputs($fo_file, " <fo:table-body>\n"); fputs($fo_file, " <fo:table-row >\n"); fputs($fo_file, " <fo:table-cell ><fo:block start-indent=\"3mm\" end-indent=\"3mm\" padding-left=\"3mm\" padding-right=\"3mm\" padding-top=\"4mm\" padding-bottom=\"4mm\">\n"); fputs($fo_file, " <!-- table start -->\n"); fputs($fo_file, " <fo:table table-layout=\"fixed\">\n"); if (!$freetype) { fputs($fo_file, " <fo:table-column column-width=\"60mm\"/>\n"); fputs($fo_file, " <fo:table-column column-width=\"40mm\"/>\n"); } else { fputs($fo_file, " <fo:table-column column-width=\"160mm\"/>\n"); } fputs($fo_file, " <fo:table-body>\n"); } // ($group_type=="normal") if (!$freetype) { // Keine Freitext-Eingabe $ret = answers($question['evalquestion_id'], $question_users, $question['type']); $ret["frage"] = $question['text']; array_push($answer_arr, $ret); if ($group_type == "normal") { fputs($fo_file, $ret["txt"]); } } else { // Freitext freetype_answers($question['evalquestion_id'], $question_users); } if ($group_type == "normal") { fputs($fo_file, " </fo:table-body>\n"); fputs($fo_file, " </fo:table>\n"); fputs($fo_file, " <!-- table end -->\n"); fputs($fo_file, " </fo:block></fo:table-cell>\n"); if (!$freetype) { fputs($fo_file, " <fo:table-cell ><fo:block start-indent=\"3mm\" end-indent=\"3mm\" padding-left=\"3mm\" padding-right=\"3mm\" padding-top=\"4mm\" padding-bottom=\"4mm\">\n"); if (do_template("show_graphics")) { fputs($fo_file, " <fo:external-graphic content-width=\"70mm\" content-height=\"60mm\" src=\"url('file:///" . $tmp_path_export . "/evalsum" . $question['evalquestion_id'] . $auth->auth["uid"] . "." . $GLOBALS['EVAL_AUSWERTUNG_GRAPH_FORMAT'] . "')\"/>\n"); } fputs($fo_file, " </fo:block></fo:table-cell>\n"); } fputs($fo_file, " </fo:table-row>\n"); fputs($fo_file, " </fo:table-body>\n"); fputs($fo_file, " </fo:table>\n"); fputs($fo_file, " <!-- table end -->\n"); } // ($group_type=="normal") } if (!$freetype && $group_type == "table") { $antworten_angezeigt = FALSE; $i = 0; $has_residual = 0; $col_count = count($answer_arr[0]["antwort_texte"]); fputs($fo_file, " <!-- table start -->\n"); fputs($fo_file, " <fo:table table-layout=\"fixed\" border-width=\".1mm\" border-style=\"solid\" space-after.optimum=\"10pt\">\n"); fputs($fo_file, " <fo:table-column/>\n"); for ($a = 1; $a <= $col_count; $a++) { fputs($fo_file, " <fo:table-column column-width=\"15mm\"/>\n"); } fputs($fo_file, " <fo:table-column column-width=\"8mm\"/>\n"); fputs($fo_file, " <fo:table-column column-width=\"8mm\"/>\n"); fputs($fo_file, " <fo:table-column column-width=\"15mm\"/>\n"); fputs($fo_file, " <fo:table-body>\n"); foreach ($answer_arr as $k1 => $questions) { // Oberste Ebene, hier sind die Questions abgelegt if (!$antworten_angezeigt) { $i = 1; fputs($fo_file, " <fo:table-row >\n"); fputs($fo_file, " <fo:table-cell ><fo:block space-before.optimum=\"10pt\">\n"); fputs($fo_file, " </fo:block></fo:table-cell >"); foreach ($questions["antwort_texte"] as $k2 => $v2) { // 1. Unterebene, hier sind die Antworttexte abgelegt fputs($fo_file, " <fo:table-cell ><fo:block space-before.optimum=\"10pt\" font-size=\"7pt\">\n"); fputs($fo_file, xml_escape($v2)); fputs($fo_file, " </fo:block></fo:table-cell >"); } fputs($fo_file, " <fo:table-cell ><fo:block text-align=\"center\" space-before.optimum=\"10pt\" font-size=\"7pt\" font-family=\"Symbol\">\n"); fputs($fo_file, "∑"); fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " <fo:table-cell ><fo:block text-align=\"center\" space-before.optimum=\"10pt\" font-size=\"7pt\" font-family=\"Symbol\">\n"); fputs($fo_file, "∅"); fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " <fo:table-cell ><fo:block text-align=\"center\" space-before.optimum=\"10pt\" font-size=\"7pt\">\n"); fputs($fo_file, _("Teilnehmer")); fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " </fo:table-row>\n"); $antworten_angezeigt = TRUE; } fputs($fo_file, " <fo:table-row >\n"); fputs($fo_file, " <fo:table-cell ><fo:block font-size=\"6pt\" start-indent=\"3mm\">\n"); fputs($fo_file, $questions["frage"]); fputs($fo_file, " </fo:block></fo:table-cell >"); foreach ($questions["auswertung"] as $k3 => $v3) { fputs($fo_file, " <fo:table-cell ><fo:block font-size=\"7pt\">\n"); fputs($fo_file, $v3[0] . " (" . $v3[1] . "%)"); // 2. Unterebene, hier sind die Zahlen abgelegt if ($v3[2]) { fputs($fo_file, " (" . $v3[2] . "%)*"); } fputs($fo_file, " </fo:block></fo:table-cell >"); } $i = 0; if ($questions["has_residual"]) { $has_residual = 1; } fputs($fo_file, " <fo:table-cell ><fo:block text-align=\"center\" font-size=\"7pt\">\n"); fputs($fo_file, $questions["summe_antworten"]); fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " <fo:table-cell ><fo:block text-align=\"center\" font-size=\"7pt\">\n"); fputs($fo_file, $questions["antwort_durchschnitt"] . ($questions["has_residual"] ? "*" : "")); fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " <fo:table-cell ><fo:block text-align=\"center\" font-size=\"7pt\">\n"); fputs($fo_file, $questions["anzahl_teilnehmer"]); fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " </fo:table-row>\n"); } fputs($fo_file, " <fo:table-row >\n"); fputs($fo_file, " <fo:table-cell ><fo:block start-indent=\"3mm\" space-after.optimum=\"10pt\" font-size=\"7pt\">\n"); if ($has_residual) { fputs($fo_file, "* " . _("Werte ohne Enthaltungen") . "."); } fputs($fo_file, " </fo:block></fo:table-cell >"); fputs($fo_file, " </fo:table-row >\n"); fputs($fo_file, " </fo:table-body>\n"); fputs($fo_file, " </fo:table>\n"); fputs($fo_file, " <!-- table end -->\n"); } } groups($group['evalgroup_id']); } }
$results = mysql_query($query); if (mysql_num_rows($results) > 0) { $i = 1; echo "</br></br><h2>Sensors available</h2>"; while ($row = mysql_fetch_assoc($results)) { //$id=$row['id']; $sensor = $row['name']; echo "<span style='color:#3B5998;font-weight:normal;'><b>" . $i . ".</b> <b>{$sensor} </b> <a href=" . "javascript:dels('{$sensor}')" . ">delete</a></span><hr>"; $i++; } } else { echo "</br><div class='notice'><b>No Sensors added yet.</b></div>"; } } if ($macid != null) { echo "<span id='{$macid}' style='color:#3B5998;font-weight:normal;'> <b>Allot group and sensor type</b> </br><b> </b><input type='text' name='dname' id='dname'> <b>Name </b></br><b>MAC id:</b> {$macid} " . groups() . " " . sensors() . "<button id='{$macid}' type='button' onclick=" . "update('{$macid}')" . ">Update</button></span><hr>"; } if ($update != null) { mysql_select_db($dbname) or die(mysql_error()); $query = "SELECT name FROM groups WHERE id='{$gid}'"; $grps = mysql_query($query); $grp = mysql_fetch_assoc($grps); $name = $grp['name']; if ($name == '') { $name = "<span style='color: #0088FF;'><b>New Device Found</b></span>"; } $query = "UPDATE devices SET devices.group = '{$gid}', devices.status='1', devices.name='{$dname}', devices.type='{$sentyp}' WHERE devices.macid = '{$update}'"; //updating item with group id if (!mysql_query($query, mysql_connect($dbhost, $dbuser, $dbpass))) { echo "UPDATE failed: {$query}<br/>" . mysql_error() . "<br/><br/>"; }
//aciennement ufdbguard.databases.php?scripts=config-file $usersmenus=new usersMenus(); if(!$usersmenus->AsDansGuardianAdministrator){ $tpl=new templates(); $alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}'); echo "alert('$alert');"; die(); } if(isset($_POST["DenyUfdbWriteConf"])){DenyUfdbWriteConf();exit;} if(isset($_POST["UFDB_CONTENT"])){UFDB_CONTENT();exit;} if(isset($_GET["tabs"])){tabs();exit;} if(isset($_GET["databases"])){databases();exit;} if(isset($_GET["database-items"])){databases_items();exit;} if(isset($_GET["conf"])){conf();exit;} if(isset($_GET["groups"])){groups();exit;} if(isset($_GET["debug-groups"])){debug_groups();exit;} js(); function js(){ header("content-type: application/x-javascript"); $page=CurrentPageName(); $tpl=new templates(); $title=$tpl->javascript_parse_text("{config_status}"); echo "YahooWin3('1000','$page?tabs=yes','$title',true)"; } function conf(){ $sock=new sockets(); $page=CurrentPageName();