public function createNew() { $F = new Factory("TinkerforgeBricklet"); $F->sA("TinkerforgeBrickletTinkerforgeID", $this->getID()); $F->store(); echo $this->bricklets(); }
public function createNewServer() { $F = new Factory("xCal"); $F->sA("xCalServerActive", "1"); $F->sA("xCalUserID", Session::currentUser()->getID()); $F->store(); }
public function addFrozenItem($name) { if (preg_match("/[0-9]+/", $name)) { $this->addEAN($name, false); } elseif (trim($name) != "") { $F = new Factory("Gefrierschrank"); $F->sA("GefrierschrankName", $name); $F->sA("GefrierschrankAdded", "1"); $F->store(); } echo $this->getFrozenListTable(); }
public function sendMessage($target, $message, $from, $urgency = 50) { if (trim($message) == "") { return; } $F = new Factory("Nuntius"); $F->sA("NuntiusDeviceID", $target); $F->sA("NuntiusSender", $from); $F->sA("NuntiusTime", time()); $F->sA("NuntiusUrgency", $urgency); $F->sA("NuntiusMessage", $message); $F->sA("NuntiusRead", $urgency < 10 ? "1" : "0"); return $F->store(); }
function deleteMe() { $F = new Factory("UserOld"); $F->sA("UserOldUserID", $this->getID()); $id = $F->store(); $O = new UserOld($id); $this->loadMe(); $A = $this->getA(); foreach ($A as $k => $v) { if ($O->A($k) !== null) { $O->changeA($k, $v); } } $O->saveMe(); parent::deleteMe(); }
private function logDownload($logLink, $link, $fileName = "", $fileSize = 0, Serie $Serie = null, $renamed = false) { $F = new Factory("JDownload"); $F->sA("JDownloadURL", $logLink); $F->sA("JDownloadFilename", $link); $F->sA("JDownloadRenameto", $fileName); $F->sA("JDownloadJDID", $this->getID()); $F->sA("JDownloadSerieID", $Serie != null ? $Serie->getID() : 0); if ($renamed) { $F->sA("JDownloadRenamed", time()); } $E = $F->exists(true); if ($E === false) { $F->sA("JDownloadDate", time()); $F->sA("JDownloadFilesize", $fileSize); $id = $F->store(); } else { $E->changeA("JDownloadDate", time()); $E->changeA("JDownloadFilesize", $fileSize); $E->saveMe(); $id = $E->getID(); } return $id; }
public function addSettingNew($type) { $F = new Factory("System"); $F->sA("SystemType", $type); echo $F->store(); }
function handleForm($valuesAssocArray) { switch ($valuesAssocArray["action"]) { case "alterAddress": $F = new Factory("Adresse", $valuesAssocArray["AdresseID"]); $F->fill($valuesAssocArray); $F->store(); break; } parent::handleForm($valuesAssocArray); }
<?php define("PHYNX_NO_SESSION_RELOCATION", true); require "../../system/connect.php"; addClassPath(Util::getRootPath() . "ubiquitous/phim"); $T = mUserdata::getGlobalSettingValue("phimServerToken"); if (!$T) { die("<phynx><phim><token>unknown</token></phim></phynx>"); } if ($T !== filter_input(INPUT_GET, "token")) { die("<phynx><phim><token>unknown</token></phim></phynx>"); } $U = anyC::getFirst("phimUser", "phimUserSystemName", str_replace("\\", "/", filter_input(INPUT_GET, "user"))); if ($U == null) { $F = new Factory("phimUser"); $F->sA("phimUserSystemName", str_replace("\\", "/", filter_input(INPUT_GET, "user"))); $F->store(); die("<phynx><phim><token>unknown</token></phim></phynx>"); } echo "<phynx><phim><token>" . $U->A("phimUserToken") . "</token></phim></phynx>";
public function createContent() { $F = new Factory("Content"); $F->sA("SeiteID", $this->ID); $F->sA("TemplateID", TemplatesGUI::getDefault("contentTemplate")); $F->store(true, true); }
public function reAddItem($EinkaufszettelID, $overviewList = false) { $E = new Einkaufszettel($EinkaufszettelID); $E->changeA("EinkaufszettelAdded", $E->A("EinkaufszettelAdded") + 1); $E->saveMe(); $F = new Factory("Einkaufszettel"); $F->sA("EinkaufszettelBought", "0"); $F->sA("EinkaufszettelName", $E->A("EinkaufszettelName")); $exists = $F->exists(true); if ($exists !== false) { $exists->changeA("EinkaufszettelMenge", $exists->A("EinkaufszettelMenge") + 1); $exists->saveMe(); } else { #$E->changeA("EinkaufszettelBought", "0"); #$E->changeA("EinkaufszettelTime", time()); $F->sA("EinkaufszettelMenge", "1"); #$E->newMe(); $F->sA("EinkaufszettelEinkaufszettelKategorieID", $E->A("EinkaufszettelEinkaufszettelKategorieID")); $F->sA("EinkaufszettelTime", time()); $F->store(); } #$F->sA("EinkaufszettelName", $E->A("EinkaufszettelName")); #$exists = $F->exists(true); #if($exists !== false){ #$exists->changeA("EinkaufszettelMenge", $exists->A("EinkaufszettelMenge") + 1); # $exists->saveMe(); #} else { # $E->changeA("EinkaufszettelBought", "0"); # #$E->changeA("EinkaufszettelMenge", "1"); # $E->newMe(); #} #if(!$overviewList) echo $this->getListTable(); #else # echo $this->getOverviewList(); }
public function discoverNow($reloadWhat = null, $force = false, $quiet = false) { $last = mUserdata::getGlobalSettingValue("UPnPLastDiscover", 0); if (time() - $last < 3600 * 3.5 and !$force) { return; } $C = new phpUPnP(); $result = $C->mSearch(); #print_r($result); if (!$quiet) { echo "<p>Gefundene Geräte:</p>"; } #$locations = array(); $L = new HTMLList(); $L->addListStyle("list-style-type:none;"); $foundLocations = array(); #echo "<pre style=\"padding:5px;font-size:9px;overflow:auto;height:400px;\">"; #print_r($result); #echo "</pre>"; foreach ($result as $r) { if (isset($foundLocations[$r["location"]])) { continue; } $info = file_get_contents($r["location"]); if ($info === false) { continue; } $xml = new SimpleXMLElement($info); $services = array(); foreach ($xml->device->serviceList->service as $service) { foreach (self::$desiredServices as $k => $S) { if ($service->serviceId[0] == $S) { $services[$k] = $service; } } } #echo "<pre>"; #print_r($xml->device->UDN); #echo "</pre>"; $F = new Factory("UPnP"); $F->sA("UPnPUDN", $xml->device->UDN); $L->addItem($xml->device->friendlyName); $U = $F->exists(true); if ($U !== false) { $U->changeA("UPnPLocation", $r["location"]); #$U->changeA("UPnPName", $xml->device->friendlyName); $U->changeA("UPnPModelName", $xml->device->modelName); $U->changeA("UPnPUDN", $xml->device->UDN); foreach (self::$desiredServices as $S => $nil) { $U->changeA("UPnP{$S}", 0); } foreach ($services as $S => $service) { $U->changeA("UPnP{$S}", 1); $U->changeA("UPnP" . $S . "SCPDURL", $service->SCPDURL[0] . ""); $U->changeA("UPnP" . $S . "controlURL", $service->controlURL[0] . ""); } #echo "save"; $U->saveMe(); } else { $F->sA("UPnPLocation", $r["location"]); $F->sA("UPnPName", $xml->device->friendlyName); $F->sA("UPnPModelName", $xml->device->modelName); foreach (self::$desiredServices as $S => $nil) { $F->sA("UPnP{$S}", 0); } foreach ($services as $S => $service) { $F->sA("UPnP{$S}", 1); $F->sA("UPnP" . $S . "SCPDURL", $service->SCPDURL[0] . ""); $F->sA("UPnP" . $S . "controlURL", $service->controlURL[0] . ""); } #echo "store"; $F->store(); } $foundLocations[$r["location"]] = true; } $AC = anyC::get("UPnP"); while ($U = $AC->getNextEntry()) { if (!isset($foundLocations[$U->A("UPnPLocation")])) { $U->deleteMe(); } } if (!$quiet) { echo $L; } $B = new Button("OK", "bestaetigung"); $B->style("float:right;margin:10px;"); if ($reloadWhat == "targets") { $B->onclick(OnEvent::closePopup("mUPnP") . " UPnP.targetSelection();"); } if ($reloadWhat == "sources") { $B->onclick(OnEvent::closePopup("mUPnP") . " UPnP.sourceSelection();"); } if ($reloadWhat) { echo $B . "<div style=\"clear:both;\"></div>"; } mUserdata::setUserdataS("UPnPLastDiscover", time(), "", -1); #echo "</pre>"; }
public function addInvitee($TodoID, $name, $email) { $F = new Factory("TodoInvitation"); $F->sA("TodoInvitationTodoID", $TodoID); $F->sA("TodoInvitationName", $name); $F->sA("TodoInvitationUserEmail", $email); #$F->sA("TodoInvitationStatus", 0); if ($F->exists()) { $this->getInvitees($TodoID); return; } $F->store(); $this->getInvitees($TodoID); }
public function saveCols($data, $DeviceID, $col) { $O = anyC::getFirst("fheOverview", "fheOverviewDeviceID", $DeviceID); if ($O == null) { $F = new Factory("fheOverview"); $F->sA("fheOverviewDeviceID", $DeviceID); $F->store(); $O = anyC::getFirst("fheOverview", "fheOverviewDeviceID", $DeviceID); } $O->changeA("fheOverviewCol{$col}", $data); $O->saveMe(true, true); }
function sendMessage($to, $text) { $F = new Factory("phim"); $target = $to; $group = 0; if ($to[0] == "g") { $group = str_replace("g", "", $to); $to = 0; } $F->sA("phimFromUserID", Session::currentUser()->getID()); $F->sA("phimToUserID", $to); $F->sA("phimTime", time()); $F->sA("phimMessage", $text); $F->sA("phimphimGruppeID", $group); $message = new stdClass(); $message->method = "message"; $message->content = $text; $message->from = Session::currentUser()->getID(); $message->fromUser = Session::currentUser()->A("name"); $message->to = $to; $message->time = time(); $message->group = $group; $F->store(); $this->go($message, $target); }
public function downloadTrashData() { $andreas = false; if (!$andreas) { $json = file_get_contents("http://awido.cubefour.de/WebServices/Awido.Service.svc/getData/00000000-0000-0000-0000-000000001190?fractions=1,5,2,6,3,4,10&client=awv-nordschwaben"); } else { $json = file_get_contents("http://awido.cubefour.de/WebServices/Awido.Service.svc/getData/00000000-0000-0000-0000-000000000629?fractions=1,5,2,6,3,4,10&client=awv-nordschwaben"); } echo "<pre style=\"font-size:10px;max-height:400px;overflow:auto;\">"; $data = json_decode($json); foreach ($data->calendar as $day) { if ($day->fr == "") { continue; } if ($day->dt < date("Ymd")) { continue; } print_r($day); $tag = new Datum(Util::parseDate("de_DE", substr($day->dt, 6) . "." . substr($day->dt, 4, 2) . "." . substr($day->dt, 0, 4))); if ($andreas) { $tag->subDay(); } $name = ""; foreach ($day->fr as $T) { if ($T == "PT") { $name .= ($name != "" ? ", " : "") . "Papiertonne"; } if ($T == "RT") { $name .= ($name != "" ? ", " : "") . "Restmüll"; } if ($T == "GS") { $name .= ($name != "" ? ", " : "") . "Gelber Sack"; } if ($T == "BT") { $name .= ($name != "" ? ", " : "") . "Biotonne"; } } if ($name == "") { continue; } $F = new Factory("Todo"); $F->sA("TodoName", $name); $F->sA("TodoFromDay", $tag->time()); $F->sA("TodoTillDay", $tag->time()); $F->sA("TodoFromTime", "32400"); $F->sA("TodoTillTime", "36000"); $F->sA("TodoUserID", "-1"); $F->sA("TodoRemind", "-1"); if ($andreas) { $F->sA("TodoFromTime", Util::parseTime("de_DE", "18:00")); $F->sA("TodoTillTime", Util::parseTime("de_DE", "18:05")); $F->sA("TodoUserID", Session::currentUser()->getID()); $F->sA("TodoRemind", 60); } $F->sA("TodoClass", "Kalender"); $F->sA("TodoClassID", "-1"); $F->sA("TodoType", "2"); if ($F->exists()) { continue; } $F->store(); } echo "</pre>"; }
public function newMe($checkUserData = true, $output = false) { $this->changeA("TodoLastChange", time()); if (Session::currentUser() != null) { $this->changeA("TodoCreatorUserID", Session::currentUser()->getID()); } #if($this->A("TodoGUID") == "") # $this->changeA("TodoGUID", uniqid()."-".uniqid()); if ($this->A("TodoClass") != "" and $this->A("TodoClass") != "Kalender" and $this->A("TodoName") == "") { $this->changeA("TodoName", $this->getOwnerObject()->getCalendarTitle()); } $id = parent::newMe($checkUserData, false); if (Session::isPluginLoaded("mSync") and ($this->A("TodoExceptionForID") == "0" or $this->A("TodoExceptionForID") == "")) { mSync::newGUID("Todo", $id); } #$name = $this->getOwnerObject()->getCalendarTitle(); if (Session::isPluginLoaded("mGoogle") and $this->updateGoogle) { if ($this->A("TodoUserID") == Session::currentUser()->getID()) { Google::calendarCreateEvent(mTodoGUI::getCalendarDetails("Todo", $id)); } } if ($this->A("TodoClass") == "DBMail" and Session::isPluginLoaded("mMail")) { Mail::assign("Todo", $id, $this->A("TodoClassID")); } if (Session::isPluginLoaded("mAufgabe") and ($this->A("TodoType") == 3 or $this->A("TodoType") == 4 or $this->A("TodoType") == 5) and $this->A("TodoUserID") > 0) { $F = new Factory("Aufgabe"); $F->sA("AufgabeByClass", "Todo"); $F->sA("AufgabeByClassID", $id); $F->sA("AufgabeUserID", $this->A("TodoUserID")); $F->sA("AufgabeText", "Bericht für Termin eintragen"); $F->sA("AufgabeCreated", time()); $F->sA("AufgabeUntil", $this->A("TodoFromDay")); $F->sA("AufgabeUhrzeitVon", $this->A("TodoTillTime")); $F->store(); } return $id; }
public function download(Serie $S, $echo = false) { $tab = new HTMLTable(1); $mirrorPath = $this->getMirror(); $tab->addRow("Retrieving mirror list... using {$mirrorPath}"); $serverTime = $this->getServerTime(); $tab->addRow("Retrieving server time... {$serverTime}"); $S->changeA("lastupdate", $serverTime); if ($S->A("siteID") == 0) { $tab->addRow("Retrieving series information..."); $data = file_get_contents("{$mirrorPath}/api/GetSeries.php?seriesname=" . urlencode($S->A("name")) . "&language=" . $S->A("sprache")); if ($data === false) { throw new Exception("No data from {$mirrorPath}/api/GetSeries.php?seriesname=" . urlencode($S->A("name")) . "&language=" . $S->A("sprache")); } #die("DATA: $data"); $seriesInfo = new SimpleXMLElement($data, null, false); $seriesID = $seriesInfo->Series->seriesid; $S->changeA("siteID", $seriesID); #$S->changeA("description", $seriesInfo->Series->Overview); } else { $seriesID = $S->A("siteID"); } $tempFile = Util::getTempFilename("SerieID" . $S->getID(), "zip"); $tab->addRow("Downloading episodes information..."); $SZip = "{$mirrorPath}/api/{$this->apiKey}/series/{$seriesID}/all/" . $S->A("sprache") . ".zip"; if (!copy($SZip, $tempFile)) { Red::errorD("The download of {$SZip} failed!"); } try { $zip = new ZipArchive(); if ($zip->open($tempFile) === TRUE) { $zip->extractTo(dirname($tempFile) . "/SerieID" . $S->getID()); $zip->close(); $tab->addRow("Extracting data..."); } else { throw new ClassNotFoundException(""); } } catch (ClassNotFoundException $e) { if (!Util::isWindowsHost()) { $commandUnzip = "unzip -o {$tempFile} -d SerieID" . $S->getID(); } else { $commandUnzip = Util::getRootPath() . "trinityDB/Serien/unzip.exe -o {$tempFile} -d SerieID" . $S->getID(); } $tab->addRow("Extracting data...<br />{$commandUnzip}"); $sc = new SystemCommand(); $sc->setCommand("cd " . dirname($tempFile) . " && {$commandUnzip}"); $sc->execute(); } $e = 0; $u = 0; $file = dirname($tempFile) . "/SerieID" . $S->getID() . "/" . $S->A("sprache") . ".xml"; if (!file_exists($file)) { Red::errorD("Could not find the expected file {$file}. Please check if it was properly extracted from {$tempFile}."); } $episodesList = new SimpleXMLElement(file_get_contents($file)); $status = $episodesList->Series->Status; $S->changeA("description", $episodesList->Series->Overview); $S->changeA("status", $status); $S->changeA("genre", $episodesList->Series->Genre); foreach ($episodesList->Episode as $k => $v) { $AC = anyC::get("Folge", "SerieID", $S->getID()); $AC->addAssocV3("season", "=", $v->SeasonNumber); $AC->addAssocV3("episode", "=", $v->EpisodeNumber); $AC->lCV3(); if ($AC->numLoaded() > 1) { while ($F = $AC->getNextEntry()) { $F->deleteMe(); } } $F = new Factory("Folge"); $F->sA("SerieID", $S->getID()); $F->sA("season", $v->SeasonNumber); $F->sA("episode", $v->EpisodeNumber); if ($E = $F->exists(true)) { if ($v->lastupdated == $E->A("lastupdate")) { continue; } $E->changeA("name", $v->EpisodeName); $E->changeA("airDate", $v->FirstAired); $E->changeA("lastupdate", $v->lastupdated); $E->changeA("description", $v->Overview); $E->saveMe(true, false); $u++; continue; } $F->sA("episodeID", $v->id); $F->sA("name", $v->EpisodeName); $F->sA("airDate", $v->FirstAired); $F->sA("lastupdate", $v->lastupdated); $F->sA("description", $v->Overview); $F->sA("wanted", "1"); $F->store(true, false); $e++; } $tab->addRow("Loaded {$e} episodes"); $tab->addRow("Updated {$u} episodes"); if (mUserdata::getGlobalSettingValue("trinityDBdlCover", "0") == "1") { $bannerList = new SimpleXMLElement(dirname($tempFile) . "/SerieID" . $S->getID() . "/banners.xml", null, true); foreach ($bannerList as $banner) { if ($banner->BannerType . "" == "poster") { #echo $banner->BannerPath.""; $cover = file_get_contents("http://www.thetvdb.com/banners/" . $banner->BannerPath); $temp = Util::getTempFilename("cover", "jpg"); file_put_contents($temp, $cover); if ($S->A("dir") != "" and file_exists($S->A("dir"))) { file_put_contents($S->A("dir") . "/Folder.jpg", $cover); } $S->changeA("cover", DBImageGUI::stringifyS("image/jpg", $temp)); $S->changeA("coverThumb", DBImageGUI::stringifyS("image/png", $temp, 150, 220)); #$S->saveMe(); unlink($temp); $tab->addRow("Downloaded cover"); break; } } } $S->saveMe(true, false); if ($echo) { echo $tab; } }
public function saveContextMenu($identifier, $key) { $F = new Factory("Userdata"); $F->sA("UserID", "-1"); $F->sA("name", "trinityDBdlCover"); $U = $F->exists(true); if ($U !== false) { $U->changeA("wert", $identifier); $U->saveMe(); } else { $F->sA("wert", $identifier); $F->store(); } mUserdata::setUserdataS("trinityDBdlCover", $identifier); }
function handleForm($valuesAssocArray) { $this->classes(); switch ($valuesAssocArray["action"]) { case "register": $F = new Factory("Adresse"); $F->sA("firma", $valuesAssocArray["firma"]); $F->sA("strasse", $valuesAssocArray["strasse"]); $F->sA("nr", $valuesAssocArray["nr"]); $F->sA("plz", $valuesAssocArray["plz"]); $F->sA("ort", $valuesAssocArray["ort"]); $F->sA("email", $valuesAssocArray["userEmail"]); //from email $F->sA("tel", $valuesAssocArray["tel"]); $AdresseID = $F->store(false, false); $K = new Kunden(); $Kappendix = $K->createKundeToAdresse($AdresseID, false, true); $Kappendix->changeA("KappendixKontonummer", $valuesAssocArray["kontonummer"]); $Kappendix->changeA("KappendixBLZ", $valuesAssocArray["blz"]); $Kappendix->changeA("KappendixSameKontoinhaber", "1"); $KappendixID = $Kappendix->newMe(false); $token = sha1($AdresseID . $KappendixID . microtime()); $F = new Factory("PDFixUser"); $F->sA("PDFixUserAdresseID", $AdresseID); $F->sA("PDFixUserKappendixID", $KappendixID); $F->sA("PDFixUserPDFixUserDBID", "0"); $F->sA("PDFixUserIsActive", "0"); $F->sA("PDFixUserVorNachname", $valuesAssocArray["userVorNachname"]); $F->sA("PDFixUserUsername", $valuesAssocArray["userUsername"]); $F->sA("PDFixUserPassword", $valuesAssocArray["userPassword"]); $F->sA("PDFixUserEmail", $valuesAssocArray["userEmail"]); $F->sA("PDFixUserRate", $valuesAssocArray["zahlungsweise"]); $F->sA("PDFixUserRegisteredDate", time()); $F->sA("PDFixUserToken", $token); $F->store(false, false); $mail = new htmlMimeMail5(); $mail->setFrom("*****@*****.**"); $mail->setSubject(utf8_decode("PDFix Registrierung ihres Mitarbeiters " . $valuesAssocArray["userVorNachname"])); $mail->setText(utf8_decode("Sehr geehrte Damen und Herren,\n \nSie selbst oder Ihr Mitarbeiter/Ihre Mitarbeiterin \n" . $valuesAssocArray["userVorNachname"] . " hat sich soeben bei www.pdfix.de angemeldet. \n \nDer Account wurde angelegt.\n \nIm Anhang finden Sie unsere AGB und den Softwarelizenzvertrag.\nMit der Aktivierung des Accounts werden die AGB und Nutzungsbedingungen\nannerkannt.\n\nSobald die Abbuchungserklärung bei uns eingegangen ist,\nwird der Account innerhalb 24 Std. freigeschalten und\n\"pdfix\" kann dann genutzt werden.\n \nWenn Sie die Kosten übernehmen, dann klicken Sie auf\n\n\nnachstehenden Aktivierungslink.\n\nhttp://" . $_SERVER["HTTP_HOST"] . "" . str_replace("/ubiquitous/CustomerPage/index.php", "/ubiquitous/CustomerPage/?CC=RegistrationPDFix&activate={$token}", $_SERVER["SCRIPT_NAME"]) . "\n \n\nAnsonsten klären Sie bitte die Kostenübernahme mit Ihrem Mitarbeiter ab.\n\n \nMit freundlichen Grüßen\n \nM. Tischler\nGeschäftsführer\nETS-SÜD UG (haftungsbeschränkt)\nDR. Michael Samer Ring 2a\n86609 Donauwörth\nAG Augsburg\nHRB 26204\ninfo@pdfix.de")); /* Zum Download von pdfix besuchen Sie bitte http://www.meine-smn.de und klicken auf \"Login\" melden Sie sich an mit: Benutzername: ".$valuesAssocArray["userUsername"]." Passwort: ".$valuesAssocArray["userPassword"]." Bestätigen Sie jeweils am Ende der Seiten die AGB´s und Lizenzbedingungen und laden \"pdfix\" down. Sobald die Abbuchungserklärung bei uns eingegangen ist, wird der Account innerhalb 24 Std. freigeschalten,und \"pdfix\" kann dann genutzt werden. */ #$mail->setTextCharset("UTF-8"); #$mail->addAttachment(new fileAttachment(Util::getRootPath()."open3A/PDFix/abbuchungserkl.pdf", "application/pdf")); $mail->addAttachment(new fileAttachment(Util::getRootPath() . "../download/Agbs.pdf", "application/pdf")); $mail->addAttachment(new fileAttachment(Util::getRootPath() . "../download/Softwarelizenzvertrag.pdf", "application/pdf")); if (!$mail->send(array($valuesAssocArray["userEmail"]))) { //from email Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!"); } break; case "activate": $PU = anyC::getFirst("PDFixUser", "PDFixUserToken", $valuesAssocArray["token"]); $PU->changeA("PDFixUserActivatedDate", time()); $PU->changeA("PDFixUserIsActive", "1"); $PU->changeA("PDFixUserRate", $valuesAssocArray["zahlungsweise"]); $PU->saveMe(); $mail = new htmlMimeMail5(); $mail->setFrom("*****@*****.**"); $mail->setSubject(utf8_decode("PDFix Registrierung ihres Mitarbeiters " . $valuesAssocArray["userVorNachname"])); $mail->setText(utf8_decode("Sehr geehrte Damen und Herren,\n \nIhr Account wurde soeben angelegt.\n \nBenutzername: " . $PU->A("PDFixUserUsername") . "\nPasswort: " . $PU->A("PDFixUserPassword") . "\n \nSobald die Abbuchungserklärung bei uns eingegangen ist,\nwird der Account innerhalb 24 Std. freigeschalten und\n\"pdfix\" kann dann genutzt werden.\n\t\n\nMit freundlichen Grüßen\n \nM. Tischler\nGeschäftsführer\nETS-SÜD UG (haftungsbeschränkt)\nDR. Michael Samer Ring 2a\n86609 Donauwörth\nAG Augsburg\nHRB 26204\ninfo@pdfix.de")); /* Zum Download von pdfix besuchen Sie bitte http://www.meine-smn.de und klicken auf \"Login\" melden Sie sich an mit: Bestätigen Sie jeweils am Ende der Seiten die AGB´s und Lizenzbedingungen und laden \"pdfix\" down. */ #$mail->setTextCharset("UTF-8"); if (!$mail->send(array($PU->A("PDFixUserEmail")))) { Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!"); } $Adresse = new Adresse($PU->A("PDFixUserAdresseID")); $mail = new htmlMimeMail5(); $mail->setFrom("*****@*****.**"); $mail->setSubject("PDFix Aktivierung"); $mail->setText(utf8_decode("\nFirma: " . $Adresse->A("firma") . "\nBenutzername: " . $PU->A("PDFixUserUsername") . "")); #$mail->setTextCharset("UTF-8"); if (!$mail->send(array("*****@*****.**"))) { Red::errorD("Die E-Mail konnte nicht verschickt werden, bitte versuchen Sie es erneut!"); } break; } }
public function loadDevices() { $AC = anyC::get("FhemServer", "FhemServerType", "0"); while ($S = $AC->getNextEntry()) { $T = new HTMLTable(4, $S->A("FhemServerName")); try { $Devices = $S->getListDevices(); foreach ($Devices as $D) { $ACD = anyC::get("Fhem", "FhemName", $D->name); $ACD->addAssocV3("FhemServerID", "=", $S->getID()); $Dev = $ACD->getNextEntry(); if ($Dev == null) { $F = new Factory("Fhem"); $F->sA("FhemServerID", $S->getID()); $F->sA("FhemName", $D->name); $F->sA("FhemType", $D->type); $F->sA("FhemSpecific", $D->address); $F->store(); } $T->addRow(array($D->name, $D->state, $D->type, $D->address)); } } catch (NoServerConnectionException $e) { continue; } echo $T; } }
function handleOrder() { $values = $_SESSION["ticketDataAddress"]; $F = new Factory("Adresse"); $values["land"] = ISO3166::getCountryToCode($values["land"]); $F->fill($values); $exists = $F->exists(true); if (!$exists) { $AdresseID = $F->store(false, false); $K = new Kunden(); $Kappendix = $K->createKundeToAdresse($AdresseID, false, true); } else { $AdresseID = $exists->getID(); $Kappendix = Kappendix::getKappendixToAdresse($AdresseID); } if ($_SESSION["ticketDataPayment"]["via"] == "debit") { $Kappendix->changeA("KappendixKontonummer", $_SESSION["ticketDataPayment"]["debitKontonummer"]); $Kappendix->changeA("KappendixBLZ", $_SESSION["ticketDataPayment"]["debitBlz"]); $Kappendix->changeA("KappendixKontoinhaber", $_SESSION["ticketDataPayment"]["debitInhaber"]); $Kappendix->changeA("KappendixEinzugsermaechtigung", "1"); $Kappendix->changeA("KappendixEinzugsermaechtigungAltZBTB", "5"); $Kappendix->changeA("KappendixSameKontoinhaber", "0"); } if (!$exists) { $Kappendix->newMe(false); } else { $Kappendix->saveMe(); } $zahlungsart = 6; if ($_SESSION["ticketDataPayment"]["via"] == "debit") { $zahlungsart = 1; } if ($_SESSION["ticketDataPayment"]["via"] == "transfer") { $zahlungsart = 5; } if ($_SESSION["ticketDataPayment"]["via"] == "paypal") { $zahlungsart = 7; } $orderIDs = array(); foreach ($_SESSION["ticketDataSelection"] as $SeminarID => $anzahl) { if ($anzahl == 0) { continue; } $F = new Factory("STeilnehmer"); $F->sA("STeilnehmerSeminarID", $SeminarID); $F->sA("STeilnehmerAdresseID", $AdresseID); $F->sA("STeilnehmerAngemeldetAm", time()); $F->sA("STeilnehmerErwachsene", $anzahl); $F->sA("STeilnehmerZahlungsart", $zahlungsart); $STeilnehmerID = $F->store(); $Tickets = array(); foreach ($_SESSION["ticketDataTickets"] as $k => $v) { $ex = explode("_", $k); if (count($ex) != 3) { continue; } if ($ex[1] != $SeminarID) { continue; } if (!isset($Tickets[$ex[2]])) { $Tickets[$ex[2]] = array(); } $Tickets[$ex[2]][$ex[0]] = $v; } foreach ($Tickets as $ticket) { $F = new Factory("STeilnehmerTicket"); $F->sA("STeilnehmerTicketSeminarID", $SeminarID); $F->sA("STeilnehmerTicketSTeilnehmerID", $STeilnehmerID); $F->sA("STeilnehmerTicketVorname", $ticket["Vorname"]); $F->sA("STeilnehmerTicketNachname", $ticket["Nachname"]); $F->sA("STeilnehmerTicketPosition", $ticket["Position"]); $F->sA("STeilnehmerTicketUnternehmen", $ticket["Unternehmen"]); $F->sA("STeilnehmerTicketEMail", $ticket["Email"]); if ($this->fromPOS) { $F->sA("STeilnehmerTicketFirstSeen", time()); } $F->store(); } $S = new Seminar($SeminarID); $S->createRechnungen($STeilnehmerID); foreach ($S->createdGRLBMs as $GRLBM) { $Auftrag = new Auftrag($GRLBM->A("AuftragID")); $Auftrag->sendViaEmail($GRLBM->getID(), "", "", "", false); $B = new Bestellung(-1); $orderIDs[] = $B->createFromInvoice($GRLBM->A("AuftragID"), $GRLBM, "MMDB/Seminare/STeilnehmer", $STeilnehmerID); } } $_SESSION["ticketStep"] = 6; $_SESSION["ticketDataOrderIDs"] = $orderIDs; }
public static function stamp($args, $die = true) { #if(strtolower($args["P0"]) == "303005f7b4") # die('{"status":"command", "action":"reload"}'); if (!isset($_SESSION["BPS"])) { $_SESSION["BPS"] = new BackgroundPluginState(); } addClassPath(Util::getRootPath() . "personalKartei/Zeiterfassung/"); addClassPath(Util::getRootPath() . "personalKartei/Personal/"); addClassPath(Util::getRootPath() . "personalKartei/ObjekteL/"); #if(file_exists(Util::getRootPath()."personalKartei/Schichten/")) # addClassPath(Util::getRootPath()."personalKartei/Schichten/"); addClassPath(Util::getRootPath() . "open3A/Kategorien/"); $CCP = new CCPage(); $CCP->loadPlugin("personalKartei", "Schichten", true); $T = anyC::getFirst("ZETerminal", "ZETerminalID", $args["P1"]); if (!$T) { if ($die) { die('{"status":"error", "message":"Unbekanntes Terminal"}'); } else { return; } } $CT = FileStorage::getFilesDir() . "ChipTrans.csv"; if ($args["P3"] and $args["P4"] > 0) { $P = new Personal($args["P4"]); if (trim($P->A("PersonalChipNummer")) == "") { $P->changeA("PersonalChipNummer", trim(strtolower($args["P0"]))); $P->saveMe(); } else { file_put_contents($CT, "{$args['P4']}:" . trim(strtolower($args["P0"])) . "\n", FILE_APPEND); } } $A = new stdClass(); $Date = new Datum(); $Date->subDay(); $Date->addDay(); $A->ChipID = trim(strtolower($args["P0"])); $A->Date = $Date->time(); $A->Time = Util::parseTime("de_DE", date("H:i", !isset($args["P5"]) ? time() : $args["P5"])); $A->Type = $args["P2"]; $A->Mode = ""; $A->TerminalID = $args["P1"]; try { $ok = ZEData::addTime($A); } catch (Exception $e) { try { $hex = str_pad(trim(strtolower(dechex($args["P0"]))), 10, "0", STR_PAD_LEFT); $A->ChipID = $hex; $ok = ZEData::addTime($A); } catch (Exception $e) { try { if (!$args["P3"]) { throw new Exception("Chip unknown", 100); } if (!file_exists($CT)) { file_put_contents($CT, ""); } $trans = file_get_contents($CT); $found = false; foreach (explode("\n", $trans) as $line) { $line = trim($line); $ex = explode(":", $line); if (trim(strtolower($ex[1])) != trim(strtolower($args["P0"]))) { continue; } $P = new Personal($ex[0]); $A->ChipID = $P->A("PersonalChipNummer"); $found = true; } if (!$found) { throw new Exception("Learn", 200); } #if(!$found) # throw new Exception ("Chip unknown", 100); $ok = ZEData::addTime($A); } catch (Exception $e) { switch ($e->getCode()) { case 100: try { $F = new Factory("ZETerminalFail"); $F->sA("ZETerminalFailTime", time()); $F->sA("ZETerminalFailData", json_encode($args)); $F->sA("ZETerminalFailZETerminalID", $args["P1"]); $F->store(); } catch (Exception $e) { } if ($die) { die('{"status":"error", "message":"Unbekannter Chip"}'); } else { return; } break; case 200: $AC = anyC::get("Personal", "isDeleted", "0"); $AC->setFieldsV3(array("CONCAT(nachname, ' ', vorname) AS name")); $AC->addAssocV3("TRIM(CONCAT(nachname, vorname))", "!=", ""); $AC->addOrderV3("nachname"); $AC->addOrderV3("vorname"); $knownPID = array(); $file = file($CT); foreach ($file as $line) { $line = trim($line); $ex = explode(":", $line); $knownPID[$ex[0]] = true; } $array = array(); while ($A = $AC->n()) { if (isset($knownPID[$A->getID()])) { continue; } $subArray = array(); foreach ($A->getA() as $key => $value) { $subArray[$key] = $value; } $array[] = $subArray; } if ($die) { die('{"status":"learn", "message":' . json_encode($array, defined("JSON_UNESCAPED_UNICODE") ? JSON_UNESCAPED_UNICODE : 0) . '}'); } else { return; } break; default: try { $F = new Factory("ZETerminalFail"); $F->sA("ZETerminalFailTime", time()); $F->sA("ZETerminalFailData", $e->getMessage()); $F->sA("ZETerminalFailZETerminalID", $args["P1"]); $F->store(); } catch (Exception $e) { } if ($die) { die('{"status":"error", "message":"' . $e->getMessage() . '"}'); } else { return; } } } } } if ($args["P2"] == "G") { $AC = anyC::get("ZEData", "ZEDataPersonalID", $ok["Personal"]->getID()); $AC->addAssocV3("ZEDataType", "=", "K"); $AC->addAssocV3("ZEDataDate + ZEDataTime", ">", time() - 3600 * 13); $AC->addAssocV3("ZEDataDate + ZEDataTime", "<", time()); $AC->addAssocV3("ZEDataIsDeleted", "=", "0"); $AC->addOrderV3("ZEDataDate + ZEDataTime", "DESC"); $AC->setLimitV3("1"); $Kommen = $AC->getNextEntry(); if ($Kommen != null) { $Gehen = $ok["ZEData"]; $T = new ZETerminal($args["P1"]); $AC2 = anyC::get("PZuO", "ObjektLID", $T->A("ZETerminalObjektLID")); $AC2->addAssocV3("PersonalID", "=", $Kommen->A("ZEDataPersonalID")); $PZuO = $AC2->n(); if ($PZuO !== null) { $worked = $Gehen->A("ZEDataDate") + $Gehen->A("ZEDataTime") - ($Kommen->A("ZEDataDate") + $Kommen->A("ZEDataTime")); $AZ = mZEArbeitsZeit::getArbeitszeiten($PZuO->getID(), time()); if (isset($AZ[0])) { $hasTo = $AZ[0]->A("ZEArbeitsZeitEnde") - $AZ[0]->A("ZEArbeitsZeitStart"); if ($worked > 0 and $worked / $hasTo > 0.9) { # AND $hasTo / $worked < 1.15){ $DE = $ok["ZEData"]; $DE->changeA("ZEDataPause", $AZ[0]->A("ZEArbeitsZeitMittag")); $DE->saveMe(false, false); } } } } } #303046a1b7 BPS::setProperty("ZEAuswertung", "objektLID", $T->A("ZETerminalObjektLID")); BPS::setProperty("ZEAuswertung", "personalID", $ok["Personal"]->getID()); BPS::setProperty("ZEAuswertung", "month", date("Ym")); #$ZEA = new ZEAuswertung($A->ChipID); #$ZEA->debug = false; #$current = $ZEA->getContent(); if ($die) { die('{"status":"OK", "message": "' . addslashes($ok["Personal"]->A("vorname") . " " . $ok["Personal"]->A("nachname")) . '", "details": ""}'); } else { return; } }
public function downloadTrashData() { $json = file_get_contents("http://www.awv-nordschwaben.de/WebService/AWVService.svc/getData/00000000-0000-0000-0000-000000001190"); echo "<pre style=\"font-size:10px;max-height:400px;overflow:auto;\">"; $data = json_decode($json); foreach ($data->calendar as $day) { if ($day->fr == "") { continue; } if ($day->dt < date("Ymd")) { continue; } print_r($day); $tag = Util::parseDate("de_DE", substr($day->dt, 6) . "." . substr($day->dt, 4, 2) . "." . substr($day->dt, 0, 4)); $name = ""; foreach ($day->fr as $T) { if ($T == "PT") { $name .= ($name != "" ? ", " : "") . "Papiertonne"; } if ($T == "RM") { $name .= ($name != "" ? ", " : "") . "Restmüll"; } if ($T == "GS") { $name .= ($name != "" ? ", " : "") . "Gelber Sack"; } if ($T == "BT") { $name .= ($name != "" ? ", " : "") . "Biotonne"; } } if ($name == "") { continue; } $F = new Factory("Todo"); $F->sA("TodoName", $name); $F->sA("TodoFromDay", $tag); $F->sA("TodoFromTime", "32400"); $F->sA("TodoTillDay", $tag); $F->sA("TodoTillTime", "36000"); $F->sA("TodoUserID", "-1"); $F->sA("TodoClass", "Kalender"); $F->sA("TodoClassID", "-1"); $F->sA("TodoType", "2"); $F->sA("TodoRemind", "-1"); if ($F->exists()) { continue; } $F->store(); } echo "</pre>"; }
public function addElement($poolAnzeigeID, $elementID) { $F = new Factory("poolAnzeigeControl"); $F->sA("poolAnzeigeControlpoolAnzeigeID", $poolAnzeigeID); $c = poolAnzeigeControl::get(); foreach ($c[$elementID] as $k => $e) { $F->sA("poolAnzeigeControl" . ucfirst($k), $e); } $F->store(); }