uawdijnntqw1x1x1
IP : 216.73.216.39
Hostname : diefsweb003.fsit.ch
Kernel : Linux diefsweb003.fsit.ch 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
wirbesti
/
nousdecidons.ch
/
472b8
/
..
/
..
/
www
/
php
/
Committee.php
/
/
<?php class Committee { private $con; private int $lastid; // Database Connection public function __construct(DBConnection $database) { $this->con = $database; $this->lastid = -1; return $this->con; } public function getByName(string $name) { $query = "SELECT `id`, `name`, `address`, `zip`, `town`, `picturepath`, `description` FROM `nvbjn_committee` c ". "WHERE c.name = :name;"; $getcommittee = $this->con->dbc->prepare($query); $getcommittee->bindParam(':name', $name); $getcommittee->execute(); $result = $getcommittee->fetch(); return $result; } public function getById(int $id) { $query = "SELECT `id`, `name`, `address`, `zip`, `town`, `picturepath`, `description` FROM `nvbjn_committee` c ". "WHERE c.id = :id;"; $getcommittee = $this->con->dbc->prepare($query); $getcommittee->bindParam(':name', $id); $getcommittee->execute(); $result = $getcommittee->fetch(); return $result; } public function getMaxId() { $query = "SELECT max(`id`) FROM `nvbjn_committee` c;"; $getcommittee = $this->con->dbc->prepare($query); $getcommittee->execute(); $result = $getcommittee->fetchColumn(); return $result; } public function insert($data) { $name = $data['name']; $address = $data['address']; $zip = $data['zip']; $town = $data['town']; $picturepath = $data['picturepath'] ?? ''; $description = $data['description'] ?? ''; $cdata = [ 'name' => $name, 'address' => $address, 'zip' => $zip, 'town' => $town, 'picturepath' => $picturepath, 'description' => $description, ]; $insertSQL = "INSERT INTO `nvbjn_committee`(`name`, `address`, `zip`, `town`, `picturepath`, `description`) ". "VALUES (:name, :address, :zip, :town, :picturepath, :description)"; $result = false; try { $this->con->dbc->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $insertmetadata = $this->con->dbc->prepare($insertSQL); $result = $insertmetadata->execute($cdata); $last_id = $this->con->dbc->lastInsertId(); $this->lastid = $last_id; } catch (PDOException $e) { echo $e->getMessage().' in '.$e->getFile().' on line '.$e->getLine(); } return $result; } public function getLastId() { return $this->lastid; } } ?>
/home/wirbesti/nousdecidons.ch/472b8/../../www/php/Committee.php