public function download(RSSFilter $RSF, $filename, $page, $targetFileName, Serie $Serie) { $usableHosts = $this->getAvailableHosts($RSF); if (count($usableHosts) == 0) { return array("You did not select any hosts to download from", ""); } $JD = new JD($RSF->A("RSSFilterJDID")); foreach (self::$links[$page] as $link) { $url = parse_url($link); #print_r($url); #echo $link."\n"; $found = false; foreach ($usableHosts as $host) { if (stripos($url["host"], $host) === false) { continue; } #echo Serie::determineQuality($link); #echo $Serie->A("quality"); if (Serie::determineQuality($link) != SerieGUI::getQualities($Serie->A("quality"))) { continue; } $found = $link; } if (!$found) { continue; } try { $JD->download($link, $filename, $targetFileName, $Serie); } catch (Exception $e) { } break; } return true; }
public function fileExists($S = null) { if ($S == null) { $S = new Serie($this->A("SerieID")); } return file_exists($S->A("dir") . "/" . $this->getNewFileName($S, $this->getExistingSuffix($S))); #return (file_exists($S->A("dir")."/".$this->getNewFileName($S, "avi")) OR file_exists($S->A("dir")."/".$this->getNewFileName($S, "mkv")) OR file_exists($S->A("dir")."/".$this->getNewFileName($S, "divx"))); }
public function renameFile($originalFile) { $S = new Serie($this->A("SerieID")); if (Util::isWindowsHost()) { $originalFile = utf8_decode($originalFile); } if (rename($S->A("dir") . "/" . $originalFile, $S->A("dir") . "/" . $this->getNewFileName($S, $this->getSuffix($originalFile)))) { echo "message:'renaming successfull'"; } }
function __construct() { parent::__construct(); $bps = $this->getMyBPSData(); $S = new Serie($bps["SerieID"]); $F = new mFile(); $F->setDir($S->A("dir"), true); mFolgeGUI::$Serie = $S; $E = array(); while ($t = $F->getNextEntry()) { if (!$t->A("FileIsDir")) { $newFilename = $t->A("FileName"); if (Util::isWindowsHost()) { $newFilename = utf8_encode($newFilename); } $E[] = $newFilename; } } mFolgeGUI::$files = $E; mFolgeGUI::$found = array(); }
static function ajouteSerie($titre, $titreoriginal, $infos, $urlposter, $urlbackdrop, $anneeprod, $acteurs, $realisateurs, $idallocine = null, $idthemoviedb = null) { if ($f = Serie::checkIdallocine($idallocine)) { return $f; } else { $serie = new Serie(); $serie->titre = $titre; $serie->titreoriginal = $titreoriginal; $serie->infos = $infos; $serie->idallocine = $idallocine; $serie->idthemoviedb = $idthemoviedb; $serie->urlbackdrop = $urlbackdrop; $serie->urlposter = $urlposter; $serie->acteurs = $acteurs; $serie->anneeprod = $anneeprod; $serie->realisateurs = $realisateurs; do { $serie->id = \model\simple\String::random(10); } while (!$serie->insert()); return $serie; } }
static function deleteByClefunique($clefunique) { $query = "select distinct idserie as idserie from torrentserie "; $query .= "where clefunique=" . \core\Mysqli::real_escape_string_html($clefunique); \core\Mysqli::query($query); $tfs = \core\Mysqli::getObjectAndClose(true); $query = "delete from torrentserie "; $query .= "where clefunique=" . \core\Mysqli::real_escape_string_html($clefunique); \core\Mysqli::query($query); $res = \core\Mysqli::nombreDeLigneAffecte() > 1; \core\Mysqli::close(); foreach ($tfs as $k => $tf) { $query = "select count(*) as cpt from torrentserie "; $query .= "where idserie=" . \core\Mysqli::real_escape_string_html($tf->idserie); \core\Mysqli::query($query); $re = \core\Mysqli::getObjectAndClose(); if ($re->cpt === "0") { $res &= Serie::delete($tf->idserie); } } return $res; }
public function getSerie() { if (is_null($this->serie)) { $this->serie = Serie::getSerieByBookId($this->id); } return $this->serie; }
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; }
static function getPosterSetHeight($id, $height) { $myimage = new \model\simple\MyImage(Serie::getPoster($id)); return $myimage->getImageHeightFixed($height); }
public function listarDisponiveisProfessor($idProfessor) { $sql = "SELECT * FROM serie s\r\n JOIN grupo g ON g.grp_serie = s.sri_id\r\n WHERE g.grp_professor = " . $idProfessor; $result = $this->retrieve($sql); $lista = array(); while ($qr = mysqli_fetch_array($result)) { $ser = new Serie(); $ser->setSri_id($qr["sri_id"]); $ser->setSri_serie($qr["sri_serie"]); array_push($lista, $ser); } return $lista; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Serie::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * @param Serie $Series * @param Folge[] $Episodes */ public function filterFor(Serie $Series, $Episodes) { $filtered = array(); $foundEpisodes = array(); $this->loadFeed(); $Adapter = $this->getFeedAdapter(); $xml = RSSFilter::$feeds[$this->A("RSSFilterFeed")]; if ($xml === "null") { return $filtered; } foreach ($xml->channel->item as $v) { #print_r($v); foreach ($Episodes as $E) { $title = $v->title . ""; if (strpos($title, "[ENGLISCH]") !== false or strpos($title, "[DEUTSCH]") !== false) { if ($Series->A("sprache") == "en" and strpos($title, "[ENGLISCH]") === false) { continue; } if ($Series->A("sprache") == "de" and strpos($title, "[DEUTSCH]") === false) { continue; } } $ts01e01 = stripos($title, "S" . ($E->A("season") < 10 ? "0" : "") . $E->A("season") . "E" . ($E->A("episode") < 10 ? "0" : "") . $E->A("episode")); $t01x01 = stripos($title, $E->A("season") . "×" . ($E->A("episode") < 10 ? "0" : "") . $E->A("episode")); $t01ix01 = stripos($title, $E->A("season") . "x" . ($E->A("episode") < 10 ? "0" : "") . $E->A("episode")); if ($ts01e01 === false and $t01x01 === false and $t01ix01 === false) { continue; } if (strpos(strtolower($title), strtolower(str_replace(" ", ".", $Series->A("name")))) === false and strpos(strtolower($title), strtolower($Series->A("name"))) === false and ($Series->A("altFeedName1") == "" or strpos(strtolower($title), strtolower(str_replace(" ", ".", $Series->A("altFeedName1")))) === false)) { continue; } if ($Series->A("quality") > 1 and strpos(strtolower($title), strtolower(SerieGUI::getQualities($Series->A("quality")))) === false) { continue; } $continue = false; if ($Series->A("quality") == "1") { foreach (SerieGUI::getQualities() as $k => $q) { if ($k < 2) { continue; } if (strpos(strtolower($title), strtolower($q)) !== false) { $continue = true; } } } if ($continue) { continue; } if (isset($foundEpisodes[$E->getID()])) { continue; } $foundEpisodes[$E->getID()] = true; $filtered[] = array("title" => $title, "link" => $v->link . "", "pubDate" => $v->pubDate . "", "description" => $v->description . "", "fileName" => $Adapter->filterFilename($Series, $v), "season" => ($E->A("season") < 10 ? "0" : "") . $E->A("season"), "episode" => ($E->A("episode") < 10 ? "0" : "") . $E->A("episode")); #print_r($filtered); #echo $title."<br />"; } } return $filtered; }
/** * Billing and Print */ public function actionGeneratePrint() { $model = Book::model()->findByPK($_GET["id"]); // Change Book status $model->Type = 1; $model->save(); $items = array(); $startDate = strtotime($model->Start); $finishDate = strtotime($model->Finish); $roomID = $model->RoomID; $Pax = $model->Pax; // Create Invoice $modelInvoice = new Invoice(); $modelInvoice->UserID = Yii::app()->user->ID; $modelInvoice->CustomerID = $model->CustomerID; $modelInvoice->Date = date("Y-m-d"); $criteriaNextNumber = new CDbCriteria(); $criteriaNextNumber->condition = 'UserID = :userid'; $criteriaNextNumber->params = array(':userid' => Yii::app()->user->ID); $criteriaNextNumber->order = 'Number Desc'; $modelInvoice->Number = Invoice::model()->find($criteriaNextNumber)->ID + 1; $modelInvoice->SerieID = Serie::model()->findByAttributes(array('Pred' => '1'))->ID; $modelInvoice->BookID = $model->ID; $modelInvoice->save(); $days = round(($finishDate - $startDate) / 86400); $price = 0; // Calculate Room price if (Room::model()->findByPK($roomID)->Type == 0) { for ($i = 0; $i < $days; $i++) { $date = $startDate + $i * 86400; $season = Book::model()->getSeason(date("Y-m-d", $date)); $modelCharge = new Charge(); $modelCharge->UserID = Yii::app()->user->ID; $modelCharge->InvoiceID = $modelInvoice->ID; $modelCharge->IVA = User::model()->findByPK(Yii::app()->user->ID)->IVA; switch ($season) { case 0: $items[] = array($model->room->PriceLow, $model->room->Name . " (Temporada Baja)."); $price = $price + Room::model()->findByPK($roomID)->PriceLow; $modelCharge->Text = $model->room->Name . " (Temporada Baja)."; $modelCharge->Price = Room::model()->findByPK($roomID)->PriceLow; break; case 1: $items[] = array($model->room->PriceMed, $model->room->Name . " (Temporada Media)."); $price = $price + Room::model()->findByPK($roomID)->PriceMed; $modelCharge->Text = $model->room->Name . " (Temporada Media)."; $modelCharge->Price = Room::model()->findByPK($roomID)->PriceMed; break; case 2: $items[] = array($model->room->PriceBig, $model->room->Name . " (Temporada Alta)."); $price = $price + Room::model()->findByPK($roomID)->PriceBig; $modelCharge->Text = $model->room->Name . " (Temporada Alta)."; $modelCharge->Price = Room::model()->findByPK($roomID)->PriceBig; break; } $modelCharge->save(); } } else { for ($i = 0; $i < $days; $i++) { $date = $startDate + $i * 86400; $season = Book::model()->getSeason(date("Y-m-d", $date)); $modelCharge = new Charge(); $modelCharge->UserID = Yii::app()->user->ID; $modelCharge->InvoiceID = $modelInvoice->ID; $modelCharge->IVA = User::model()->findByPK(Yii::app()->user->ID)->IVA; switch ($season) { case 0: $items[] = array(Room::model()->findByPK($roomID)->PriceLow * $Pax, $model->room->Name . " (" . $Pax . " personas Temporada Baja)."); $price = $price + Room::model()->findByPK($roomID)->PriceLow * $Pax; $modelCharge->Text = $model->room->Name . " (" . $Pax . " personas Temporada Baja)."; $modelCharge->Price = Room::model()->findByPK($roomID)->PriceLow * $Pax; break; case 1: $items[] = array(Room::model()->findByPK($roomID)->PriceMed * $Pax, $model->room->Name . " (" . $Pax . " personas Temporada Media)."); $price = $price + Room::model()->findByPK($roomID)->PriceMed * $Pax; $modelCharge->Text = $model->room->Name . " (" . $Pax . " personas Temporada Media)."; $modelCharge->Price = Room::model()->findByPK($roomID)->PriceMed * $Pax; break; case 2: $items[] = array(Room::model()->findByPK($roomID)->PriceBig * $Pax, $model->room->Name . " (" . $Pax . " personas Temporada Alta)."); $price = $price + Room::model()->findByPK($roomID)->PriceBig * $Pax; $modelCharge->Text = $model->room->Name . " (" . $Pax . " personas Temporada Alta)."; $modelCharge->Price = Room::model()->findByPK($roomID)->PriceBig * $Pax; break; } $modelCharge->save(); } } // Add extras to price if ($model->ID > 0) { $criteria = new CDbCriteria(); $criteria->condition = "UserID = :userid AND BookID = :bookid"; $criteria->params = array(':userid' => Yii::app()->user->ID, ':bookid' => $model->ID); $modelExtra = Extra::model()->findAll($criteria); foreach ($modelExtra as $extra) { $modelCharge = new Charge(); $modelCharge->UserID = Yii::app()->user->ID; $modelCharge->InvoiceID = $modelInvoice->ID; $modelCharge->IVA = User::model()->findByPK(Yii::app()->user->ID)->IVA; $items[] = array($extra->Value, $extra->Name . " (Suplemento)"); $modelCharge->Text = $extra->Name . " (Suplemento)"; $modelCharge->Price = $extra->Value; $price = $price + $extra->Value; $modelCharge->save(); } } // Apply discount to price if ($model->ID > 0) { $modelDiscount = Discount::model()->findAll($criteria); foreach ($modelDiscount as $discount) { $modelCharge = new Charge(); $modelCharge->UserID = Yii::app()->user->ID; $modelCharge->InvoiceID = $modelInvoice->ID; $modelCharge->IVA = User::model()->findByPK(Yii::app()->user->ID)->IVA; $items[] = array(-($discount->Value * $price) / 100, $discount->Name . " (Descuento)"); $modelCharge->Text = $discount->Name . " (Descuento)"; $modelCharge->Price = -($discount->Value * $price / 100); $price = $price + -($discount->Value * $price) / 100; $modelCharge->save(); } } // Print invoice set_time_limit(600); # mPDF $pdf = Yii::app()->ePdf->mpdf('', 'A4', '', '', '', '', '', '', '', '', 'P'); $pdf->writeHTMLfooter = false; $pdf->writeHTMLheader = false; $pdf->DeflMargin = 25; $pdf->DefrMargin = 25; $pdf->tMargin = 15; $pdf->bMargin = 15; $pdf->w = 297; //manually set width $pdf->h = 209.8; //manually set height $pdf->WriteHTML($this->renderPartial('printbill', array('model' => $model, 'items' => $items, 'price' => $price), true)); # Outputs ready PDF $pdf->Output('Factura_' . date("d/m/Y") . '.pdf', 'D'); }
function deleteSerie($idSerie, $idEjercicio, $numeroSerie) { if ($idSerie != NULL) { if ($idSerie != 0) { $serie = new Serie(); $response = $serie->deleteSerie($idSerie, $idEjercicio, $numeroSerie); } else { $response["success"] = 6; $response["message"] = 'El id de la serie debe ser diferente de cero'; } } else { $response["success"] = 5; $response["message"] = 'El id de la serie debe ser diferente de NULO'; } return $response; }
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; } }
<?php echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->hiddenField($model, 'UserID', array('value' => Yii::app()->user->ID)); ?> </div> <div class="row" style="width: 20%; float: left;"> <?php echo $form->labelEx($model, 'SerieID'); ?> <?php echo $form->dropDownList($model, 'SerieID', CHtml::listData(Serie::model()->findAll($criteria), 'ID', 'Serie'), array('style' => 'width: 100%;')); ?> <?php echo $form->error($model, 'SerieID'); ?> </div> <?php // If it is a new record. We calculate the next invoice number if ($model->isNewRecord) { $criteriaNextNumber = new CDbCriteria(); $criteriaNextNumber->condition = 'UserID = :userid'; $criteriaNextNumber->params = array(':userid' => Yii::app()->user->ID); $criteriaNextNumber->order = 'Number Desc'; $model->Number = Invoice::model()->find($criteriaNextNumber)->ID + 1; }
public static function parserSerie($w) { $Serie = new Serie($w); return $Serie->A("name"); }
function actualizarPesoEnSerie($IdSerie, $PesoNuevo, $TipoPeso, $idEjercicio, $circuitoColor) { if ($IdSerie != NULL and $IdSerie > 0) { $serie = new Serie(); $response["Serie"] = $serie->updatePesoEnSerie($IdSerie, $PesoNuevo, $TipoPeso); if ($response["Serie"]["success"] == 0) { $subrutina = new Subrutina(); $response["Ejercicio"] = $subrutina->getDetalleEjercicioByID($idEjercicio, $circuitoColor); if ($response["Ejercicio"]["success"] == 0) { $response["success"] = 0; $response["message"] = 'El peso se registró correctamente'; } else { $response["success"] = 8; $response["message"] = 'El pesos se registró correctamente, pero no se pudo obtener el ejercicio actualizado'; } } else { $response["success"] = 7; $response["message"] = 'Se presentó un error al almacenar el peso'; } } else { $response["success"] = 6; $response["message"] = 'El id de la serie debe ser diferente de nulo y mayor a cero'; } return $response; }
function configurarSeriesMasivas($ejercicios, $series) { // Este método permite configurar las series de manera masiva // Se recibe un arreglo de ejercicios, y un arreglo de series, para configurar todos los ejercicios en las series indicadas. $response["getEjercicios"] = ''; $serie = new Serie(); $response = $serie->configurarSeriesMasivas($ejercicios, $series); if ($response["success"] == 0) { $listadoEjercicios = '0'; foreach ($ejercicios as $datosEjercicio) { // Recorreremos cada uno de los ejercicios del arreglo $listadoEjercicios = $listadoEjercicios . ',' . $datosEjercicio["IdEjercicio"]; } $ejercicio = new Ejercicio(); $response["getEjercicios"] = $ejercicio->getEjerciciosByArregloEjercicios($listadoEjercicios); } return $response; //devolvemos el array }
function newEpisodes() { $html = "<h1>Demnächst</h1>"; $AC = anyC::get("Folge"); $AC->addAssocV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d')) + 120", ">=", mktime(0, 0, 1)); $AC->addAssocV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d'))", "<=", time() + 3600 * 24 * 6); $AC->addAssocV3("RSSFilterID", ">", "0"); $AC->addJoinV3("Serie", "SerieID", "=", "SerieID"); $AC->addOrderV3("UNIX_TIMESTAMP(STR_TO_DATE(airDate, '%Y-%m-%d 18:00'))", "ASC"); $i = 0; $lastAD = null; while ($S = $AC->getNextEntry()) { if ($lastAD != $S->A("airDate")) { if ($lastAD !== null) { $html .= "</div>"; } $date = strtotime($S->A("airDate")); $html .= "<div class=\"comingUp\" style=\"box-sizing:border-box;" . ($i % 2 == 0 ? "background-color: #F2F2F2;" : "") . "padding:10px;display:inline-block;width:calc(100% / 7);vertical-align:top;\"><h2 style=\"margin-top:0;padding-top:0;\">" . mb_substr(Util::CLWeekdayName(date("w", $date)), 0, 2) . ", " . Util::CLDateParser($date) . "</h2>"; $i++; } $html .= $S->A("name") . " <span style=\"color:grey;\">S" . ($S->A("season") < 10 ? "0" : "") . $S->A("season") . "E" . ($S->A("episode") < 10 ? "0" : "") . $S->A("episode") . "</span><br>"; $lastAD = $S->A("airDate"); } $html .= "</div>" . OnEvent::script("g.sameHeight('.comingUp');"); $html .= "<h1>Neue Folgen</h1>"; $AC = anyC::get("JDownload"); $AC->addAssocV3("JDownloadDate", ">", time() - 3600 * 24 * 7); $AC->addOrderV3("JDownloadDate", "DESC"); $AC->addAssocV3("JDownloadSerieID", "!=", "0"); $AC->addJoinV3("Serie", "JDownloadSerieID", "=", "SerieID"); while ($D = $AC->getNextEntry()) { if ($D->A("JDownloadSerieID") != "0" and $D->A("cover") != "" and trim($D->A("coverThumb")) == "") { $S = new Serie($D->A("JDownloadSerieID")); $S->changeA("coverThumb", DBImageGUI::stringifyDataS("image/png", DBImageGUI::getData($S->A("cover")), 150, 220)); $S->saveMe(true, false); $D->changeA("coverThumb", $S->A("coverThumb")); } preg_match("/S([0-9]+)E([0-9]+)/", $D->A("JDownloadRenameto"), $matches); $ACF = anyC::get("Folge", "SerieID", $D->A("SerieID")); $ACF->addAssocV3("season", "=", $matches[1]); $ACF->addAssocV3("episode", "=", $matches[2]); $ACF->setLimitV3(1); $F = $ACF->getNextEntry(); $B = new Button("Abspielen", "play", "touch"); $B->onclick("parent.UPnP.search('" . Util::makeFilename(str_replace(" ", ".", $D->A("JDownloadRenameto"))) . "');"); $html .= "\n\t\t\t<div style=\"display:inline-block;width:33%;margin-bottom:2%;vertical-align:top;\">\n\t\t\t\t<div style=\"margin-right:20px;float:left;width:150px;\">\n\t\t\t\t\t<img style=\"width:150px;height:220px;margin-bottom:5px;\" src=\"./index.php?D=trinityDB/Serien&M=getCover&P0=" . $D->A("SerieID") . "\" />\n\t\t\t\t\t\t{$B}\n\t\t\t\t</div>\n\t\t\t\t<h2 style=\"margin-top:0px;padding-top:0px;\">" . $D->A("JDownloadRenameto") . "</h2>\n\t\t\t\t<p style=\"color:grey;\">" . ($F != null ? $F->A("description") : "Keine Beschreibung") . " <small>" . Util::CLDateParser($D->A("JDownloadDate")) . "</small></p>\n\t\t\t</div>"; } return $html; }
private function searchByScope($scope, $limit = FALSE) { $n = $this->n; $numberPerPage = NULL; $queryNormedAndUp = $this->query; if (useNormAndUp()) { $queryNormedAndUp = normAndUp($this->query); } if ($limit) { $n = 1; $numberPerPage = 5; } switch ($scope) { case self::SCOPE_BOOK: $array = Book::getBooksByStartingLetter('%' . $queryNormedAndUp, $n, NULL, $numberPerPage); break; case self::SCOPE_AUTHOR: $array = Author::getAuthorsForSearch('%' . $queryNormedAndUp); break; case self::SCOPE_SERIES: $array = Serie::getAllSeriesByQuery($queryNormedAndUp); break; case self::SCOPE_TAG: $array = Tag::getAllTagsByQuery($queryNormedAndUp, $n, NULL, $numberPerPage); break; case self::SCOPE_PUBLISHER: $array = Publisher::getAllPublishersByQuery($queryNormedAndUp); break; default: $array = Book::getBooksByQuery(array("all" => "%" . $queryNormedAndUp . "%"), $n); } return $array; }
<?php /* @var $this InvoiceController */ /* @var $model Invoice */ $this->breadcrumbs = array('Facturas' => array('admin'), 'Listado'); $this->menu = array(array('label' => 'Nueva Factura', 'url' => array('create')), array('label' => 'Nueva Serie', 'url' => array('serie/create')), array('label' => 'Listado de series', 'url' => array('serie/admin'))); ?> <h1 class="header">Listado de facturas</h1> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'invoice-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => "function(){\n\t\t\t\t\t\t\tjQuery('#date_Date').datepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['es'], {'dateFormat':'yy-mm-dd'}));\n\t\t\t\t\t\t}", 'columns' => array(array('name' => 'SerieID', 'value' => '$data->serie->Serie', 'filter' => CHtml::listData(Serie::model()->findAll(), 'ID', 'Serie'), 'headerHtmlOptions' => array('style' => 'width:10%;text-align:left !important;'), 'htmlOptions' => array('style' => 'width:10%;text-align:left;')), array('name' => 'Number', 'filter' => CHtml::activeTextField($model, 'Number', array('placeholder' => 'Escribe el valor a buscar...')), 'headerHtmlOptions' => array('style' => 'width:15%;text-align:left !important;'), 'htmlOptions' => array('style' => 'width:15%;text-align:left;')), array('name' => 'CustomerID', 'value' => '$data->customer->FullName', 'filter' => CHtml::listData(Customer::model()->findAll(), 'ID', 'FullName'), 'headerHtmlOptions' => array('style' => 'width:50%;text-align:left !important;'), 'htmlOptions' => array('style' => 'width:50%;text-align:left;')), array('name' => 'Date', 'filter' => false, 'value' => 'date("d-m-Y", strtotime($data->Date))'), array('class' => 'CButtonColumn', 'template' => '{update} {delete}', 'buttons' => array('update' => array('label' => 'Editar', 'imageUrl' => Yii::app()->baseURL . '/images/edit.png'), 'delete' => array('label' => 'Borrar', 'imageUrl' => Yii::app()->baseURL . '/images/delete.png')), 'deleteConfirmation' => 'Si aceptas eliminaras este registro definitivamente.')), 'emptyText' => 'No hay registros. <a href="' . $this->createURL('create') . '">Picha</a> para crear uno.', 'summaryText' => 'Mostrando del {start} al {end} de {count} registro(s).'));