Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class dataBase{
- private static $lesdbInstantie = null;
- private $dbh;
- private function __construct($server, $username, $password, $database){
- try{
- $this->dbh =
- new PDO("mysql:host=$server; dbname=$database;charset=utf8; port=3306", $username, $password);
- $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- }
- catch (PDOException $e){ die($e->getMessage());}
- }
- public static function getDataBase($server, $username, $password, $database){
- if(is_null(self::$lesdbInstantie)){
- self::$lesdbInstantie =
- new dataBase($server, $username, $password, $database);
- }
- return self::$lesdbInstantie;
- }
- public function getPictures() {
- try{
- $sql = "select * From meetjeslandPictures";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $content = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $content;
- }
- public function changePicture($naam,$filename,$filetype){
- try{
- $sql = "update meetjeslandPictures set imageRef =:filename , extension = :filetype where naam = :naam";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":filename", $filename);
- $stmt->bindParam(":filetype", $filetype);
- $stmt->bindParam(":naam", $naam);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function getContentFaciliteiten(){
- try{
- $sql = "select * From meetjeslandFaciliteitenPage";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $content = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $content;
- }
- public function updateAlgemeneInfo($nieuwsbrief,$aboutUs){
- try{
- $sql = "UPDATE meetjeslandAlgemeneInfo SET nieuwsbrief = :nieuwsbrief,aboutUs = :aboutUs";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":nieuwsbrief", $nieuwsbrief);
- $stmt->bindParam(":aboutUs", $aboutUs);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function getAlgemeneInfo(){
- try{
- $sql = "select * From meetjeslandAlgemeneInfo";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $content = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $content;
- }
- public function updateDeelnameContent($content){
- try{
- $sql = "UPDATE meetjeslandDeelnamePage SET content = :content";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":content", $content);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function updateFaciliteitenContent($content){
- try{
- $sql = "UPDATE meetjeslandFaciliteitenPage SET content = :content";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":content", $content);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function getContentDeelname(){
- try{
- $sql = "select * From meetjeslandDeelnamePage";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $content = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $content;
- }
- public function sluitDB(){
- $dbh = null;
- }
- public function getRoutesFromStartPoint($id){
- try{
- $sql = "select * from routeInStartPunt
- join meetjeslandRoutes on routeInStartPunt.routeId = meetjeslandRoutes.idroute
- where StartpuntId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- $routes = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $routes;
- }
- public function getDownloads(){
- try{
- $sql = "select * From meetjeslandDownloads";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $downloads = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $downloads;
- }
- public function getLinksFromDownload($id){
- try{
- $sql = "select * from meetjeslandDownloadsItems where downloadId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- $links = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $links;
- }
- public function getRouteId($naam){
- try{
- $sql = "select * from meetjeslandRoutes where routeNaam = :naam";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->execute();
- $route = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $route;
- }
- public function getLogos(){
- try{
- $sql = "SELECT * FROM meetjeslandImages";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $logos = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $logos;
- }
- public function getInfoPunten(){
- try{
- $sql = "SELECT * FROM meetjeslandInfoPunten";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $startpunten = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $startpunten;
- }
- public function getInfoPuntenFromRoute($id){
- try{
- $sql = "select * from InfoPuntInRoute
- join meetjeslandInfoPunten
- on meetjeslandInfoPunten.id = InfoPuntInRoute.infoPuntId
- where routeId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- $infoPunten = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $infoPunten;
- }
- public function getInfoPuntenFromRouteWithId($id){
- try{
- $sql = "select * from InfoPuntInRoute
- where routeId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- $infoPunten = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $infoPunten;
- }
- public function getRouteInStartPunt($id){
- try{
- $sql = "select * from routeInStartPunt
- where routeId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- $ids = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $ids;
- }
- public function getStartPlaatsenFromRoute($id){
- try{
- $sql = "select * from routeInStartPunt
- join meetjeslandStartPunten
- on routeInStartPunt.startpuntid = meetjeslandStartPunten.id
- where routeid = :id
- ";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- $startplaatsen = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $startplaatsen;
- }
- public function getStartPlaatsen(){
- try{
- $sql = "SELECT * FROM meetjeslandStartPunten";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $startpunten = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $startpunten;
- }
- public function saveImage($name , $img){
- try{
- $sql = "INSERT INTO meetjeslandImages(name,image) values (:name ,:image)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":name", $name);
- $stmt->bindParam(":image" , $img);
- $stmt->execute();
- }
- catch (PDOException $e){
- die($e->getMessage());
- }
- }
- public function getImages(){
- try{
- $sql = "SELECT * FROM meetjeslandImages";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $images = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $images;
- }
- public function getRoutes(){
- try{
- $sql = "SELECT * FROM meetjeslandRoutes";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $routes = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $routes;
- }
- public function getFooterInfo(){
- try{
- $sql = "SELECT * FROM meetjeslandFooter";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $info = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $info;
- }
- public function getFotos(){
- try{
- $sql = "SELECT * FROM meetjeslandFotos order by jaar desc";
- $stmt = $this->dbh->prepare($sql);
- $stmt->execute();
- $fotos = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $fotos;
- }
- public function getInfoFromPostCode($code){
- try{
- $sql = "SELECT * FROM gemeente WHERE postcode = :code";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":code", $code);
- $stmt->execute();
- $info = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $info;
- }
- public function getInfoAboutLogo($name){
- try{
- $sql = "SELECT * FROM meetjeslandImages WHERE name = :name";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":name", $name);
- $stmt->execute();
- $user = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- return $user;
- }
- public function addLogo($name, $type, $link,$imageRef,$extension){
- try{
- $sql = "INSERT INTO meetjeslandImages(name, type, link, extension, imageRef)
- VALUES(:name, :type, :link, :extension, :imageRef)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":name", $name);
- $stmt->bindParam(":type", $type);
- $stmt->bindParam(":link", $link);
- $stmt->bindParam(":extension", $extension);
- $stmt->bindParam(":imageRef", $imageRef);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function makeUser($name , $password){
- try{
- $sql = "INSERT INTO meetjeslandUsers(name,password) values (:user,:password)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":user", $name);
- $stmt->bindParam(":password", $password);
- $stmt->execute();
- }
- catch (PDOException $e){
- die($e->getMessage());
- }
- }
- public function removeLogo($id){
- try{
- $sql = "DELETE FROM meetjeslandImages WHERE imageId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeImageLogo($logo,$fileName,$extension){
- try{
- $sql = "UPDATE meetjeslandImages SET imageRef = :fileName,extension = :extension
- WHERE name = :logo";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":fileName", $fileName);
- $stmt->bindParam(":extension", $extension);
- $stmt->bindParam(":logo", $logo);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeLogo($logoName, $newName, $type, $link){
- try{
- $sql = "UPDATE meetjeslandImages SET name = :newName,type = :type,link = :link
- WHERE name = :logoName";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":newName", $newName);
- $stmt->bindParam(":type", $type);
- $stmt->bindParam(":link", $link);
- $stmt->bindParam(":logoName", $logoName);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function checkOnUser($name,$password){
- try{
- $sql = "SELECT * FROM meetjeslandUsers WHERE name = :name and password = :password ";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":name", $name);
- $stmt->bindParam(":password" , $password);
- $stmt->execute();
- $user = $stmt->fetchAll(PDO::FETCH_CLASS);
- }
- catch (PDOException $e){ die($e->getMessage());}
- if(isset($user[0])) { return true; }
- else{ return false; }
- }
- public function addRoute($naam,$routeInformatie,$afstand,$type,$fileName,$imageFileType){
- try{
- $sql = "INSERT INTO meetjeslandRoutes (routeNaam,informatie,afstand,type,imageRef,extension)
- VALUES(:routeNaam, :informatie, :afstand, :type, :imageRef, :extension)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":routeNaam", $naam);
- $stmt->bindParam(":informatie", $routeInformatie);
- $stmt->bindParam(":afstand", $afstand);
- $stmt->bindParam(":type", $type);
- $stmt->bindParam(":imageRef", $fileName);
- $stmt->bindParam(":extension", $imageFileType);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeRoute($naam,$routeInformatie,$afstand,$type,$routeName){
- try{
- $sql = "UPDATE meetjeslandRoutes SET routeNaam = :naam, informatie = :routeinformatie, afstand = :afstand, type = :type
- WHERE routeNaam = :oriName";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":routeinformatie", $routeInformatie);
- $stmt->bindParam(":afstand", $afstand);
- $stmt->bindParam(":type", $type);
- $stmt->bindParam(":oriName", $routeName);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeRouteImage($naam,$fileName,$imageFileType){
- try{
- $sql = "UPDATE meetjeslandRoutes SET imageRef = :fileName, extension = :extension
- WHERE routeNaam = :naam";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":fileName", $fileName);
- $stmt->bindParam(":extension", $imageFileType);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteRoute($id){
- try{
- $sql = "DELETE FROM meetjeslandRoutes WHERE idroute = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addDownloadEditie($naam,$jaar){
- try{
- $sql = "INSERT INTO meetjeslandDownloads (naam,jaar)
- VALUES(:naam,:jaar)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":jaar", $jaar);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function updateDownloadEditie($id,$naam,$jaar){
- try{
- $sql = "UPDATE meetjeslandDownloads SET naam = :naam, jaar = :jaar
- WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":id", $id);
- $stmt->bindParam(":jaar", $jaar);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteDownloadEditie($id){
- try{
- $sql = "DELETE FROM meetjeslandDownloads WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addLink($downloadId,$naam,$link){
- try{
- $sql = "INSERT INTO meetjeslandDownloadsItems (downloadId,naam,link)
- VALUES(:downloadId,:naam,:link)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":downloadId", $downloadId);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":link", $link);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeLink($id,$naam,$link){
- try{
- $sql = "UPDATE meetjeslandDownloadsItems SET naam = :naam, link =:link
- WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":link", $link);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteLink($id){
- try{
- $sql = "DELETE FROM meetjeslandDownloadsItems WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteLinks($id){
- try{
- $sql = "DELETE FROM meetjeslandDownloadsItems WHERE downloadId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addFotoAlbum($albumNaam,$fotoGrafen,$albumLink,$jaar){
- try{
- $sql = "INSERT INTO meetjeslandFotos (naam,fotografen,link,jaar)
- VALUES(:naam,:fotografen,:link,:jaar)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $albumNaam);
- $stmt->bindParam(":fotografen", $fotoGrafen);
- $stmt->bindParam(":link", $albumLink);
- $stmt->bindParam(":jaar", $jaar);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeFotoAlbum($albumNaam,$fotoGrafen,$albumLink,$id,$jaar){
- try{
- $sql = "UPDATE meetjeslandFotos SET naam = :naam,fotografen = :fotografen ,link =:link, jaar=:jaar
- WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $albumNaam);
- $stmt->bindParam(":fotografen", $fotoGrafen);
- $stmt->bindParam(":link", $albumLink);
- $stmt->bindParam(":id", $id);
- $stmt->bindParam(":jaar", $jaar);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteFotoAlbum($id){
- try{
- $sql = "DELETE FROM meetjeslandFotos WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addStartpunt($startpuntName,$openingsuren,$sluittijd,$postcode,$gemeente,$straat,$nummer,$informatie){
- try{
- $sql = "INSERT INTO meetjeslandStartPunten (naam,gemeente,postcode,straat,huisnummer,information,start,sluit)
- VALUES(:naam,:gemeente,:postcode,:straat,:huisnummer,:information,:start,:sluit)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $startpuntName);
- $stmt->bindParam(":gemeente", $gemeente);
- $stmt->bindParam(":postcode", $postcode);
- $stmt->bindParam(":straat", $straat);
- $stmt->bindParam(":huisnummer", $nummer);
- $stmt->bindParam(":information", $informatie);
- $stmt->bindParam(":start", $openingsuren);
- $stmt->bindParam(":sluit", $sluittijd);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeStartpunt($startpuntName,$openingsuren,$sluittijd,$postcode,$gemeente,$straat,$nummer,$informatie,$id){
- try{
- $sql = "UPDATE meetjeslandStartPunten SET naam = :naam, gemeente = :gemeente, postcode =:postcode, straat =:straat, huisnummer =:huisnummer, information = :information, start = :start, sluit = :sluit
- WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $startpuntName);
- $stmt->bindParam(":gemeente", $gemeente);
- $stmt->bindParam(":postcode", $postcode);
- $stmt->bindParam(":straat", $straat);
- $stmt->bindParam(":huisnummer", $nummer);
- $stmt->bindParam(":information", $informatie);
- $stmt->bindParam(":start", $openingsuren);
- $stmt->bindParam(":sluit", $sluittijd);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteStartpunt($id){
- try{
- $sql = "DELETE FROM meetjeslandStartPunten WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addInfoPunt($naam,$informatie,$fileName,$imageFileType){
- try{
- $sql = "INSERT INTO meetjeslandInfoPunten (infoPuntName,infoPuntInformatie,imageRef,extension)
- VALUES(:naam,:informatie,:imageref,:extension)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":informatie", $informatie);
- $stmt->bindParam(":imageref", $fileName);
- $stmt->bindParam(":extension", $imageFileType);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeInfoPunt($naam,$informatie,$id){
- try{
- $sql = "UPDATE meetjeslandInfoPunten SET infoPuntName = :naam, infoPuntInformatie = :informatie
- WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":naam", $naam);
- $stmt->bindParam(":informatie", $informatie);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function changeImageInfoPunt($id,$fileName,$imageFileType){
- try{
- $sql = "UPDATE meetjeslandInfoPunten SET imageRef = :imageref,extension = :extension
- WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":imageref", $fileName);
- $stmt->bindParam(":extension", $imageFileType);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function deleteInfoPunt($id){
- try{
- $sql = "DELETE FROM meetjeslandInfoPunten WHERE id = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function removeReferencesWithId($id){
- try{
- $sql = "DELETE FROM routeInStartPunt WHERE StartpuntId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function removeReferencesInfoPuntRoute($id){
- try{
- $sql = "DELETE FROM InfoPuntInRoute WHERE routeId = :id";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":id", $id);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addReferencesInfoPuntInRoute($routeName,$checkbox){
- try{
- $sql = "INSERT INTO InfoPuntInRoute (routeId,infoPuntId)
- VALUES(:routeid,:infoPuntId)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":routeid", $routeName);
- $stmt->bindParam(":infoPuntId", $checkbox);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- public function addReferenceStartPuntRoute($routeName,$checkbox){
- try{
- $sql = "INSERT INTO routeInStartPunt (routeId,StartpuntId)
- VALUES(:routeid,:starpuntid)";
- $stmt = $this->dbh->prepare($sql);
- $stmt->bindParam(":routeid", $checkbox);
- $stmt->bindParam(":starpuntid", $routeName);
- $stmt->execute();
- }
- catch (PDOException $e){die($e->getMessage());}
- }
- }
- ?>
Add Comment
Please, Sign In to add comment