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 checkAllEpisodes($returnValues = false, $newFiles = null) { $ac = new anyC(); $ac->setCollectionOf("Folge"); $ac->addAssocV3("SerieID", "=", $this->getID()); $ac->addAssocV3("wanted", "=", "1"); $ac->addOrderV3("season"); $ac->addOrderV3("episode"); if (!$returnValues) { $T = new HTMLTable(5); } $R = array(); if ($newFiles != null) { $newFound = $this->findNewEpisodes($newFiles); } while ($E = $ac->getNextEntry()) { $c = $E->check($this); if ($c[0] === true) { continue; } $continue = false; if ($newFiles != null) { foreach ($newFound as $NE) { if ($NE["season"] * 1 == $E->A("season") * 1 and $NE["episode"] * 1 == $E->A("episode") * 1) { $continue = true; } } } if ($continue) { continue; } $R[] = $E; if (!$returnValues) { $T->addRow(array("S" . $E->A("season") . "E" . $E->A("episode"), $E->A("name"), $c[0] ? "ok" : "", Util::formatByte($c[1]), $c[2])); } } if ($returnValues) { return $R; } echo "<div style=\"overflow:auto;max-height:400px;\">" . $T . "</div>"; }
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 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; }
* 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(); }
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; }