private function getNav($parentID, $domain) { $mNav = new anyC(); $mNav->setCollectionOf("Navigation"); $mNav->addAssocV3("parentID", "=", $parentID); $mNav->addAssocV3("DomainID", "=", $domain); $mNav->addOrderV3("sort"); $mNav->lCV3(); if ($mNav->numLoaded() == 0) { return; } $html = "\n\t\t<ul style=\"list-style-image:none;list-style-type:none;\" id=\"sortable_{$parentID}\">"; while ($n = $mNav->getNextEntry()) { $B = new Button("Element bearbeiten", "./images/i2/edit.png"); $B->type("icon"); $B->onclick("contentManager.loadFrame('contentLeft','Navigation','" . $n->getID() . "');"); $B->style("float:left;margin-right:10px;"); $D = new Button("Element löschen", "./images/i2/delete.gif"); $D->type("icon"); $D->onclick("deleteClass('Navigation','" . $n->getID() . "', function() { contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '1') \$('contentLeft').update(''); },'Element und alle Unterelemente wirklich löschen?');"); $D->style("float:right;margin-right:10px;"); $html .= "<li id=\"NavigationElementID_" . $n->getID() . "\" style=\"" . ($n->A("hidden") == "1" ? "text-decoration:line-through;" : "") . "\">{$D}<img src=\"./images/i2/topdown.png\" class=\"navigationHandler_sortable_{$parentID}\"\" style=\"cursor:pointer;float:right;margin-right:10px;\" />{$B}" . ($n->A("name") == "" ? "<kein Name>" : $n->A("name")) . $this->getNav($n->getID(), $domain) . "</li>"; } # $html .= "\n\t\t</ul>\n\t\t<script type=\"text/javascript\">Website.add('sortable_{$parentID}');</script>"; return $html; }
public function activate() { /*$ac = new anyC(); $ac->setCollectionOf("FhemPreset"); $ac->addJoinV3("FhemServer","FhemPresetServerID","=","FhemServerID"); $ac->addAssocV3("FhemPresetID", "=", $PresetID); $S = $ac->getNextEntry();*/ $S = new FhemServer($this->A("FhemPresetServerID")); switch ($S->A("FhemServerType")) { case "0": try { $T = new Telnet($S->A("FhemServerIP"), $S->A("FhemServerPort")); } catch (NoServerConnectionException $e) { die("error:'The connection to the server with IP-address " . $S->A("FhemServerIP") . " could not be established!'"); } $c = "set " . $this->A("FhemPresetName") . " on"; $T->fireAndForget($c); $T->disconnect(); break; case "1": $ac = new anyC(); $ac->setCollectionOf("FhemEvent"); $ac->addAssocV3("FhemEventPresetID", "=", $this->ID); $ac->lCV3(); while ($E = $ac->getNextEntry()) { $S->setDevice($E->A("FhemEventFhemID"), $E->A("FhemEventAction")); } break; } }
function getLocations() { $AC = new anyC(); $AC->setCollectionOf("FhemLocation"); $Locations = array(); while ($L = $AC->getNextEntry()) { $Locations[] = $L->getID() . "::" . $L->A("FhemLocationName"); } return $Locations; }
public function getAvailableCategories() { $AC = new anyC(); $AC->setCollectionOf("Serie"); $AC->addGroupV3("status"); $status = array(); while ($S = $AC->getNextEntry()) { $status[$S->A("status")] = $S->A("status"); } return $status; }
public static function testDownloaded($link) { $AC = new anyC(); $AC->setCollectionOf("JDownload"); $AC->addAssocV3("JDownloadURL", "=", $link); $L = $AC->getNextEntry(); if ($L == null) { return false; } return true; }
public static function getCalendarData($firstDay, $lastDay) { $K = new Kalender(); $AC = new anyC(); $AC->setCollectionOf("Adresse"); $AC->addAssocV3("type", "=", "default"); $AC->addAssocV3("AuftragID", "=", "-1"); $AC->addAssocV3("geb", "!=", "0"); while ($t = $AC->getNextEntry()) { $K->addEvent(self::getCalendarDetails("mFAdresseGUI", $t->getID(), $t)); } return $K; }
public function getHTML($id) { $bps = $this->getMyBPSData(); $t = new HTMLTable(1); $t->setTableStyle("width:160px;float:right;margin-right:10px;"); if (!isset($bps["ID"])) { $F = new mFhemGUI(); $F->addAssocV3("FhemType", "!=", "FHZ"); while ($f = $F->getNextEntry()) { $B = new Button($f->getA()->FhemName, "./fheME/Fhem/fhem.png"); $B->onclick("contentManager.loadFrame('contentRight','mFhemTimer',-1,0,'mFhemTimerGUI;ID:" . $f->getID() . ";type:D;name:" . $f->getA()->FhemName . "');"); $t->addRow($B); $t->addRowClass("backgroundColor0"); } $t->addRow(""); $t->addRowClass("backgroundColor1"); $F = new anyC(); $F->setCollectionOf("FhemPreset"); $F->addAssocV3("FhemPresetHide", "=", "0"); while ($f = $F->getNextEntry()) { $B = new Button($f->getA()->FhemPresetName, "./fheME/Fhem/events.png"); $B->onclick("contentManager.loadFrame('contentRight','mFhemTimer',-1,0,'mFhemTimerGUI;ID:" . $f->getID() . ";type:P;name:" . $f->getA()->FhemPresetName . "');"); $t->addRow($B); $t->addRowClass("backgroundColor0"); } return $t; } if (isset($bps["ID"])) { if ($bps["type"] == "D") { $F = new Fhem($bps["ID"]); $F->loadMe(); $FF = new Fhem("timer"); $FF->setA($F->getA()); $C = new FhemControlGUI(); $control = $C->getControl($FF); } else { $control = ""; } $rand = rand(10, 10000000); $B = new Button("set timer", "okCatch"); $B->rme("FhemControl", '', 'setTimer', array($bps["ID"], "'setBPSValue'", "'{$bps['type']}'", "parent.clock4Timer{$rand}.stunden", "parent.clock4Timer{$rand}.minuten", "'{$bps['name']}'"), "contentManager.loadFrame(\\'contentRight\\',\\'mFhem\\',-1,0,\\'\\');"); $B->style("float:right;"); $t->addRow("<iframe name=\"clock4Timer{$rand}\" style=\"width:240px;height:330px;border:0px;\" src=\"./libraries/ClockGUI.class.php\"></iframe>"); $t->addRowClass("backgroundColor0"); $t->addRow($B); $t->addRowClass("backgroundColor0"); return $control . $t; } }
public function runRules() { $AC = new anyC(); $AC->setCollectionOf("IncomingPrettify"); $AC->addAssocV3("IncomingPrettifyIsActive", "=", "1"); $I = new mIncoming(); $files = $I->getNewFiles(); echo "<div style=\"max-height:400px;overflow:auto;font-size:10px;padding:5px;\">"; $run = mUserdata::getUDValueS("trinityDBPrettifyExecute", "0") == "1"; if (!$run) { echo "<p style=\"color:red;margin-bottom:10px;\">The following operations are NOT executed, this is only a preview!<br />To execute the operations, you'll have to enable it in the options.</p>"; } foreach ($files as $path) { $newName = basename($path); if (strpos(strtolower($newName), ".part") == strlen($newName) - 5) { continue; } if (strpos(strtolower($newName), ".mkv") != strlen($newName) - 4 and strpos(strtolower($newName), ".mp4") != strlen($newName) - 4) { continue; } while ($P = $AC->getNextEntry()) { $newName = preg_replace("/" . str_replace(".", "\\.", $P->A("IncomingPrettifyFind")) . "/e" . ($P->A("IncomingPrettifyCaseSensitive") == "1" ? "" : "i"), str_replace(array("//", "."), array("\\", "\\."), $P->A("IncomingPrettifyReplace")), $newName); } $newName = str_replace("\\", "", $newName); $AC->resetPointer(); if ($newName != basename($path)) { $color = ""; if ($run) { $renamed = str_replace(basename($path), $newName, $path); if (file_exists($renamed)) { $color = "color:red;"; } else { if (rename($path, $renamed)) { $color = "color:green;"; } else { $color = "color:red;"; } } } echo "<span style=\"{$color}\">" . basename($path) . " -><br />" . basename($newName) . "</span><br /><br />"; } } echo "</div>"; }
public function filterNew() { $this->loadFeed(); $xml = RSSFilter::$feeds[$this->A("RSSFilterFeed")]; $Adapter = $this->getFeedAdapter(); $ac = new anyC(); $ac->setCollectionOf("Serie"); $Serien = array(); while ($S = $ac->getNextEntry()) { $Serien[strtolower($S->A("name"))] = $S; $Serien[strtolower($S->A("altFeedName1"))] = $S; } $new = array(); foreach ($xml->channel->item as $v) { $Epis = $Adapter->parseItem($v); if (!isset($Serien[strtolower($Epis->name)]) and $Epis->name != "") { $new[strtolower($Epis->name)] = $Epis; } } return $new; }
public function createMoveScript($run = false) { if (!$run) { header("Content-Type: application/x-shellscript; charset=UTF-8"); if (!Util::isWindowsHost()) { header("Content-Disposition: attachment; filename=\"move.sh\""); } else { header("Content-Disposition: attachment; filename=\"move.bat\""); } } $new = $this->findNewEpisodes(); $maxlength = 0; foreach ($new as $series) { foreach ($series as $episode) { if (strlen($episode["path"]) > $maxlength) { $maxlength = strlen($episode["path"]); } } } $code = ""; foreach ($new as $series) { if (count($series) == 0) { continue; } if ($series[0]["pointer"]->A("dir") == "") { continue; } if (!Util::isWindowsHost()) { $code .= "##" . $series[0]["name"] . "\n"; } else { $code .= "echo \"" . $series[0]["name"] . "\"\r\n"; } #$code .= print_r($series, true); foreach ($series as $episode) { if ($episode["pointer"]->A("dir") == "") { continue; } $AC = new anyC(); $AC->setCollectionOf("Folge"); $AC->addAssocV3("SerieID", "=", $episode["pointer"]->getID()); $AC->addAssocV3("season", "=", $episode["season"]); $AC->addAssocV3("episode", "=", $episode["episode"]); $AC->addAssocV3("wanted", "=", "1"); $F = $AC->getNextEntry(); if ($F == null) { continue; } if (!Util::isWindowsHost()) { $code .= "mv \"" . str_pad($episode["path"] . "\"", $maxlength + 3) . " \"" . $episode["pointer"]->A("dir") . "/" . $F->getNewFileName($episode["pointer"], $F->getSuffix(basename($episode["path"]))) . "\";\n"; } else { $code .= "move /-Y '" . str_pad(str_replace("/", "\\", $episode["path"]) . "\"", $maxlength + 3) . " \"" . str_replace("/", "\\", $episode["pointer"]->A("dir")) . "\\" . $F->getNewFileName($episode["pointer"], $F->getSuffix(basename($episode["path"]))) . "';\r\n"; } } $code .= "\n"; } if (!$run) { echo $code; } else { $SC = new SystemCommand(); $SC->setCommand($code); $SC->execute(); } #print_r(); #echo Util::getBasicHTMLText(trim($code)."\n\n", "move script"); }
public function lostPassword($username) { // <editor-fold defaultstate="collapsed" desc="Aspect:jP"> try { $MArgs = func_get_args(); return Aspect::joinPoint("around", $this, __METHOD__, $MArgs); } catch (AOPNoAdviceException $e) { } Aspect::joinPoint("before", $this, __METHOD__, $MArgs); // </editor-fold> if ($username == "") { Red::errorC("User", "lostPasswordErrorUser"); } $Lang = $this->loadLanguageClass("User")->getText(); $ac = new anyC(); $ac->setCollectionOf("User"); $ac->addAssocV3("username", "=", $username); $ac->lCV3(); $U = $ac->getNextEntry(); if ($U == null) { try { $AL = new mphynxAltLogin(); $AL->addAssocV3("username", "=", $username); $U = $AL->getNextEntry(); } catch (Exception $e) { Red::errorC("User", "lostPasswordErrorUser"); } } if ($U == null) { Red::errorC("User", "lostPasswordErrorUser"); } $Admin = new anyC(); $Admin->setCollectionOf("User"); $Admin->addAssocV3("isAdmin", "=", "1"); $Admin = $Admin->getNextEntry(); if ($Admin == null) { Red::errorC("User", "lostPasswordErrorAdmin"); } if ($Admin->A("UserEmail") == "") { Red::errorC("User", "lostPasswordErrorAdmin"); } $mail = new htmlMimeMail5(); $mail->setFrom("phynx@" . $_SERVER["HTTP_HOST"]); $mail->setSubject("[phynx] Password recovery for user {$username}"); $mail->setText(wordwrap("Dear " . $Admin->A("name") . ",\n\nyou received this email because the user '{$username}' of the phynx framework at {$_SERVER['HTTP_HOST']} has lost his password and is requesting a new one.\n\nBest regards\n\tphynx", 80)); if (!$mail->send(array($Admin->A("UserEmail")))) { Red::errorC("User", "lostPasswordErrorAdmin"); } Red::alertC("User", "lostPasswordOK"); }
public function findNewEpisodes() { $episodes = $this->getNewFiles(true); $ac = new anyC(); $ac->setCollectionOf("Serie"); #$ac->addAssocV3("status", "=", "Continuing"); $found = array(); while ($S = $ac->getNextEntry()) { $found[] = $S->findNewEpisodes($episodes); } return $found; }
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * 2007 - 2012, Rainer Furtmeier - Rainer@Furtmeier.de */ error_reporting(E_ALL); require "./multiCMSData/connect.php"; if (isset($_GET["filedl"])) { $DL = new Download($_GET["filedl"]); $DL->makeDownload(); header("Location: " . $DL->getA()->url); exit; } if (isset($_GET["newestdl"])) { $aC = new anyC(); $aC->setCollectionOf("Download"); $aC->addAssocV3("ContentID", "=", $_GET["newestdl"]); $aC->addOrderV3("datum", "DESC"); $aC->setLimitV3("1"); $DL = $aC->getNextEntry(); $DL = new Download($DL->getID()); if (!isset($_GET["getLink"])) { $DL->makeDownload(); header("Location: " . $DL->getA()->url); exit; } else { die($DL->getA()->url); } }
public function update($echo = false) { $oldest = new anyC(); $oldest->setCollectionOf("Serie"); $oldest->addOrderV3("lastupdate", "ASC"); $oldest->addAssocV3("status", "=", "Continuing"); $oldest->addAssocV3("lastupdate", "<", time() - 3600 * 24 * 3); $oldest->setLimitV3("2"); while ($S = $oldest->getNextEntry()) { $this->download($S, $echo); } $oldest = new anyC(); $oldest->setCollectionOf("Serie"); $oldest->addOrderV3("lastupdate", "ASC"); $oldest->addAssocV3("status", "=", "Ended"); $oldest->addAssocV3("lastupdate", "<", time() - 3600 * 24 * 21); $oldest->setLimitV3("1"); while ($S = $oldest->getNextEntry()) { $this->download($S, $echo); } $oldest = new anyC(); $oldest->setCollectionOf("Serie"); $oldest->addOrderV3("lastupdate", "ASC"); $oldest->addAssocV3("lastupdate", "<", time() - 3600 * 24 * 3, "AND", "1"); $oldest->addAssocV3("status", "=", "Continuing", "AND", "1"); $oldest->addAssocV3("lastupdate", "<", time() - 3600 * 24 * 21, "OR", "2"); $oldest->addAssocV3("status", "=", "Ended", "AND", "2"); $oldest->lCV3(); return $oldest->numLoaded(); }
header("HTTP/1.1 301 Moved Permanently"); header("Location: http" . ((isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == "on") ? "s" : "") . "://www." . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]); header("Connection: close"); } if (count($ex) > 0 and $domain->A("umleitung") == "2" and $_SERVER["HTTP_HOST"] != trim($ex[0])) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http" . ((isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == "on") ? "s" : "") . "://" . trim($ex[0]) . $_SERVER["REQUEST_URI"]); header("Connection: close"); } } if (isset($_GET["permalink"]) and $_GET["permalink"] != "") { $ac = new anyC(); $ac->setCollectionOf("Seite"); $ac->addAssocV3("permalink", "=", $_GET["permalink"]); $ac->addAssocV3("DomainID", "=", $domain->getID()); $resolvedPL = $ac->getNextEntry(); if ($resolvedPL == null) { header("HTTP/1.1 404 Not Found"); emoFatalError("Die gesuchte Seite kann leider nicht gefunden werden", "Die Seite, die Sie suchen, existiert nicht (mehr).<br />Vielleicht möchten Sie die Suche auf der <a href=\"/\">Startseite</a> fortsetzen.", "multiCMS", "./multiCMS"); #header("Connection: close"); #exit(); #die("Die gewünschte Seite existiert nicht!"); } $_GET["p"] = $resolvedPL->getID(); if ($ac->numLoaded() != 1) { die("der Permalink {$_GET['permalink']} ist nicht eindeutig und verweist auf " . $ac->numLoaded() . " Seiten!"); } } if (isset($_GET["p"])) { $domain->setSeite($_GET["p"]); }
public function registerSettings() { $tab = new HTMLTable(2, "Telnet-Commands"); $tab->maxHeight(500); $this->registerType($tab, "FHZ"); $this->registerType($tab, "FS20"); $this->registerType($tab, "FHT"); $this->registerType($tab, "IT"); $this->registerType($tab, "CUL_HM"); $this->registerType($tab, "CUL_EM"); $this->registerType($tab, "dummy"); $oldServer = ""; $T = null; $ac = new anyC(); $ac->setCollectionOf("Fhem"); $ac->addJoinV3("FhemServer", "FhemServerID", "=", "FhemServerID"); $ac->addOrderV3("t1.FhemServerID"); $ac->addAssocV3("FhemType", "=", "notify"); $ac->addAssocV3("FhemServerType", "=", "0"); $oldServer = ""; while ($t = $ac->getNextEntry()) { try { if ($oldServer != $t->A("FhemServerID")) { $T = new Telnet($t->A("FhemServerIP"), $t->A("FhemServerPort")); } } catch (NoServerConnectionException $e) { die("error:'The connection to the server with IP-address " . $t->A("FhemServerIP") . " could not be established!'"); } #$tel = "define ".$t->getA()->FhemName." notify ".$t->getA()->FhemRunOn." ".str_replace("\n"," ",$t->getA()->FhemCommand); #$T->fireAndForget($tel); $tel = $t->getDefineCommand(); foreach ($tel as $c) { $T->fireAndForget($c); } $tab->addRow(array($t->A("FhemServerName"), implode("<br />", $tel))); $oldServer = $t->A("FhemServerID"); } $ac = new mFhemPresetGUI(); $ac->addJoinV3("FhemServer", "FhemPresetServerID", "=", "FhemServerID"); $ac->addJoinV3("FhemEvent", "FhemPresetID", "=", "FhemEventPresetID"); $ac->addJoinV3("Fhem", "t3.FhemEventFhemID", "=", "FhemID"); #sleep 0.5;; $ac->setFieldsV3(array("FhemEventAction", "FhemPresetRunOn", "FhemPresetName", "FhemServerIP", "FhemPresetNightOnly", "FhemServerName", "FhemServerPort", "t2.FhemServerID", "FhemName", "FhemEventFhemID")); $ac->addOrderV3("FhemPresetID"); $ac->addOrderV3("FhemEventID"); $ac->addAssocV3("FhemServerType", "=", "0"); $tab->addRow(array("", "")); $tab->addRowColspan(1, 2); $command = ""; $oldServer = ""; while ($b = $ac->getNextEntry()) { try { if ($oldServer != $b->A("FhemServerID")) { $T = new Telnet($b->A("FhemServerIP"), $b->A("FhemServerPort")); } } catch (NoServerConnectionException $e) { die("error:'The connection to the server with IP-address " . $t->A("FhemServerIP") . " could not be established!'"); } if ($b->A("FhemEventFhemID") != "-1") { $command .= "set " . $b->A("FhemName") . " " . $b->A("FhemEventAction") . ";;"; } else { $command .= $b->A("FhemEventAction") . ";;"; } $next = $ac->getNextEntry(); if ($next == null or $next->A("FhemPresetID") != $b->A("FhemPresetID")) { $runOn = null; if ($b->A("FhemPresetRunOn") != "") { $runOn = $b->A("FhemPresetRunOn"); } $d = ""; if ($runOn == null) { $d = "define " . $b->A("FhemPresetName") . " dummy"; } $c = "define n" . $b->A("FhemPresetID") . " notify " . ($runOn == null ? $b->A("FhemPresetName") : $runOn) . " {fhem(\"" . str_replace("%", "%%", $command) . "\") " . ($b->A("FhemPresetNightOnly") == "1" ? "if(!isday())" : "") . "}"; $tab->addRow(array($b->A("FhemPresetName") . "<br />" . $b->A("FhemServerName"), $d . "<br />" . $c)); if ($runOn == null) { $T->fireAndForget($d); } $T->fireAndForget($c); $command = ""; } if ($next != null) { $ac->subPointer(); } } /*$oldServer = ""; while($b = $ac->getNextEntry()){ try { if($oldServer != $b->getA()->FhemServerID) $T = new Telnet($b->getA()->FhemServerIP, $b->getA()->FhemServerPort); } catch(NoFhemServerConnectionException $e){ die("error:'The connection to the server with IP-address ".$t->getA()->FhemServerIP." could not be established!'"); } $c = "define n".$b->getA()->FhemPresetID." notify ".$b->getA()->FhemPresetName." {fhem(\"".str_replace("%","%%",$b->getA()->action)."\") ".($b->getA()->FhemPresetNightOnly == "1" ? "if(!isday())" : "")."}"; $d = "define ".$b->getA()->FhemPresetName." dummy"; $tab->addRow(array($b->getA()->FhemPresetName."<br />".$b->getA()->FhemServerName,$d."<br />".$c)); $T->fireAndForget($d); $T->fireAndForget($c); $oldServer = $b->getA()->FhemServerID; }*/ echo $tab; }
public function exists($returnElement = false) { $AC = new anyC(); $AC->setCollectionOf($this->className); foreach ($this->setAttributes as $k) { if ($k == $this->className . "ID") { continue; } $AC->addAssocV3($k, isset($this->onExistsOperator[$k]) ? $this->onExistsOperator[$k] : "=", $this->attributes->{$k}); } $AC->lCV3(); if ($AC->numLoaded() == 0) { return false; } else { if ($returnElement) { return $AC->getNextEntry(); } return $AC->getNextEntry()->getID(); } }
public function runUpdate($XML) { $IDs = array(); $XML->lCV3(); while ($t = $XML->getNextEntry()) { $ac = new anyC(); $ac->setCollectionOf("Patch"); $ac->addAssocV3("PatchNummer", "=", $t->A("PatchNummer")); $P = $ac->getNextEntry(); if ($P == null) { $IDs[] = $t->newMe(); } else { $nP = new Patch($P->getID()); $AS = $t->getA(); unset($AS->PatchID); $nP->setA($AS); $nP->saveMe(); $IDs[] = $P->getID(); } } return $IDs; }
public static function getCalendarData($firstDay, $lastDay, $UserID = null) { if ($UserID === null) { $UserID = Session::currentUser()->getID(); } #echo $UserID; $K = new Kalender(); #$include = array(); //TERMINE IN DIESEM MONAT $AC = new anyC(); $AC->setCollectionOf("Todo"); $AC->addAssocV3("TodoTillDay", ">=", $firstDay, "AND", "1"); $AC->addAssocV3("TodoTillDay", "<=", $lastDay, "AND", "1"); $AC->addAssocV3("TodoRepeat", "=", "", "AND", "1"); if ($UserID != 0) { $AC->addAssocV3("TodoUserID", "=", $UserID, "AND", "2"); } else { $AC->addAssocV3("TodoUserID", ">", "0", "AND", "2"); } $AC->addAssocV3("TodoUserID", "=", "-1", "OR", "2"); /*$ACS = anyC::get("Userdata", "name", "shareCalendarTo".($UserID != 0 ? $UserID : "0")); //disabled for all users at the moment! while($Share = $ACS->getNextEntry()){ $include[$Share->A("UserID")] = mUserdata::getUDValueS("showCalendarOf".$Share->A("UserID"), "1"); if($include[$Share->A("UserID")] == "1") $AC->addAssocV3("TodoUserID", "=", $Share->A("UserID"), "OR", "2"); }*/ $AC->addOrderV3("TodoTillTime"); while ($t = $AC->getNextEntry()) { $K->addEvent(self::getCalendarDetails("mTodoGUI", $t->getID(), $t)); } //TERMINE ÜBER DIESEN MONAT HINAUS $AC = new anyC(); $AC->setCollectionOf("Todo"); $AC->addAssocV3("TodoFromDay", "<=", $lastDay, "AND", "1"); $AC->addAssocV3("TodoTillDay", ">", $lastDay, "AND", "1"); $AC->addAssocV3("TodoRepeat", "=", "", "AND", "1"); if ($UserID != 0) { $AC->addAssocV3("TodoUserID", "=", $UserID, "AND", "2"); } else { $AC->addAssocV3("TodoUserID", ">", "0", "AND", "2"); } $AC->addAssocV3("TodoUserID", "=", "-1", "OR", "2"); #$ACS->resetPointer(); #while($Share = $ACS->getNextEntry()){ # if($include[$Share->A("UserID")] == "1") # $AC->addAssocV3("TodoUserID", "=", $Share->A("UserID"), "OR", "2"); #} $AC->addOrderV3("TodoTillTime"); while ($t = $AC->getNextEntry()) { $K->addEvent(self::getCalendarDetails("mTodoGUI", $t->getID(), $t)); } //WIEDERHOLTE TERMINE $AC = new anyC(); $AC->setCollectionOf("Todo"); $AC->addAssocV3("TodoFromDay", "<=", $lastDay, "AND", "1"); $AC->addAssocV3("TodoRepeat", "!=", "", "AND", "1"); /*$AC->addAssocV3("MONTH(FROM_UNIXTIME(TodoFromDay))","=", date("m", $lastDay), "AND", "1"); if(date("m", $firstDay) != date("m", $lastDay)) $AC->addAssocV3("MONTH(FROM_UNIXTIME(TodoFromDay))","=", date("m", $firstDay), "OR", "1"); $AC->addAssocV3("TodoRepeat", "!=", "", "AND", "3");*/ if ($UserID != 0) { $AC->addAssocV3("TodoUserID", "=", $UserID, "AND", "2"); } else { $AC->addAssocV3("TodoUserID", ">", "0", "AND", "2"); } $AC->addAssocV3("TodoUserID", "=", "-1", "OR", "2"); $AC->addAssocV3("TodoRepeatUntil", "=", "0", "AND", "3"); $AC->addAssocV3("TodoRepeatUntil", ">=", $firstDay, "OR", "3"); #$ACS->resetPointer(); #while($Share = $ACS->getNextEntry()){ # if($include[$Share->A("UserID")] == "1") # $AC->addAssocV3("TodoUserID", "=", $Share->A("UserID"), "OR", "2"); #} $AC->addOrderV3("TodoTillTime"); while ($t = $AC->getNextEntry()) { $K->addEvent(self::getCalendarDetails("mTodoGUI", $t->getID(), $t)); } return $K; }
public static function SeiteParser($w, $l, $p) { $Seite = new Seite($w); $Seite->loadMe(); $aC = new anyC(); $aC->setCollectionOf("Seite"); $aC->setFieldsV3(array("IF(name = '', header, name) AS name")); $aC->addAssocV3("DomainID", "=", $p); $select = "\n\t\t<ul style=\"list-style-image:none;list-style-type:none;\">"; #$select .= NavigationGUI::getOption(-1, "Neue Seite erstellen", $w, "./images/i2/new.gif"); $select .= NavigationGUI::getOption(0, "Keine Seite", $w, "./images/i2/stop.png", "margin-bottom:5px;"); while ($s = $aC->getNextEntry()) { $select .= NavigationGUI::getOption($s->getID(), $s->A("name"), $w); } $label = $Seite->A("name") == "" ? $Seite->A("header") : $Seite->A("name"); if ($Seite->getA() == null) { $label = "Seite unbekannt"; } #if($w == -1) $label = "Neue Seite erstellen"; if ($w == 0) { $label = "Keine Seite"; } $select .= "\n\t\t</ul>"; $html = "\n\t\t<input type=\"hidden\" value=\"{$w}\" name=\"SeiteID\" />\n\t\t\n\t\t<div onclick=\"if(\$('pageSelection').style.display == 'none') new Effect.BlindDown('pageSelection', { duration: 0.3 }); else new Effect.BlindUp('pageSelection', { duration: 0.3 });\"\n\t\t\tstyle=\"background-image:url(./images/i2/go-down.png);background-repeat:no-repeat;background-position:99% 2px;width:246px;padding:3px;border-bottom-style:dotted;border-bottom-width:1px;\" class=\"borderColor1 backgroundColor0\">\n\t\t\t<span id=\"selectedPage\">{$label}</span>\n\t\t</div>\n\t\t<div id=\"pageSelection\" class=\"backgroundColor0 borderColor1\" style=\"border-width:1px;border-style:solid;border-top-width:0px;position:absolute;display:none;width:250px;\">\n\t\t\t<div style=\"overflow:auto;height:150px;\">\n\t\t\t{$select}\n\t\t\t</div>\n\t\t</div>"; return $html; }
</image> <?php if ($tvdbUnavailable !== false) { echo "\n\t\t<item>\n\t\t\t<title>The TV DB is currently unavailable</title>\n\t\t\t<description><![CDATA[{$tvdbUnavailable}]]></description>\n\t\t\t<link>{$link}</link>\n\t\t</item>"; } $Incoming = new mIncoming(); $Incoming->renameDownloaded(); $newFiles = $Incoming->getNewFiles(); $ac = new anyC(); $ac->setCollectionOf("Serie"); $ac->addAssocV3("RSSFilterID", "=", $_GET["RSSFilterID"]); $ac->addAssocV3("status", "=", "Continuing"); $series = ""; while ($S = $ac->getNextEntry()) { try { $C = $S->checkRSS($newFiles); foreach ($C as $En) { if ($series != $S->A("name") and $series != "") { echo "\n\t\t\t<item>\n\t\t\t\t<title>-----------------------------------</title>\n\t\t\t\t<link>{$link}/trinityDB/RSSFilter/FilteredFeed.php?RSSFilterID={$_GET['RSSFilterID']}</link>\n\t\t\t</item>"; } $series = $S->A("name"); $DLLink = "{$link}/trinityDB/RSSFilter/FilteredFeed.php?RSSFilterID={$_GET['RSSFilterID']}&fromPage=" . urlencode($En["link"]) . "&getLink=" . urlencode($En["fileName"]); if ($RSF->A("RSSFilterJDID") == "0") { $DLLink = $En["link"]; } $usedAutoDL = false; $alreadyDLed = JDownload::testDownloaded($En["fileName"]); if (!$alreadyDLed) { $usedAutoDL = $RSF->autoDownload($En["fileName"], $En["link"], $S->A("name") . " S" . $En["season"] . "E" . $En["episode"], $S);
public function useUser($username = null) { $ac = new anyC(); $ac->setCollectionOf("User"); if ($username != null) { $ac->addAssocV3("username", "=", $username); } $ac->addAssocV3("isAdmin", "=", "0"); $ac->setLimitV3("1"); $u = $ac->getNextEntry(); if ($u == null) { $this->errors[] = "100"; return false; } return $this->login($u->A("username"), $u->A("SHApassword"), true); }
public function convertPasswords() { $ac = new anyC(); $ac->setCollectionOf("User"); $ac->addAssocV3("password", "!=", ";;;-1;;;"); while ($t = $ac->getNextEntry()) { $t->convertPassword(); } }
public function getCartText($withPayPal = false) { $text = ""; $paypalHTML = '<form id="formPayPal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="upload" value="1" /> <input type="hidden" name="currency_code" value="EUR" /> <input type="hidden" name="charset" value="utf-8" /> <input type="hidden" name="invoice" value=";;;REPLACETHIS;;;" /> <input type="hidden" name="business" value="' . $this->sellerEmail . '" />'; $steuern = array(); $gesamt = 0; $netto = 0; /*$c = $this->useClass; $mwst = $this->mwstField; $name = $this->nameField; $preis = $this->preisField;*/ $i = 0; if ($this->cookie != "") { $text .= "\n " . str_pad("Artikel", 40, " ") . " MwSt Preis Gesamt\n-------------------------------------------------------------------------------------------"; 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; } $gesamt += $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1) * $t[1]; $netto += $A->getA()->{$preis} * 1 * $t[1]; $steuern[$A->getA()->{$mwst}] += $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100) * $t[1]; #$image = $this->invokeParser($this->imagePathCallback, $t[0], $A); $tName = str_pad(substr($A->getA()->{$name}, 0, 38), 40, " ", STR_PAD_RIGHT); $tName .= str_pad("", Util::countUmlaute($tName), " "); $brutto = $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1) * $t[1]; $this->sum += $brutto; $this->count += $t[1]; $text .= "\n" . str_pad($t[1], 5, " ", STR_PAD_LEFT) . " x " . $tName . "|" . str_pad(Util::formatNumber("de_DE", $A->getA()->{$mwst} * 1, 2, true, false), 7, " ", STR_PAD_LEFT) . "% |" . str_pad(Util::conv_euro8(Util::formatCurrency("de_DE", $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1), true)), 15, " ", STR_PAD_LEFT) . " |" . str_pad(Util::conv_euro8(Util::formatCurrency("de_DE", $brutto, true)), 15, " ", STR_PAD_LEFT) . ""; /** * Artikelnummer in neuer Zeile */ if (isset($A->getA()->{$artikelnummer}) and $A->getA()->{$artikelnummer} != "") { $text .= "\n" . str_pad("", 5, " ", STR_PAD_LEFT) . " " . str_pad(substr("Art.Nr. " . $A->getA()->{$artikelnummer}, 0, 38), 40, " ", STR_PAD_RIGHT) . "| | |"; } $i++; $ppName = str_replace(array("Ä", "Ö", "Ü", "ß", "ä", "ö", "ü"), array("Ae", "Oe", "Ue", "ss", "ae", "oe", "ue"), $tName); if ($t[2] == "CookieCart" and ($t[0] == "1" or $t[0] == "1010")) { $paypalHTML .= '<input type="hidden" name="discount_amount_cart" value="' . abs($brutto) . '" />'; } else { $paypalHTML .= ' <input type="hidden" name="item_name_' . $i . '" value="' . trim($ppName) . '"/ > <input type="hidden" name="amount_' . $i . '" value="' . Util::formatCurrency("en_GB", $brutto, false) . '" />'; } } if ($this->versandkostenBrutto != null) { $tName = str_pad(substr($this->versandkostenBrutto[0], 0, 38), 40, " ", STR_PAD_RIGHT); $tName .= str_pad("", Util::countUmlaute($tName), " "); $text .= "\n" . str_pad("1", 5, " ", STR_PAD_LEFT) . " x " . $tName . "|" . str_pad(Util::formatNumber("de_DE", $this->versandkostenBrutto[2], 2, true, false), 7, " ", STR_PAD_LEFT) . "% |" . str_pad(Util::conv_euro8(Util::formatCurrency("de_DE", $this->versandkostenBrutto[1], true)), 15, " ", STR_PAD_LEFT) . " |" . str_pad(Util::conv_euro8(Util::formatCurrency("de_DE", $this->versandkostenBrutto[1], true)), 15, " ", STR_PAD_LEFT) . ""; $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 != "" ? "\n" : "") . "" . str_pad(Util::conv_euro8("Gesamt MwSt" . str_pad(Util::formatNumber("de_DE", $key * 1, 2, true, false), 7, " ", STR_PAD_LEFT) . "%: " . str_pad(Util::formatCurrency("de_DE", $value, true), 15, " ", STR_PAD_LEFT)), 91, " ", STR_PAD_LEFT); } $text .= "\n-------------------------------------------------------------------------------------------\n Gesamt Netto " . str_pad(Util::conv_euro8(Util::formatCurrency("de_DE", $netto, true)), 15, " ", STR_PAD_LEFT) . "\n{$s}\n -------------------------------------\n Gesamt " . str_pad(Util::conv_euro8(Util::formatCurrency("de_DE", $gesamt, true)), 15, " ", STR_PAD_LEFT); } else { $text = "Ihr Warenkorb enthält keine Artikel."; } $this->elementPointer = 0; $paypalHTML .= ' <p> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" style="width:auto;border:0px;" name="submit" /> </p> </form>'; #if($withPayPal) $_SESSION["CookieCart_payPalHTML"] = $paypalHTML; #elseif(isset($_SESSION["CookieCart_payPalHTML"])) unset($_SESSION["CookieCart_payPalHTML"]); $this->PayPalButton = $paypalHTML; return $text; }
public function deleteMe() { $AC = new anyC(); $AC->setCollectionOf("Folge"); $AC->addAssocV3("SerieID", "=", $this->getID()); while ($F = $AC->getNextEntry()) { $F->deleteMe(); } parent::deleteMe(); }