public static function sandbox()
 {
     // Testaa koodiasi täällä
     // Kint-luokan dump-metodi tulostaa muuttujan arvon
     $m = Teammember::findByBoth(1, 1);
     Kint::dump($p);
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     $wokki = new Resepti(array('ruokalaji' => '', 'annosmaara' => ''));
     $errors = $wokki->errors();
     Kint::dump($errors);
 }
 public static function show($id)
 {
     $reader = Reader::find($id);
     $bookCount = Book::getNumberOfBooksByReader($id);
     Kint::dump($bookCount);
     View::make('reader/show_reader.html', array('reader' => $reader, 'bookCount' => $bookCount));
 }
 public function showList()
 {
     $imageService = new ImageService();
     $images = $imageService->getAllImages();
     \Kint::dump($images);
     $this->slim->render('gallery/list.phtml', ['images' => $images]);
 }
示例#5
0
 public function parse(&$variable)
 {
     if (!$variable instanceof Closure) {
         return false;
     }
     $this->name = 'Closure';
     $reflection = new ReflectionFunction($variable);
     $ret = array('Parameters' => array());
     if ($val = $reflection->getParameters()) {
         foreach ($val as $parameter) {
             // todo http://php.net/manual/en/class.reflectionparameter.php
             $ret['Parameters'][] = $parameter->name;
         }
     }
     if ($val = $reflection->getStaticVariables()) {
         $ret['Uses'] = $val;
     }
     if (method_exists($reflection, 'getClousureThis') && ($val = $reflection->getClosureThis())) {
         $ret['Uses']['$this'] = $val;
     }
     if ($val = $reflection->getFileName()) {
         $this->value = Kint::shortenPath($val) . ':' . $reflection->getStartLine();
     }
     return $ret;
 }
示例#6
0
 public function forgot($usuario)
 {
     try {
         $this->load->library('email');
         $data['errores'] = false;
         Kint::dump();
         if ($this->email->valid_email($usuario['email'])) {
             echo 'valido email OKA';
             die;
             $query = $this->db->query("SELECT u.* FROM usuarios u WHERE u.estado_usuario ' AND email = " . $this->db->escape($usuario['email']));
             if ($query->num_rows() == 1) {
                 $usuario = $query->row_array();
                 $newData = $this->cambiarClave($usuario);
                 $usuario['clave'] = $newData['clave'];
                 $data['usuario'] = $usuario;
             } else {
                 $data['errores'] = true;
                 $data['noExiste'] = true;
             }
         } else {
             echo 'no valido el mail';
             $data['errores'] = true;
             $data['email'] = true;
         }
         return $data;
     } catch (Exception $e) {
         $data['errores'] = true;
         return $data;
     }
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     $Sven = new Hero(array('name' => 's', 'primaryattribute' => 'jäbäys', 'damagetype' => 'Physical', 'primaryrole' => 'core', 'attacktype' => 'Melee'));
     $errors = $Sven->errors();
     Kint::dump($errors);
 }
 public static function sandbox()
 {
     $first = Recipe::find(1);
     $recipes = Recipe::all();
     Kint::dump($recipes);
     Kint::dump($first);
 }
示例#9
0
 public function save()
 {
     $pdo_connection = DB::connection();
     $success = true;
     //the begin of transaction
     $pdo_connection->beginTransaction();
     try {
         $query = $pdo_connection->prepare("INSERT INTO saalistieto (pvm, kellonaika," . " kalalaji, lkm, pituus, paino, vesisto, paikka, tuulenvoimakkuus," . " tuulensuunta, ilmanlampo, vedenlampo, pilvisyys, huomiot," . " saaliskuva, pyydys) VALUES(:pvm, NULLIF(:aika,'')::time, :laji, :lkm," . " NULLIF(:pituus,'')::numeric, NULLIF(:paino,'')::numeric, :vesisto," . " :paikka, :tuulenVoima, :tuulenSuunta," . " NULLIF(:ilmanLampo,'')::integer, NULLIF(:vedenLampo,'')::integer, :pilvisyys," . " :huomiot, :kuva, NULLIF(:pyydys,'default')::integer) RETURNING saalisid");
         $query->execute(array('pvm' => $this->date, 'aika' => $this->time, 'laji' => $this->species, 'lkm' => $this->count, 'pituus' => $this->length, 'paino' => $this->weight, 'vesisto' => $this->water_sys, 'paikka' => $this->location, 'tuulenVoima' => $this->wind_speed, 'tuulenSuunta' => $this->wind_dir, 'ilmanLampo' => $this->air_temp, 'vedenLampo' => $this->water_temp, 'pilvisyys' => $this->cloudiness, 'huomiot' => $this->notes, 'kuva' => $this->picture_url, 'pyydys' => $this->trap_id));
         $resultRow = $query->fetch();
         $this->catch_id = $resultRow['saalisid'];
         $catchers;
         $username = array($_SESSION['user']);
         if (isset($this->friends)) {
             $catchers = array_merge($username, $this->friends);
         } else {
             $catchers = $username;
         }
         $query_2 = $pdo_connection->prepare("INSERT INTO pyydystaja VALUES(" . ":kalastaja, :saalisid)");
         foreach ($catchers as $catcher) {
             $query_2->execute(array('kalastaja' => $catcher, 'saalisid' => $this->catch_id));
         }
     } catch (PDOException $e) {
         $success = false;
         Kint::dump($e);
         Kint::trace();
     }
     //end of transaction
     if (!$success) {
         $pdo_connection->rollBack();
     } else {
         $pdo_connection->commit();
     }
 }
示例#10
0
 public static function store()
 {
     self::check_logged_in();
     $params = $_POST;
     if (empty($_POST['projects'])) {
         $errors[] = 'Select at least one project!';
         $projects = '';
     } else {
         $projects = $_POST['projects'];
     }
     $attributes = array('description' => $params['description'], 'priority' => $params['priority'], 'status' => 0, 'projectids' => $projects);
     $task = new Task($attributes);
     //$errors = $task->errors(); // Deprecated: Switched to valitron. Calls all validators
     $errors = $task->validateTask();
     // Valitron takes care of putting all errors in one array
     //Kint::dump($params); // Debug, comment out Redirect if used!
     //Kint::dump($task);
     if (count($errors) == 0) {
         $task->save();
         // Tell task-model to save this object to DB
         foreach ($projects as $project) {
             Project::addTask($task->id, $project);
             // We don't know the id before it is saved!
             Project::updateCount($project);
         }
         Redirect::to('/task/' . $task->id, array('message' => 'Task added to database!'));
     } else {
         Kint::dump($errors);
         $projects = Project::all();
         Kint::dump($attributes);
         Kint::dump($projects);
         View::make('task/new.html', array('errors' => $errors, 'attributes' => $attributes, 'projects' => $projects));
     }
 }
示例#11
0
 public static function sandbox()
 {
     $postedTo1 = ForumUser::findPostedTo(1);
     $postedTo2 = ForumUser::findPostedTo(2);
     Kint::dump($postedTo1);
     Kint::dump($postedTo2);
 }
 public static function sandbox()
 {
     $Bouillabaisse = Resepti::find(1);
     $reseptit = Resepti::all();
     // Kint-luokan dump-metodi tulostaa muuttujan arvon
     Kint::dump($reseptit);
     Kint::dump($Bouillabaisse);
 }
示例#13
0
 public static function updateCount($id)
 {
     $count = self::taskcount($id);
     Kint::dump($count);
     $query = DB::connection()->prepare('UPDATE Project SET taskcount = :taskcount WHERE id = :id');
     $query->execute(array('id' => $id, 'taskcount' => $count));
     $row = $query->fetch();
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     //$logged_user = self::get_user_logged_in();
     $params = $_POST;
     Kint::dump($params);
     View::make('notimplemented.html');
 }
示例#15
0
文件: task.php 项目: rubinju/Todolist
 public function update()
 {
     $query = DB::connection()->prepare('UPDATE Task SET (description, status, priority, projectids) = (:description, :status, :priority, :projectids) WHERE id = :id');
     Kint::dump($query);
     $query->execute(array('id' => $this->id, 'description' => $this->description, 'status' => $this->status, 'priority' => $this->priority, 'projectids' => implode(",", $this->projectids)));
     $row = $query->fetch();
     // row is false if db is angry, great for debugging
 }
示例#16
0
 public static function sandbox()
 {
     $skyrim = Astiat::find(1);
     $astia = Astiat::all();
     // Kint-luokan dump-metodi tulostaa muuttujan arvon
     Kint::dump($astia);
     Kint::dump($skyrim);
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     //$catch_1 = CatchModel::find(1);
     $catch = new CatchModel(array('kalalaji' => "lahna", 'lkm' => '0', 'vedenLampo' => '-3'));
     $errors = $catch->errors();
     Kint::dump($errors);
 }
示例#18
0
 public function delete($id)
 {
     $query = DB::connection()->prepare('DELETE FROM Customer WHERE id= :id RETURNING id');
     $query->execute(array('id' => $id));
     $row = $query->fetch();
     Kint::dump($row);
     //$this->id = $row['id'];
 }
示例#19
0
 public function save()
 {
     $query = DB::connection()->prepare('INSERT INTO Askare (perheenjasen_id, nimi, tarkeys, lisatty, valmis, muuta)VALUES(:perheenjasen_id, :nimi, :tarkeys, NOW(), :valmis, :muuta)RETURNING id');
     $query->execute(array('perheenjasen_id' => BaseController::get_user_logged_in()->id, 'nimi' => $this->nimi, 'tarkeys' => $this->tarkeys, 'valmis' => $this->valmis, 'muuta' => $this->muuta));
     $row = $query->fetch();
     Kint::dump($row);
     $this->id = $row['id'];
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     $eka = Survey::find(1);
     $kaikki = Survey::all();
     Kint::dump($eka);
     Kint::dump($kaikki);
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     $pokemon = Pokemons::find(1);
     $pokemons = Pokemons::all();
     Kint::dump($pokemon);
     Kint::dump($pokemons);
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     //View::make('helloworld.html');
     $uusiKurssi = new Kurssi(array('nimi' => '1', 'aika' => 'III periodi', 'tyyppi' => 'agf', 'kuvaus' => 'Metriikkaa', 'opettaja' => ''));
     $errors = $uusiKurssi->errors();
     Kint::dump($errors);
 }
示例#23
0
 public function save()
 {
     $query = DB::connection()->prepare('INSERT INTO Hero (name, primaryattribute, attacktype, primaryrole, damagetype, description) VALUES(:name, :primaryattribute, :attacktype, :primaryrole, :damagetype, :description) RETURNING id');
     $query->execute(array('name' => $this->name, 'primaryattribute' => $this->primaryattribute, 'attacktype' => $this->attacktype, 'primaryrole' => $this->primaryrole, 'damagetype' => $this->damagetype, 'description' => $this->description));
     $row = $query->fetch();
     Kint::trace();
     Kint::dump($row);
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     //View::make('helloworld.html');
     $torakat = Book::find(1);
     $books = Book::all();
     Kint::dump($books);
     Kint::dump($torakat);
 }
示例#25
0
 /** Prints stack trace if in developer mode or force flag set
  *
  * @param bool $force Force dumping?
  *
  * @return mixed Returns true if trace printed successfully, false otherwise.
  */
 public function trace($force = false)
 {
     if ($force or $this->developerMode) {
         Kint::trace();
         return true;
     } else {
         return false;
     }
 }
示例#26
0
 public function update()
 {
     $query = DB::connection()->prepare('UPDATE Requests (name, description, hashtags) VALUES (:name, :start_date, :end_date, :description, :hashtags) RETURNING id');
     $query->execute(array('name' => $this->name, 'description' => $this->description, 'hashtags' => $this->hashtags));
     $row = $query->fetch();
     Kint::trace();
     Kint::dump($row);
     $this->id = $row['id'];
 }
示例#27
0
 public static function varastotuote_lisaa_show($varasto_id)
 {
     self::check_logged_in();
     Kint::dump($varasto_id);
     // Hae ja listaa kaikki tuotteet tähän taulukkoon
     $Tuotteet = TuoteController::tuote_list_all();
     Kint::dump($Tuotteet);
     View::make('VarastoTuote/Lisaauusivarastotuote.html', array('Tuotteet' => $Tuotteet));
 }
 public static function sandbox()
 {
     // Testaa koodiasi täällä
     // View::make('helloworld.html');
     $indi = Recipe::find(1);
     $indis = Recipe::all();
     Kint::dump($indi);
     Kint::dump($indis);
 }
示例#29
0
 protected function _parse(&$variable)
 {
     if (!is_object($variable) || !$variable instanceof SplFileInfo) {
         return false;
     }
     $this->type = 'object';
     $this->subtype = 'SplFileInfo';
     $this->value = Kint::shortenPath($variable->getRealPath());
 }
示例#30
0
 public function save()
 {
     $query = DB::connection()->prepare('INSERT INTO Aanestys (nimi, aanestysalkaa, aanestysloppuu, kuvaus, onkoid, luojaid) VALUES (:nimi, :aanestysalkaa, :aanestysloppuu, :kuvaus, :onkoid, :luojaid) RETURNING id');
     $query->execute(array('nimi' => $this->nimi, 'aanestysalkaa' => $this->aanestysalkaa, 'aanestysloppuu' => $this->aanestysloppuu, 'kuvaus' => $this->kuvaus, 'onkoid' => $this->onkoid, 'luojaid' => $this->luojaid));
     $row = $query->fetch();
     $this->id = $row['id'];
     Kint::trace();
     Kint::dump($row);
 }