/** * @param LoginModel $model */ public function __construct(LoginModel $model, Entries $entries) { self::$sessionSaveLocation = Settings::MESSAGE_SESSION_NAME . Settings::APP_SESSION_NAME; self::$userSaveLocation = Settings::USER_SESSION_NAME . Settings::APP_SESSION_NAME; $this->model = $model; $this->entries = $entries->getEntries(); }
/** * @covers Geissler\Converter\Model\Container::getIterator */ public function testGetIterator() { $this->assertInstanceOf('\\Geissler\\Converter\\Model\\Entries', $this->object->setEntry(new Entry())); $this->assertInstanceOf('\\Geissler\\Converter\\Model\\Entries', $this->object->setEntry(new Entry())); $this->assertInstanceOf('\\ArrayIterator', $this->object->getIterator()); foreach ($this->object as $child) { $this->assertInstanceOf('\\Geissler\\Converter\\Model\\Entry', $child); } }
public function __construct($parameters) { $this->view('test')->with($parameters)->statusCode(201); echo '<br/>contact controller works'; // database testing $data = Entries::getData(); var_dump($data); }
/** * @func void * @return void */ public function __construct() { echo 'tss1 controller works<br/>'; /* load::service('validator'); $rules = array ( 'name' => 'alpha|required', 'year' => 'num|required', ); $Validation = new Validator(); $Validation->validate($_POST, $rules); if (!$Validation->passed()) { $Validation->goBackWithErrors(); } if (!empty($Validation->getErrors())) { print_r($Validation->getErrors()); } */ load::library(SF::STRINGS); load::library(SF::NETWORK); #$test_string = Strings::generate_password(4); $test_string = Strings::generatePassword(4); var_dump($test_string); $numeric_test = (int) '-abc12.3edf'; // this SHOULD FALL AND THROW AN ERROR #var_dump(Strings::strip_to_numeric($numeric_test)); var_dump(Strings::StripToNumeric($numeric_test)); #var_dump(Network::get_client_lang()); var_dump(Network::getClientLang()); exit; // database testing $data = Entries::getData(); var_dump($data); /* load::library(SF::DEBUG); //load::library(SF::DEBUG)->func('pr'); // will only load clean_str() ExecuteTime::start(); $parameters = array ( 'key' => '1e46165dsa5ds4a', 'action' => 'push', 'userid' => 1234998, 'keywords' => 'test' ); ExecuteTime::end(); echo ExecuteTime::display(); */ }
$folder_id_untrusted = null; if (filter_input(INPUT_GET, 'folder_id') !== null) { $folder_id_untrusted = filter_input(INPUT_GET, 'folder_id'); } if (filter_input(INPUT_POST, 'folder_id') !== null) { $folder_id_untrusted = filter_input(INPUT_POST, 'folder_id'); } $folder = Folders::load_folder($folder_id_untrusted); if ($folder_id_untrusted != $folder->id || $folder->budget_id != $budget_id) { die("Access Violation"); } $unsafe_amount = filter_input(INPUT_POST, 'amount'); $unsafe_comment = filter_input(INPUT_POST, 'comment'); $message = ""; if (isset($unsafe_amount)) { Entries::add_transaction($folder->budget_id, $folder->id, $month_id, $unsafe_amount, $unsafe_comment); $message = "Added"; header("location: index.php"); die; } include 'header.php'; ?> <div role="main" class="ui-content jqm-content"> <p>Add To Folder <p><?php echo $folder->name; ?> </p> <p>Amount</p> <form method="post" action="add_transaction.php" data-ajax="false"> <input type="hidden" name="folder_id" value="<?php
<?php require '../load.php'; $response = Entries::get($_GET['id']); $tpl = new Layout(); $data = array(); if ($response['success'] == true) { $data['entries'] = $response['data']; } else { $data['msg'] = $response['msg']; } echo $tpl->entriesLayout($tpl->loadTemplate('post', $data));
<?php require '../load.php'; require '../init.php'; $response = Entries::getAll($_SESSION['userNAME']); $tpl = new Layout(); $data = array(); if ($response->success == true) { $data['entries'] = $response->data; } else { $data['msg'] = $response->msg; } echo $tpl->mobiLayout($tpl->loadTemplate('entries', $data));
<?php require 'load.php'; $entries = Entries::getAll(); $tpl = new Layout(); echo $tpl->blogLayout($tpl->loadTemplate('index', array('posts' => $entries->data)));
<?php require '../load.php'; require '../init.php'; if (!isset($_POST['enviar'])) { $data = array(); $error = array(); } else { $response = Entries::create($_POST); if ($response->success) { setNotification('success', $response->msg); redirect('entries.php'); } else { $data = $response->data; $data['msg'] = $response->msg; } } $tpl = new Layout(); echo $tpl->mobiLayout($tpl->loadTemplate('new_entry', $data));
function printVideoEntry($videoEntry) { // the videoEntry object contains many helper functions // that access the underlying mediaGroup object //echo 'Video: ' . $videoEntry->getVideoTitle() . "<br />"; //echo 'Video ID: ' . $videoEntry->getVideoId() . "<br />"; //echo 'Updated: ' . $videoEntry->getUpdated() . "<br />"; //echo 'Description: ' . $videoEntry->getVideoDescription() . "<br />"; //echo 'Category: ' . $videoEntry->getVideoCategory() . "<br />"; //echo 'Tags: ' . implode(", ", $videoEntry->getVideoTags()) . "<br />"; //echo 'Watch page: ' . $videoEntry->getVideoWatchPageUrl() . "<br />"; //echo 'Flash Player Url: ' . $videoEntry->getFlashPlayerUrl() . "<br />"; //echo 'Duration: ' . $videoEntry->getVideoDuration() . "<br />"; //echo 'View count: ' . $videoEntry->getVideoViewCount() . "<br />"; //echo 'Rating: ' . $videoEntry->getVideoRatingInfo() . "<br />"; //echo 'Geo Location: ' . $videoEntry->getVideoGeoLocation() . "<br />"; //echo 'Recorded on: ' . $videoEntry->getVideoRecorded() . "<br />"; $videoThumbnails = $videoEntry->getVideoThumbnails(); foreach ($videoThumbnails as $videoThumbnail) { $img_url = $videoThumbnail['url']; break; } $entries = new Entries(); $entries->setSource('YOUTUBE'); $entries->setName($videoEntry->getVideoTitle()); $entries->setStory($videoEntry->getFlashPlayerUrl()); $entries->setImageUrl($img_url); $entries->save(); }
include 'header.php'; ?> <h4>Projection For <?php echo $month_name; ?> </h4> <form method="post"> <input type="hidden" name="add_projection" value="yes"> <p>Folder <input name="folder_name" type="text"> Amount <input name="amount" type="text"> </p> <input type="submit" value="Submit"> </form> <?php echo $error_msg; $projections = Projections::projections_for_month($budget_id, $month_id); $entries = Entries::summary_for_month($budget_id, $month_id); $projections_by_folder = array(); $summary_by_folder = array(); $known_folders = array(); foreach ($projections as $p) { $projections_by_folder[$p->folder_id] = $p; if (!in_array($p->folder_id, $known_folders)) { array_push($known_folders, $p->folder_id); } } foreach ($entries as $e) { $summary_by_folder[$e->folder_id] = $e; if (!in_array($e->folder_id, $known_folders)) { array_push($known_folders, $e->folder_id); } }
<?php require '../load.php'; require '../init.php'; if (isset($_POST)) { $tpl = new Layout(); if (!isset($_POST['accion'])) { $response = Entries::get($_POST['id']); $data = $response->data; echo $tpl->mobiLayout($tpl->loadTemplate('edit_entries', $data)); } else { $response = Entries::edit($_POST); if ($response->success) { setNotification('success', $response->msg); redirect('entries.php'); } else { $data = $response->data; $data['error'] = $response->msg; echo $tpl->mobiLayout($tpl->loadTemplate('edit_entries', $data)); } } } else { redirect('entries.php'); }
<?php require '../load.php'; $response = Entries::getAll('beto'); $tpl = new Layout(); $data = array(); if ($response['success'] == true) { $data['entries'] = $response['data']; } else { $data['msg'] = $response['msg']; } echo $tpl->entriesLayout($tpl->loadTemplate('index', $data));
<?php require 'load.php'; $entry = Entries::get($_GET['id']); if (!$entry->success) { setNotification('error', $entry->msg); redirect('index.php'); } $tpl = new Layout(); echo $tpl->entriesLayout($tpl->loadTemplate('post', array('post' => $entry->data)));
<?php include_once "db.php"; include_once "util.php"; include_once "login_filter.php"; include_once 'tables.php'; $summaries = Entries::summary_for_month($_SESSION[SESSION_BUDGET_ID], $_SESSION[SESSION_MONTH_ID]); include 'header.php'; ?> <div role="main" class="ui-content"> <h4>Summary <?php echo $_SESSION[SESSION_MONTH_NAME]; ?> </h4> <ul> <?php foreach ($summaries as $sum) { $html = <<<RGDM <li><span>{$sum->folder_name}</span> <span>{$sum->total}</span></li> RGDM; echo $html; } ?> </ul> </div> <?php include 'footer.php';