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' &amp;&amp; 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") == "" ? "&lt;kein Name&gt;" : $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;
 }
Exemple #2
0
 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;
     }
 }
Exemple #3
0
 /**
  * @param string $collectionOf
  * @param string $field
  * @param string $value
  * @return anyC
  */
 public static function get($collectionOf, $field = "", $value = "")
 {
     $AC = new anyC();
     $AC->setCollectionOf($collectionOf);
     if ($field != "") {
         $AC->addAssocV3($field, "=", $value);
     }
     return $AC;
 }
Exemple #4
0
 function getLocations()
 {
     $AC = new anyC();
     $AC->setCollectionOf("FhemLocation");
     $Locations = array();
     while ($L = $AC->getNextEntry()) {
         $Locations[] = $L->getID() . "::" . $L->A("FhemLocationName");
     }
     return $Locations;
 }
Exemple #5
0
 function getHTML($id)
 {
     $this->customize();
     #if($this->A == null AND $id != -1) $this->loadMe();
     #if($id == -1) $this->A = new UserAttributes();
     $this->loadMeOrEmpty();
     $up = new anyC();
     $up->setCollectionOf("User");
     $up->addAssocV3("password", "!=", ";;;-1;;;");
     $up->lCV3();
     if ($up->numLoaded() > 0) {
         return "\n\t\t<table>\n\t\t\t<colgroup>\n\t\t\t\t<col class=\"backgroundColor3\" />\n\t\t\t</colgroup>\n\t\t\t<tr>\n\t\t\t\t<td><input onclick=\"rme('Users','','convertPasswords','','contentManager.reloadFrameRight();');\" type=\"button\" style=\"float:right;background-image:url(./images/navi/keys.png);\" class=\"bigButton backgroundColor2\" value=\"Passwörter\nkonvertieren\" />In Ihrer Datenbank befinden sich noch unkonvertierte Passwörter.</td>\n\t\t\t</tr>\n\t\t</table>";
     }
     $this->A->password = "******";
     $gui = new HTMLGUIX($this);
     #$gui->setObject();
     $gui->name("Benutzer");
     $gui->attributes(array("name", "username", "password", "SHApassword", "language", "UserPosition", "isAdmin", "UserEmail", "UserICQ", "UserJabber", "UserSkype", "UserTel"));
     $gui->label("name", "Name");
     $gui->label("username", "Benutzername");
     $gui->label("password", "Passwort");
     $gui->label("SHApassword", "Passwort");
     $gui->label("language", "Sprache");
     $gui->label("isAdmin", "Admin-Rechte?");
     $gui->label("UserEmail", "E-Mail");
     $gui->label("UserICQ", "ICQ");
     $gui->label("UserJabber", "Jabber");
     $gui->label("UserSkype", "Skype");
     $gui->label("UserTel", "Telefon");
     $gui->type("language", "select", array("de_DE" => "Deutsch (Deutschland) €", "de_DE_EUR" => "Deutsch (Deutschland) EUR", "de_CH" => "Deutsch (Schweiz) sFr", "de_CH_CHF" => "Deutsch (Schweiz) CHF", "en_GB" => "English (United Kingdom)"));
     #$gui->setOptions("language",);
     $gui->descriptionField("SHApassword", "Zum Ändern eingeben.");
     $gui->type("password", "hidden");
     $gui->type("SHApassword", "password");
     $gui->type("isAdmin", "radio");
     $gui->descriptionField("isAdmin", "<span style=\"color:red;\">Achtung: als Admin sehen Sie nur diese Admin-Oberfläche und NICHT das Programm selbst!</span>");
     #$gui->translate($this->loadTranslation());
     $gui->space("UserEmail", isset($this->texts["Kontaktdaten"]) ? $this->texts["Kontaktdaten"] : "Kontaktdaten");
     $gui->type("isAdmin", "checkbox");
     #$gui->setOptions("isAdmin",array("1","0"),array("ja ","nein"));
     #$gui->setStandardSaveButton($this);
     $gui->customize($this->customizer);
     $mUD = new mUserdataGUI();
     $mUD->addAssocV3("UserID", "=", $this->ID);
     $mUD->addAssocV3("typ", "=", "uRest", "AND", "1");
     $mUD->addAssocV3("typ", "=", "relab", "OR", "1");
     $mUD->addAssocV3("typ", "=", "hideF", "OR", "1");
     $mUD->addAssocV3("typ", "=", "pSpec", "OR", "1");
     $mUD->addAssocV3("typ", "=", "pHide", "OR", "1");
     $html = "<div>" . $mUD->getHTML(-1) . "</div>";
     if ($id == -1) {
         $html = "<table><tr><td class=\"backgroundColor3\">Sie können Einschränkungen erst anlegen, wenn der Benutzer angelegt wurde.</td></tr></table>";
     }
     return $gui->getEditHTML() . ($this->A->isAdmin != 1 ? $html : "");
 }
Exemple #6
0
 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;
 }
Exemple #7
0
 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;
 }
Exemple #8
0
 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;
 }
Exemple #9
0
 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;
     }
 }
 function getHTML($id)
 {
     $this->loadMeOrEmpty();
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Domain");
     if ($id != -1) {
         $Seiten = new SeitenGUI();
         $Seiten->addAssocV3("DomainID", "=", $this->getID());
         $Seiten->setFieldsV3(array("SeiteID", "IF(name = '', header , name) AS name"));
         $gui->selectWithCollection("startseite", $Seiten, "name");
     } else {
         $gui->setParser("startseite", "DomainGUI::startseiteParser");
     }
     $T = new TemplatesGUI();
     $T->addAssocV3("templateType", "=", "domainTemplate");
     $gui->selectWithCollection("TemplateID", $T, "name");
     $gui->setStandardSaveButton($this);
     #$gui->setSaveButtonValues(get_parent_class($this),$this->ID,"Domains");
     $gui->setShowAttributes(array("TemplateID", "url", "DomainDefaultSpracheID", "startseite", "title", "header", "umleitung", "permalinkPrefix", "horizontalNav"));
     if (Session::isPluginLoaded("mSprache")) {
         $mS = new anyC();
         $mS->setCollectionOf("Sprache");
         $gui->selectWithCollection("DomainDefaultSpracheID", $mS, "SpracheIdentifier", "keine Auswahl");
     } else {
         $gui->setType("DomainDefaultSpracheID", "hidden");
     }
     $gui->setLabel("DomainDefaultSpracheID", "Sprache");
     $gui->setLabel("url", "Domains");
     $gui->setLabel("title", "Titelzeile");
     $gui->setLabel("header", "Header");
     $gui->setLabel("permalinkPrefix", "Permalink-Präfix");
     $gui->setLabel("horizontalNav", "horizontale Navigation");
     $gui->setType("horizontalNav", "checkbox");
     $gui->setFieldDescription("horizontalNav", "Subkategorien in der Navigation werden nicht zwischen den Einträgen angezeigt sondern am Ende angehängt.");
     $gui->setFieldDescription("umleitung", "<b>www-Umleitung</b><br />Anfragen an Adressen ohne www-Subdomain werden auf die www-subdomain umgeleitet. Also es würde http://example.com an http://www.example.com umgeleitet. Nicht jedoch http://test.example.com<br /><br /><b>erster Eintrag</b><br />Alle Anfragen werden auf den ersten Eintrag der Liste umgeleitet.");
     $gui->setType("umleitung", "select");
     $gui->setOptions("umleitung", array("0", "1", "2"), array("keine", "www-Umleitung", "erster Eintrag"));
     $gui->setType("url", "textarea");
     $gui->setFieldDescription("url", "geben Sie eine Domain pro Zeile an oder * für eine beliebige Domain");
     $tab = new HTMLTable(1);
     $tab->addRow("Das Permalink-Präfix wird vor den Permalink geschrieben, wenn er für eine Seite eingetragen wurde.<br /><br />Wenn Sie also \"page-\" als Präfix angeben, wird der Permalink für die Startseite so aussehen (wenn der Permalink für die Startseite \"Startseite\" lautet) page-Startseite.<br /><br />Sie müssen diesen Permalink dann noch mit mod_rewrite umschreiben. Mit präfix \"page-\" dann zum Beispiel:<pre style=\"font-size:9px;\">RewriteEngine on\nRewriteRule ^page-([a-zA-Z0-9-_]*)\$ ?permalink=\$1</pre>");
     return $gui->getEditHTML() . $tab;
 }
 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>";
 }
Exemple #12
0
 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;
 }
Exemple #13
0
 public function deleteMe()
 {
     $AC = new anyC();
     $AC->setCollectionOf("Folge");
     $AC->addAssocV3("SerieID", "=", $this->getID());
     while ($F = $AC->getNextEntry()) {
         $F->deleteMe();
     }
     parent::deleteMe();
 }
 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 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;
 }
 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;
 }
 *  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();
 }
Exemple #19
0
 $ex = explode("\n", $domain->A("url"));
 if ($domain->A("umleitung") != null) {
     if ($domain->A("umleitung") == "1" and substr_count(str_replace(".uk", "", $_SERVER["HTTP_HOST"]), ".") == 1) {
         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&ouml;chten Sie die Suche auf der <a href=\"/\">Startseite</a> fortsetzen.", "multiCMS", "./multiCMS");
         #header("Connection: close");
         #exit();
         #die("Die gew&uuml;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!");
     }
 }
 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");
 }
Exemple #21
0
 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;
 }
 function getHTML($id)
 {
     $type = "none";
     $U = new mUserdata();
     $U = $U->getUDValue("selectedDomain");
     $bps = $this->getMyBPSData();
     if ($bps != -1 and isset($bps["type"])) {
         $type = $bps["type"];
     }
     $this->loadMeOrEmpty();
     if ($id == -1) {
         if ($type != "none" and $type != "undefined") {
             $this->A->SeiteID = $type;
         }
     }
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Content");
     $gui->setType("contentType", "select");
     $gui->setOptions("contentType", array("text", "preset", "downloads", "php"), array("Text", "HTML-Vorlage", "Downloads", "PHP"));
     $FB = new FileBrowser();
     $FB->addDir("../specifics/");
     if ($_SESSION["S"]->checkForPlugin("mShop")) {
         $FB->addDir("../multiCMS/Shop/");
     }
     $a = $FB->getAsLabeledArray("iCustomContent", ".class.php");
     $gui->setLabel("customContent", "Inhalt");
     $gui->setType("customContent", "select");
     $gui->setOptions("customContent", array_values($a), array_keys($a));
     $Tab = new HTMLTable(1);
     if ($this->singular) {
         $gui->setType("sort", "hidden");
     } else {
         $B = new Button("zurück", "back");
         $B->onclick("contentManager.loadFrame('contentLeft','Seite', " . $this->A("SeiteID") . ");");
         $Tab->addRow($B);
     }
     $gui->setLabel("contentType", "Typ");
     $gui->setLabel("ContentImage", "Bild");
     $gui->setLabel("SeiteID", "Seite");
     $gui->setLabel("TemplateID", "Vorlage");
     $gui->setLabel("sort", "Sortierung");
     $gui->setFieldDescription("ContentImage", "Wird an Stelle des Parameters %%%IMAGE%%% eingesetzt.");
     #$gui->setType("header","hidden");
     $gui->insertSpaceAbove("contentType");
     #$gui->insertSpaceAbove("TemplateID","sonstiges", true);
     $gui->setInputJSEvent("contentType", "onchange", "Content.selectType(this);");
     $gui->setType("text", "HTMLEditor");
     if (Session::isPluginLoaded("mFile")) {
         $B = new Button("Bild auswählen", "./images/i2/add.png");
         $B->type("icon");
         $B->customSelect("contentRight", $this->ID, "mFile", "Content.selectImage");
         $gui->activateFeature("addCustomButton", $this, "ContentImage", $B);
     } else {
         $gui->setType("ContentImage", "hidden");
     }
     $gui->setShowAttributes(array("text", "ContentSpracheID", "ContentImage", "TemplateID", "header", "sort", "contentType", "presetTemplateID", "formHandlerID", "customContent"));
     $gui->setFormID("ContentForm");
     $S = new anyC();
     $S->setCollectionOf("Seite");
     $gui->selectWithCollection("SeiteID", $S, "name");
     $gui->setType("name", "hidden");
     $gui->setType("SeiteID", "hidden");
     $gui->setLabel("presetTemplateID", "Vorlage");
     $gui->setLabel("formHandlerID", "Handler");
     $gui->setLabel("ContentSpracheID", "Sprache");
     if (Session::isPluginLoaded("mSprache")) {
         $Sprachen = new anyC();
         $Sprachen->setCollectionOf("Sprache");
         $gui->selectWithCollection("ContentSpracheID", $Sprachen, "SpracheIdentifier", "alle");
     } else {
         $gui->setType("ContentSpracheID", "hidden");
     }
     $aC = new anyC();
     $aC->setCollectionOf("Template");
     $aC->addAssocV3("templateType", "=", "presetTemplate");
     $gui->selectWithCollection("presetTemplateID", $aC, "name");
     if ($_SESSION["S"]->checkForPlugin("mHandler")) {
         $handlerAC = new anyC();
         $handlerAC->setCollectionOf("Handler");
         $handlerAC->addAssocV3("HandlerDomainID", "=", $U);
         $gui->selectWithCollection("formHandlerID", $handlerAC, "HandlerName", "keiner");
     } else {
         $gui->setParser("formHandlerID", "ContentGUI::noHandlerParser");
     }
     if ($this->A->contentType != "preset") {
         $gui->setLineStyle("presetTemplateID", "display:none;");
         $gui->setLineStyle("formHandlerID", "display:none;");
     }
     if ($this->A->contentType != "php") {
         $gui->setLineStyle("customContent", "display:none;");
     }
     $T = new TemplatesGUI();
     $T->addAssocV3("templateType", "=", "contentTemplate");
     $T->addAssocV3("templateType", "=", "listTemplate", "OR");
     $T->addAssocV3("templateType", "=", "tableTemplate", "OR");
     $T->addAssocV3("templateType", "=", "dlTemplate", "OR");
     $T->addOrderV3("templateType");
     $TG = new TemplatesGUI();
     $cats = $TG->getAvailableCategories();
     $options = array();
     while ($o = $T->getNextEntry()) {
         $options[$o->getID()] = $cats[$o->getA()->templateType];
     }
     $T->resetPointer();
     $gui->selectWithCollection("TemplateID", $T, "name");
     $gui->selectOptgroup("TemplateID", $options);
     $gui->setJSEvent("onSave", "function() { contentManager.loadFrame('contentLeft','Seite', " . $this->A("SeiteID") . "); }");
     $gui->setStandardSaveButton($this);
     $gui->customize($this->customizer);
     return $Tab . $gui->getEditHTML();
 }
Exemple #23
0
 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;
 }
 function getHTML($id)
 {
     $U = new mUserdata();
     $U = $U->getUDValue("selectedDomain");
     if ($id == -1) {
         $this->A = $this->newAttributes();
         $this->A->DomainID = $U;
         $this->A->header = "leere Seite";
         if ($_SESSION["S"]->checkForPlugin("Templates")) {
             $this->A->TemplateID = TemplatesGUI::getDefault("pageTemplate");
         }
         $id = $this->newMe();
         $c = new Content(-1);
         $cA = $c->newAttributes();
         $c->setA($cA);
         $c->changeA("SeiteID", $id);
         if ($_SESSION["S"]->checkForPlugin("Templates")) {
             $c->changeA("TemplateID", TemplatesGUI::getDefault("contentTemplate"));
         }
         $c->newMe();
         $this->forceReload();
     }
     if ($this->A == null) {
         $this->loadMe();
     }
     #$this->loadMeOrEmpty();
     #if($id == -1 AND $U != null) $this->A->DomainID = $U;
     $gui = new HTMLGUI();
     $gui->setObject($this);
     $gui->setName("Seite");
     $gui->setShowAttributes(array("header", "TemplateID", "name", "metaTagDescription", "permalink"));
     $gui->insertSpaceAbove("name", "sonstiges", true);
     $gui->setLabel("header", "Seitenname");
     #$gui->insertSpaceAbove("metaTagDescription");
     #$gui->setFieldDescription("header","wird auf der Seite angezeigt");
     $gui->setFieldDescription("name", "wird nur intern angezeigt");
     $gui->setFieldDescription("permalink", "Ein Name, unter der die Seite über ?permalink= erreichbar ist. Darf nur aus Buchstaben (keine Umlaute), Zahlen, _ und - bestehen und muss eindeutig für die Domain sein. Es kann dann mit mod_rewrite auf diesen permalink an Stelle der SeitenID verlinkt werden.");
     $gui->setLabel("TemplateID", "Vorlage");
     $gui->setType("DomainID", "hidden");
     $gui->setType("metaTagDescription", "textarea");
     $gui->setLabel("metaTagDescription", "Beschreibung für meta tag");
     $gui->setInputJSEvent("metaTagDescription", "onkeyup", "\$('charCounter').update(\$('metaTagDescription').value.length)");
     $gui->setFieldDescription("metaTagDescription", "<span id=\"charCounter\">" . strlen($this->A("metaTagDescription")) . "</span> Zeichen");
     $gui->setInputStyle("metaTagDescription", "font-size:8px;");
     if (Session::isPluginLoaded("mMultiLanguage")) {
         $gui->activateFeature("addAnotherLanguageButton", $this, "header");
     }
     if (Session::isPluginLoaded("Templates")) {
         $T = new anyC();
         $T->setCollectionOf("Template");
         $T->addAssocV3("templateType", "=", "pageTemplate", "AND", "1");
         $T->addAssocV3("TemplateDomainID", "=", "0", "AND", "2");
         $T->addAssocV3("TemplateDomainID", "=", $this->A("DomainID"), "OR", "2");
         $gui->selectWithCollection("TemplateID", $T, "name");
     } else {
         $gui->setType("TemplateID", "hidden");
     }
     $gui->setStandardSaveButton($this);
     $H = "";
     $E = "";
     $C = new mContentGUI();
     $C->addAssocV3("SeiteID", "=", $this->ID);
     $C->lCV3();
     if ($C->numLoaded() == 1) {
         $content = $C->getNextEntry();
         $H = new ContentGUI($content->getID());
         $H->singular = true;
         $H = "<div style=\"height:20px;width:20px;\"></div>" . $H->getHTML($content->getID());
     } else {
         $E = $C->getHTML(-1);
     }
     $tab = new HTMLTable(1);
     $tab->setTableStyle("margin-top:20px;");
     $B = new Button("Content\nhinzufügen", "gutschrift");
     $B->rmePCR("Seite", $this->ID, "createContent", "", "contentManager.reloadFrame('contentLeft');");
     $tab->addRow($B);
     return $gui->getEditHTML() . $H . $tab . $E;
 }
Exemple #25
0
 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();
     }
 }
Exemple #26
0
 public function convertPasswords()
 {
     $ac = new anyC();
     $ac->setCollectionOf("User");
     $ac->addAssocV3("password", "!=", ";;;-1;;;");
     while ($t = $ac->getNextEntry()) {
         $t->convertPassword();
     }
 }
Exemple #27
0
 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");
 }
Exemple #28
0
 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;
 }
Exemple #29
0
    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;
    }
Exemple #30
0
			<link><?php 
echo $link;
?>
</link>
		</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']}&amp;fromPage=" . urlencode($En["link"]) . "&amp;getLink=" . urlencode($En["fileName"]);
            if ($RSF->A("RSSFilterJDID") == "0") {
                $DLLink = $En["link"];
            }