Пример #1
0
 private function row(poolAnzeige $A)
 {
     $html = "\n\t\t\t<div style=\"height:auto;padding-top:30px;padding-bottom:25px;border-bottom: 1px solid #ddd;\">";
     $I = new HTMLInput("poolAnzeigeName", "text", $A->A("poolAnzeigeName"));
     $I->activateMultiEdit("poolAnzeige", $A->getID());
     $I->style("text-align: right;width:90%;");
     $I->placeholder("Beschriftung");
     $B = new Button("Zeile löschen", "trash_stroke", "iconicL");
     $B->style("margin-top:10px;");
     $B->doBefore("if(confirm('Die Zeile löschen?')) %AFTER");
     $B->rmePCR("poolAnzeige", $A->getID(), "deleteMe", "", OnEvent::reload("Screen"));
     $html .= "\n\t\t\t\t<div style=\"text-align: right;color: #777;font-size: 1.5em;display: inline-block;width: 195px;height: auto;vertical-align: top;margin-top: 7px;margin-right: 21px;\">\n\t\t\t\t\t{$I}{$B}\n\t\t\t\t</div>";
     $close = 0;
     $AC = anyC::get("poolAnzeigeControl", "poolAnzeigeControlpoolAnzeigeID", $A->getID());
     $AC->addOrderV3("poolAnzeigeControlOrder");
     $AC->addOrderV3("poolAnzeigeControlID");
     while ($C = $AC->n()) {
         if ($C->A("poolAnzeigeControlNewLine")) {
             $html .= "<div style=\"margin-top:15px;\">\n\t\t\t\t\t<div style=\"display: inline-block;width: 195px;height: 120px;vertical-align: top;margin-top: 7px;margin-right: 21px;\"></div>";
             $close++;
         }
         $html .= $this->control($C);
     }
     $B = new Button("Element\nhinzufügen", "new");
     $B->style("margin:10px;display:inline-block;vertical-align:top;");
     $B->popup("", "Element hinzufügen", "mpoolAnzeige", "-1", "addElementPopup", array($A->getID()));
     $html .= $B;
     for ($i = 0; $i < $close; $i++) {
         $html .= "</div>";
     }
     $html .= "</div>";
     return $html;
 }
Пример #2
0
 function getCMSHTML()
 {
     if (!isset($_GET["terminalID"])) {
         return "<p>Keine Terminal-ID per GET übergeben! (terminalID)</p>";
     }
     if (!isset($_GET["done"])) {
         return "<p style=\"font-size:30px;\">\r\n\t\t\t\tTerminal IP: " . $_SERVER['REMOTE_ADDR'] . "<br>\r\n\t\t\t\tServer IP: " . $_SERVER['SERVER_ADDR'] . "</p>\r\n\t\t\t\t<p>\r\n\t\t\t\t<a href=\"#\" onclick=\"\$.jStorage.set('pKTransferStack', []); \$.jStorage.set('pKTimeStack', []); return false;\">Datenspeicher löschen</a>\r\n\t\t\t\t</p>" . OnEvent::script("window.setTimeout(function(){ document.location.href=\"?" . $_SERVER['QUERY_STRING'] . "&done=true\"; }, 3000);");
     }
     self::loadClasses();
     $AC = self::getPersonal();
     $json = $AC->asJSON();
     $html = "\r\n\t\t<style type=\"text/css\">\r\n\t\t\thtml {\r\n\t\t\t\toverflow-y: hidden;\r\n\t\t\t}\r\n\t\t\tbody {\r\n\t\t\t\t/*background-image:url(./images/TimeTerminalBG.svg);\r\n\t\t\t\tbackground-size:100%;*/\r\n\t\t\t\tmargin:0px;\r\n\t\t\t}\r\n\t\t\t.message {\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 0;\r\n\t\t\t\tleft: 0;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tbackground-color: #72c100;\r\n\t\t\t\tz-index: 1100;\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlayCenter {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 6%;\r\n\t\t\t\tleft: 3%;\r\n\t\t\t\twidth: 94%;\r\n\t\t\t\theight: 88%;\r\n\t\t\t\tbackground-color: white;\r\n\t\t\t\tz-index: 1101;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.green {\r\n\t\t\t\tbackground-color:#72c100;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.red {\r\n\t\t\t\tbackground-color:#c90021;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.orange {\r\n\t\t\t\tbackground-color:orange;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.touchField {\r\n\t\t\t\tbackground-color:#CCC;\r\n\t\t\t\tmargin-top:40px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.currentAction {\r\n\t\t\t\tbackground-color:#c5ffab;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay ul {\r\n\t\t\t\tlist-style-type:none;\r\n\t\t\t}\r\n\r\n\t\t\t.overlay li {\r\n\t\t\t\tfont-size:30px;\r\n\t\t\t\tfont-weight:normal;\r\n\t\t\t\tpadding-top:14px;\r\n\t\t\t\tpadding-bottom:14px;\r\n\t\t\t}\r\n\t\t</style>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\tvar months = new Array('" . implode("', '", Datum::getGerMonthArray()) . "');\r\n\t\t\tvar days = new Array('" . implode("', '", Datum::getGerWeekArray()) . "');\r\n\t\t\tvar action = '" . ($this->switch ? "G" : "K") . "';\r\n\t\t\tvar inOverlay = false;\r\n\t\t\tvar inTransfer = false;\r\n\t\t\tvar Personal = {$json};\r\n\t\t\tvar PersonalLastUpdate = " . time() . ";\r\n\t\t\tvar timeoutTransfer = null;\r\n\t\t\t\r\n\t\t\t\$(function(){\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tclokk();\r\n\t\t\t\t}, 1000 * 30);\r\n\t\t\t\t\r\n\t\t\t\tclokk();\r\n\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tif(inOverlay || document.activeElement.id == 'chipCode')\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t}, 1000);\r\n\t\t\t\t\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\talive();\r\n\t\t\t\t}, 60000);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfunction alive(){\r\n\t\t\t\tCustomerPage.rme('alive', [" . $_GET["terminalID"] . ", PersonalLastUpdate], function(t){\r\n\t\t\t\t\t\$('#aliveStatus').css('background-color', 'green');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(t != ''){\r\n\t\t\t\t\t\tPersonal = JSON.parse(t);\r\n\t\t\t\t\t\tPersonalLastUpdate = Math.round(Date.now() / 1000);\r\n\t\t\t\t\t\t//console.log(Personal);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, function(){\r\n\t\t\t\t\t\$('#aliveStatus').css('background-color', 'red');\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfunction clokk(){\r\n\t\t\t\tvar jetzt = new Date();\r\n\t\t\t\t\$('#clock').html(jetzt.getHours()+':'+(jetzt.getMinutes() < 10 ? '0' : '')+jetzt.getMinutes());\r\n\t\t\t\t\$('#day').html(days[jetzt.getDay()]+', '+jetzt.getDate()+'. '+months[jetzt.getMonth()]+' '+jetzt.getFullYear());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction heightContent(){\r\n\t\t\t\tvar max = \$j(window).height() / 100 * 88;\r\n\t\t\t\t\r\n\t\t\t\t\$j.each(\$j('.overlayContentSub'), function(k, v){\r\n\t\t\t\t\tmax -= \$j(v).outerHeight();\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn max;\r\n\t\t\t}\r\n\r\n\t\t\tfunction transfer(){\r\n\t\t\t\tif(inOverlay){\r\n\t\t\t\t\ttimeoutTransfer = window.setTimeout(function(){\r\n\t\t\t\t\t\ttransfer();\r\n\t\t\t\t\t}, 60000);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tinTransfer = true;\r\n\t\t\t\tvar timeStack = \$.jStorage.get('pKTimeStack', []);\r\n\t\t\t\t\$.jStorage.set('pKTimeStack', []);\r\n\t\t\t\tinTransfer = false;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tvar transferStack = \$.jStorage.get('pKTransferStack', []);\r\n\t\t\t\tvar newTransferStack = transferStack.concat(timeStack);\r\n\t\t\t\t\$.jStorage.set('pKTransferStack', newTransferStack);\r\n\t\t\t\t\r\n\t\t\t\tif(newTransferStack.length > 0)\r\n\t\t\t\t\tCustomerPage.rme('stampStack', [JSON.stringify(newTransferStack)/*, PersonalLastUpdate*/], function(t){\r\n\t\t\t\t\t\t\$.jStorage.set('pKTransferStack', []);\r\n\t\t\t\t\t\t//console.log('Transfer succeeded!');\r\n\t\t\t\t\t\tcounter();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/*if(t != ''){\r\n\t\t\t\t\t\t\tPersonal = JSON.parse(t);\r\n\t\t\t\t\t\t\tPersonalLastUpdate = Math.round(Date.now() / 1000);\r\n\t\t\t\t\t\t}*/\r\n\t\t\t\t\t}, function(){\r\n\t\t\t\t\t\t//console.log('Transfer failed!');\r\n\t\t\t\t\t\tcounter();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttimeoutTransfer = window.setTimeout(function(){\r\n\t\t\t\t\t\t\ttransfer();\r\n\t\t\t\t\t\t}, 60000);\r\n\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfunction counter(){\r\n\t\t\t\t\$('#transferCounter').html(\$.jStorage.get('pKTimeStack', []).length+'/'+\$.jStorage.get('pKTransferStack', []).length);\r\n\t\t\t}\r\n\r\n\t\t\tfunction stampp(){\r\n\t\t\t\tif(inTransfer){\r\n\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\tstampp();\r\n\t\t\t\t\t}, 20);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tinOverlay = true;\r\n\t\t\t\tvar stack = \$.jStorage.get('pKTimeStack', []);\r\n\t\t\t\tvar chip = \$('#chipCode').val();\r\n\t\t\t\t\r\n\t\t\t\tstack.push({'chip': chip, 'terminal': " . $_GET["terminalID"] . ", 'action': action, 'time': Math.round(Date.now() / 1000)});\r\n\t\t\t\t\$.jStorage.set('pKTimeStack', stack);\r\n\r\n\t\t\t\tvar usePersonal = null;\r\n\t\t\t\tfor (k in Personal) {\r\n\t\t\t\t//console.log(Personal[k].PersonalName+':'+Personal[k].PersonalChipNummer+';'+Personal[k].PersonalChipNummer2+';'+Personal[k].PersonalChipNummer3+';'+Personal[k].PersonalChipNummer4);\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer2){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer3){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer4){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\t\tvar color = 'green';\r\n\t\t\t\t\$('#chipCode').val('');\r\n\t\t\t\tif(usePersonal)\r\n\t\t\t\t\t\$j('.overlayText').html(usePersonal.PersonalName);\r\n\t\t\t\telse\r\n\t\t\t\t\t\$j('.overlayText').html('Zeit erfasst');\r\n\t\t\t\t\$j('.overlayDetails').html('');\r\n\r\n\t\t\t\t\$('.overlay').addClass(color).show();\r\n\r\n\t\t\t\tmoep();\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\$('.overlay').hide().removeClass(color);\r\n\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t}, " . (isset($_GET["wait"]) ? $_GET["wait"] : "1500") . ");\r\n\t\t\t\t\r\n\r\n\t\t\t\tif(timeoutTransfer){\r\n\t\t\t\t\twindow.clearTimeout(timeoutTransfer);\r\n\t\t\t\t\ttimeoutTransfer = null;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\ttimeoutTransfer = window.setTimeout(function(){\r\n\t\t\t\t\ttransfer();\r\n\t\t\t\t}, 60000 * 2);\r\n\t\t\t\t\r\n\t\t\t\tcounter();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction moep(){\r\n\t\t\t\tif(typeof alex == 'undefined')\r\n\t\t\t\t\treturn;\r\n\t\t\t\tconsole.log(alex);\r\n\t\t\t\talex.beep();\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\$('html').focus(function() {\r\n\t\t\t\tif(inOverlay)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t}); \r\n\r\n\t\t\t\$(function(){\r\n\t\t\t\tmoep();\r\n\t\t\t\tcounter();\r\n\t\t\t\talive();\r\n\t\t\t\ttransfer();\r\n\t\t\t\t\r\n\t\t\t\t\$('.touchField').css('height', \$(window).height() - \$('#displayTime').outerHeight() - 60 - 130);\r\n\t\t\t\t\$('.touchField').hammer().on('touch release', function(ev){\r\n\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', '');\r\n\t\t\t\t\t\t\taction = \$(ev.target).closest('.touchField').data('action');\r\n\t\t\t\t\t\t\t\$('.currentAction').removeClass('currentAction');\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').addClass('currentAction');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t</script>";
     $I = new HTMLInput("chipCode");
     $I->id("chipCode");
     $I->onEnter("stampp();");
     $I->style("background-color:white;border:1px solid white;font-size:30px;width:96%;position:fixed;bottom:50px;");
     $BK = new Button("Kommen", "arrow_right", "iconic");
     $BK->style("font-size:200px;width:auto;");
     $BG = new Button("Gehen", "arrow_left", "iconic");
     $BG->style("font-size:200px;width:auto;");
     $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"G\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:4%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Gehen<br />{$BG}</p>\r\n\t\t\t\t</div><div data-action=\"K\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Kommen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     if ($this->switch) {
         $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"K\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:4%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Kommen<br />{$BG}</p>\r\n\t\t\t\t</div><div data-action=\"G\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Gehen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     }
     $html .= "\r\n\t\t\t<div id=\"transferCounter\" style=\"position:absolute;top:0px;left:0px;padding:3px;color:grey;\"></div>\r\n\t\t\t<div id=\"aliveStatus\" style=\"position:absolute;top:0px;right:0px;height:10px;width:10px;\"></div>\r\n\t\t\t\r\n\t\t\t<div id=\"displayTime\">\r\n\t\t\t\t<div id=\"clock\" style=\"font-size:190px;text-align:center;margin-top:40px;color:#333;\"></div>\r\n\t\t\t\t<div id=\"day\" style=\"font-size:35px;text-align:right;padding-right:45px;margin-top:0px;color:#CCC;\"></div>\r\n\t\t\t</div>\r\n\t\t\t{$actschion}\r\n\t\t\t{$I}\r\n\t\t\t<div class=\"overlay\">\r\n\t\t\t\t<div class=\"overlayCenter\">\r\n\t\t\t\t\t<div class=\"overlayList\"></div>\r\n\t\t\t\t\t<p style=\"font-size:70px;margin-top:60px;font-weight:bold;\" class=\"overlayText\"></p>\r\n\t\t\t\t\t<p style=\"font-size:50px;margin-top:60px;\" class=\"overlayDetails\"></p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     return $html;
 }
Пример #3
0
 public function openInPopup($className, $classID, $fieldName)
 {
     $C = new $className($classID);
     $ITA = new HTMLInput("nicEditor", "textarea");
     $ITA->id("nicEditor");
     $ITA->style("width:998px;height:300px;");
     echo $ITA;
     echo OnEvent::script("\n\$j('#nicEditor').val('" . addslashes($C->A($fieldName)) . "'.makeHTML());\n\nsetTimeout(function(){\n\tnew nicEditor({\n\t\ticonsPath : './libraries/nicEdit/nicEditorIconsTiny.gif',\n\t\tbuttonList : ['save','bold','italic','underline','hr'],\n\t\tmaxHeight : 400,\n\n\t\tonSave : function(content, id, instance) {\n\t\t\tif(content.substr(0, 3) != '<p ' && content.substr(0, 3) != '<p>')\n\t\t\t\tcontent = '<p>'+content+'</p>';\n\t\t\t\n\t\t\t" . OnEvent::rme($C, "saveMultiEditField", array("'{$fieldName}'", "content.replace(/<br>/g, '<br />')")) . "\n\n\t\t\t" . OnEvent::closePopup("nicEdit") . "\n\t\t}\n\t}).panelInstance('nicEditor');}, 100);");
 }
 private function noBackupButton()
 {
     $GoAway = new HTMLInput("BackupGoAway", "checkbox");
     $GoAway->id("BackupGoAway");
     $GoAway->style("float:left;margin-right:5px;");
     $BSave = new Button("Einstellung\nspeichern", "save");
     $BSave->style("float:right;");
     $BSave->onclick("if(\$('BackupGoAway').checked) ");
     $BSave->rmePCR("BackupManager", "", "GoAway", "", "Popup.close('','BackupManagerGUI'); contentManager.reloadFrame('contentLeft');");
     return $BSave . $GoAway . " <label for=\"BackupGoAway\" style=\"float:none;text-align:left;width:auto;\">Diese Meldung nicht mehr anzeigen, ich erstelle meine Backups selbst.</label>";
 }
Пример #5
0
 public function getPosten(GRLBM $Beleg)
 {
     $T = new HTMLTable(1, "Arbeitsbeschreibung");
     $T->setTableStyle("width:100%;");
     $tinyMCEID = "tinyMCE" . rand(100, 90000000);
     $I = new HTMLInput("textbausteinUnten", "textarea", $Beleg->A("textbausteinUnten"));
     $I->style("width:100%;height:300px;margin-left:10px;");
     $I->id($tinyMCEID);
     $T->addRow(array($I));
     $buttons = "undo redo | pastetext | styleselect fontsizeselect fontselect | bold italic underline forecolor | hr";
     return $T . parent::getPosten($Beleg) . OnEvent::script("if(CCAuftrag.lastTextbausteinUnten != null) \$('[name=textbausteinUnten]').val(CCAuftrag.lastTextbausteinUnten); CCAuftrag.lastTextbausteinUnten = null;" . tinyMCEGUI::editorDokument($tinyMCEID, "function(content){}", $buttons, "../../styles/tinymce/email.css"));
 }
Пример #6
0
 public static function ActionParser($w, $l, $p)
 {
     $s = HTMLGUI::getArrayFromParametersString($p);
     if ($s[2] == "-1") {
         $I = new HTMLInput("FhemEventAction", "multiInput", $w, array("FhemEvent", $s[0], "FhemEventAction"));
         $I->style("width:95%;text-align:left;");
         return $I;
     }
     $Fhem = new Fhem($s[1]);
     $Fhem->loadMe();
     $op = $Fhem->getAvailableOptions();
     $o = "<option value=\"\">select...</option>";
     foreach ($op as $k => $v) {
         $o .= "<option " . ($w == $v ? "selected=\"selected\"" : "") . " value=\"{$v}\">{$k}</option>";
     }
     return "<select onchange=\"rme('FhemEvent', '{$s['0']}', 'saveMultiEditField', Array('FhemEventAction',this.value), 'checkResponse(transport);');\">{$o}</select>";
 }
Пример #7
0
 function getCMSHTML()
 {
     if (!isset($_SERVER['PHP_AUTH_USER']) or $_SERVER['PHP_AUTH_USER'] == "") {
         header('WWW-Authenticate: Basic realm="Ticket POS"');
         header('HTTP/1.0 401 Unauthorized');
         die("Authentifikation fehlgeschlagen");
     }
     $EC = new ExtConn(Util::getRootPath());
     if (!$EC->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
         header('WWW-Authenticate: Basic realm="Ticket POS"');
         header('HTTP/1.0 401 Unauthorized');
         die("Authentifikation fehlgeschlagen");
     }
     $html = "<div style=\"width:200px;float:right;\">Angemeldet als<br /><b>" . Session::currentUser()->A("name") . "</b></div>";
     $html .= "<h1>Ticket POS</h1>";
     $AC = anyC::get("Seminar");
     $AC->addAssocV3("SeminarVon", ">=", time() - 3600 * 48);
     $Events = array();
     while ($S = $AC->getNextEntry()) {
         $Events[$S->getID()] = $S->A("SeminarName") . ", " . Util::CLFormatDate($S->A("SeminarVon"), true);
     }
     $I = new HTMLInput("currentEvent", "select", null, $Events);
     $I->style("font-size:20px;width:45%;");
     $html .= "<div style=\"margin-bottom:45px;\">{$I}</div>";
     $TS = new CCTicketShop();
     /*$count = array();
     		for($i = 0; $i < 21; $i++)
     			$count[$i] = $i;
     		
     		$I = new HTMLInput("ticketCount", "select", null, $count);
     		$I->style("width:100%;font-size:20px;");
     		
     		$IC = new Button("Weiter", "");
     		$IC->onclick("CustomerPage.rme('handleTicketSale', [$('select[name=currentEvent]').val(), $('select[name=ticketCount]').val()], function(){  })");
     		$IC->className("submitFormButton");*/
     $html .= "\n\t\t<div style=\"float:right;width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Ticketverkauf</h2>\n\t\t\t" . $TS->getCMSHTML(false) . "\n\t\t\t<!--<div style=\"border:1px dashed grey;padding:10px;margin-top:10px;\">\n\t\t\t\tAnzahl der Tickets:\n\t\t\t\t{$I}{$IC}\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>-->\n\t\t</div>";
     $I = new HTMLInput("ticketCheck");
     $I->style("width:98%;font-size:20px;");
     $I->onEnter("CustomerPage.rme('handleTicketCheck', [\$('select[name=currentEvent]').val(), \$(this).val()], function(transport){ \$('#ticketValidInfo').html(transport); })");
     $html .= "\n\t\t<div style=\"width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Einlass</h2>\n\t\t\t<div style=\"border:1px dashed #BBBBBB;padding:10px;\">\n\t\t\t\tTicket-Nummer:\n\t\t\t\t{$I}\n\t\t\t\t<div id=\"ticketValidInfo\" style=\"font-size:20px;margin-top:20px;\">\n\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>";
     return $html;
 }
Пример #8
0
 function getCMSHTML()
 {
     if (!isset($_GET["terminalID"])) {
         return "<p>Keine Terminal-ID per GET übergeben! (terminalID)</p>";
     }
     if (!isset($_GET["done"])) {
         return "<p style=\"font-size:30px;\">Terminal IP: " . $_SERVER['REMOTE_ADDR'] . "<br />Server IP: " . $_SERVER['SERVER_ADDR'] . "</p>" . OnEvent::script("window.setTimeout(function(){ document.location.href=\"?" . $_SERVER['QUERY_STRING'] . "&done=true\"; }, 3000);");
     }
     $html = "\n\t\t<style type=\"text/css\">\n\t\t\thtml {\n\t\t\t\toverflow-y: hidden;\n\t\t\t}\n\t\t\tbody {\n\t\t\t\t/*background-image:url(./images/TimeTerminalBG.svg);\n\t\t\t\tbackground-size:100%;*/\n\t\t\t\tmargin:0px;\n\t\t\t}\n\t\t\t.message {\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t.overlay {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground-color: #72c100;\n\t\t\t\tz-index: 1100;\n\t\t\t\tdisplay:none;\n\t\t\t}\n\t\t\t\n\t\t\t.overlayCenter {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 6%;\n\t\t\t\tleft: 3%;\n\t\t\t\twidth: 94%;\n\t\t\t\theight: 88%;\n\t\t\t\tbackground-color: white;\n\t\t\t\tz-index: 1101;\n\t\t\t}\n\t\t\t\n\t\t\t.green {\n\t\t\t\tbackground-color:#72c100;\n\t\t\t}\n\t\t\t\n\t\t\t.red {\n\t\t\t\tbackground-color:#c90021;\n\t\t\t}\n\t\t\t\n\t\t\t.touchField {\n\t\t\t\tbackground-color:#CCC;\n\t\t\t\tmargin-top:40px;\n\t\t\t}\n\t\t\t\n\t\t\t.currentAction {\n\t\t\t\tbackground-color:#c5ffab;\n\t\t\t}\n\t\t</style>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar months = new Array('" . implode("', '", Datum::getGerMonthArray()) . "');\n\t\t\tvar days = new Array('" . implode("', '", Datum::getGerWeekArray()) . "');\n\t\t\tvar action = 'K';\n\n\t\t\t\$(function(){\n\t\t\t\twindow.setInterval(function(){\n\t\t\t\t\tclokk();\n\t\t\t\t}, 1000 * 30);\n\t\t\t\t\n\t\t\t\tclokk();\n\t\t\t\t\n\t\t\t\t\$('#chipCode').focus();\n\t\t\t});\n\t\t\t\n\t\t\tfunction clokk(){\n\t\t\t\tvar jetzt = new Date();\n\t\t\t\t\$('#clock').html(jetzt.getHours()+':'+(jetzt.getMinutes() < 10 ? '0' : '')+jetzt.getMinutes());\n\t\t\t\t\$('#day').html(days[jetzt.getDay()]+', '+jetzt.getDate()+'. '+months[jetzt.getMonth()]+' '+jetzt.getFullYear());\n\t\t\t}\n\t\t\t\n\t\t\tfunction stampp(){\n\t\t\t\tif(typeof alex != 'undefined')\n\t\t\t\t\talex.takePhoto();\n\t\t\t\t\t\n\t\t\t\tCustomerPage.rme('stamp', [\$('#chipCode').val(), " . $_GET["terminalID"] . ", action], function(t){\n\t\t\t\t\tif(t == '')\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tvar r = jQuery.parseJSON(t);\n\t\t\t\t\t\$('#chipCode').val('');\n\t\t\t\t\tif(r.status == 'command' && r.action =='reload'){\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar color = 'green';\n\t\t\t\t\tif(r.status == 'error')\n\t\t\t\t\t\tcolor = 'red';\n\n\t\t\t\t\t\$j('.overlayText').html(r.message);\n\t\t\t\t\t\$j('.overlayDetails').html('');\n\t\t\t\t\tif(r.details)\n\t\t\t\t\t\t\$j('.overlayDetails').html(r.details);\n\n\t\t\t\t\t\$('.overlay').addClass(color).show();\n\t\t\t\t\t\n\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\$('.overlay').hide().removeClass(color);\n\t\t\t\t\t}, 2000);\n\t\t\t\t\t\n\t\t\t\t\tif(r.status == 'OK')\n\t\t\t\t\t\tmoep();\n\n\t\t\t\t}, function(){\n\t\t\t\t\tvar color = 'red';\n\t\t\t\t\t\$('#chipCode').val('');\n\t\t\t\t\t\$j('.overlayText').html('Server nicht erreichbar!');\n\t\t\t\t\t\$j('.overlayDetails').html('');\n\n\t\t\t\t\t\$('.overlay').addClass(color).show();\n\t\t\t\t\t\n\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\$('.overlay').hide().removeClass(color);\n\t\t\t\t\t}, 1000);\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tfunction moep(){\n\t\t\t\tif(typeof alex == 'undefined')\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\talex.beep();\n\n\t\t\t}\n\n\t\t\t//if(typeof alex != 'undefined')\n\t\t\t//\talex.louder(100);\n\t\t\t\n\t\t\tmoep();\n\n\t\t\t\$('html').click(function() {\n\t\t\t\t\$('#chipCode').focus();\n\t\t\t}); \n\n\t\t\t\$(function(){\n\t\t\t\t\$('.touchField').css('height', \$(window).height() - \$('#displayTime').outerHeight() - 40 - 130);\n\t\t\t\t\$('.touchField').hammer().on('touch release', function(ev){\n\t\t\t\t\tswitch(ev.type){\n\t\t\t\t\t\tcase 'touch':\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', 'rgba(255,204,0,0.3)');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'release':\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', '');\n\t\t\t\t\t\t\taction = \$(ev.target).closest('.touchField').data('action');\n\t\t\t\t\t\t\t\$('.currentAction').removeClass('currentAction');\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').addClass('currentAction');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t</script>";
     $I = new HTMLInput("chipCode");
     $I->id("chipCode");
     $I->onEnter("stampp();");
     $I->style("background-color:white;border:1px solid white;font-size:30px;width:96%;position:fixed;bottom:20px;");
     $BK = new Button("Kommen", "arrow_right", "iconic");
     $BK->style("font-size:200px;width:auto;");
     $BG = new Button("Gehen", "arrow_left", "iconic");
     $BG->style("font-size:200px;width:auto;");
     $actschion = "\n\t\t\t<div>\n\t\t\t\t<div data-action=\"G\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Gehen<br />{$BG}</p>\n\t\t\t\t</div>\n\t\t\t\t<div data-action=\"K\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Kommen<br />{$BK}</p>\n\t\t\t\t</div>\n\t\t\t</div>";
     if ($this->switch) {
         $actschion = "\n\t\t\t<div>\n\t\t\t\t<div data-action=\"K\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Kommen<br />{$BG}</p>\n\t\t\t\t</div>\n\t\t\t\t<div data-action=\"G\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Gehen<br />{$BK}</p>\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "\n\t\t\t<div id=\"displayTime\">\n\t\t\t\t<div id=\"clock\" style=\"font-size:190px;text-align:center;margin-top:40px;color:#333;\"></div>\n\t\t\t\t<div id=\"day\" style=\"font-size:35px;text-align:right;padding-right:45px;margin-top:0px;color:#CCC;\"></div>\n\t\t\t</div>\n\t\t\t{$actschion}\n\t\t\t{$I}\n\t\t\t<div class=\"overlay\">\n\t\t\t\t<div class=\"overlayCenter\">\n\t\t\t\t\t<p style=\"font-size:70px;margin-top:60px;font-weight:bold;\" class=\"overlayText\"></p>\n\t\t\t\t\t<p style=\"font-size:50px;margin-top:60px;\" class=\"overlayDetails\"></p>\n\t\t\t\t</div>\n\t\t\t</div>";
     return $html;
 }
Пример #9
0
 function getCMSHTML()
 {
     if (!isset($_GET["terminalID"])) {
         return "<p>Keine Terminal-ID per GET übergeben! (terminalID)</p>";
     }
     if (!isset($_GET["done"])) {
         return "<p style=\"font-size:30px;\">Terminal IP: " . $_SERVER['REMOTE_ADDR'] . "<br />Server IP: " . $_SERVER['SERVER_ADDR'] . "</p>" . OnEvent::script("window.setTimeout(function(){ document.location.href=\"?" . $_SERVER['QUERY_STRING'] . "&done=true\"; }, 3000);");
     }
     $html = "\r\n\t\t<style type=\"text/css\">\r\n\t\t\thtml {\r\n\t\t\t\toverflow-y: hidden;\r\n\t\t\t}\r\n\t\t\tbody {\r\n\t\t\t\t/*background-image:url(./images/TimeTerminalBG.svg);\r\n\t\t\t\tbackground-size:100%;*/\r\n\t\t\t\tmargin:0px;\r\n\t\t\t}\r\n\t\t\t.message {\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 0;\r\n\t\t\t\tleft: 0;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tbackground-color: #72c100;\r\n\t\t\t\tz-index: 1100;\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlayCenter {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 6%;\r\n\t\t\t\tleft: 3%;\r\n\t\t\t\twidth: 94%;\r\n\t\t\t\theight: 88%;\r\n\t\t\t\tbackground-color: white;\r\n\t\t\t\tz-index: 1101;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.green {\r\n\t\t\t\tbackground-color:#72c100;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.red {\r\n\t\t\t\tbackground-color:#c90021;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.orange {\r\n\t\t\t\tbackground-color:orange;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.touchField {\r\n\t\t\t\tbackground-color:#CCC;\r\n\t\t\t\tmargin-top:40px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.currentAction {\r\n\t\t\t\tbackground-color:#c5ffab;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay ul {\r\n\t\t\t\tlist-style-type:none;\r\n\t\t\t}\r\n\r\n\t\t\t.overlay li {\r\n\t\t\t\tfont-size:30px;\r\n\t\t\t\tfont-weight:normal;\r\n\t\t\t\tpadding-top:14px;\r\n\t\t\t\tpadding-bottom:14px;\r\n\t\t\t}\r\n\t\t</style>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\tvar months = new Array('" . implode("', '", Datum::getGerMonthArray()) . "');\r\n\t\t\tvar days = new Array('" . implode("', '", Datum::getGerWeekArray()) . "');\r\n\t\t\tvar action = '" . ($this->switch ? "G" : "K") . "';\r\n\t\t\tvar inOverlay = false;\r\n\t\t\tvar learnPersonalID = 0;\r\n\t\t\tvar learnChipID = 0;\r\n\t\t\t\r\n\t\t\t\$(function(){\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tclokk();\r\n\t\t\t\t}, 1000 * 30);\r\n\t\t\t\t\r\n\t\t\t\tclokk();\r\n\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tif(inOverlay || document.activeElement.id == 'chipCode')\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t}, 1000);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfunction clokk(){\r\n\t\t\t\tvar jetzt = new Date();\r\n\t\t\t\t\$('#clock').html(jetzt.getHours()+':'+(jetzt.getMinutes() < 10 ? '0' : '')+jetzt.getMinutes());\r\n\t\t\t\t\$('#day').html(days[jetzt.getDay()]+', '+jetzt.getDate()+'. '+months[jetzt.getMonth()]+' '+jetzt.getFullYear());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction heightContent(){\r\n\t\t\t\tvar max = \$j(window).height() / 100 * 88;\r\n\t\t\t\t\r\n\t\t\t\t\$j.each(\$j('.overlayContentSub'), function(k, v){\r\n\t\t\t\t\tmax -= \$j(v).outerHeight();\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn max;\r\n\t\t\t}\r\n\r\n\t\t\tfunction stampp(){\r\n\t\t\t\tinOverlay = true;\r\n\t\t\t\tif(typeof alex != 'undefined' && typeof alex.takePhoto == 'function')\r\n\t\t\t\t\talex.takePhoto();\r\n\t\t\t\t\r\n\t\t\t\tlearnChipID = \$('#chipCode').val();\r\n\r\n\t\t\t\tCustomerPage.rme('stamp', [\$('#chipCode').val(), " . $_GET["terminalID"] . ", action, " . (isset($_GET["learn"]) ? "1" : "0") . ", learnPersonalID], function(t){\r\n\t\t\t\t\tif(t == '')\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tvar r = jQuery.parseJSON(t);\r\n\t\t\t\t\t\$('#chipCode').val('');\r\n\t\t\t\t\tlearnPersonalID = 0;\r\n\t\t\t\t\tif(r.status == 'command' && r.action =='reload'){\r\n\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tvar message = r.message;\r\n\t\t\t\t\tvar color = 'green';\r\n\t\t\t\t\tvar list = '';\r\n\t\t\t\t\tif(r.status == 'error')\r\n\t\t\t\t\t\tcolor = 'red';\r\n\t\t\t\t\tif(r.status == 'learn')\r\n\t\t\t\t\t\tcolor = 'orange';\r\n\r\n\t\t\t\t\tif(r.status == 'learn'){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlist = '<p class=\"overlayContentSub\" style=\"font-size:70px;font-weight:bold;background-color:white;margin-top:-20;\">Bitte wählen Sie:</p>';\r\n\t\t\t\t\t\tlist += '<ul class=\"overlayContentHeight\" style=\"padding-left:0px;padding-top:0px;padding-bottom:0px;margin-top:0;margin-bottom:0;overflow:auto;\">';\r\n\t\t\t\t\t\tfor(var i = 0;i < r.message.length; i++){\r\n\t\t\t\t\t\t\tlist += '<li data-personalid=\"'+r.message[i].PersonalID+'\" class=\"selectionName\" style=\"padding-left:40px;\">'+r.message[i].name+'</li>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlist += '</ul>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlist += '<div class=\"overlayContentSub\" id=\"buttonCancel\" style=\"background-color: rgb(204, 204, 204);padding-top:20px;padding-bottom:20px;font-size:30px;width:50%;display:inline-block;\"><div style=\"padding-left:10px;\"><span style=\"font-size:40px;margin-right:20px;\" class=\"iconic x\"></span> Abbrechen</div></div>';\r\n\t\t\t\t\t\tlist += '<div id=\"buttonSave\" style=\"background-color: rgb(204, 204, 204);padding-top:20px;padding-bottom:20px;width:50%;display:inline-block;font-size:30px;color:grey;\"><div style=\"padding-left:10px;\"><span style=\"font-size:40px;margin-right:20px;\" class=\"iconic check\"></span> Speichern</div></div>';\r\n\t\t\t\t\t\t//return;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$j('.overlayText').html(message);\r\n\t\t\t\t\t\$j('.overlayDetails').html('');\r\n\t\t\t\t\t\$j('.overlayList').html(list);\r\n\t\t\t\t\t\$j('.overlayCenter').scrollTop(0);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(r.details)\r\n\t\t\t\t\t\t\$j('.overlayDetails').html(r.details);\r\n\r\n\t\t\t\t\t\$('.overlay').removeClass().addClass('overlay '+color).show();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(\$j('.overlayContentHeight').length)\r\n\t\t\t\t\t\t\$j('.overlayContentHeight').css('height', heightContent());\r\n\r\n\t\t\t\t\tif(r.status == 'learn'){\r\n\t\t\t\t\t\t\$('.selectionName').hammer().on('tap', function(ev){\r\n\t\t\t\t\t\t\t\$j('.selectionName').css('background-color', '');\r\n\t\t\t\t\t\t\t\$j(ev.target).css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\t\t\$j('#buttonSave').css('background-color', '#c5ffab').css('color', '');\r\n\t\t\t\t\t\t\tlearnPersonalID = \$j(ev.target).data('personalid');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\$('#buttonSave').hammer().on('touch release', function(ev){\r\n\t\t\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonSave').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonSave').css('background-color', 'rgb(204, 204, 204)');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(learnPersonalID == 0)\r\n\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\$('.overlay').hide();\r\n\t\t\t\t\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t\t\t\t\t\t\$('#chipCode').val(learnChipID);\r\n\t\t\t\t\t\t\t\t\tstampp();\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\$('#buttonCancel').hammer().on('touch release', function(ev){\r\n\t\t\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonCancel').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonCancel').css('background-color', 'rgb(204, 204, 204)');\r\n\t\t\t\t\t\t\t\t\t\$('.overlay').hide();\r\n\t\t\t\t\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t\t\t\t\t\tlearnPersonalID = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(r.status != 'learn')\r\n\t\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\t\t\$('.overlay').hide();\r\n\t\t\t\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t\t\t}, 1500);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(r.status == 'OK')\r\n\t\t\t\t\t\tmoep();\r\n\r\n\r\n\t\t\t\t\tvar stack = \$.jStorage.get('pKTimeStack', [])\r\n\t\t\t\t\tif(stack.length > 0)\r\n\t\t\t\t\t\tCustomerPage.rme('stampStack', [JSON.stringify(stack)], function(t){\r\n\t\t\t\t\t\t\t\$.jStorage.set('pKTimeStack', []);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}, function(){\r\n\t\t\t\t\tvar stack = \$.jStorage.get('pKTimeStack', []);\r\n\t\t\t\t\t//console.log(stack);\r\n\t\t\t\t\tstack.push({'chip': \$('#chipCode').val(), 'terminal': " . $_GET["terminalID"] . ", 'action': action, 'time': Math.round(Date.now() / 1000)});\r\n\t\t\t\t\t\$.jStorage.set('pKTimeStack', stack);\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar color = 'orange';\r\n\t\t\t\t\t\$('#chipCode').val('');\r\n\t\t\t\t\t\$j('.overlayText').html('Zeit erfasst');\r\n\t\t\t\t\t\$j('.overlayDetails').html('Der Server ist nicht erreichbar.');\r\n\r\n\t\t\t\t\t\$('.overlay').addClass(color).show();\r\n\t\t\t\t\t\r\n\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\t\$('.overlay').hide().removeClass(color);\r\n\t\t\t\t\t}, 1000);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction moep(){\r\n\t\t\t\tif(typeof alex == 'undefined')\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\t\talex.beep();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//if(typeof alex != 'undefined')\r\n\t\t\t//\talex.louder(100);\r\n\t\t\t\r\n\t\t\tmoep();\r\n\r\n\t\t\t\$('html').focus(function() {\r\n\t\t\t\tif(inOverlay)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t}); \r\n\r\n\t\t\t\$(function(){\r\n\t\t\t\t\$('.touchField').css('height', \$(window).height() - \$('#displayTime').outerHeight() - 40 - 130);\r\n\t\t\t\t\$('.touchField').hammer().on('touch release', function(ev){\r\n\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', '');\r\n\t\t\t\t\t\t\taction = \$(ev.target).closest('.touchField').data('action');\r\n\t\t\t\t\t\t\t\$('.currentAction').removeClass('currentAction');\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').addClass('currentAction');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t</script>";
     $I = new HTMLInput("chipCode");
     $I->id("chipCode");
     $I->onEnter("stampp();");
     $I->style("background-color:white;border:1px solid white;font-size:30px;width:96%;position:fixed;bottom:20px;");
     $BK = new Button("Kommen", "arrow_right", "iconic");
     $BK->style("font-size:200px;width:auto;");
     $BG = new Button("Gehen", "arrow_left", "iconic");
     $BG->style("font-size:200px;width:auto;");
     $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"G\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Gehen<br />{$BG}</p>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div data-action=\"K\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Kommen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     if ($this->switch) {
         $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"K\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Kommen<br />{$BG}</p>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div data-action=\"G\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Gehen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     }
     $html .= "\r\n\t\t\t<div id=\"displayTime\">\r\n\t\t\t\t<div id=\"clock\" style=\"font-size:190px;text-align:center;margin-top:40px;color:#333;\"></div>\r\n\t\t\t\t<div id=\"day\" style=\"font-size:35px;text-align:right;padding-right:45px;margin-top:0px;color:#CCC;\"></div>\r\n\t\t\t</div>\r\n\t\t\t{$actschion}\r\n\t\t\t{$I}\r\n\t\t\t<div class=\"overlay\">\r\n\t\t\t\t<div class=\"overlayCenter\">\r\n\t\t\t\t\t<div class=\"overlayList\"></div>\r\n\t\t\t\t\t<p style=\"font-size:70px;margin-top:60px;font-weight:bold;\" class=\"overlayText\"></p>\r\n\t\t\t\t\t<p style=\"font-size:50px;margin-top:60px;\" class=\"overlayDetails\"></p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     return $html;
 }
Пример #10
0
 public function sendMessagePopup()
 {
     $AC = anyC::get("Device");
     $AC->addOrderV3("DeviceName");
     $B = new Button("Alle", "fullscreen", "touch");
     $B->className("nuntiusMessageTo");
     $B->id("nuntiusMessageTarget0");
     $B->onclick("\$j('.nuntiusMessageTo:not(#nuntiusMessageTarget0)').slideToggle(); \$j('#nuntiusMessageContainer').slideToggle();");
     $L = $B;
     while ($D = $AC->getNextEntry()) {
         $B = new Button($D->A("DeviceName"), "iphone", "touch");
         $B->className("nuntiusMessageTo");
         $B->id("nuntiusMessageTarget" . $D->getID());
         $B->onclick("\$j('.nuntiusMessageTo:not(#nuntiusMessageTarget" . $D->getID() . ")').slideToggle(); \$j('#nuntiusMessageContainer').slideToggle();");
         $L .= $B;
     }
     $BS = new Button("Senden", "arrow_right", "touch");
     $BS->style("margin-top:0px;height:190px;margin-bottom:0px;");
     $BS->rmePCR("mNuntius", "-1", "sendMessage", array("\$j('.nuntiusMessageTo:visible').attr('id').replace('nuntiusMessageTarget', '')", "\$j('[name=NuntiusMessage]').val()", "'Device:'+\$j.jStorage.get('phynxDeviceID', -1)"), "function(){ " . OnEvent::closePopup("mNuntius") . " }");
     $I = new HTMLInput("NuntiusMessage", "textarea");
     $I->style("width:100%;height:200px;max-width:400px;font-size:15px;");
     $I->placeholder("Nachricht...");
     echo "\n\t\t\t<div id=\"nuntiusTargets\" style=\"padding-top:15px;padding-bottom:1px;\">\n\t\t\t\t" . $L . "\n\t\t\t</div>\n\t\t\t<div style=\"display:none;padding-bottom:1px;\" id=\"nuntiusMessageContainer\">\n\t\t\t\t<div style=\"width:100px;float:right;\">{$BS}</div><div style=\"width:300px;\">{$I}</div>\n\t\t\t</div>";
 }
Пример #11
0
 function getBrowserHTML($lineWithId = -1)
 {
     $this->texts = $this->languageClass->getBrowserTexts();
     $singularLanguageClass = $this->loadLanguageClass($this->singularClass);
     $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $this->singularClass);
     $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $this->singularClass);
     $userHiddenFields = mUserdata::getHides($this->singularClass);
     $defaultTarget = "contentRight";
     if ($this->displaySide != "default") {
         $defaultTarget = "content" . ucfirst($this->displaySide);
     }
     if ($this->singularClass == "none") {
         echo "collectionOf is not set. See message log for further details.";
         throw new CollectionOfNotSetException();
     }
     if ($this->name == "Noname") {
         $_SESSION["messages"]->addMessage("There is no name set. You might use setName of HTMLGUI to do that.");
     }
     /**
      * ERROR-TABLE
      */
     $errorTab = new HTMLTable(1);
     if (isset($_SESSION["phynx_errors"]) and $lineWithId == -1 and ($_SERVER["HTTP_HOST"] == "dev.furtmeier.lan" or strpos(__FILE__, "nemiah") !== false)) {
         $errorTab->addRow("\n\t\t\t\t\t<img style=\"float:left;margin-right:10px;\" src=\"./images/navi/warning.png\" />\n\t\t\t\t\t<b>Es " . (count($_SESSION["phynx_errors"]) != 1 ? "liegen" : "liegt") . " " . count($_SESSION["phynx_errors"]) . " PHP-Fehler vor:</b><br />\n\t\t\t\t\t<a href=\"javascript:windowWithRme('Util','','showPHPErrors','');\">Fehler anzeigen</a>,<br />\n\t\t\t\t\t<a href=\"javascript:rme('Util','','deletePHPErrors','','contentManager.reloadFrameRight();');\">Fehler löschen</a>");
     }
     /**
      * RETURN-BUTTON
      */
     $returnTab = new HTMLTable(1);
     if ($this->isSelection) {
         $BReturn = new Button("Auswahl\nbeenden", "back");
         $BReturn->onclick("contentManager.restoreFrame('content" . ucfirst($this->displaySide) . "','selectionOverlay');");
         #return "<input type=\"button\" value=\"zurück zu\n".$p2[$s[0]]."\" style=\"background-image:url(./images/navi/back.png);\" class=\"bigButton backgroundColor3\" onclick=\"loadFrameV2('contentRight','$s[0]');\" />";
         $returnTab->addRow($BReturn);
     }
     /**
      * DELETE-BUTTON
      */
     if ((!$this->onlyDisplayMode or $this->deleteInDisplayMode) and $userCanDelete and !$this->isSelection and $this->showDeleteButton) {
         $this->newColsRight["delete"] = "\n\t\t\t<span class=\"iconic trash_stroke\" onclick=\"deleteClass('" . $this->singularClass . "','%%VALUE%%', " . ($this->JSOnDelete == null ? "function() { " . ($this->displaySide == "left" ? "contentManager.reloadFrameLeft();" : "contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '%%VALUE%%') \$('contentLeft').update('');") . " }" : $this->JSOnDelete) . ",'" . str_replace("%1", $this->singularName, $this->texts["%1 wirklich löschen?"]) . "');\"></span>";
     } elseif (!$userCanDelete) {
         $this->newColsRight["delete"] = "<img src=\"./images/i2/empty.png\" />";
     }
     /**
      * EDIT-BUTTON
      */
     if (!isset($this->newColsLeft["select"]) and (!$this->onlyDisplayMode or $this->editInDisplayMode) and $this->showEditButton) {
         $EB = new Button("", "./images/i2/edit.png");
         $EB->type("icon");
         $EB->className("editButton");
         if ($this->JSOnEdit == null) {
             $EB->onclick("contentManager.selectRow(this); contentManager.loadFrame('contentLeft','" . $this->singularClass . "','%%VALUE%%','0');");
         } else {
             $EB->onclick($this->JSOnEdit);
         }
         $this->newColsLeft["select"] = $EB;
     }
     $cols = count($this->showAttributes) + count($this->newColsLeft) + count($this->newColsRight);
     $valuesTab = new HTMLTable($cols, $lineWithId == -1 ? $this->displaySide == "left" ? $this->name : "" : null);
     $valuesTab->addTableClass("contentBrowser");
     /*if(isset($this->newColsRight["delete"]) AND ($this->displaySide == "default" OR $this->displaySide == "right"))
     			$valuesTab->setColClass($cols, "backgroundColor0");
     		if(isset($this->newColsRight["delete"]) AND $this->displaySide == "left")
     			$valuesTab->setColClass(1, "backgroundColor0");*/
     /**
      * QUICKSEARCH
      */
     #$quickSearchRow = "";
     if ($this->quickSearchPlugin != "" and $lineWithId == -1) {
         list($quickSearchRow, $BSearchInfo) = $this->getQuicksearchField();
         if ($this->displaySide == "left") {
             $insertRow = array($quickSearchRow);
             for ($i = 1; $i < $cols - 1; $i++) {
                 $insertRow[] = "";
             }
             $insertRow[] = $BSearchInfo;
             $valuesTab->addRow($insertRow);
             $valuesTab->addRowColspan(1, $cols - 1);
         } else {
             $valuesTab->addRow(array($BSearchInfo, $quickSearchRow));
             $valuesTab->addRowColspan(2, $cols - 1);
         }
         $valuesTab->addRowClass("backgroundColorHeader");
     }
     if ($this->headerRow != null) {
         $valuesTab->addHeaderRow($this->headerRow);
     }
     /**
      * PAGE-BROWSER
      */
     #$multiPageRow = "";
     $separator = "";
     $userDefinedEntriesPerPage = false;
     $isMultiPageMode = false;
     if (count($this->multiPageMode) > 0) {
         $isMultiPageMode = true;
         $this->multiPageMode[3] = $defaultTarget;
         if ($this->multiPageMode[2] == 0) {
             $userDefinedEntriesPerPage = true;
             #$mU = new mUserdata();
             #$this->multiPageMode[2] = $mU->getUDValue("entriesPerPage{$this->multiPageMode[4]}");
             #if($this->multiPageMode[2] == null) $this->multiPageMode[2] = 20;
         }
         /*
         
         if($this->multiPageMode[1] == "undefined") $this->multiPageMode[1] = 0;
         
         $pages = ceil($this->multiPageMode[0] / $this->multiPageMode[2]);
         
         if($this->multiPageMode[1] != 0) $pageLinks = "<a href=\"javascript:contentManager.loadPage('$defaultTarget', '0');\">&nbsp;&lt;&lt;&nbsp;</a> ";
         else $pageLinks = "&nbsp;&lt;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != 0) $pageLinks .= "<a href=\"javascript:contentManager.backwardOnePage('$defaultTarget');\">&nbsp;&lt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.forwardOnePage('$defaultTarget');\">&nbsp;&gt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&gt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget',".($pages-1).");\">&nbsp;&gt;&gt;&nbsp;</a> | ";
         else $pageLinks .= "&nbsp;&gt;&gt;&nbsp; | ";
         
         $start = $this->multiPageMode[1] - 3;
         if($start < 0) $start = 0;
         
         $end = $this->multiPageMode[1] + 3;
         if($end > $pages - 1) $end = $pages - 1;
         
         for($i=$start; $i<=$end; $i++)
         	if($this->multiPageMode[1] != "$i") $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget','".$i."');\">".($i+1)."</a> ";
         	else $pageLinks .= ($i+1)." ";
         
         	$pageLinks = "".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": ".$pageLinks;
         */
         if ($this->displaySide == "left") {
             $pageLinks = "<span style=\"float:right;\">" . $this->getMultiPageButtons() . "</span>";
         } else {
             $pageLinks = $this->getMultiPageButtons();
         }
         /*if($lineWithId == -1) $multiPageRow = "
         					<tr>
         						".($userDefinedEntriesPerPage ? "<td><img class=\"mouseoverFade\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','multiPageSettings:{$this->multiPageMode[4]}','".$this->texts["Einstellungen"].":');\" /></td>" : "")."
         						<td colspan=\"".($colspan+1+($userDefinedEntriesPerPage ? 0 : 1))."\"><input type=\"text\"onkeydown=\"if(event.keyCode == 13) loadFrameV2('".$this->multiPageMode[3]."','".$this->multiPageMode[4]."','',this.value - 1);\" style=\"width:30px;float:right;text-align:right;\" value=\"".($this->multiPageMode[1]+1)."\" onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\" />".$this->multiPageMode[0]." ".($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"])."<!--, ".$pages." ".($pages != 1 ? $this->texts["Seiten"] : $this->texts["Seite"])."--></td>
         					</tr>
         					<tr>
         						<td colspan=\"$determinedNumberofCols\">".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": $pageLinks</td>
         					</tr>";
         
         
         */
         if ($lineWithId == -1) {
             $BSettings = $this->getPageOptionsButton();
             #$IPage = $this->getPageSelectionField();
             #$IPage->style("width:30px;float:right;text-align:right;");
             $pageOptions = $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . ", {$pageLinks}";
             if (!$userDefinedEntriesPerPage) {
                 $valuesTab->addRow(array($pageOptions));
                 $valuesTab->addRowColspan(1, $cols);
             } else {
                 if ($this->displaySide == "left") {
                     $insertRow = array($pageOptions);
                     for ($i = 1; $i < $cols - 1; $i++) {
                         $insertRow[] = "";
                     }
                     $insertRow[] = $BSettings;
                     $valuesTab->addRow($insertRow);
                     #$valuesTab->addRow(array($pageOptions,$BSettings));
                     $valuesTab->addRowColspan(1, $cols - 1);
                 } else {
                     /*$insertRow = array($BSettings);
                     		for($i=1; $i<$cols-1; $i++)
                     			$insertRow[] = "";
                     		$insertRow[] = $pageOptions;
                     		$valuesTab->addRow($insertRow);*/
                     $valuesTab->addRow(array($BSettings, $pageOptions));
                     $valuesTab->addRowColspan(2, $cols - 1);
                 }
             }
             $valuesTab->addRowClass("backgroundColorHeader");
             #$valuesTab->addRow(array($pageLinks));
             #$valuesTab->addRowColspan(1, $cols);
             #$valuesTab->addRowClass("backgroundColorHeader");
             $valuesTab->addRow("");
             $valuesTab->addRowColspan(1, $cols);
             $valuesTab->addRowClass("backgroundColor0 browserSeparatorTop");
         }
     }
     $filteredCol = null;
     if ($lineWithId == -1 and $this->showFilteredCategoriesWarning != null and $this->showFilteredCategoriesWarning[0]) {
         $dB = new Button($this->texts["Filter löschen"], "./images/i2/delete.gif");
         $dB->style("float:right;");
         $dB->type("icon");
         $dB->rme("HTML", "", "saveContextMenu", array("'deleteFilters'", "'{$this->showFilteredCategoriesWarning[1]}'"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         /*$separator = "
         		<tr>
         			<td class=\"backgroundColor0\"".((isset($this->showFilteredCategoriesWarning[0]) AND $this->showFilteredCategoriesWarning[0] == true) ? "<img src=\"./images/i2/note.png\" /></td><td class=\"backgroundColor0\" colspan=\"".($determinedNumberofCols - 2)."\" style=\"color:grey;\" >".$this->texts["Anzeige wurde gefiltert"]."</td><td class=\"backgroundColor0\">$dB</td>" : " >")."</td>
         		</tr>";*/
         $filteredCol = array("<img src=\"./images/i2/note.png\" />", $dB . $this->texts["Anzeige wurde gefiltert"]);
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     /**
      * NEW-BUTTON
      */
     if (!$this->onlyDisplayMode and $userCanCreate and $this->showNewButton and $lineWithId == -1) {
         $BNew = new Button("", "./images/i2/new.gif");
         $BNew->type("icon");
         $BNew->id("buttonNewEntry{$this->singularClass}");
         #$BNew->onclick($this->JSOnNew == null ? "contentManager.newClassButton('$this->singularClass','');" : $this->JSOnNew);
         if ($this->displaySide == "left") {
             #$valuesTab->addRow(array("<b>$this->singularName neu anlegen</b>",$BNew));
             #$valuesTab->addRowColspan(1, $cols-1);
         } else {
             $valuesTab->addRow(array($BNew, "<b>{$this->singularName} neu anlegen</b>"));
             $valuesTab->addRowColspan(2, $cols - 1);
             $valuesTab->addRowEvent("click", $this->JSOnNew == null ? "contentManager.newClassButton('{$this->singularClass}','');" : $this->JSOnNew);
             $valuesTab->addRowStyle("cursor:pointer;");
         }
         #$valuesTab->addRowColspan(2, $cols-1);
     }
     /**
      * TABLE-CONTENT
      */
     $displayGroup = null;
     for ($i = 0; $i < count($this->attributes); $i++) {
         $aid = $this->attributes[$i]->getID();
         // get the id of an object separately
         $sc = $this->attributes[$i]->getA();
         // get the attributes-object from the object
         if ($this->displayGroupBy != null) {
             $displayGroupField = $this->displayGroupBy;
             if ($sc->{$displayGroupField} != $displayGroup and $i > 0) {
                 $valuesTab->addRow("");
                 $valuesTab->addRowClass("backgroundColor0");
             }
         }
         $row = array();
         $styles = array();
         if ($this->displaySide == "left") {
             $colsLeft = $this->newColsRight;
             $colsRight = $this->newColsLeft;
         } else {
             $colsLeft = $this->newColsLeft;
             $colsRight = $this->newColsRight;
         }
         if (count($colsLeft) > 0) {
             foreach ($colsLeft as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         foreach ($this->showAttributes as $key => $value) {
             if (isset($userHiddenFields[$value])) {
                 continue;
             }
             if (isset($this->parsers[$value])) {
                 $t = $this->invokeParser($this->parsers[$value], $sc->{$value}, $this->makeParameterStringFromArray($this->parserParameters[$value], $sc, $aid));
             } else {
                 $t = htmlspecialchars($sc->{$value});
             }
             if ($this->multiEditMode != null and in_array($value, $this->multiEditMode)) {
                 $posInArray = array_search($value, $this->multiEditMode);
                 if ($this->multiEditModeInputs[$posInArray] == null) {
                     $MI = new HTMLInput($value . "ID{$aid}", "multiInput", $sc->{$value}, array($this->singularClass, $aid, $value));
                     if ($this->multiEditModeStyle != null) {
                         $MI->style($this->multiEditModeStyle[$posInArray]);
                     }
                 } else {
                     $MI = clone $this->multiEditModeInputs[$posInArray];
                     $MI->setValue($sc->{$value});
                     $MI->activateMultiEdit($this->singularClass, $aid);
                 }
                 $t = $MI;
             }
             #<td id=\"Browser".$value."$aid\" ".(isset($this->colStyles[$value]) ? "style=\"".$this->colStyles[$value]."\"" : "").">".$t."</td>";
             $row[] = $t;
             if (isset($this->colStyles[$value])) {
                 $styles[count($row)] = $this->colStyles[$value];
             }
         }
         if (count($colsRight) > 0) {
             foreach ($colsRight as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         $valuesTab->addRow($row);
         if (count($styles) > 0) {
             foreach ($styles as $col => $s) {
                 $valuesTab->addColStyle($col, $s);
             }
         }
         $valuesTab->setRowID("BrowserMain{$aid}");
         #foreach($this->showAttributes as $key => $value) {
         #	$valuesTab->addCellID($cellNo, "Browser".$value."$aid");
         #}
         if ($this->displayGroupBy != null) {
             $displayGroup = $sc->{$displayGroupField};
         }
     }
     if ($filteredCol !== null) {
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     if ($lineWithId == -1 and $isMultiPageMode) {
         $valuesTab->addRow("");
         $valuesTab->addRowColspan(1, $cols);
         $valuesTab->addRowClass("backgroundColor0 browserSeparatorBottom");
         if (!$userDefinedEntriesPerPage) {
             $valuesTab->addRow(array($pageOptions));
             $valuesTab->addRowColspan(1, $cols);
         } else {
             if ($this->displaySide == "left") {
                 $valuesTab->addRow(array($pageOptions, $BSettings));
                 $valuesTab->addRowColspan(1, $cols - 1);
             } else {
                 $valuesTab->addRow(array($BSettings, $pageOptions));
                 $valuesTab->addRowColspan(2, $cols - 1);
             }
         }
         $valuesTab->addRowClass("backgroundColorHeader");
         #$valuesTab->addRow(array($pageLinks));
         #$valuesTab->addRowColspan(1, $cols);
         #$valuesTab->addRowClass("backgroundColorHeader");
     }
     if (count($this->attributes) == 0) {
         $valuesTab->addRow(array("keine Einträge"));
         $valuesTab->addRowColspan(1, $cols);
     }
     if ($lineWithId != -1) {
         $valuesTab = $valuesTab->getHTMLForUpdate();
     }
     return $errorTab . $returnTab . $valuesTab . ($lineWithId == -1 ? $this->tip : "");
 }
Пример #12
0
 public function leftFrame($R = null)
 {
     if ($R == null) {
         $R = new GSRaumgruppe($_GET["RGID"]);
     }
     $GST = $this->getTaetigkeiten($R);
     $Tab = new HTMLTable(3);
     $Tab->setColWidth(1, 500);
     $Tab->setColWidth(2, 120);
     $Tab->setColWidth(3, 120);
     $Tab->addColStyle(1, "text-align:left;font-size:11px;");
     $Tab->addColStyle(2, "text-align:right;");
     $Tab->addColStyle(3, "text-align:right;");
     $Tab->addHeaderRow(array("", "wöchentlich", "jährlich"));
     $i = 0;
     while ($T = $GST->getNextEntry()) {
         $IW = new HTMLInput("GSTaetigkeitTurnusWoechentlich", "select", $T->A("GSTaetigkeitTurnusWoechentlich"), mGSTaetigkeitGUI::$woechentlich);
         $IW->style("text-align:right;width:50px;");
         $IJ = new HTMLInput("GSTaetigkeitTurnusJaehrlich", "select", $T->A("GSTaetigkeitTurnusJaehrlich"), mGSTaetigkeitGUI::$jaehrlich);
         $IJ->style("text-align:right;width:50px;");
         $Tab->addRow(array($T->A("GSTaetigkeitName"), $IW, $IJ));
         $i++;
     }
     return "<h4>Zugeordnete Tätigkeiten</h4>{$Tab}" . ($i == 0 ? "<p>Keine Tätigkeiten zugeordnet</p>" : "");
 }
Пример #13
0
 public function rightCol($return = false)
 {
     $useDir = realpath(FileStorage::getFilesDir());
     $path = BPS::getProperty("mFileGUI", "path", false);
     if ($path) {
         $path = preg_replace("/^([A-Z])%/", "\\1:", $path);
         if (strpos($path, realpath(FileStorage::getFilesDir())) === 0) {
             $useDir = $path;
         }
     }
     $writable = is_writable($useDir);
     $readable = is_readable($useDir);
     $this->setDir($useDir);
     $this->loadMultiPageMode(-1, 0, 10000);
     $showPath = str_replace(realpath(FileStorage::getFilesDir()), "", $useDir);
     $BH = new Button("Root", "home", "iconicL");
     $BH->onclick($this->pather(FileStorage::getFilesDir()));
     $BH->style("float:left;");
     $way = realpath(FileStorage::getFilesDir());
     $bread = "<div style=\"vertical-align:top;display:inline-block;border-right:1px solid #aaa;\" class=\"isFolder\" data-path=\"{$way}\">{$BH}&nbsp;</div>";
     foreach (explode(DIRECTORY_SEPARATOR, $showPath) as $k => $v) {
         if ($k == 0) {
             continue;
         }
         $way .= DIRECTORY_SEPARATOR . "{$v}";
         $bread .= "<div class=\"selectionRow isFolder\" data-path=\"{$way}\" onclick=\"" . $this->pather($way) . "\" style=\"padding:8px;cursor:pointer;border-right:1px solid #aaa;color:#555;vertical-align:top;display:inline-block;padding-left:20px;padding-right:20px;border-bottom:0px;\">{$v}</div>";
     }
     $I = new HTMLInput("upload", "file", null, array("path" => $way, "class" => "File"));
     $I->style("width:250px;");
     $I->onchange($this->pather($way));
     $IN = new HTMLInput("newDir", "text");
     $IN->placeholder("Neues Verzeichnis");
     $IN->style("width:250px;margin-right:20px;");
     $IN->onEnter(OnEvent::rme($this, "makeDir", array("'{$way}'", "\$j(this).val()"), "function(){ " . $this->pather($way) . " }"));
     $ISA = new HTMLInput("selectAll", "checkbox");
     $ISA->onchange("console.log(\$j(this).prop('checked')); \$j('.selectFile').prop('checked', \$j(this).prop('checked'));");
     if (!$writable or !$readable) {
         $I = "";
         $IN = "";
     }
     $html = "\n\t\t\t<div style=\"background-color:#F7F7F7;border-bottom:1px solid #ddd;\">\n\t\t\t\t{$bread}\n\t\t\t\t<div style=\"display:inline-block;margin-top:2px;float:right;\">{$IN}</div>\n\t\t\t\t<div style=\"display:inline-block;margin-top:1px;float:right;\">{$I}</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id=\"filesFrame\" style=\"overflow:auto;\">\n\t\t\t<form id=\"dlFiles\">\n\t\t\t<div style=\"border-bottom:1px solid #ddd;color:#777;\">\n\t\t\t\t<div style=\"display:inline-block;float:right;padding:5px;\">\n\t\t\t\t\tGröße\n\t\t\t\t\t<div style=\"display:inline-block;width:64px;\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t\t<!--<div style=\"display:inline-block;width:57px;float:left;padding-left:5px;\">{$ISA}</div>-->\n\t\t\t\t<div style=\"display:inline-block;width:26px;float:left;padding-left:5px;\">&nbsp;</div>\n\t\t\t\t<div style=\"padding:5px;\">Dateiname</div>\n\t\t\t</div>";
     if (!$readable) {
         $html .= "<div style=\"padding:5px;\" class=\"highlight\">Das Verzeichnis <code>{$useDir}</code> ist nicht lesbar.</div>";
         return $html;
     }
     if (!$writable) {
         $html .= "<div style=\"padding:5px;\" class=\"highlight\">Das Verzeichnis {$useDir} ist nicht beschreibbar.<br />\n\t\t\t\tEs können keine Unterverzeichnisse angelegt oder Dateien hochgeladen werden.<br />\n\t\t\t\tBitte machen Sie das Verzeichnis mit <code>chmod 777 " . basename($useDir) . "</code> durch den Webserver beschreibbar.</div>";
     }
     $i = 0;
     while ($F = $this->getNextEntry()) {
         if ($F->A("FileName") == "." or $F->A("FileName") == "..") {
             continue;
         }
         $ext = Util::ext($F->A("FileName"));
         $B = "";
         if ($F->A("FileIsDir")) {
             $B = new Button("Verzeichnis öffnen", "./plugins/Files/icons/folder.png", "icon");
             $B->style("margin-right:5px;margin-top:2px;");
         } elseif (!$F->A("FileIsDir") and file_exists(dirname(__FILE__) . "/icons/file_extension_{$ext}.png")) {
             $B = new Button("", "./plugins/Files/icons/file_extension_{$ext}.png", "icon");
             $B->style("margin-right:5px;margin-top:2px;");
         } elseif (!$F->A("FileIsDir") and !file_exists(dirname(__FILE__) . "/icons/file_extension_{$ext}.png")) {
             $B = new Button("", "./plugins/Files/icons/file_extension_unknown.png", "icon");
             $B->style("margin-right:5px;margin-top:2px;");
         }
         $BDL = new Button("Datei herunterladen", "download", "iconic");
         $BDL->style("margin-right:10px;");
         $BDL->windowRme("File", $F->getID(), "download");
         $size = "<div style=\"display:inline-block;margin-right:20px;color:grey;width:60px;text-align:right;\"></div>";
         if ($F->A("FileIsDir")) {
             $onclick = $this->pather($F->getID());
             $BDL = "";
         } else {
             $onclick = OnEvent::popup("Vorschau", "File", $F->getID(), "previewWindow", "", "", "{width:600, hPosition: 'center'}");
             $size = "<div style=\"display:inline-block;margin-right:20px;color:grey;width:60px;text-align:right;\">" . Util::formatByte($F->A("FileSize")) . "</div>";
         }
         $onRename = OnEvent::rme($F, "rename", array("\$j('input[name=renameFile{$i}]').val()"), "function(t){ \$j('.fileName{$i}').html(t.responseText); \$j('#default{$i}').show(); \$j('#rename{$i}').hide(); }");
         $BD = new Button("Element löschen", "trash_stroke", "iconic");
         #$BD->style("float:right;");
         $BD->onclick("deleteClass('File','" . $F->getID() . "', function() { " . $this->pather(realpath(dirname($F->getID()))) . " },'Element wirklich löschen?');");
         $BR = new Button("Element umbenennen", "pen_alt2", "iconic");
         $BR->style("margin-right:10px;");
         $BR->onclick("\$j('.fileDefault').show(); \$j('.fileRename, #default{$i}').hide(); \$j('#rename{$i}').show();");
         $IR = new HTMLInput("renameFile{$i}", "text", $F->A("FileName"));
         $IR->style("width:350px;");
         $IR->onEnter($onRename);
         $BC = new Button("Umbenennen abbrechen", "x", "iconic");
         $BC->onclick("\$j('#default{$i}').show(); \$j('#rename{$i}').hide();");
         $BC->style("margin-left:10px;");
         $BO = new Button("Umbenennen abschließen", "check", "iconic");
         $BO->onclick($onRename);
         $BO->style("margin-left:10px;");
         $IC = new HTMLInput("select{$i}", "checkbox");
         $IC->setClass("selectFile");
         $IC->style("margin-top:2px;margin-right:10px;display:none;");
         $html .= "\n\t\t\t<div data-path=\"" . $F->getID() . "\" class=\"selectionRow " . ($F->A("FileIsDir") ? "isFolder" : "") . "\" style=\"\">\n\t\t\t\t<div class=\"selectionRowHeightSetter\" style=\"display:inline-block;float:left;\">{$IC}{$B}</div>\n\t\t\t\t<div class=\"selectionRowHeightSetter\" style=\"display:inline-block;float:right;\">{$BDL}{$BR}{$size}{$BD}</div>\n\t\t\t\t\t\n\t\t\t\t<div id=\"rename{$i}\" class=\"fileRename selectionRowHeightSetter\" style=\"display:none;margin-bottom:-3px;\">{$IR}{$BC}{$BO}</div>\n\t\t\t\t<div id=\"default{$i}\" class=\"selectionRowHeightSetter fileDefault\" onclick=\"" . $onclick . "\" style=\"padding:5px;padding-top:9px;cursor:pointer;\">\n\t\t\t\t\t<span class=\"fileName{$i}\">" . str_replace(".{$ext}", "<span style=\"color:grey;\">.{$ext}</span>", $F->A("FileName")) . "</span>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>";
         $i++;
     }
     $html .= "</form></div>" . OnEvent::script("\n\$j('.selectionRow').draggable({\n\trevert: true,\n\thelper: function(v){\n\t\tvar newE = \$j(v.target).closest('.selectionRow').clone();\n\t\tnewE.css('width', '400px').css('opacity', '0.7').addClass('selectionRow');\n\t\tnewE.find('.iconic').remove();\n\t\treturn newE;\n\t}/*,\n\tstart: function (event, ui) {\n\t\t \$j(ui.helper).css('margin-left', event.clientX - \$j(event.target).offset().left + 10);\n\t\t \$j(ui.helper).css('margin-top', event.clientY - \$j(event.target).offset().top + 10);\n\t }*/\n});\n\n\$j('.isFolder').droppable({\n\thoverClass: 'highlight',\n\taccept: '.selectionRow',\n\ttolerance: 'pointer',\n\tdrop: function(event, ui) {\n\t\tvar newE = ui.helper.clone();\n\t\tui.helper.remove();\n\t\t" . OnEvent::rme($this, "moveFile", array("\$j(ui.draggable).data('path')", "\$j(this).data('path')"), "function(){ \n\t\t\t\$j(ui.draggable).fadeOut(400, function(){ \$j(this).remove(); }); \n\t\t\t\$j('body').append(newE);\n\t\t\t\$j(newE).fadeOut(400, function(){ \$j(this).remove(); }); \n\t\t}") . "\n\t}\n});\n");
     if (!$return) {
         echo $html;
     } else {
         return $html;
     }
 }
Пример #14
0
 public function __toString()
 {
     #$style = "";
     if ($this->type == "date" and strpos($this->style, "width:") === false) {
         $this->style .= "width:87%;";
     }
     #if($this->style != null) $style = " style=\"$this->style\"";
     switch ($this->type) {
         case "audio":
             return "<audio controls preload=\"auto\" autobuffer style=\"{$this->style}\"><source src=\"{$this->value}\"></audio>";
             break;
         case "HTMLEditor":
             $B = new Button("in HTML-Editor\nbearbeiten", "editor");
             $B->windowRme("Wysiwyg", "", "getEditor", "", "WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->className("backgroundColor2");
             return $B->__toString();
             break;
         case "TextEditor":
             #return "<input ".(isset($this->events[$as]) ? $eve : "")." style=\"background-image:url(./images/navi/editor.png);".(isset($this->inputStyle[$as]) ? "".$this->inputStyle[$as]."" : "")."\" type=\"button\" class=\"bigButton backgroundColor2\" onclick=\"TextEditor.show('$as','$this->FormID');\" value=\"".$this->texts["in Editor bearbeiten"]."\" /><textarea style=\"display:none;\" name=\"".$as."\" id=\"".$as."\">".$this->attributes->$as."</textarea>";
             $B = new Button("in Editor\nbearbeiten", "editor");
             $B->className("backgroundColor2");
             $B->onclick("TextEditor.show('{$this->name}','{$this->options[0]}');");
             $ITA = new HTMLInput($this->name, "textarea", $this->value);
             $ITA->id($this->name);
             $ITA->style("display:none;");
             return $B->__toString() . $ITA;
             break;
         case "tinyMCE":
             $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'");
             if (isset($this->options[2])) {
                 $BO[] = "'{$this->options[2]}'";
             }
             $B = new Button("in Editor\nbearbeiten", "editor");
             #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->popup("", "Editor", "Wysiwyg", "-1", "editInPopup", $BO, "", "Popup.presets.large");
             $B->className("backgroundColor2");
             $ITA = new HTMLInput($this->name, "textarea", $this->value);
             return $B->__toString() . $ITA;
             break;
         case "multiInput":
             return "<input\n\t\t\t\t\tclass=\"multiEditInput2\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tvalue=\"" . htmlspecialchars($this->value) . "\"\n\t\t\t\t\tonfocus=\"oldValue = this.value;\"\n\t\t\t\t\tid=\"" . $this->options[2] . "ID" . $this->options[1] . "\"\n\t\t\t\t\tonblur=\"if(oldValue != this.value) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"\n\t\t\t\t\tonkeydown=\"if(event.keyCode == 13) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"/>";
             break;
             /*case "customSelection":
             				$B = new Button("Eintrag auswählen...", "gutschrift");
             				$B->type("LPBig");
             				$B->style("float:right;margin-left:10px;");
             				#				 "contentRight"		"callingPluginID"  "selectPlugin"
             				$B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]);
             
             				return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />";
             			break;*/
         /*case "customSelection":
         				$B = new Button("Eintrag auswählen...", "gutschrift");
         				$B->type("LPBig");
         				$B->style("float:right;margin-left:10px;");
         				#				 "contentRight"		"callingPluginID"  "selectPlugin"
         				$B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]);
         
         				return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />";
         			break;*/
         case "textarea":
             if ($this->isDisplayMode) {
                 return nl2br($this->value);
             }
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
                 $this->onfocus .= " oldValue = this.value;";
                 $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 $this->onblur .= "if(oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 if ($this->hasFocusEvent) {
                     $this->onfocus .= "focusMe(this);";
                     $this->onblur .= "blurMe(this);";
                 }
                 $this->hasFocusEvent = false;
             }
             return "<textarea\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->hasFocusEvent ? "onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">{$this->value}</textarea>";
             break;
         case "file":
             $currentId = ($this->id != null ? $this->id : $this->name) . rand(100, 100000000);
             return "\n\t\t\t\t\t<div id=\"progress_{$currentId}\" style=\"height:10px;width:95%;display:none;\" class=\"\">\n\t\t\t\t\t\t<div id=\"progressBar_{$currentId}\" style=\"height:10px;width:0%;\" class=\"backgroundColor1\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"{$currentId}\" style=\"width:100%;\"></div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tvar QQUploader = new qq.FileUploader({\n\t\t\t\t\t\t\tmaxSizePossible: '" . ini_get("upload_max_filesize") . "B',\n\t\t\t\t\t\t\telement: \$('{$currentId}'),\n\t\t\t\t\t\t\taction: './interface/set.php',\n\t\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\t\t'class': '" . (($this->options == null or !isset($this->options["class"])) ? "TempFile" : $this->options["class"]) . "'\n\t\t\t\t\t\t\t\t,'id':'-1'\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["path"])) ? ",'path':'" . $this->options["path"] . "'" : "") . "\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonSubmit: function(id, fileName){ \$('progress_{$currentId}').style.display = 'block';},\n\t\t\t\t\t\t\tonComplete: function(id, fileName, transport){ \$('progress_{$currentId}').style.display = 'none'; if(checkResponse(transport)) { {$this->onchange} } },\n\t\t\t\t\t\t\tonProgress: function(id, fileName, loaded, total){ \$('progressBar_{$currentId}').style.width = Math.ceil((loaded / total) * 100)+'%'; }});\n\t\t\t\t\t</script>";
             break;
         case "radio1":
         case "date":
         case "text":
         case "hidden":
         case "submit":
         case "button":
         case "password":
         case "checkbox":
         case "readonly":
             $JS = "";
             if ($this->type == "radio1") {
                 $this->type = "radio";
             }
             if ($this->isDisplayMode) {
                 if ($this->type == "checkbox") {
                     return Util::catchParser($this->value);
                 }
                 if ($this->type == "hidden") {
                     return "";
                 }
                 return $this->value . "";
             }
             if ($this->hasFocusEvent) {
                 $this->onfocus .= "focusMe(this);";
                 $this->onblur .= "blurMe(this);";
             }
             $cal = "";
             $B2 = "";
             if ($this->type == "date") {
                 if ($this->id == null) {
                     $this->id = rand(10000, 90000);
                 }
                 $cal = new Button("", "./images/i2/calendar.gif");
                 $cal->onclick("\$j('#{$this->id}').focus();");
                 $cal->type("icon");
                 $cal->className("calendarIcon");
                 $JS = "<script type=\"text/javascript\">\$j('#{$this->id}').datepicker();</script>";
                 $this->type = "text";
             }
             $value = "value=\"" . htmlspecialchars($this->value) . "\"";
             if ($this->type == "checkbox") {
                 $value = $this->value == "1" ? "checked=\"checked\"" : "";
             }
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
                 if ($this->type == "checkbox") {
                     $this->onchange = "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 } else {
                     $this->onfocus .= " oldValue = this.value;";
                     $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                     $this->onblur .= "if(oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 }
             }
             if ($this->autocomplete != null) {
                 if ($this->id == null) {
                     $this->id = $this->name;
                 }
                 /*$this->onfocus .= " ACInputHasFocus=true; AC.start(this);";
                 		$this->onblur .= " ACInputHasFocus = false; AC.end(this);";
                 		$this->onkeyup .= " AC.update(event.keyCode, this, '".$this->autocomplete[0]."');";*/
                 $this->autocompleteBrowser = false;
                 $cal = new Button("Suche", "./images/i2/details.png");
                 $cal->onclick("\$('{$this->id}').style.display = ''; \$('{$this->id}').value = ''; \$('{$this->id}').focus();");
                 $cal->type("icon");
                 $cal->className("calendarIcon");
                 if ($this->autocomplete[4] != null) {
                     $B2 = $this->autocomplete[4];
                     $B2->style("float:right;margin-left:5px;");
                     $this->style .= "width:80%";
                 } else {
                     $this->style .= "width:87%";
                 }
                 if ($this->autocomplete[1] == null) {
                     $cal->onclick("\$('{$this->id}Display').style.display = ''; \$('{$this->id}Display').value = ''; \$('{$this->id}Display').focus();");
                     $IN = new HTMLInput($this->name, "hidden", htmlspecialchars($this->value));
                     $IN->id($this->name);
                     $JS .= $IN;
                     $this->autocomplete[1] = "function(selection){ \$('{$this->id}').value = selection.value; \$('{$this->id}Display').value = selection.label; return false; }";
                     if ($this->value != "") {
                         $C = substr($this->autocomplete[0], 1) . "GUI";
                         $C = new $C($this->value);
                         $value = "value=\"" . htmlspecialchars($C->ACLabel()) . "\"";
                     }
                     $this->id .= "Display";
                 }
                 $JS .= OnEvent::script("var OnSelectCallback{$this->id} = " . $this->autocomplete[1] . "; \$j(\"input#{$this->id}\").autocomplete({\n\t\t\t\t\t\tsource: function(request, response){ \n\t\t\t\t\t\t\t " . OnEvent::rme($this->autocomplete[0], "getACData", array("'{$this->name}'", "request.term", $this->autocomplete[3]), "function(transport){ response(jQuery.parseJSON(transport.responseText)); }") . "\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t},\n\t\t\t\t\t\tselect: function(event, ui) { var r = OnSelectCallback{$this->id}(ui.item); " . ($this->autocomplete[2] ? "\$('{$this->id}').style.display = 'none';" : "") . " return r; }\n\t\t\t\t\t}).data(\"autocomplete\")._renderItem = function( ul, item ) {\n\t\t\t\t\t\treturn \$j( \"<li></li>\" )\n\t\t\t\t\t\t\t.data( \"item.autocomplete\", item )\n\t\t\t\t\t\t\t.append( \"<a>\" + item.label + (item.description ? \"<br /><small>\"+item.description+\"</small>\" : \"\")+\"</a>\" )\n\t\t\t\t\t\t\t.appendTo( ul );\n\t\t\t\t\t};");
             }
             return "{$B2}{$cal}<input\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\t" . (!$this->autocompleteBrowser ? "autocomplete=\"off\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onclick != null ? "onclick=\"{$this->onclick}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeydown != null ? "onkeydown=\"{$this->onkeydown}\"" : "") . "\n\t\t\t\t\t" . ($this->tabindex != null ? "tabindex=\"{$this->tabindex}\"" : "") . "\n\t\t\t\t\t" . ($this->isSelected ? "checked=\"checked\"" : "") . "\n\t\t\t\t\t" . ($this->type == "file" ? "size=\"1\"" : "") . "\n\t\t\t\t\t" . ($this->type == "readonly" ? "readonly=\"readonly\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . ($this->isDisabled ? "disabled=\"disabled\"" : "") . "\n\t\t\t\t\ttype=\"" . ($this->type != "readonly" ? $this->type : "text") . "\"\n\t\t\t\t\t" . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . "\n\t\t\t\t\t{$value} />{$this->requestFocus}{$JS}";
             break;
         case "option":
             return "<option" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->isSelected ? "selected=\"selected\"" : "") . " value=\"{$this->value}\">{$this->name}</option>";
             break;
         case "radio":
             $html = "";
             foreach ($this->options as $k => $v) {
                 $html .= "<div style=\"margin-bottom:5px;\"><input name=\"{$this->name}\" value=\"{$k}\" " . ($k == $this->value ? "checked=\"checked\"" : "") . " style=\"float:left;margin-right:5px;\" type=\"radio\">{$v}</div>";
             }
             return $html;
             break;
         case "select":
         case "select-multiple":
             if ($this->type == "select-multiple") {
                 $values = trim($this->value) != "" ? explode(";:;", $this->value) : array();
             }
             if ($this->isDisplayMode) {
                 return is_object($this->options[$this->value]) ? $this->options[$this->value]->__toString() : $this->options[$this->value];
             }
             if ($this->multiEditOptions != null) {
                 $this->onchange("saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");");
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
             }
             $html = "<select " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->type == "select-multiple" ? " multiple=\"multiple\"" : "") . "" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . " name=\"{$this->name}\" " . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">";
             if ($this->options != null and is_array($this->options)) {
                 foreach ($this->options as $k => $v) {
                     if (!is_object($v)) {
                         if ($this->type == "select") {
                             $isThisIt = $this->value == $k;
                         } else {
                             $isThisIt = in_array($k, $values);
                         }
                         $html .= "<option " . ($isThisIt ? "selected=\"selected\"" : "") . " value=\"{$k}\">{$v}</option>";
                     } else {
                         if ($this->value == $k or $v->getValue() == $this->value) {
                             $v->isSelected(true);
                         }
                         $html .= $v;
                     }
                 }
             }
             $html .= "</select>";
             return $html;
             break;
     }
 }
Пример #15
0
 public static function parserFallback($w, $l, $E)
 {
     T::D("Wecker");
     $I = new HTMLInput("WeckerFallback", "text", $w);
     $I->style("margin-top:10px;");
     $IF = new HTMLInput("WeckerFallbackUpload", "file");
     $IF->onchange(OnEvent::rme($E, "processUpload", array("fileName"), "\$j('[name=WeckerFallback]').val(fileName).trigger('change');"));
     return $IF . $I . "<br /><small style=\"color:grey;\">" . T::_("Diese Datei wird abgespielt, wenn nach 15 Sekunden kein Internetradio geladen werden konnte. Bitte beachten Sie, dass nicht alle Browser <a href=\"http://en.wikipedia.org/wiki/HTML5_Audio\" target=\"_blank\">alle Formate abspielen können</a>.") . "</small>";
 }
Пример #16
0
 public function getQuicksearchInput()
 {
     $I = new HTMLInput("quickSearch", "text", "");
     #$I->hasFocusEvent(true);
     $I->id("quickSearch{$this->collectionName}");
     $I->onkeyup("AC.update(event.keyCode, this, '{$this->collectionName}','quickSearchLoadFrame');");
     $I->autocompleteBrowser(false);
     $I->onfocus("focusMe(this); ACInputHasFocus=true; AC.start(this); if(this.value != '') AC.update('10', this, '{$this->collectionName}', 'quickSearchLoadFrame');");
     $I->onblur("blurMe(this); ACInputHasFocus=false; AC.end(this);");
     $I->placeholder("Suche");
     $B = "";
     $showSF = PMReflector::implementsInterface($this->collectionName . "GUI", "iSearchFilter");
     if ($showSF) {
         $B = new Button("Suche als Filter anwenden", "./images/i2/searchFilter.png", "icon");
         $B->style("float:right;");
         $B->rme("HTML", "", "saveContextMenu", array("'searchFilter'", "'{$this->collectionName};:;'+\$('quickSearch{$this->collectionName}').value"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         $mU = new mUserdata();
         $K = $mU->getUDValue("searchFilterInHTMLGUI" . $this->collectionName);
         $I->setValue($K);
         $I->style("width:90%;");
     }
     return $B . $I;
 }
Пример #17
0
 public function __toString()
 {
     $hiddenFields = "";
     if ($this->cols == 2 or $this->cols == 1) {
         foreach ($this->fields as $k => $v) {
             if (isset($this->spaceLines[$v])) {
                 $this->table->addRow(array("<hr />"));
                 #$this->table->addRowStyle("font-weight:bold;");
                 #$this->table->addCellStyle(1, "padding-top:20px;");
                 $this->table->addRowColspan(1, 2);
                 $this->table->addRowClass("FormSeparatorWithoutLabel");
             }
             if (isset($this->spaces[$v]) and $this->spaces[$v] != "") {
                 $this->table->addRow(array($this->spaces[$v]));
                 #$this->table->addRowStyle("font-weight:bold;");
                 #$this->table->addCellStyle(1, "padding-top:20px;");
                 $this->table->addRowColspan(1, 2);
                 $this->table->addRowClass("FormSeparatorWithLabel");
             }
             if (isset($this->spaces[$v]) and $this->spaces[$v] == "") {
                 $this->table->addRow(array(""));
                 $this->table->addRowClass("backgroundColor0");
                 $this->table->addRowColspan(1, 2);
                 $this->table->addRowClass("FormSeparatorWithoutLabel");
             }
             $Input = $this->getInput($v);
             $B = $this->getCustomButton($v, $Input);
             if (is_object($Input) and $Input instanceof HTMLInput) {
                 $InputS = $Input->__toString();
                 $this->callbacks .= $Input->getCallback();
             } else {
                 $InputS = $Input;
             }
             if (!isset($this->types[$v]) or $this->types[$v] != "hidden") {
                 if ($this->cols == 2) {
                     $this->table->addLV((isset($this->labels[$v]) ? $this->labels[$v] : ucfirst($v)) . ($this->printColon ? ":" : ""), $B . $InputS . (isset($this->descriptionField[$v]) ? "<br /><small style=\"color:grey;\">" . $this->descriptionField[$v] . "</small>" : ""));
                 }
                 if ($this->cols == 1) {
                     $this->table->addRow("<label " . ($this->cols == 1 ? "style=\"width:100%;\"" : "") . ">" . (isset($this->labels[$v]) ? $this->labels[$v] : ucfirst($v)) . ":</label>");
                     $this->table->addRowClass("backgroundColor3");
                     $this->table->addRow($B . $InputS . (isset($this->descriptionField[$v]) ? "<br /><small style=\"color:grey;\">" . $this->descriptionField[$v] . "</small>" : ""));
                     $this->table->addRowClass("backgroundColor0");
                 }
                 if (isset($this->inputLineSyles[$v])) {
                     $this->table->addRowStyle($this->inputLineSyles[$v]);
                 }
             } else {
                 $hiddenFields .= $InputS;
             }
         }
     }
     if ($this->cols == 4) {
         $row = array();
         foreach ($this->fields as $k => $v) {
             $Input = $this->getInput($v);
             if (isset($this->types[$v]) and $this->types[$v] == "hidden") {
                 $hiddenFields .= $Input;
                 continue;
             }
             if (isset($this->spaces[$v])) {
                 if ($this->spaces[$v] == "") {
                     if (count($row) == 0) {
                         $this->table->addRow(array("", "", "", ""));
                         $this->table->addRowClass("backgroundColor0");
                     }
                     if (count($row) == 2) {
                         $row[] = "";
                         $row[] = "";
                         $this->table->addRow($row);
                         $row = array();
                         $this->table->addRow(array("", "", "", ""));
                         $this->table->addRowClass("backgroundColor0");
                     }
                 } else {
                     if (count($row) == 0) {
                         $this->table->addRow(array($this->spaces[$v], "", "", ""));
                         $this->table->addRowClass("backgroundColor0");
                     }
                     if (count($row) == 2) {
                         $row[] = "";
                         $row[] = "";
                         $this->table->addRow($row);
                         $row = array();
                         $this->table->addRow(array($this->spaces[$v], "", "", ""));
                         $this->table->addRowClass("backgroundColor0");
                     }
                 }
                 #$this->table->addRow($row);
                 #$row = array();
             }
             $B = $this->getCustomButton($v, $Input);
             $row[] = "<label>" . (isset($this->labels[$v]) ? $this->labels[$v] : ucfirst($v)) . ":</label>";
             $row[] = $B . $Input . (isset($this->descriptionField[$v]) ? "<br /><small style=\"color:grey;\">" . $this->descriptionField[$v] . "</small>" : "");
             /*if(!isset($this->types[$v]) OR $this->types[$v] != "hidden"){
             					$this->table->addLV(
             						(isset($this->labels[$v]) ? $this->labels[$v] : ucfirst($v)).":",
             						$B.$Input);
             
             					if(isset($this->inputLineSyles[$v]))
             						$this->table->addRowStyle($this->inputLineSyles[$v]);
             				}
             				else $hiddenFields .= $Input;*/
             if (count($row) == 4) {
                 $this->table->addRow($row);
                 $row = array();
             }
         }
         if (count($row) == 2) {
             $row[] = "";
             $row[] = "";
             $this->table->addRow($row);
         }
     }
     foreach ($this->endLV as $k => $v) {
         $this->table->addLV($v[0], $v[1]);
     }
     if ($this->saveMode != null) {
         switch ($this->saveMode) {
             case "custom":
                 $this->table->addRow(array($this->saveButtonCustom));
                 $this->table->addRowColspan(1, $this->cols);
                 break;
             case "class":
                 $S = $this->saveButton();
                 $this->table->addRow(array($S));
                 $this->table->addRowColspan(1, $this->cols);
                 break;
             case "multiCMS":
                 $S = new HTMLInput("submitForm", "submit", $this->saveButtonLabel);
                 if ($this->saveButtonBGIcon != "") {
                     $S->style("background-image:url({$this->saveButtonBGIcon});background-position:98% 50%;background-repeat:no-repeat;");
                 }
                 if ($this->saveButtonSubmit != null) {
                     $S->onclick(str_replace("/*CALLBACKS*/", $this->callbacks, $this->saveButtonSubmit));
                 }
                 $action = new HTMLInput("action", "hidden", $this->saveAction);
                 $handler = new HTMLInput("HandlerName", "hidden", $this->saveClass);
                 $return = new HTMLInput("returnP", "hidden", "/" . $_GET["permalink"]);
                 if ($this->cols > 1) {
                     $this->table->addRow(array("", $S . $action . $handler . $return));
                 } else {
                     $this->table->addRow(array($S . $action . $handler . $return));
                 }
                 break;
             case "rmeP":
                 $S = new HTMLInput("submitForm", "button", $this->saveButtonLabel);
                 if ($this->saveButtonBGIcon != "") {
                     $S->style("background-image:url({$this->saveButtonBGIcon});background-position:98% 50%;background-repeat:no-repeat;");
                 }
                 $S->onclick(($this->saveButtonConfirm != null ? "if(confirm('" . $this->saveButtonConfirm . "')) " : "") . $this->saveButtonSubmit);
                 $S->setClass("submitFormButton borderColor1");
                 $C = "";
                 if ($this->abortButton != null) {
                     $C = new HTMLInput("abortForm", "button", $this->abortButton[0]);
                     if ($this->abortButton[2] != null) {
                         $C->style("background-image:url({$this->abortButton[2]});background-position:98% 50%;background-repeat:no-repeat;");
                     }
                     $C->onclick($this->abortButton[1]);
                     $C->setClass("abortFormButton borderColor1");
                 }
                 $this->table->addRow(array($S . $C));
                 $this->table->addRowColspan(1, 2);
                 break;
             case "Bericht":
                 $S = new HTMLInput("submitForm", "button", $this->saveButtonLabel);
                 if ($this->saveButtonBGIcon != "") {
                     $S->style("background-image:url({$this->saveButtonBGIcon});background-position:98% 50%;background-repeat:no-repeat;");
                 }
                 $S->onclick($this->saveButtonOnclick);
                 $this->table->addRow(array($S));
                 $this->table->addRowColspan(1, 2);
                 break;
         }
     }
     $html = "";
     if ($this->formTag) {
         $html .= "\n\t<form\n\t\tid=\"{$this->id}\"\n\t\t" . ($this->action != null ? "action=\"{$this->action}\"" : "") . "\n\t\t" . ($this->method != null ? "method=\"{$this->method}\"" : "") . "\n\t\t" . ($this->enctype != null ? "enctype=\"{$this->enctype}\"" : "") . "\n\t\t" . ($this->onSubmit != null ? "onsubmit=\"{$this->onSubmit}\"" : "") . "\n\t\t" . ($this->style != null ? "style=\"{$this->style}\"" : "") . ">";
     }
     $html .= $this->table;
     $html .= $hiddenFields;
     if ($this->formTag) {
         $html .= "\n\t</form>";
     }
     return $html . ($this->appendJs != "" ? OnEvent::script($this->appendJs) : "") . ($this->useRecentlyChanged ? GUIFactory::editFormOnchangeTest($this->id) : "");
 }
Пример #18
0
 function showWarenkorb()
 {
     $AC = anyC::get("Seminar");
     $AC->addAssocV3("SeminarVon", ">=", Util::parseDate("de_DE", Util::formatDate("de_DE", time())));
     $count = array();
     for ($i = 0; $i < 21; $i++) {
         $count[$i] = $i;
     }
     $T = new HTMLTable(3, "Events");
     $T->setTableStyle("width:100%;");
     while ($S = $AC->getNextEntry()) {
         $I = new HTMLInput("AnzahlKarten" . $S->getID(), "select", "0", $count);
         $I->style("width:80px;text-align:right;");
         $I->onchange("CustomerPage.rme('recalc', ['" . $S->getID() . "', this.value], function(response){ \$('#PreisGesamt" . $S->getID() . "').html(response) });");
         if (isset($_SESSION["ticketDataSelection"])) {
             $I->setValue($_SESSION["ticketDataSelection"][$S->getID()]);
         }
         $Adresse = new Adresse($S->A("SeminarAdresseID"));
         $T->addRow(array("<b>" . $S->A("SeminarName") . "</b>, " . Util::CLDateParser($S->A("SeminarVon")) . " ab " . Util::CLTimeParser($S->A("SeminarStart")) . " Uhr, " . $Adresse->A("ort")));
         $T->addRowColspan(1, 3);
         $T->addRow(array($I, Util::formatCurrency("de_DE", $S->A("SeminarPreisErwachsene") * 1, true), Util::formatCurrency("de_DE", $S->A("SeminarPreisErwachsene") * $I->getValue(), true)));
         $T->addCellStyle(1, "text-align:right;");
         $T->addCellStyle(2, "text-align:right;");
         $T->addCellStyle(3, "text-align:right;");
         $T->addCellID(3, "PreisGesamt" . $S->getID());
         $T->addRow(array("&nbsp;"));
         $T->addRowColspan(1, 3);
     }
     $I = new Button("Weiter", "");
     $I->onclick("CustomerPage.rme('handleForm', \$('#ticketShop').serialize(), function(){ document.location.reload(); })");
     $I->className("submitFormButton");
     $T->addRow($I);
     $T->addRowColspan(1, 3);
     $IA = new HTMLInput("action", "hidden", "handleSelection");
     return "<form id=\"ticketShop\">" . $T . $IA . "</form>";
 }
Пример #19
0
    die($html);
}
if (isset($_GET["getLink"]) and isset($_GET["fromPage"]) or isset($_GET["manualDL"])) {
    if (isset($_GET["manualDL"])) {
        $result = $RSF->download($_GET["manualDL"]);
        $dled = $_GET["manualDL"];
    } else {
        $result = $Adapter->download($RSF, $_GET["getLink"], $_GET["fromPage"]);
        $dled = $_GET["getLink"];
    }
    if ($result !== true) {
        $ILink = new HTMLInput("manualDL");
        $ILink->id("manualDL");
        $ILink->style("border:1px solid grey;width:400px;padding:2px;");
        $IGo = new HTMLInput("go", "button", "Go");
        $IGo->style("border:1px solid grey;margin-left:10px;padding:2px;");
        $IGo->onclick("if(document.getElementById('manualDL').value != '') document.location.href='?RSSFilterID={$_GET['RSSFilterID']}&manualDL='+document.getElementById('manualDL').value; else alert('Please input a link!');");
        $html = emoFatalError($result[0] . "</h1><p>Look for <b>" . basename($dled) . "</b></p><p>Please input the link here: " . $ILink . $IGo . "</p><h1>", $result[1], "trinityDB automatic downloader", false, false);
        $html = str_replace("<!-- MORE SPACE -->", "<iframe src=\"{$_GET['fromPage']}\" style=\"width:100%;border:0px;height:550px;margin-top:5px;\"></iframe>", $html);
        die($html);
    } else {
        echo "<!DOCTYPE html>\n\t\t<html lang=\"en\">\n\t\t\t<head>\n\t\t\t\t<meta charset=\"utf-8\" />\n\t\t\t\t<title>trinityDB automatic downloader</title>" . RSSFilter::getStyle() . "\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<div class=\"backgroundColor0\">\n\t\t\t\t\t<h1>Download OK</h1>\n\t\t\t\t\t<p>" . basename($dled) . "</p>\n\t\t\t\t\t<p>From <a href=\"{$_GET['fromPage']}\">{$_GET['fromPage']}</a></p>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>";
    }
    exit;
}
$tvdbUnavailable = false;
$tvdb = new thetvdbcomAdapter();
$nonupdated = 0;
try {
    $nonupdated = $tvdb->update();
} catch (Exception $ex) {
Пример #20
0
    public function editInPopup($formID, $fieldName, $variablesCallback = null)
    {
        $ITA = new HTMLInput("tinyMCEEditor", "textarea");
        $ITA->id("tinyMCEEditor");
        $ITA->style("width:100%;height:500px;");
        if ($variablesCallback != null) {
            echo "<div style=\"float:right;width:190px;margin:5px;\">\n\t\t\t\t\t<p><small>Sie können folgende Variablen in Ihrem Text verwenden (bitte beachen Sie Groß- und Kleinschreibung):</small></p>\n\t\t\t\t\t<p style=\"margin-top:5px;\" id=\"tinyMCEVars\"></p></div>";
        }
        echo "<div style=\"width:" . ($variablesCallback != null ? "800" : "1000") . "px;\">" . $ITA . "</div>";
        #$rand = rand(100, 13454832910);
        echo '
			<style type="text/css">
				#tinyMCEEditor_toolbargroup table {
					width:auto;
					margin:0px;
				}
			</style>
			<script type="text/javascript">
				tinymce.create("tinymce.plugins.ExamplePlugin", {
					createControl: function(n, cm) {
						switch (n) {
							case "mylistbox":
								var mlb = cm.createListBox("mylistbox", {
									 title : "Variablen",
									 onselect : function(v) {
										 tinyMCE.activeEditor.windowManager.alert("Value selected:" + v);
									 }
								});

								// Add some values to the list box
								mlb.add("Some item 1", "val1");
								mlb.add("some item 2", "val2");
								mlb.add("some item 3", "val3");
								mlb.add("some item 4", "val4");

								// Return the new listbox instance
								return mlb;
						}

						return null;
					}
				});
				
				tinymce.PluginManager.add("variablen", tinymce.plugins.ExamplePlugin);

				if(!$("tinyMCEEditor").value.match("</p>"))
					$("tinyMCEEditor").value = $("' . $formID . '").' . $fieldName . '.value.replace(/\\n/g, "<br />");
				else
					$("tinyMCEEditor").value = $("' . $formID . '").' . $fieldName . '.value;
				$j("#tinyMCEEditor").tinymce({
				mode : "textareas",
				theme : "advanced",
					plugins: "-variablen,save,table,spellchecker,searchreplace,insertdatetime,paste,inlinepopups,pagebreak,preview,media,layer,advimage,style,safari,tabfocus",
					theme_advanced_buttons1 : "save,|,undo,redo,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,charmap,|,insertdate,inserttime,removeformat,code",
					theme_advanced_buttons2 : "mylistbox,|,bold,italic,underline,|,forecolor",
					theme_advanced_buttons3 : null,
					save_onsavecallback : function(content){ $("' . $formID . '").' . $fieldName . '.value = content.getContent(); },
					theme_advanced_toolbar_location : "top"/*,
					theme_advanced_toolbar_align : "left",
					theme_advanced_statusbar_location : "bottom",
					theme_advanced_resizing : false*/
				});
				' . ($variablesCallback != null ? "{$variablesCallback}();" : "") . '
			</script>';
    }
Пример #21
0
 public static function EMailPopupAttachmentsSP($dataClass, $dataClassID, $callbackParameter = null)
 {
     $c = new $dataClass($dataClassID);
     $data = $c->getEMailData($callbackParameter);
     $T = new HTMLTable(1, "Anhänge");
     foreach ($data["attachmentsAlways"] as $file) {
         $T->addRow("<small>{$file}</small>");
         $T->addCellStyle(1, "max-width: 100px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;");
     }
     echo $T;
     $T = new HTMLTable(2, "Mögliche Anhänge");
     $T->setColWidth(1, 20);
     foreach ($data["attachmentsOptional"] as $k => $file) {
         $I = new HTMLInput("addFile{$k}", "checkbox");
         $I->style("margin:0px;");
         $I->data("value", $file);
         $T->addRow(array($I, "<small>{$file}</small>"));
         $T->addCellStyle(2, "max-width: 100px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;cursor:pointer;");
         $T->addCellEvent(2, "click", "\$j('[name=addFile{$k}]').prop('checked', !\$j('[name=addFile{$k}]').prop('checked'));");
     }
     echo ((isset($data["attachmentsOptional"]) and count($data["attachmentsOptional"])) ? "<div style=\"height:30px;\"></div>" : "") . "<form id=\"UtilEmailFormAttachments\">" . $T . "</form>";
 }
Пример #22
0
 public function openInPopup($className, $classID, $fieldName)
 {
     $C = new $className($classID);
     $tinyMCEID = "tinyMCEEditor" . rand(100, 9000000);
     $ITA = new HTMLInput("tinyMCEEditor", "textarea", $C->A($fieldName));
     $ITA->id($tinyMCEID);
     $ITA->style("width:1000px;height:300px;");
     echo "<div style=\"width:1000px;\">" . $ITA . "</div>";
     $buttons = "save | undo redo | pastetext | styleselect fontsizeselect fontselect | bold italic underline forecolor | hr code fullscreen";
     echo OnEvent::script("\n\t\t\t\$j('#{$tinyMCEID}').css('height', contentManager.maxHeight());\nsetTimeout(function(){\n\t" . $this->editorDokument($tinyMCEID, "function(content){" . OnEvent::rme($C, "saveMultiEditField", array("'{$fieldName}'", "content.getContent()")) . "" . OnEvent::closePopup("tinyMCE") . "}", $buttons) . "\n\t\t\t\n\t\t}, 100);");
 }
Пример #23
0
 public function getArtikel($data)
 {
     $TKategorien = new HTMLTable(2, "Kategorien");
     $TKategorien->setTableStyle("width:100%;");
     $TKategorien->setTableID("tableKategorien");
     $TKategorien->setColWidth(1, 20);
     $B = new Button("Nach Kategorie filtern", "arrow_down", "iconic");
     $B->className("reverse");
     $AC = anyC::get("Kategorie", "type", "2");
     $AC->addOrderV3("name");
     $TKategorien->addRow(array($B, "Alle Kategorien"));
     $TKategorien->addRowClass("selectable");
     $TKategorien->addRowEvent("click", "CustomerPage.rme('getArtikel', {KategorieID: '', query : '{$data['query']}', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });");
     if ($data["KategorieID"] == "") {
         $TKategorien->addRowStyle("text-decoration:underline;");
     }
     while ($K = $AC->getNextEntry()) {
         $B = new Button("Nach Kategorie filtern", "arrow_down", "iconic");
         if ($data["KategorieID"] != $K->getID()) {
             $B->className("reverse");
         }
         $TKategorien->addRow(array($B, $K->A("name")));
         $TKategorien->addRowClass("selectable");
         $TKategorien->addRowEvent("click", "CustomerPage.rme('getArtikel', {KategorieID: '" . $K->getID() . "', query : '{$data['query']}', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });");
         #if($data["KategorieID"] == $K->getID())
         #	$TKategorien->addRowStyle ("text-decoration:underline;");
     }
     $TArtikel = new HTMLTable(4, "Artikel");
     $TArtikel->setTableStyle("width:100%;");
     $TArtikel->setColWidth(1, 26);
     $TArtikel->setColWidth(2, 100);
     $TArtikel->setColStyle(4, "text-align:right;");
     $BQ = "";
     if ($data["query"] != "") {
         $BQ = new Button("Suche löschen", "x_alt", "iconic");
         $BQ->onclick("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : '', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });");
         $BQ->style("color:darkred;float:left;");
     } else {
         $BQ = new Button("Suche", "question_mark", "iconic");
     }
     $I = new HTMLInput("query", "text", $data["query"]);
     $I->placeholder("Suche nach Name, Nummer oder Beschreibung");
     $I->style("width:90%;");
     $I->onEnter("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : this.value, GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });");
     $BS = new Button("Los", "arrow_right", "iconic");
     $BS->onclick("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : \$j('[name=query]').val(), GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });");
     $TArtikel->addRow(array($BQ, $I . " " . $BS));
     $TArtikel->addRowColspan(2, 3);
     $AC = anyC::get("Artikel");
     if ($data["KategorieID"] != "") {
         $AC->addAssocV3("KategorieID", "=", $data["KategorieID"], "AND", "1");
     }
     if ($data["query"] != "") {
         $AC->addAssocV3("artikelnummer", "LIKE", "%{$data['query']}%", "AND", "2");
         $AC->addAssocV3("name", "LIKE", "%{$data['query']}%", "OR", "2");
         $AC->addAssocV3("beschreibung", "LIKE", "%{$data['query']}%", "OR", "2");
     }
     $AC->addOrderV3("artikelnummer");
     $AC->addOrderV3("name");
     $AC->setLimitV3(100);
     while ($A = $AC->getNextEntry()) {
         $B = new Button("Artikel hinzufügen", "arrow_left", "iconic");
         $B->className("reverse");
         #$B->onclick("CustomerPage.rme('delPosten', {PostenID: '".$P->getID()."'}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: $data[GRLBMID]}, function(transport){ $('#contentLeft').html(transport); }); });");
         $A->resetParsers();
         $TArtikel->addRow(array($B, $A->A("artikelnummer"), $A->A("name") . ($A->A("bemerkung") != "" ? "<br /><small style=\"color:grey;\">" . $A->A("bemerkung") . "</small>" : ""), $this->showPrices ? Util::CLFormatCurrency($A->getGesamtBruttoVK() * 1, true) . "<br /><small style=\"color:grey;\">" . Util::CLFormatCurrency($A->getGesamtNettoVK() * 1, true) . "</small>" : ""));
         $TArtikel->addRowClass("selectable");
         $TArtikel->addRowEvent("click", "CCAuftrag.lastTextbausteinUnten = \$('[name=textbausteinUnten]').val(); CustomerPage.rme('addArtikel', {ArtikelID: '" . $A->getID() . "', GRLBMID: {$data['GRLBMID']}}, function(transport){ CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); }); });");
     }
     if ($AC->numLoaded() == 0) {
         $TArtikel->addRow(array("", "Keine Artikel gefunden"));
         $TArtikel->setColWidth(2, 200);
     }
     $html = "<h1>Artikel</h1>\n\t\t\t\t{$TKategorien}\n\t\t\t\t{$TArtikel}";
     return $html;
 }
Пример #24
0
 public static function parserDayOfWeek($value)
 {
     $I = new HTMLInput("TodoRepeatDayOfWeek", "hidden", $value);
     $checked = array();
     if ($value != "") {
         $checked = explode(",", $value);
     }
     $Is = "";
     for ($i = 0; $i < 7; $i++) {
         $I2 = new HTMLInput("DOW{$i}", "checkbox", in_array($i, $checked) ? "1" : "0");
         $I2->style("float:left;margin:0px;margin-right:5px;");
         $I2->onchange("var selectedDOW = ''; \$j('.DOWSelector:checked').each(function(k, v){ selectedDOW += (selectedDOW == '' ? '' : ',')+\$j(v).prop('name').replace('DOW', '');}); \$j('[name=TodoRepeatDayOfWeek]').val(selectedDOW);");
         $I2->setClass("DOWSelector");
         $Is .= "<div style=\"margin-bottom:5px;\">" . $I2 . Util::CLWeekdayName($i) . "</div>";
     }
     return $Is . $I;
 }
Пример #25
0
 public function showCurrentFrozenList()
 {
     $I = new HTMLInput("GefrierschrankNewEntry", "textarea", "");
     $I->placeholder("Neuer Eintrag");
     $I->style("width:390px;padding:5px;margin-left:5px;font-size:20px;float:left;font-family:monospace;max-width:390px;resize:none;height:35px;max-height:35px;");
     $I->onEnter(OnEvent::rme($this, "addFrozenItem", array("this.value"), "function(transport){ \$j('#currentList').html(transport.responseText); }") . " \$j(this).val('');");
     $B = new Button("Liste schließen", "stop");
     $B->onclick(OnEvent::closePopup("mGericht"));
     $B->style("float:right;margin:10px;");
     #<div id=\"EinkaufslisteNewEntryAC\" style=\"width:390px;height:35px;padding:5px;font-size:20px;margin-top:3px;font-family:monospace;color:grey;float:left;\"></div>
     echo "\n\t\t<div style=\"width:600px;display:inline-block;vertical-align:top;\" id=\"reAddList\">\n\t\t\t" . $this->getFrozenListReAddTable() . "\n\t\t</div><div style=\"width:400px;display:inline-block;vertical-align:top;\">\n\t\t\t<div id=\"headerList\">\n\t\t\t{$B}\n\t\t\t{$I}<div style=\"clear:both;\"></div></div>\n\t\t\t\n\t\t\t<div id=\"currentList\">" . $this->getFrozenListTable() . "</div>\n\t\t</div>\n\t\t\t" . OnEvent::script("\$j('#editDetailsContentmEinkaufszettel').css('overflow', ''); setTimeout(function(){ \$j('input[name=EinkaufslisteNewEntry]').focus(); }, 200);");
 }
Пример #26
0
 public static function timeTillParser($w, $f, $E)
 {
     if ($f == "") {
         $f = "TodoTillTime";
     }
     $f2 = "TodoFromTime";
     if ($f == "TodoFromTime") {
         $f2 = "TodoTillTime";
     }
     $rawTime = Util::CLTimeParser($w, "store");
     $down = floor($rawTime / (15 * 60)) * 15 * 60;
     $up = ceil($rawTime / (15 * 60)) * 15 * 60;
     if (Util::CLTimeParser($down) == $w) {
         $down -= 15 * 60;
         $up += 15 * 60;
     }
     $I = new HTMLInput($f, "time", $w);
     $I->style("width:50px;text-align:right;");
     $I->id($f);
     if ($f == "TodoFromTime") {
         $I->connectTo("TodoTillTime");
     }
     $values = array($down - 900 * 2, $down - 900, $down, $up, $up + 900);
     if ($f == "TodoFromTime") {
         $values = array($down, $up, $up + 900, $up + 900 * 2, $up + 900 * 3);
     }
     /*$T = new HTMLTable(count($values));
     		$T->setTableStyle("margin-top:5px;display:none;");
     		$val = array_map("Util::CLTimeParser", $values);
     		$T->addRow($val);
     		$T->setTableID("{$f}Table");
     
     		for($i = 1; $i < 6; $i++){
     			#$T->setColClass($i, "");
     			
     			$T->setColWidth($i, (100 / count($values))."%");
     			$T->addCellStyle($i, "cursor:pointer;text-align:center;color:grey;");
     			$T->addCellEvent($i, "mouseover", "this.className = 'backgroundColor0';");
     			$T->addCellEvent($i, "mouseout", "this.className = '';");
     			
     			$T->addCellEvent($i, "click", "$('$f').value = '".Util::CLTimeParser($values[$i-1])."'; ".($f == "TodoFromTime" ? "$('$f2').value = '".Util::CLTimeParser($values[$i-1] + 3600)."';" : ""));
     		}*/
     return "<span id=\"{$f}Display\" style=\"" . ($E->A("TodoAllDay") ? "display:none;" : "") . "\" ><span style=\"color:grey;margin-left:30px;\">um</span> " . $I . "</span>";
     #.($w != "" ? $T : "")
 }
Пример #27
0
 public function buildFlipPageLine($where = "top")
 {
     if ($this->multiPageDetails["total"] == null) {
         return;
     }
     if (!$this->showFlipPage) {
         return;
     }
     $I = new HTMLInput("targetPage", "text", $this->multiPageDetails["page"] + 1);
     $I->onEnter("javascript:contentManager.loadPage('" . $this->multiPageDetails["target"] . "', this.value - 1);");
     $I->style("width: 30px; float: right; text-align: right;");
     $I->hasFocusEvent(true);
     $wholeLine2 = array($this->getPageBrowser());
     if ($where == "top" or $where == "bottom") {
         if ($this->tableMode == "BrowserRight") {
             $wholeLine1 = array($this->getSettingsButton(), $I . "<span style=\"float:left;\">" . $this->multiPageDetails["total"] . " " . ($this->multiPageDetails["total"] != 1 ? "Einträge" : "Eintrag") . "</span>");
             $this->table->addRow($wholeLine1);
             $this->table->addRowColspan(2, count($this->referenceLine) - 1);
         }
         if ($this->tableMode == "BrowserLeft") {
             $wholeLine1 = array($I . "<span style=\"float:left;\">" . $this->multiPageDetails["total"] . " " . ($this->multiPageDetails["total"] != 1 ? "Einträge" : "Eintrag") . "</span>");
             $wholeLine1 = array_pad($wholeLine1, count($this->referenceLine) - 1, "");
             $wholeLine1[] = $this->getSettingsButton();
             $this->table->addRow($wholeLine1);
             $this->table->addRowColspan(1, count($this->referenceLine) - 1);
             $this->setColStyle($this->referenceLine[count($this->referenceLine) - 1], "width:20px;");
         }
         $this->table->addRow($wholeLine2);
         $this->table->addRowColspan(1, count($this->referenceLine));
     }
 }
Пример #28
0
 public function __toString()
 {
     #$style = "";
     if ($this->type == "date" and strpos($this->style, "width:") === false) {
         $this->style .= "width:calc(100% - 28px)%;";
     }
     #if($this->style != null) $style = " style=\"$this->style\"";
     switch ($this->type) {
         /*case "JSONMultiText":
         			$data = json_decode($this->value);
         			
         			print_r($data);
         			
         			$L = new HTMLList();
         			$L->noDots();
         			$L->addListStyle("padding:0px;");
         			
         			foreach($data AS $k => $v){
         				$IL = new HTMLInput($this->name."_$k", "text", $v);
         				$BL = new Button("Element hinzufügen");
         				$L->addItem($IL);
         				$L->addItemStyle("margin-left:0px;");
         			}
         			
         			$I = new HTMLInput($this->name, "textarea", $this->value);
         			$I->id($this->name);
         			
         			return $L.$I;
         		break;*/
         case "audio":
             return "<audio controls preload=\"auto\" autobuffer style=\"{$this->style}\"><source src=\"{$this->value}\"></audio>";
             break;
         case "search":
             $currentId = $this->id != null ? $this->id : $this->name . rand(100, 100000000);
             $enter = "if(\$j('#{$currentId}').val() != ''){ \$j('#SB{$currentId}').fadeOut(200, function(){ \$j('#SA{$currentId}').fadeIn();}); } else { \$j('#SA{$currentId}').fadeOut(200, function(){ \$j('#SB{$currentId}').fadeIn(); }); }";
             $I = new HTMLInput($this->name, "text", $this->value, $this->options);
             $I->style($this->style);
             $I->placeholder($this->placeholder);
             $I->onEnter($this->onenter . $enter);
             #$I->onEnter(" ");
             $I->id($currentId);
             $BSearch = new Button("Suchen", "question_mark", "iconicG");
             $BSearch->style("margin-left:5px;");
             $BSearch->id("SB{$currentId}");
             $BSearch->onclick($this->onenter . $enter);
             #$BSearch->id("searchMailsInfo");
             $BSearchClear = new Button("Suche beenden", "x_alt", "iconicR");
             $BSearchClear->style("margin-left:5px;display:none;");
             $BSearchClear->id("SA{$currentId}");
             $BSearchClear->onclick("\$j('#{$currentId}').val('').trigger('blur'); {$this->onenter}{$enter}");
             #$BSearchClear->id("searchMailsClear");
             return $I . $BSearch . $BSearchClear . $this->requestFocus;
             break;
         case "HTMLEditor":
             $B = new Button("in HTML-Editor\nbearbeiten", "editor");
             $B->windowRme("Wysiwyg", "", "getEditor", "", "WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->className("backgroundColor2");
             return $B->__toString();
             break;
         case "TextEditor":
             #return "<input ".(isset($this->events[$as]) ? $eve : "")." style=\"background-image:url(./images/navi/editor.png);".(isset($this->inputStyle[$as]) ? "".$this->inputStyle[$as]."" : "")."\" type=\"button\" class=\"bigButton backgroundColor2\" onclick=\"TextEditor.show('$as','$this->FormID');\" value=\"".$this->texts["in Editor bearbeiten"]."\" /><textarea style=\"display:none;\" name=\"".$as."\" id=\"".$as."\">".$this->attributes->$as."</textarea>";
             $B = new Button("in Editor\nbearbeiten", "editor");
             $B->className("backgroundColor2");
             $B->onclick("TextEditor.show('{$this->name}','{$this->options[0]}');");
             $ITA = new HTMLInput($this->name, "textarea", $this->value);
             $ITA->id($this->name);
             $ITA->style("display:none;");
             return $B->__toString() . $ITA;
             break;
         case "nicEdit":
             $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'");
             if (isset($this->options[2])) {
                 $BO[] = "'{$this->options[2]}'";
             }
             $B = new Button("in Editor\nbearbeiten", "editor");
             #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->doBefore("Overlay.showDark(); %AFTER");
             $B->popup("", "Editor", "nicEdit", "-1", "editInPopup", $BO, "", "Popup.presets.large");
             $B->className("backgroundColor2");
             $ITA = new HTMLInput($this->name, "hidden", $this->value);
             return $B->__toString() . $ITA;
             break;
         case "tinyMCE":
             $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'");
             if (isset($this->options[2])) {
                 $BO[] = "'{$this->options[2]}'";
             }
             if (isset($this->options[3])) {
                 $BO[] = "'{$this->options[3]}'";
             }
             $B = new Button("in Editor\nbearbeiten", "editor");
             #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}");
             $B->doBefore("Overlay.showDark(); %AFTER");
             $B->popup("", "Editor", "tinyMCE", "-1", "editInPopup", $BO, "", "Popup.presets.large");
             $B->className("backgroundColor2");
             $ITA = new HTMLInput($this->name, "hidden", $this->value);
             return $B->__toString() . $ITA;
             break;
         case "multiInput":
             return "<input\n\t\t\t\t\tclass=\"multiEditInput2\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tvalue=\"" . htmlspecialchars($this->value) . "\"\n\t\t\t\t\tonfocus=\"oldValue = this.value;\"\n\t\t\t\t\tid=\"" . $this->options[2] . "ID" . $this->options[1] . "\"\n\t\t\t\t\tonblur=\"if(oldValue != this.value) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"\n\t\t\t\t\tonkeydown=\"if(event.keyCode == 13) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"/>";
             break;
             /*case "customSelection":
             				$B = new Button("Eintrag auswählen...", "gutschrift");
             				$B->type("LPBig");
             				$B->style("float:right;margin-left:10px;");
             				#				 "contentRight"		"callingPluginID"  "selectPlugin"
             				$B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]);
             
             				return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />";
             			break;*/
         /*case "customSelection":
         				$B = new Button("Eintrag auswählen...", "gutschrift");
         				$B->type("LPBig");
         				$B->style("float:right;margin-left:10px;");
         				#				 "contentRight"		"callingPluginID"  "selectPlugin"
         				$B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]);
         
         				return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />";
         			break;*/
         case "textarea":
             if ($this->isDisplayMode) {
                 return nl2br($this->value);
             }
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
                 $this->onfocus .= " contentManager.oldValue = this.value;";
                 $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 $this->onblur .= "if(contentManager.oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 if ($this->hasFocusEvent) {
                     $this->onfocus .= "focusMe(this);";
                     $this->onblur .= "blurMe(this);";
                 }
                 $this->hasFocusEvent = false;
             }
             return "<textarea\n\t\t\t\t\t" . ($this->placeholder != null ? " placeholder=\"{$this->placeholder}\"" : "") . "\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . (!$this->autocorrect ? "autocorrect=\"off\"" : "") . "\n\t\t\t\t\t" . (!$this->spellcheck ? "spellcheck=\"false\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->isDisabled ? "disabled=\"disabled\"" : "") . "\n\t\t\t\t\t" . ($this->hasFocusEvent ? "onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">{$this->value}</textarea>";
             break;
         case "file":
             $physion = Session::physion();
             $currentId = ($this->id != null ? $this->id : $this->name) . rand(100, 100000000);
             if (isset($this->options["autoUpload"]) and !$this->options["autoUpload"]) {
                 $this->callback = "QQUploader{$currentId}.uploadStoredFiles();";
             }
             return "\n\t\t\t\t\t<div id=\"progress_{$currentId}\" style=\"height:10px;width:95%;display:none;\" class=\"\">\n\t\t\t\t\t\t<div id=\"progressBar_{$currentId}\" style=\"height:10px;width:0%;\" class=\"backgroundColor1\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"{$currentId}\" style=\"width:100%;{$this->style}\"></div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tQQUploader{$currentId} = new qq.FileUploader({\n\t\t\t\t\t\t\tmaxSizePossible: '" . ini_get("upload_max_filesize") . "B',\n\t\t\t\t\t\t\tsizeLimit: " . Util::toBytes(ini_get("upload_max_filesize")) . ",\n\t\t\t\t\t\t\telement: \$j('#{$currentId}')[0],\n\t\t\t\t\t\t\taction: '" . (($this->options != null and isset($this->options["action"])) ? $this->options["action"] : "./interface/set.php") . "',\n\t\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\t\t'class': '" . (($this->options == null or !isset($this->options["class"])) ? "TempFile" : $this->options["class"]) . "'\n\t\t\t\t\t\t\t\t,'id':'-1'\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["path"])) ? ",'path':'" . $this->options["path"] . "'" : "") . "\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["targetFilename"])) ? ",'targetFilename':'" . $this->options["targetFilename"] . "'" : "") . "\n\t\t\t\t\t\t\t\t" . ($physion ? ",'physion':'{$physion['0']}'" : "") . "\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t" . (isset($this->options["autoUpload"]) ? "autoUpload: " . ($this->options["autoUpload"] ? "true" : "false") . "," : "") . "\n\t\t\t\t\t\t\t" . (isset($this->options["multiple"]) ? "multiple: " . ($this->options["multiple"] ? "true" : "false") . "," : "") . "\n\t\t\t\t\t\t\tonSubmit: function(id, fileName){ \$j('#progress_{$currentId}').css('display', 'block');},\n\t\t\t\t\t\t\tonComplete: function(id, fileName, transport){ \$j('progress_{$currentId}').css('display', 'none'); {$this->onchange} },\n\t\t\t\t\t\t\tonProgress: function(id, fileName, loaded, total){ \$j('#progressBar_{$currentId}').css('width', Math.ceil((loaded / total) * 100)+'%'); }});\n\t\t\t\t\t</script>";
             break;
         case "time":
             $this->type = "text";
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
             }
             if (!$this->id) {
                 $this->id = rand(100000, 9999999) . $this->name;
             }
             #$this->onkeyup .= "if(\$j(this).val().length == 2 && \$j(this).val().lastIndexOf(':') == -1) \$j(this).val(\$j(this).val()+':'); ";
             if ($this->connectTo) {
                 $this->onkeyup .= "contentManager.connectedTimeInput(event, '{$this->id}', '{$this->connectTo}'); ";
             } else {
                 $this->onkeyup .= "contentManager.timeInput(event, '{$this->id}'); ";
             }
         case "time2":
             if ($this->type == "time2") {
                 $this->type = "time";
             }
         case "radio1":
         case "date":
         case "email":
         case "text":
         case "hidden":
         case "submit":
         case "number":
         case "button":
         case "password":
         case "checkbox":
         case "readonly":
         case "fileold":
         case "color":
             $JS = "";
             if ($this->type == "radio1") {
                 $this->type = "radio";
             }
             if ($this->type == "fileold") {
                 $this->type = "file";
             }
             if ($this->isDisplayMode) {
                 if ($this->type == "checkbox") {
                     return Util::catchParser($this->value);
                 }
                 if ($this->type == "hidden") {
                     return "";
                 }
                 if ($this->type == "password") {
                     return str_repeat("*", mb_strlen($this->value));
                 }
                 return $this->value . "";
             }
             if ($this->hasFocusEvent) {
                 $this->onfocus .= "focusMe(this);";
                 $this->onblur .= "blurMe(this);";
             }
             if ($this->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
                 if ($this->type == "checkbox") {
                     $this->onchange = "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 } else {
                     $this->onfocus .= " oldValue = this.value;";
                     $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                     $this->onblur .= "if(oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 }
                 if ($this->type == "date") {
                     $this->onchange .= "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 }
             }
             $cal = "";
             $B2 = "";
             if ($this->type == "date") {
                 if ($this->id == null) {
                     $this->id = rand(10000, 90000);
                 }
                 $cal = new Button("Kalender anzeigen", "calendar", "iconic");
                 $cal->onclick("\$j('#{$this->id}').focus();");
                 $cal->style("float:right;");
                 $JS = "<script type=\"text/javascript\">\$j('#{$this->id}').datepicker();</script>";
                 $this->type = "text";
             }
             $value = "value=\"" . htmlspecialchars($this->value) . "\"";
             if ($this->type == "checkbox") {
                 $value = $this->value == "1" ? "checked=\"checked\"" : "";
             }
             $data = "";
             foreach ($this->data as $k => $v) {
                 $data .= " data-{$k}=\"{$v}\"";
             }
             if ($this->autocomplete != null) {
                 if ($this->id == null) {
                     $this->id = $this->name;
                 }
                 /*$this->onfocus .= " ACInputHasFocus=true; AC.start(this);";
                 		$this->onblur .= " ACInputHasFocus = false; AC.end(this);";
                 		$this->onkeyup .= " AC.update(event.keyCode, this, '".$this->autocomplete[0]."');";*/
                 $this->autocompleteBrowser = false;
                 $cal = $this->autocomplete[5];
                 #new Button("Suche", "./images/i2/details.png");
                 $cal->onclick("\$('{$this->id}').style.display = ''; \$('{$this->id}').value = ''; \$('{$this->id}').focus();");
                 if ($cal->getStyle() == "") {
                     $cal->style("float:right;");
                 }
                 if ($this->autocomplete[4] != null) {
                     $B2 = $this->autocomplete[4];
                     $B2->style("float:right;margin-left:5px;");
                     if (strpos($this->style, "width") === false) {
                         $this->style .= "width:80%";
                     }
                 } else {
                     if (strpos($this->style, "width") === false) {
                         $this->style .= "width:90%";
                     }
                 }
                 if ($this->autocomplete[1] == null) {
                     $cal->onclick("\$('{$this->id}Display').style.display = ''; \$('{$this->id}Display').value = ''; \$('{$this->id}').value = ''; \$('{$this->id}Display').focus();");
                     $IN = new HTMLInput($this->name, "hidden", htmlspecialchars($this->value));
                     $IN->id($this->name);
                     if ($this->onchange) {
                         $IN->onchange($this->onchange);
                         $this->onchange = "";
                     }
                     $JS .= $IN;
                     $this->autocomplete[1] = "function(selection){ if(!selection) return false; var oldVal = \$j('#{$this->id}').val(); \$j('#{$this->id}').val(selection.value); if(\$j('#{$this->id}').val() != oldVal) \$j('#{$this->id}').trigger('change'); \$('{$this->id}Display').value = selection.label; return false; }";
                     if ($this->value != "") {
                         $C = substr($this->autocomplete[0], 1) . "GUI";
                         $C = new $C($this->value);
                         $value = "value=\"" . htmlspecialchars($C->ACLabel($this->value, is_array($this->autocomplete[3]) ? $this->autocomplete[3] : array($this->autocomplete[3]))) . "\"";
                     }
                     $this->onkeyup .= "if(\$j('[name={$this->name}Display]').val() == '') {  \$j('[name={$this->name}]').val(''); } ";
                     $this->id .= "Display";
                     $this->name .= "Display";
                     $this->onkeyup .= "\$j('[name={$this->name}]').val(this.value);";
                 }
                 $JS .= OnEvent::script("var OnSelectCallback{$this->id} = " . $this->autocomplete[1] . "; \$j(\"input#{$this->id}\").autocomplete({\n\t\t\t\t\t\tsource: function(request, response){ \n\t\t\t\t\t\t\t " . OnEvent::rme($this->autocomplete[0], "getACData", array("'{$this->name}'", "request.term", is_array($this->autocomplete[3]) ? "'" . json_encode($this->autocomplete[3]) . "'" : $this->autocomplete[3]), "function(transport){ response(jQuery.parseJSON(transport.responseText)); }") . "\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t},\n\t\t\t\t\t\tselect: function(event, ui) { var r = OnSelectCallback{$this->id}(ui.item, event); " . ($this->autocomplete[2] ? "\$('{$this->id}').style.display = 'none';" : "") . " return r; },\n\t\t\t\t\t\tchange: function(event, ui) { var r = OnSelectCallback{$this->id}(ui.item, event); " . ($this->autocomplete[2] ? "\$('{$this->id}').style.display = 'none';" : "") . " return r; }\n\t\t\t\t\t}).data(\"ui-autocomplete\")._renderItem = function( ul, item ) {\n\t\t\t\t\t\treturn \$j( \"<li>\" )\n\t\t\t\t\t\t\t.data( \"item.ui-autocomplete\", item )\n\t\t\t\t\t\t\t.append( \"<a>\" + item.label + (item.description ? \"<br /><small>\"+item.description+\"</small>\" : \"\")+\"</a>\" )\n\t\t\t\t\t\t\t.appendTo( ul );\n\t\t\t\t\t};");
             }
             return "{$B2}{$cal}<input\n\t\t\t\t\t" . ($this->maxlength != null ? " maxlength=\"{$this->maxlength}\"" : "") . "\n\t\t\t\t\t" . ($this->placeholder != null ? " placeholder=\"{$this->placeholder}\"" : "") . "\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\t" . (!$this->autocompleteBrowser ? "autocomplete=\"off\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onclick != null ? "onclick=\"{$this->onclick}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeydown != null ? "onkeydown=\"{$this->onkeydown}\"" : "") . "\n\t\t\t\t\t" . ($this->tabindex != null ? "tabindex=\"{$this->tabindex}\"" : "") . "\n\t\t\t\t\t" . ($this->title != null ? "title=\"{$this->title}\"" : "") . "\n\t\t\t\t\t" . ($this->isSelected ? "checked=\"checked\"" : "") . "\n\t\t\t\t\t" . ($this->type == "file" ? "size=\"1\"" : "") . "\n\t\t\t\t\t" . ($this->type == "readonly" ? "readonly=\"readonly\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t{$data}\n\t\t\t\t\t" . ($this->isDisabled ? "disabled=\"disabled\"" : "") . "\n\t\t\t\t\ttype=\"" . ($this->type != "readonly" ? $this->type : "text") . "\"\n\t\t\t\t\t" . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . "\n\t\t\t\t\t{$value} />{$this->requestFocus}{$JS}";
             break;
         case "option":
             $data = "";
             foreach ($this->data as $k => $v) {
                 $data .= " data-{$k}=\"{$v}\"";
             }
             return "<option" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " {$data} " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->isSelected ? "selected=\"selected\"" : "") . " value=\"{$this->value}\">{$this->name}</option>";
             break;
         case "optgroup":
             $html = "<optgroup label=\"" . htmlentities($this->name) . "\">";
             foreach ($this->options as $k => $v) {
                 if (is_object($v)) {
                     $v->isSelected(false);
                     if ($this->parentValue == $k or $v->getValue() == $this->parentValue) {
                         $v->isSelected(true);
                     }
                 }
                 $html .= $v;
             }
             $html .= "</optgroup>";
             return $html;
             break;
         case "radio":
             $html = "";
             foreach ($this->options as $k => $v) {
                 $html .= "<div style=\"margin-bottom:5px;\"><input name=\"{$this->name}\" value=\"{$k}\" " . ($k == $this->value ? "checked=\"checked\"" : "") . " style=\"float:left;margin-right:5px;\" type=\"radio\">{$v}</div>";
             }
             return $html;
             break;
         case "select":
         case "select-multiple":
             if ($this->hasFocusEvent) {
                 $this->onfocus .= "focusMe(this);";
                 $this->onblur .= "blurMe(this);";
             }
             if ($this->type == "select-multiple") {
                 $values = trim($this->value) != "" ? explode(";:;", $this->value) : array();
             }
             if ($this->isDisplayMode) {
                 return is_object($this->options[$this->value]) ? $this->options[$this->value]->__toString() : $this->options[$this->value];
             }
             if ($this->multiEditOptions != null) {
                 $this->onchange .= "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
             }
             $html = "<select " . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . " " . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . " " . ($this->size ? "size=\"{$this->size}\"" : "") . " " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->type == "select-multiple" ? " multiple=\"multiple\"" : "") . "" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . " name=\"{$this->name}\" " . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">";
             if ($this->options != null and is_array($this->options)) {
                 foreach ($this->options as $k => $v) {
                     if (!is_object($v)) {
                         if ($this->type == "select") {
                             $isThisIt = $this->value == $k;
                             if ($this->value . "" === "" and $k . "" === "0") {
                                 $isThisIt = false;
                             }
                         } else {
                             $isThisIt = in_array($k, $values);
                         }
                         $html .= "<option " . ($isThisIt ? "selected=\"selected\"" : "") . " value=\"{$k}\">{$v}</option>";
                     } else {
                         if ($v->getType() == "optgroup") {
                             $v->parentValue($this->value);
                         }
                         $v->isSelected(false);
                         if ($this->value == $k or $v->getValue() == $this->value) {
                             $v->isSelected(true);
                         }
                         $html .= $v;
                     }
                 }
             }
             $html .= "</select>";
             return $html;
             break;
     }
 }
Пример #29
0
 function getCartHTML($previewMode = false)
 {
     $payVia = "";
     if (count($this->payment) > 0) {
         $payVia = "&payVia='+CookieCart.getPayVia()+'";
     }
     #parameters: 'formID=nix&HandlerName=CookieCartHandler&artikelid='+id+'&action=delete&type='+type,
     if ($this->cookie != "") {
         $html = "\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t<!--\n\t\t\t\t\t\tvar CookieCart = {\n\t\t\t\t\t\t\tjoinFormFields: function(formID){\n\t\t\t\t\t\t\t\tsetString = '';\n\t\t\t\t\t\t\t\tfor(i = 0;i < \$(formID).elements.length;i++) {\n\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].type == 'button') continue;\n\n\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].type == 'radio'){\n\t\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].checked) setString += '&'+\$(formID).elements[i].name+'='+encodeURIComponent(\$(formID).elements[i].value);\n\t\t\t\t\t\t\t\t\t} else if(\$(formID).elements[i].type == 'checkbox'){\n\t\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].checked) setString += '&'+\$(formID).elements[i].name+'=1';\n\t\t\t\t\t\t\t\t\t\telse setString += '&'+\$(formID).elements[i].name+'=0';\n\t\t\t\t\t\t\t\t\t} else if(\$(formID).elements[i].type == 'select-multiple'){\n\t\t\t\t\t\t\t\t\t\tsetString += '&'+\$(formID).elements[i].name+'=';\n\t\t\t\t\t\t\t\t\t\tsubString = '';\n\t\t\t\t\t\t\t\t\t\tfor(j = 0; j < \$(formID).elements[i].length; j++)\n\t\t\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].options[j].selected) subString += (subString != '' ? ';:;' : '')+\$(formID).elements[i].options[j].value;\n\n\t\t\t\t\t\t\t\t\t\tsetString += subString;\n\n\t\t\t\t\t\t\t\t\t} else setString += '&'+\$(formID).elements[i].name+'='+encodeURIComponent(\$(formID).elements[i].value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn setString;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tgetPayVia: function(){\n\t\t\t\t\t\t\t\tfor(i = 0;i < \$('cart').payVia.length; i++)\n\t\t\t\t\t\t\t\t\tif(\$('cart').payVia[i].checked) return \$('cart').payVia[i].value;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tdeleteMe: function(id, type){\n\t\t\t\t\t\t\t\tnew Ajax.Request('/index.php', {\n\t\t\t\t\t\t\t\t\tmethod:'post',\n\t\t\t\t\t\t\t\t\tparameters:'r=" . mt_rand(0, 10000) . "&formID=nix&HandlerName=CookieCartHandler&artikelid='+id+'&action=delete&type='+type,\n\t\t\t\t\t\t\t\t\tonSuccess: function(transport){\n\t\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\torderNow: function(){\n\t\t\t\t\t\t\t\t\$('cart').action.value = 'order';\n\n\t\t\t\t\t\t\t\t//if(confirm('Jetzt kaufen?'))\n\t\t\t\t\t\t\t\tnew Ajax.Request('/index.php', {\n\t\t\t\t\t\t\t\t\tmethod:'post',\n\t\t\t\t\t\t\t\t\tparameters: 'r=" . mt_rand(0, 10000) . "&formID=nix&HandlerName=CookieCartHandler{$payVia}'+CookieCart.joinFormFields('cart'),\n\t\t\t\t\t\t\t\t\tonSuccess: function(transport){\n\t\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdateAmounts: function(){\n\t\t\t\t\t\t\t\tmultiCMS.formHandler('cart', function(transport){\n\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tinsertCoupon: function(){\n\t\t\t\t\t\t\t\tif(\$('CouponCode').value == '') {\n\t\t\t\t\t\t\t\t\talert('Bitte geben Sie einen Gutscheincode ein!');\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tnew Ajax.Request('/index.php', {\n\t\t\t\t\t\t\t\t\tmethod:'post',\n\t\t\t\t\t\t\t\t\tparameters: 'r=" . mt_rand(0, 10000) . "&formID=nix&HandlerName=CookieCartHandler&action=insertCoupon&couponCode='+encodeURIComponent(\$('CouponCode').value),\n\t\t\t\t\t\t\t\t\tonSuccess: function(transport){\n\t\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.reload();}});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t-->\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t#CookieCart .CookieCartBorderColor td {\n\t\t\t\t\t\tborder-width:0px;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t#CookieCart table th {\n\t\t\t\t\t\ttext-align:left;\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t\n\t\t\t\t<form " . (!$previewMode ? "id=\"cart\"" : "") . " onsubmit=\"return false;\">";
     }
     $tab = $this->table;
     $tab->addHeaderRow(array("", "Menge", "Artikel", "Einzelpreis", "Gesamtpreis", ""));
     #$tab->addColStyle(2, "text-align:right;");
     $tab->addColStyle(4, "text-align:right;");
     $tab->addColStyle(5, "text-align:right;");
     $tab->addColStyle(6, "text-align:right;");
     $steuern = array();
     $gesamt = 0;
     $netto = 0;
     $i = 0;
     if ($this->cookie != "") {
         while ($t = $this->getNextElement()) {
             $num = array_search($t[2], $this->useClass);
             if ($t[2] != "CookieCart") {
                 $c = $this->useClass[$num];
                 $A = new $c($t[0], false);
                 $A->loadMe();
                 $mwst = $this->mwstField[$num];
                 $name = $this->nameField[$num];
                 $preis = $this->preisField[$num];
                 $artikelnummer = $this->artikelnummerField[$num];
             } else {
                 $A = $this;
                 $this->PostenID = $t[0];
                 $mwst = "mwst";
                 $name = "artikelname";
                 $preis = "preis";
                 $artikelnummer = "artikelnummer";
             }
             try {
                 new Staffelpreis(-1);
                 if (class_exists("Staffelpreis")) {
                     $ac = new anyC();
                     $ac->setCollectionOf("Staffelpreis");
                     $ac->addAssocV3("StaffelpreisClass", "=", $this->useClass);
                     $ac->addAssocV3("StaffelpreisClassID", "=", $t[0]);
                     $ac->addAssocV3("StaffelpreisAmount", "<=", $t[1]);
                     $ac->addOrderV3("StaffelpreisAmount", "DESC");
                     $ac->setLimitV3("1");
                     $ac2 = $ac->getNextEntry();
                     if ($ac2 != null) {
                         $A->changeA($preis, $ac2->A("StaffelpreisPrice"));
                     }
                 }
             } catch (Exception $e) {
             }
             if (!isset($steuern[$A->getA()->{$mwst}])) {
                 $steuern[$A->getA()->{$mwst}] = 0;
             }
             $steuern[$A->getA()->{$mwst}] += $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100) * $t[1];
             $gesamt += $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1) * $t[1];
             $netto += $A->getA()->{$preis} * 1 * $t[1];
             $image = $this->invokeParser($this->imagePathCallback[$num], $t[0], $A);
             if ($image != "") {
                 $parsedImage = "<img src=\"{$image}\" />";
             } else {
                 $parsedImage = "";
             }
             if ($this->imageParser != null) {
                 $parsedImage = $this->invokeParser($this->imageParser[$num], $t[0], $A);
             }
             #"<input type=\"input\" style=\"text-align:right;width:60px;\" name=\"amountOf_$t[0]_$t[2]\" value=\"$t[1]\" onkeydown=\"if(event.keyCode == 13) CookieCart.updateAmounts();\" />"
             $IMenge = new HTMLInput("amountOf_{$t['0']}_{$t['2']}", "text", $t[1]);
             $IMenge->style("text-align:right;width:60px;");
             $IMenge->onEnter("CookieCart.updateAmounts();");
             if ($t[2] == "CookieCart" and $t[0] == "1") {
                 $IMenge = $t[1];
             }
             $tab->addRow(array($parsedImage, !$previewMode ? $IMenge : "{$t['1']}", $A->getA()->{$name} . ((isset($A->getA()->{$artikelnummer}) and $A->getA()->{$artikelnummer} != "") ? "<br /><small>Art.Nr. " . $A->getA()->{$artikelnummer} . "</small>" : ""), Util::formatCurrency("de_DE", $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1), true) . "<br /><small>" . Util::formatNumber("de_DE", $A->getA()->{$mwst} * 1, 2, true, false) . "%</small>", Util::formatCurrency("de_DE", $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1) * $t[1], true), !$previewMode ? "<img style=\"cursor:pointer;\" onclick=\"CookieCart.deleteMe('{$t[0]}','{$t['2']}');\" alt=\"Artikel aus Warenkorb löschen\" title=\"Artikel aus Warenkorb löschen\" src=\"{$this->trashImage}\" />" : ""));
             $tab->addCellStyle(1, "vertical-align:top;");
             $tab->addCellStyle(2, "vertical-align:middle;");
             $tab->addCellStyle(3, "vertical-align:middle;");
             $i++;
         }
         if ($this->versandkostenBrutto != null) {
             $tab->addRow(array("", "1", $this->versandkostenBrutto[0], Util::formatCurrency("de_DE", $this->versandkostenBrutto[1], true), Util::formatCurrency("de_DE", $this->versandkostenBrutto[1], true)));
             $gesamt += $this->versandkostenBrutto[1];
             $netto += Util::kRound($this->versandkostenBrutto[1] / ($this->versandkostenBrutto[2] + 100) * 100, 2);
             $steuern[number_format($this->versandkostenBrutto[2], 2)] += Util::kRound($this->versandkostenBrutto[1] / ($this->versandkostenBrutto[2] + 100) * $this->versandkostenBrutto[2], 2);
         }
         $s = "";
         foreach ($steuern as $key => $value) {
             $s .= ($s != "" ? "<br />" : "") . "" . Util::formatNumber("de_DE", $key * 1, 2, true, false) . "%: " . Util::formatCurrency("de_DE", $value, true);
         }
         $tab->addRow(array(!$previewMode ? "\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvalue=\"Mengen speichern\"\n\t\t\t\t\t\t\t\tonclick=\"CookieCart.updateAmounts();\"\n\t\t\t\t\t\t\t/>" : "", "", "", "Gesamt Netto", Util::formatCurrency("de_DE", $netto, true), ""));
         $tab->addCellStyle(1, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(2, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(3, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(4, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(5, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(6, "border-top-width:1px;border-top-style:solid;");
         $tab->addRowClass("CookieCartBorderColor");
         $tab->addRowColspan(1, 3);
         $tab->addRow(array("", "", "", "Gesamt MwSt", $s, ""));
         $tab->addRow(array("", "", "", "Gesamt", Util::formatCurrency("de_DE", $gesamt, true), ""));
         $tab->addCellStyle(4, "font-weight:bold;border-top-style:solid;border-top-width:1px;");
         $tab->addCellStyle(5, "font-weight:bold;border-top-style:solid;border-top-width:1px;");
         $tab->addRowClass("CookieCartBorderColor");
         #$tab->addCellStyle(2, "text-align:right;");
         if (!$previewMode) {
             $coupon = "";
             if ($this->couponCallback !== null) {
                 $showCouponField = $this->invokeParser($this->couponCallback, "showCouponField", null);
                 if ($showCouponField === true) {
                     $CI = new HTMLInput("CouponCode");
                     $CI->id("CouponCode");
                     $CI->onEnter("CookieCart.insertCoupon();");
                     $CB = new HTMLInput("CouponInsert", "button", "Gutschein einlösen");
                     $CB->style("margin-top:5px;");
                     $CB->onclick("CookieCart.insertCoupon();");
                 } else {
                     $CI = "";
                     $CB = $showCouponField;
                 }
                 $coupon = "<div class=\"CookieCartCoupon\"><p><b>Gutschein-Code:</b><br />{$CI}<br>{$CB}</p></div>";
             }
             $tab->addRow(array($coupon, "", ""));
             $tab->addRowStyle("height:30px;");
             $tab->addRowColspan(1, 4);
         }
         if (count($this->payment) > 0 and !$previewMode and $this->payNowButton == null) {
             $pay = "";
             foreach ($this->payment as $k => $v) {
                 if ($pay != "") {
                     $pay .= "<br /><br />";
                 }
                 switch ($v) {
                     case "PayPal":
                         $pay .= "<input name=\"payVia\" value=\"{$v}\" type=\"radio\" " . ($pay == "" ? "checked=\"checked\"" : "") . " />\n\t\t\t\t\t\t\t<img src=\"https://www.paypal.com/de_DE/DE/i/logo/logo_80x35.gif\" alt=\"PayPal\">";
                         break;
                     case "Überweisung":
                         $pay .= "<input name=\"payVia\" value=\"{$v}\" type=\"radio\" " . ($pay == "" ? "checked=\"checked\"" : "") . " /> Überweisung";
                         break;
                     case "Kreditkarte":
                         $pay .= "<input name=\"payVia\" value=\"{$v}\" type=\"radio\" " . ($pay == "" ? "checked=\"checked\"" : "") . " /> Kreditkarte";
                         break;
                 }
             }
             $tab->addRow(array("", "", "", "Zahlung via", "{$pay}"));
             $tab->addCellStyle(4, "vertical-align:top;");
             $tab->addRow(array("", "", "", "", ""));
             $tab->addRowStyle("height:30px;");
         }
         if (!$previewMode and $this->payNowButton === null) {
             $tab->addRow(array("", "", "", "\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvalue=\"Jetzt verbindlich bestellen\"\n\t\t\t\t\t\t\t\tstyle=\"border-color:green;width:220px;height:30px;color:green;\"\n\t\t\t\t\t\t\t\tonclick=\"CookieCart.orderNow();\"\n\t\t\t\t\t\t\t/>"));
             $tab->addRowColspan(4, 3);
         } elseif (!$previewMode and $this->payNowButton != null and $this->payNowButton != "") {
             $tab->addRow(array("<a href=\"{$this->payNowURL}\"><img alt=\"jetzt Bezahlen\" title=\"jetzt Bezahlen\" src=\"{$this->payNowButton}\" /></a>"));
             $tab->addRowColspan(1, 6);
             $tab->addCellStyle(1, "text-align:right;");
         }
         $html .= $tab->getHTML();
         $html .= "<input type=\"hidden\" name=\"returnP\" value=\"{$_GET['p']}\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"HandlerName\" value=\"CookieCartHandler\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"updateAll\" />\n\t\t\t\t</form>";
     } else {
         $html = "<p>Ihr Warenkorb enthält keine Artikel.</p>";
     }
     $_SESSION["CookieCart"] = $this;
     $this->elementPointer = 0;
     /*echo "<pre>";
     		echo $this->getCartText(false);
     		echo "</pre>";*/
     return "<div id=\"CookieCart\">" . $html . "</div>";
 }
Пример #30
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>';
    }