Example #1
0
 function getCMSHTML()
 {
     registerClassPath("GSRaumgruppe", Util::getRootPath() . "FCalc/GSRaumgruppe/GSRaumgruppe.class.php");
     registerClassPath("GSRaumgruppe", Util::getRootPath() . "FCalc/GSRaumgruppe/GSRaumgruppe.class.php");
     registerClassPath("ObjektL", Util::getRootPath() . "personalKartei/ObjekteL/ObjektL.class.php");
     registerClassPath("mGSTaetigkeitGUI", Util::getRootPath() . "FCalc/GSTaetigkeit/mGSTaetigkeitGUI.class.php");
     registerClassPath("GSTaetigkeit", Util::getRootPath() . "FCalc/GSTaetigkeit/GSTaetigkeit.class.php");
     registerClassPath("GSQMPruefer", Util::getRootPath() . "FCalc/GSQM/GSQMPruefer.class.php");
     $html = "\n\t\t<script src=\"./lib/jquery.signaturepad.min.js\"></script>\n\t\t<style type=\"text/css\">\n\t\t\th3 {\n\t\t\t\tpadding:7px;\n\t\t\t\tmargin-top:30px;\n\t\t\t\tclear:both;\n\t\t\t\tborder-bottom:1px solid #97a652;\n\t\t\t\tmargin-left:-10px;\n\t\t\t\tmargin-right:-10px;\n\t\t\t\tbackground-color:rgb(" . mGSTaetigkeitGUI::$fillColor[0] . ", " . mGSTaetigkeitGUI::$fillColor[1] . ", " . mGSTaetigkeitGUI::$fillColor[2] . ");\n\t\t\t}\n\t\t\t\n\t\t\t.backgroundColor1 {\n\t\t\t\tbackground-color:rgb(" . mGSTaetigkeitGUI::$fillColor[0] . ", " . mGSTaetigkeitGUI::$fillColor[1] . ", " . mGSTaetigkeitGUI::$fillColor[2] . ");\n\t\t\t}\n\t\t\t\n\t\t\th4 {\n\t\t\t\tpadding-top:15px;\n\t\t\t\tpadding-bottom:15px;\n\t\t\t}\n\t\t\t\n\t\t\t.frameRight td {\n\t\t\t\tpadding-left:3px;\n\t\t\t\tpadding-top:3px;\n\t\t\t\tpadding-bottom:3px;\n\t\t\t\tcursor:pointer;\n\t\t\t}\n\t\t\t\n\t\t\t.frameRight tr:hover {\n\t\t\t\tbackground-color:rgb(" . mGSTaetigkeitGUI::$fillColor[0] . ", " . mGSTaetigkeitGUI::$fillColor[1] . ", " . mGSTaetigkeitGUI::$fillColor[2] . ");\n\t\t\t}\n\t\t\t\n\t\t\t.frameRight {\n\t\t\t\tborder-left:1px solid #97a652;\n\t\t\t\tpadding-left:10px;\n\t\t\t}\n\t\t\t\n\t\t\t.frameLeft td {\n\t\t\t\tpadding-top:3px;\n\t\t\t\tpadding-bottom:3px;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@media print { \n\t\t\t\t.frameRight {\n\t\t\t\t\tdisplay:none;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\th3 {\n\t\t\t\t\tpage-break-before:always;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\th2 + h3 {\n\t\t\t\t\t page-break-before:avoid;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t.buttonQuestion {\n\t\t\t\tfont-size:30px;\n\t\t\t\tpadding-top:40px;\n\t\t\t\tpadding-bottom:40px;\n\t\t\t\ttext-align:center;\n\t\t\t\twidth:120px;\n\t\t\t\tmargin-right:20px;\n\t\t\t}\n\t\t\t\n\t\t\t.box {\n\t\t\t\tmargin-top:20px;\n\t\t\t\twidth:420px;\n\t\t\t\tpadding:30px;\n\t\t\t\tborder-width:1px;\n\t\t\t\tborder-style:solid;\n\t\t\t\tborder-radius:5px;\n\t\t\t\tbox-shadow:2px 2px 2px #bbb;\n\t\t\t\tmargin-left:10px;\n\t\t\t\tmargin-bottom:20px;\n\t\t\t}\n\t\t\t\n\t\t\t#headerStep1 span, #headerStep2 span, #headerStep3 span, #headerStep4 span {\n\t\t\t\t/*-webkit-transform: translate(15px,200px) rotate(270deg);\n\t\t\t\t-moz-transform: translate(15px,200px) rotate(270deg);\n\t\t\t\t-o-transform: translate(15px,200px) rotate(270deg);\n\t\t\t\t-ms-transform: translate(15px,200px) rotate(270deg);\n\t\t\t\t-moz-transform-origin: top left;\n\t\t\t\t-webkit-transform-origin: top left;\n\t\t\t\t-o-transform-origin: top left;\n\t\t\t\t-ms-transform-origin: top left;*/\n\t\t\t}\n\t\t\t\n\t\t\t#headerStep1, #headerStep2, #headerStep3, #headerStep4 {\n\t\t\t\tborder-bottom-width:0px;\n\t\t\t\tborder-right-width:1px;\n\t\t\t\tborder-right-style:solid;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth:30px;\n\t\t\t\theight:450px;\n\t\t\t\tmargin-right:20px;\n\t\t\t}\n\t\t\t\n\t\t\t#step1, #step2, #step3, #step4 {\n\t\t\t\twidth:600px;\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmargin-top:40px;\n\t\t\t\tvertical-align: top;\n\t\t\t}\n\t\t\t\n\t\t\t#selectPruefer {\n\t\t\t\tlist-style-type: none;\n\t\t\t}\n\n\t\t\t#selectPruefer li, #selectCategories li {\n\t\t\t\tfont-size:15px;\n\t\t\t\tpadding:10px;\n\t\t\t}\n\t\t</style>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar CP_LV = {\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tvar CP_QM = {\n\t\t\t\tquestions: null,\n\t\t\t\tRaumGruppen: new Array(),\n\t\t\t\tqCounter: -1,\n\t\t\t\tcCounter: 0,\n\t\t\t\tcategories: null,\n\t\t\t\tanswers: {},\n\t\t\t\tauthor: null,\n\t\t\t\t\n\t\t\t\taddRaumGruppe: function(RaumGruppeID){\n\t\t\t\t\tif(\$.inArray(RaumGruppeID, CP_QM.RaumGruppen) >= 0){\n\t\t\t\t\t\tCP_QM.RaumGruppen.splice( \$.inArray(RaumGruppeID, CP_QM.RaumGruppen), 1 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCP_QM.RaumGruppen.push(RaumGruppeID);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.updateOrderDisplay();\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tupdateOrderDisplay: function(){\n\t\t\t\t\t\$('.orderDisplay').html('&nbsp;');\n\t\t\t\t\t\n\t\t\t\t\tfor(var i = 0; i < CP_QM.RaumGruppen.length; i++){\n\t\t\t\t\t\t\$('#orderDisplay'+CP_QM.RaumGruppen[i]).html(i + 1);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tdoQuestionsAgain: function(){\n\t\t\t\t\t\$('#step3').show();\n\t\t\t\t\t\$('#step4').hide();\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.qCounter = 0;\n\t\t\t\t\tCP_QM.cCounter = 0;\n\t\t\t\t\tCP_QM.answers = {};\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.showQuestion();\n\t\t\t\t\t\n\t\t\t\t\t\$('#headerStep4').css('background-color', 'white');\n\t\t\t\t\t\$('#headerStep3').css('background-color', '');\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tsave: function(){\n\t\t\t\t\tvar value = \$.jStorage.get('QM');\n\t\t\t\t\tif(!value){\n\t\t\t\t\t\t\$.jStorage.set('QM', [{ 'answers': CP_QM.answers, 'signature' : \$('.sigPad input[name=output]').val(), 'author' : CP_QM.author, 'timestamp' : Math.round(+new Date()/1000) }])\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue.push({ 'answers': CP_QM.answers, 'signature' : \$('.sigPad input[name=output]').val(), 'author' : CP_QM.author, 'timestamp' : Math.round(+new Date()/1000) });\n\t\t\t\t\t\t\$.jStorage.set('QM', value)\n\t\t\t\t\t}\n\t\t\t\t\tCP_QM.view();\n\t\t\t\t\t//console.log(\$.jStorage.get('QM'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tupload: function(){\n\t\t\t\t\t\$.ajax({url: './index.php?CC=FCalc&M=checkConnection', success: function(transport){\n\t\t\t\t\t\tif(transport != '1')\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tCustomerPage.rme('saveData', 'data='+JSON.stringify(\$.jStorage.get('QM')), function(){ /*\$.jStorage.deleteKey('QM');*/ });\n\t\t\t\t\t\t\n\t\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\t\terror: function(XMLHttpRequest, textStatus, errorThrown) {\n\t\t\t\t\t\tif(textStatus == 'timeout')\n\t\t\t\t\t\t\talert('Keine Verbindung zum Server!');\n\t\t\t\t\t\t\n\t\t\t\t\t},\n\t\t\t\t\t\n\t\t\t\t\ttype: 'GET'});\n\t\t\t\t\t\t\n/*\n\n\t\t\t\t\tvar value = \$.jStorage.get('QM');\n\t\t\t\t\tif(!value){\n\t\t\t\t\t\t\$('#view').html('Es wurden keine Prüfungen gespeichert');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor(var i = 0; i < value.length; i++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}*/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tview: function(){\n\t\t\t\t\tvar value = \$.jStorage.get('QM');\n\t\t\t\t\tif(!value){\n\t\t\t\t\t\t\$('#view').html('Es wurden keine Prüfungen gespeichert');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar s = '<ul>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t\tfor(var i = 0; i < value.length; i++){\n\t\t\t\t\t\t\tvar date = new Date(value[i].timestamp*1000);\n\t\t\t\t\t\t\tvar hours = date.getHours();\n\t\t\t\t\t\t\tvar minutes = date.getMinutes();\n\t\t\t\t\t\t\t//var seconds = date.getSeconds();\n\t\t\t\t\t\t\tvar year = date.getFullYear();\n\t\t\t\t\t\t\tvar month = date.getMonth();\n\t\t\t\t\t\t\tvar day = date.getDate();\n\n\n\t\t\t\t\t\t\ts += '<li>Prüfung vom '+day+'.'+month+'.'+year+', '+hours+':'+minutes+' Uhr</li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ts += '</ul>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\$('#view').html(s);\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tnew: function(){\n\t\t\t\t\t\$('#step1').show();\n\t\t\t\t\t\$('#step4').hide();\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.qCounter = -1;\n\t\t\t\t\tCP_QM.cCounter = 0;\n\t\t\t\t\tCP_QM.answers = {};\n\t\t\t\t\t\n\t\t\t\t\t//CP_QM.showQuestion();\n\n\t\t\t\t\t\$('#headerStep4').css('background-color', 'white');\n\t\t\t\t\t\$('#headerStep1').css('background-color', '');\n\t\t\t\t},\n\n\t\t\t\tstep2: function(authorID){\n\t\t\t\t\t\$('#step1').hide();\n\t\t\t\t\t\$('#step2').show();\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.author = authorID;\n\t\t\t\t\t\n\t\t\t\t\t\$('#headerStep1').css('background-color', 'white');\n\t\t\t\t\t\$('#headerStep2').css('background-color', '');\n\t\t\t\t\t\n\t\t\t\t},\n\n\t\t\t\tstep3: function(){\n\t\t\t\t\t\$('#step1').hide();\n\t\t\t\t\t\$('#step2').hide();\n\t\t\t\t\t\$('#step3').show();\n\t\t\t\t\t\n\t\t\t\t\t\$('#headerStep2').css('background-color', 'white');\n\t\t\t\t\t\$('#headerStep3').css('background-color', '');\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.nextQuestion();\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tstep4: function(){\n\t\t\t\t\t\$('#step3').hide();\n\t\t\t\t\t\$('#step4').show();\n\t\t\t\t\t\n\t\t\t\t\t\$('#headerStep3').css('background-color', 'white');\n\t\t\t\t\t\$('#headerStep4').css('background-color', '');\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.view();\n\t\t\t\t\t\n\t\t\t\t\t//console.log(CP_QM.answers);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tanswerQuestion: function(answer){\n\t\t\t\t\tif(typeof CP_QM.answers[CP_QM.cCounter] == 'undefined')\n\t\t\t\t\t\tCP_QM.answers[CP_QM.cCounter] = {};\n\t\t\t\t\t\t\n\t\t\t\t\tvar current = CP_QM.questions[CP_QM.RaumGruppen[CP_QM.cCounter]][CP_QM.qCounter];\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.answers[CP_QM.cCounter][CP_QM.qCounter] = {'answer' : answer, 'object' : current };\n\t\t\t\t\t\n\t\t\t\t\t//console.log(CP_QM.answers);\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.nextQuestion();\n\t\t\t\t},\n\n\t\t\t\tnextQuestion: function(){\n\t\t\t\t\tCP_QM.qCounter++;\n\t\t\t\t\t\n\t\t\t\t\tif(CP_QM.qCounter >= CP_QM.questions[CP_QM.RaumGruppen[CP_QM.cCounter]].length) {\n\t\t\t\t\t\tCP_QM.qCounter = 0;\n\t\t\t\t\t\tCP_QM.cCounter++;\n\t\t\t\t\t\tCP_QM.showCategoryBox();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(CP_QM.cCounter >= CP_QM.RaumGruppen.length){\n\t\t\t\t\t\tCP_QM.step4();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.showQuestion();\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tpreviousQuestion: function(){\n\t\t\t\t\tCP_QM.qCounter--;\n\t\t\t\t\t\n\t\t\t\t\tif(CP_QM.qCounter == -1) {\n\t\t\t\t\t\tCP_QM.cCounter--;\n\t\t\t\t\t\tCP_QM.qCounter = CP_QM.questions[CP_QM.RaumGruppen[CP_QM.cCounter]].length - 1;\n\t\t\t\t\t\tCP_QM.showCategoryBox();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(CP_QM.cCounter == -1){\n\t\t\t\t\t\t//CP_QM.step4();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.showQuestion();\n\n\t\t\t\t\t\n\t\t\t\t},\n\n\t\t\t\tshowQuestion: function(){\n\t\t\t\t\t\$('#buttonPreviousQuestion').removeAttr('disabled');\n\t\t\t\t\t\$('.buttonQuestion').css('background-color', '');\n\t\t\t\t\t\n\t\t\t\t\tif(CP_QM.qCounter == 0 && CP_QM.cCounter == 0)\n\t\t\t\t\t\t\$('#buttonPreviousQuestion').attr('disabled', 'disabled');\n\n\t\t\t\t\tif(typeof CP_QM.answers[CP_QM.cCounter] != 'undefined' && CP_QM.answers[CP_QM.cCounter][CP_QM.qCounter] != undefined){\n\t\t\t\t\t\tvar B = 'Nein';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(CP_QM.answers[CP_QM.cCounter][CP_QM.qCounter] == 1)\n\t\t\t\t\t\t\tB = 'Teils';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(CP_QM.answers[CP_QM.cCounter][CP_QM.qCounter] == 2)\n\t\t\t\t\t\t\tB = 'Ja';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\$('#button'+B).css('background-color', '#F5FFC5');\n\t\t\t\t\t}\n\n\t\t\t\t\t\$('#category').html(CP_QM.categories[CP_QM.RaumGruppen[CP_QM.cCounter]]);\n\t\t\t\t\t\$('#categoryInfo').html(CP_QM.categories[CP_QM.RaumGruppen[CP_QM.cCounter]]);\n\t\t\t\t\t\n\t\t\t\t\tvar current = CP_QM.questions[CP_QM.RaumGruppen[CP_QM.cCounter]][CP_QM.qCounter];\n\t\t\t\t\tvar q = current.label;\n\t\t\t\t\tif(current.turnusWoechentlich > 0)\n\t\t\t\t\t\tq += ' '+current.turnusWoechentlich+'xW';\n\t\t\t\t\t\t\n\t\t\t\t\tif(current.turnusMonatlich > 0)\n\t\t\t\t\t\tq += ' '+current.turnusMonatlich+'xM';\n\t\t\t\t\t\t\n\t\t\t\t\tif(current.turnusJaehrlich > 0)\n\t\t\t\t\t\tq += ' '+current.turnusJaehrlich+'xJ';\n\t\t\t\t\t\t\n\t\t\t\t\t\$('#question').html(q);\n\t\t\t\t\t\n\t\t\t\t\t\$('#qCounter').html((CP_QM.qCounter + 1)+'/'+CP_QM.questions[CP_QM.RaumGruppen[CP_QM.cCounter]].length);\n\t\t\t\t\t\$('#cCounter').html((CP_QM.cCounter + 1)+'/'+CP_QM.RaumGruppen.length);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tcloseCategoryBox: function(){\n\t\t\t\t\t\$('#categoryBox').hide();\n\t\t\t\t\t\$('#questionBox').show();\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tshowCategoryBox: function(){\n\t\t\t\t\t\$('#categoryBox').show();\n\t\t\t\t\t\$('#questionBox').hide();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\$(document).ready(function(){\n\t\t\t\t\$('#selectPruefer').attr('size', 10);\n\t\t\t});\n\t\t</script>";
     $OID = $_GET["OBJ"] / GSRaumgruppe::$mult;
     $O = new ObjektL($OID);
     switch ($_GET["A"]) {
         case "LV":
             if (file_exists(Util::getRootPath() . "specifics/CPLogo.png")) {
                 $html .= "<img src=\"../../specifics/CPLogo.png\" style=\"float:right;\" />";
             }
             $html .= "<h1>Leistungsverzeichnis</h1>\n\t\t\t\t\t<h2>für " . $O->A("objektName") . "</h2>";
             $GSR = anyC::get("GSRaumgruppe", "GSRaumgruppeObjektLID", $OID);
             $GSR->addOrderV3("GSRaumgruppeKuerzel");
             while ($R = $GSR->getNextEntry()) {
                 $html .= "<h3>" . $R->A("GSRaumgruppeKuerzel") . " (" . $R->A("GSRaumgruppeName") . ")</h3>\n\t\t\t\t\t\t<div style=\"max-width:1200px;\">";
                 $leftFrame = "<div style=\"width:490px;float:left;\" class=\"frameLeft\" id=\"frameLeft" . $R->getID() . "\">" . $this->leftFrame($R) . "</div>";
                 $rightFrame = "<div style=\"float:right;width:490px;margin-bottom:20px;\" class=\"frameRight\" id=\"frameRight" . $R->getID() . "\">" . $this->rightFrame($R) . "</div>";
                 $html .= "{$rightFrame}{$leftFrame}<div style=\"clear:both;\"></div></div>";
             }
             break;
         case "QM":
             $html .= "<h1>Qualitätsmanagement</h1>\n\t\t\t\t\t<h2>für " . $O->A("objektName") . "</h2>";
             $html .= "<h3 id=\"headerStep1\" class=\"borderColor1\"><span>" . $this->getStringImage("Prüfer") . "</span></h3><div id=\"step1\">\n\t\t\t\t\t<p>Bitte wählen Sie den Prüfer:</p>";
             $L = new HTMLList();
             $L->setListID("selectPruefer");
             #$pruefer = array(0 => "bitte auswählen...");
             #$Users = Users::getUsers();
             $ACP = anyC::get("GSQMPruefer");
             $ACP->addJoinV3("Personal", "GSQMPrueferPersonalID", "=", "PersonalID");
             $ACP->addOrderV3("nachname");
             $ACP->addOrderV3("vorname");
             while ($U = $ACP->getNextEntry()) {
                 $L->addItem("<a href=\"#\" onclick=\"CP_QM.step2(" . $U->getID() . "); return false;\">" . $U->A("nachname") . " " . $U->A("vorname") . "</a>");
             }
             #$pruefer[$U->getID()] = $U->A("name");
             #$IU = new HTMLInput("pruefer", "select", "0", $pruefer);
             #$IU->onchange("if(this.value > 0) CP_QM.step2();");
             #$IU->id("selectPruefer");
             #$IU->style("width:400px;");
             $html .= $L;
             $html .= "</div>\n\t\t\t\t\t<h3 id=\"headerStep2\" style=\"background-color:white;\" class=\"borderColor1\"><span>" . $this->getStringImage("Kategorienauswahl") . "</span></h3>\n\t\t\t\t\t<div id=\"step2\" style=\"display:none;\">\n\t\t\t\t\t\n\t\t\t\t\t<p>Bitte wählen Sie die Kategorien in der Reihenfolge, in der Sie prüfen möchten:</p>\n\t\t\t\t\t<ul style=\"list-style-type:none;\" id=\"selectCategories\">";
             $GSR = anyC::get("GSRaumgruppe", "GSRaumgruppeObjektLID", $OID);
             $GSR->addOrderV3("GSRaumgruppeKuerzel");
             $data = array();
             $categories = array();
             while ($R = $GSR->getNextEntry()) {
                 $html .= "\n\t\t\t\t\t\t<li style=\"margin-bottom:10px;\">\n\t\t\t\t\t\t\t<div style=\"width:30px;float:left;margin-right:10px;text-align:right;font-weight:bold;\" class=\"orderDisplay\" id=\"orderDisplay" . $R->getID() . "\">&nbsp;</div>\n\t\t\t\t\t\t\t<div style=\"margin-left:40px;\"><a href=\"#\" onclick=\"CP_QM.addRaumGruppe(" . $R->getID() . "); return false;\">" . $R->A("GSRaumgruppeKuerzel") . "\n\t\t\t\t\t\t\t<span style=\"color:grey;\">(" . $R->A("GSRaumgruppeName") . ")</span></div></a>\n\t\t\t\t\t\t</li>";
                 $data[$R->getID()] = json_encode($R->getQuestions());
                 $categories[$R->getID()] = $R->A("GSRaumgruppeName");
             }
             $GSR->resetPointer();
             $BOK = new Button("Weiter", "");
             $BOK->onclick("CP_QM.step3();");
             $html .= "\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tCP_QM.questions = {";
             foreach ($data as $RGID => $D) {
                 $html .= "\n" . $RGID . ": {$D},";
             }
             $html .= "\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tCP_QM.categories = " . json_encode($categories) . ";\n\t\t\t\t</script>";
             $html .= "</ul>\n\t\t\t\t\t{$BOK}\n\t\t\t\t\t</div>";
             $BJa = new Button("Ja");
             $BJa->onclick("CP_QM.answerQuestion(2);");
             $BJa->id("buttonJa");
             $BJa->className("buttonQuestion");
             $BTeils = new Button("Teils");
             $BTeils->onclick("CP_QM.answerQuestion(1);");
             $BTeils->id("buttonTeils");
             $BTeils->className("buttonQuestion");
             $BNein = new Button("Nein");
             $BNein->onclick("CP_QM.answerQuestion(0);");
             $BNein->id("buttonNein");
             $BNein->className("buttonQuestion");
             $BP = new Button("vorherige Frage");
             $BP->onclick("CP_QM.previousQuestion(0);");
             $BP->id("buttonPreviousQuestion");
             $BN = new Button("nächste Frage");
             $BN->onclick("CP_QM.nextQuestion(0);");
             $BN->id("buttonNextQuestion");
             $BW = new Button("Weiter");
             $BW->onclick("CP_QM.closeCategoryBox();");
             $BW->style("float:right;");
             $html .= "\n\t\t\t\t\t\t<h3 id=\"headerStep3\" class=\"borderColor1\" style=\"background-color:white;\"><span>" . $this->getStringImage("Prüfen") . "</span></h3>\n\t\t\t\t\t\t<div id=\"step3\" style=\"display:none;\">\n\t\t\t\t\t\t<div id=\"questionBox\" style=\"display:none;\">\n\t\t\t\t\t\t\t<p>{$BP} {$BN}</p>\n\t\t\t\t\t\t\t<div class=\"box borderColor1\">\n\t\t\t\t\t\t\t\t<p style=\"\">Kategorie: <span id=\"category\"></span></p>\n\t\t\t\t\t\t\t\t<p style=\"font-size:20px;font-weight:bold;\" id=\"question\"></p>\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td>{$BJa}</td>\n\t\t\t\t\t\t\t\t\t\t<td>{$BTeils}</td>\n\t\t\t\t\t\t\t\t\t\t<td>{$BNein}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"borderColor1 box\" id=\"categoryBox\">\n\t\t\t\t\t\t\t<span style=\"font-size:30px;\">Kategorie:</span><br/><br/><span id=\"categoryInfo\" style=\"font-size:15px;\"></span><br /><br/>\n\t\t\t\t\t\t\t{$BW}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<p>Fragen in dieser Kategorie: <span id=\"qCounter\"></span></p>\n\t\t\t\t\t\t<p>Kategorien: <span id=\"cCounter\"></span></p>\n\t\t\t\t\t</div>";
             $BNochmal = new Button("Fragen erneut\nausfüllen");
             $BNochmal->onclick("CP_QM.doQuestionsAgain();");
             $BSave = new Button("Prüfung\nspeichern");
             $BSave->onclick("CP_QM.save();");
             $BNew = new Button("Neue\nPrüfung");
             $BNew->onclick("CP_QM.new();");
             $BUpload = new Button("Daten\nhochladen");
             $BUpload->onclick("CP_QM.upload();");
             $html .= "\n\t\t\t\t\t<h3 id=\"headerStep4\" class=\"borderColor1\" style=\"background-color:white;\"><span>" . $this->getStringImage("Abschluss") . "</span></h3>\n\t\t\t\t\t<div id=\"step4\" style=\"display:none;\">\n\t\t\t\t\t\t<div class=\"backgroundColor1\" style=\"height:450px;width:290px;float:right;\">\n\t\t\t\t\t\t\t<div id=\"view\"></div>\n\t\t\t\t\t\t\t{$BUpload}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{$BNochmal}\n\t\t\t\t\n\t\t\t\t\t\t<div class=\"sigPad\" style=\"margin-top:20px;\">\n\t\t\t\t\t\t\t<p>Unterschrift des Kunden:</p>\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<canvas style=\"border-width:1px;border-style:solid;width:300px;height:150px;\" class=\"pad borderColor1\"></canvas>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"output\" class=\"output\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{$BSave}\n\t\t\t\t\t\t\t<!--<a href=\"#clear\">Leeren</a>-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t{$BNew}\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t<script type=\"text/javascript\">\$(document).ready(function() { \$('.sigPad').signaturePad({drawOnly:true}); });</script>";
             break;
     }
     return $html;
 }
Example #2
0
    public function chatPopup($root = "")
    {
        $S = anyC::getFirst("Websocket", "WebsocketUseFor", "phim");
        $I = new HTMLInput("newMessage");
        $I->style("width:100%;background-color:white;");
        $I->onEnter("phimChat.send();");
        $IC = new HTMLInput("channel", "hidden", "0");
        $IC->id("channel");
        $B = new Button("Neue Nachricht", "star", "iconic");
        $B->style("color:orange;float:right;margin-top:-3px;");
        $B->className("newMessage");
        $BOn = new Button("Online", "{$root}../ubiquitous/phim/userOnline.png", "icon");
        $BOn->style("float:left;display:none;margin-right:3px;margin-top:-2px;");
        $BOn->className("online");
        $BOff = new Button("Offline", "{$root}../ubiquitous/phim/userOffline.png", "icon");
        $BOff->style("float:left;margin-right:3px;margin-top:-2px;");
        $BOff->className("offline");
        $AC = anyC::get("phimUserHidden");
        $hidden = array();
        while ($h = $AC->n()) {
            $hidden[$h->A("phimUserHiddenUserID")] = true;
        }
        $Users = Users::getUsersArray();
        $L = new HTMLList();
        $L->setListID("userList");
        $L->addListStyle("overflow:auto;box-sizing:border-box;");
        $L->noDots();
        $L->addItem($B . "Alle");
        $L->addItemEvent("onclick", "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatText0').show(); phimChat.scroll('chatText0'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0'); \$j('#channel').val('0');");
        $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
        $L->addItemClass("backgroundColor0");
        $L->setItemID("user0");
        $content = "";
        $AC = anyC::get("phim");
        $AC->addAssocV3("phimToUserID", "=", "0");
        $AC->addAssocV3("phimphimGruppeID", "=", "0");
        $AC->addOrderV3("phimID", "DESC");
        $AC->setLimitV3(50);
        while ($M = $AC->n()) {
            $content = "<div><span class=\"username\">" . (isset($Users[$M->A("phimFromUserID")]) ? $Users[$M->A("phimFromUserID")] : "Unbekannt") . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
        }
        $chatAll = "<div class=\"chatWindow\" id=\"chatText0\">{$content}</div>";
        $AC = anyC::get("phimGruppe");
        $AC->addAssocV3("INSTR(phimGruppeMembers, ';" . Session::currentUser()->getID() . ";')", ">", "0");
        $groups = array();
        $chatGroups = "";
        while ($G = $AC->n()) {
            $L->addItem($B . $G->A("phimGruppeName"));
            $L->addItemEvent("onclick", "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatTextg" . $G->getID() . "').show(); phimChat.scroll('chatTextg" . $G->getID() . "'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0'); \$j('#channel').val('g" . $G->getID() . "');");
            $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
            #$L->addItemClass("backgroundColor0");
            $L->setItemID("groupg" . $G->getID());
            $content = "";
            $ACS = anyC::get("phim");
            $ACS->addAssocV3("phimToUserID", "=", "0");
            $ACS->addAssocV3("phimphimGruppeID", "=", $G->getID());
            $ACS->addOrderV3("phimID", "DESC");
            $ACS->setLimitV3(50);
            while ($M = $ACS->n()) {
                $content = "<div><span class=\"username\">" . $Users[$M->A("phimFromUserID")] . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
            }
            $groups[] = $G->getID();
            $chatGroups .= "<div class=\"chatWindow\" style=\"display:none;\" id=\"chatTextg" . $G->getID() . "\">{$content}</div>";
        }
        asort($Users);
        $chatUsers = "";
        foreach ($Users as $ID => $U) {
            if ($ID == Session::currentUser()->getID()) {
                continue;
            }
            if (isset($hidden[$ID])) {
                continue;
            }
            $unread = false;
            $content = "";
            $AC = anyC::get("phim");
            $AC->addAssocV3("phimFromUserID", "=", Session::currentUser()->getID(), "AND", "1");
            $AC->addAssocV3("phimToUserID", "=", $ID, "AND", "1");
            $AC->addAssocV3("phimFromUserID", "=", $ID, "OR", "2");
            $AC->addAssocV3("phimToUserID", "=", Session::currentUser()->getID(), "AND", "2");
            $AC->addOrderV3("phimID", "DESC");
            $AC->setLimitV3(50);
            while ($M = $AC->n()) {
                $content = "<div><span class=\"username\">" . $Users[$M->A("phimFromUserID")] . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
                if (!$M->A("phimRead") and $M->A("phimToUserID") == Session::currentUser()->getID()) {
                    $unread = true;
                }
            }
            $L->addItem($BOn . $BOff . $B . $U);
            $L->addItemEvent("onclick", OnEvent::rme("phim", "setRead", $ID) . "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatText{$ID}').show(); phimChat.scroll('chatText{$ID}'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0');\$j('#channel').val('{$ID}');");
            $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
            $L->setItemID("user{$ID}");
            if ($unread) {
                $L->addItemClass("highlight");
            }
            $chatUsers .= "<div style=\"display:none;\" class=\"chatWindow\" id=\"chatText{$ID}\">{$content}</div>";
        }
        $content = "<div style=\"width:68%;display:inline-block;vertical-align:top;\">\n\t\t\t\t{$chatAll}\n\t\t\t\t{$chatUsers}\n\t\t\t\t{$chatGroups}\n\t\t\t\t<div>{$I}</div>\n\t\t\t</div><div style=\"width:32%;display:inline-block;vertical-align:top;\">{$L}{$IC}</div>";
        $rp = str_replace("interface/rme.php", "", $_SERVER["SCRIPT_NAME"]);
        if (strpos($_SERVER["SCRIPT_NAME"], "phim.php") !== false) {
            $rp = "../../";
        }
        $physion = "default";
        if (isset($_GET["physion"])) {
            $physion = $_GET["physion"];
        }
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>phim</title>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery-ui-1.10.1.custom.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/iconic/iconic.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery.qtip.min.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/P2J.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Aspect.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/handler.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/contentManager.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Interface.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Overlay.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/webtoolkit.base64.js"></script>
		
		<script type="text/javascript" src="' . $root . '../ubiquitous/phim/autobahn.min.js"></script>
		<script type="text/javascript" src="' . $root . '../ubiquitous/phim/phimChat.js"></script>
		<script type="text/javascript">
			contentManager.setRoot("' . $rp . '");
			$j(function(){
				Ajax.physion = "' . $physion . '";
					
				phimChat.init(
					"ws' . ($S->A("WebsocketSecure") ? "s" : "") . '://' . $S->A("WebsocketServer") . ":" . $S->A("WebsocketServerPort") . '/",
					"' . $S->A("WebsocketRealm") . '", 
					' . Session::currentUser()->getID() . ', 
					"' . Session::currentUser()->A("name") . '",
					"' . $S->A("WebsocketToken") . '",
					[' . implode(",", $groups) . '],
					"' . $root . '");
						
				phimChat.scroll("chatText0");
				$j("#userList").css("height", $j(window).height());
			});
		</script>
		<link rel="stylesheet" type="text/css" href="' . $root . '../libraries/jquery/jquery.qtip.min.css" />
		<link rel="stylesheet" type="text/css" href="' . $root . '../styles/' . (isset($_COOKIE["phynx_color"]) ? $_COOKIE["phynx_color"] : "standard") . '/colors.css"></link>
		<link rel="stylesheet" type="text/css" href="' . $root . '../styles/standard/general.css"></link>
		<style type="text/css">
			p {
				padding:5px;
			}
			
			body {
				background-color:#ddd;
			}
			
			html {
				overflow-y: auto;
			}

			.username {
				font-weight:bold;
			}
			
			.chatWindow {
				padding:5px;
				box-sizing:border-box;
				overflow-y: auto;
				height:270px;
				background-color:white;
				border-bottom:3px solid grey;
			}
			
			.newMessage {
				display:none;
			}
			
			.highlight .newMessage {
				display:block;
			}
			
			#darkOverlay {
				position:fixed;
				top:0;
				left:0;
			}
			
			#userList li {
				white-space: nowrap;
				overflow:hidden;
				margin-top:0;
			}
		</style>
	</head>
	<body>
		<div id="darkOverlay" style="background-color:rgba(0,0,0,.7);color:white;"></div>
		' . $content . '
	</body>
</html>';
    }