<repo_name>masterdodo/Hoteli<file_sep>/iud/nov_hotel.php
<?php
if (isset ($_POST['submit']))
{
    session_start();
    //Zahtevam povezavo na bazo
    include ('../x/dbconn.php');
    //Urejanje slike
    $username = $_SESSION['username'];
    $hotel_name = $_POST['name'];
    $picture_path = "../assets/hotels/";
    $target_file = $picture_path . basename($_FILES["picture"]["name"]);
    $ext = '.' . strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
    $newfile1 = $username . $hotel_name . $ext;
    $newfile1 = str_replace (' ', '', $newfile1);
    $picture_db_path = "https://testing.aristovnik.com/hoteli/assets/hotels/" . $newfile1;
    $uploadOk = 1;
    $check = getimagesize($_FILES["picture"]["tmp_name"]);
    if($check !== false)
    {
        echo 'Datoteka je slika.';
        $uploadOk = 1;
    }
    else
    {
        echo 'Datoteka ni slika.';
        $uploadOk = 0;
    }
    if ($uploadOk == 1)
    {
        $newfile = $picture_path . $username . $hotel_name . $ext;
        $newfile = str_replace (' ', '', $newfile);
        if (move_uploaded_file($_FILES["picture"]["tmp_name"], $newfile))
        {
            //Napišem in izvedem INSERT stavek
            echo 'Uspešno!';
            $sql = 'INSERT INTO hotels(name, address, date_from, date_to, filled_places, all_places, city_id, user_id, picture) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)';
            $stmt = $pdo->prepare ($sql)->execute ([$_POST['name'],$_POST['address'],$_POST['date_from'],$_POST['date_to'],0,$_POST['all_places'],$_POST['city'],$_SESSION['user_id'], $picture_db_path]);
            header ('location:../');
            exit;
        }
        else
        {
            echo 'Neuspešno!';
        }
    }
    else
    {
            echo 'Napaka!';
    }
}
?>
<?php
$title = "Dodaj hotel";
$css = "../css/main.css";
include ('../x/header.php');
?>
    <form method="post" enctype="multipart/form-data">
    <table>
        <tr><td class="table-label-hotel"><label for="name">Ime hotela:</label></td><td><input type="text" name="name" placeholder="Ime hotela" class="input-standard" required></td></tr>
        <tr><td class="table-label-hotel"><label for="address">Naslov hotela:</label></td><td><input type="text" name="address" placeholder="Naslov hotela" class="input-standard" required></td></tr>
        <tr><td class="table-label-hotel"><label for="city">Kraj hotela:</label></td><td><select name="city" class="input-standard">
        <?php
        include ('../x/dbconn.php');
        $stmt = $pdo->query ('SELECT * FROM cities');
        foreach ($stmt as $row)
        {
            echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
        }
        ?>
        </select></td></tr>
        <tr><td class="table-label-hotel"><label for="all_places">Število prostih mest:</label></td><td><input type="numbers" name="all_places" class="input-standard" placeholder="Število prostih mest" required></td></tr>
        <tr><td class="table-label-hotel"><label for="date_from">Datum prihoda:</label></td><td><input type="date" name="date_from" class="input-standard" required></td></tr>
        <tr><td class="table-label-hotel"><label for="date_to">Datum odhoda:</label></td><td><input type="date" name="date_to" class="input-standard" required></td></tr>
        <tr><td class="table-label-hotel"><label for="picture">Slika hotela:</label></td><td><input type="file" name="picture" class="input-standard" required></td></tr><br />
    </table>
        <input class="button-standard" type="submit" name="submit" value="Dodaj hotel">
    </form>
<?php
include ('../x/footer.php');
?><file_sep>/nastavitve/index.php
<?php
$title = "Uredi profil";
$css = "../css/main.css";
$js = "../js/nastavitve.js";
include ('../x/header.php');
require ('../x/dbconn.php');
?>
<?php
if (isset ($_POST['submit-username']))
{
    $sql = $pdo->prepare ("SELECT id FROM users WHERE username = ?");
    $sql->execute (array ($_POST['username']));
    $result = $sql->fetch();
    if ($result)
    {
        echo 'Uporabniško ime je zasedeno.';
    }
    else
    {
        $sql = 'UPDATE users SET username = ? WHERE id = ?';
        $stmt = $pdo->prepare ($sql)->execute ([$_POST['username'], $_SESSION['user_id']]);
        $_SESSION['username'] = $_POST['username'];
        header ('location:./');
        echo 'Uporabniško ime spremenjeno';
    }
}
else if (isset ($_POST['submit-password']))
{
    $sql = 'UPDATE users SET password = ? WHERE id = ?';
    $pass_hash = password_hash($_POST['password'], PASSWORD_DEFAULT);
    $stmt = $pdo->prepare ($sql)->execute ([$pass_hash, $_SESSION['user_id']]);
    header ('location:./');
    echo 'Geslo spremenjeno';
}
else if (isset ($_POST['submit-avatar']))
{
    $username = $_SESSION['username'];
    $avatar_path = "/data/testing.aristovnik.com/www/hoteli/assets/avatars/";
    $target_file = $avatar_path . basename($_FILES["avatar"]["name"]);
    $ext = '.' . strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
    $profile_picture_db_path = "https://testing.aristovnik.com/hoteli/assets/avatars/" . $username . $ext;
    $uploadOk = 1;
    $check = getimagesize($_FILES["avatar"]["tmp_name"]);
    if($check !== false)
    {
        //echo 'Datoteka je slika.';
        $uploadOk = 1;
    }
    else
    {
        //echo 'Datoteka ni slika.';
        $uploadOk = 0;
    }
    if ($uploadOk == 1)
    {
        error_reporting (E_ALL);
        if (move_uploaded_file($_FILES["avatar"]["tmp_name"], $avatar_path . $username . $ext))
        {
            echo 'Uspešno!';
            $sql = $pdo->prepare ('UPDATE users SET avatar = ? WHERE id = ?');
            $sql->execute (array ($profile_picture_db_path, $_SESSION['user_id']));
            $_SESSION['avatar'] = $profile_picture_db_path;
        }
        else
        {
            echo $avatar_path . $username . $ext;
            echo 'Neuspešno!';
        }
    }
    else
    {
            echo 'Napaka!';
    }
}
?>
<form method="post">
    <input id="input-nastavitve-username" type="text" name="username" placeholder="Uporabniško ime" class="input-standard" onkeyup="checkInputOnKeUpUser(this.value)" required>
    <input id="input-nastavitve-username-submit" type="submit" name="submit-username" value="Spremeni" class="input-submit">
</form>
<br />
<form method="post">
    <input id="input-nastavitve-pass" type="password" name="password" placeholder="<PASSWORD>" class="input-standard" onkeyup="checkInputOnKeUpPass(this.value)" required <?php if (isset ($_SESSION['google-user'])){ echo 'disabled';} ?>>
    <input id="input-nastavitve-pass-submit" type="submit" name="submit-password" value="<PASSWORD>" class="input-submit" <?php if (isset ($_SESSION['google-user'])){ echo 'disabled';} ?>>
</form>
<br />
<form method="post" enctype="multipart/form-data">
    <label class="label-standard" for="avatar">Slika profila</label><br />
    <input type="file" name="avatar" class="input-standard" required>
    <input type="submit" name="submit-avatar" value="Spremeni" class="input-submit">
</form>
<div class="errors" id="error-user"></div>
<div class="errors" id="error-pass"></div>
<?php
include ('../x/footer.php');
?><file_sep>/js/nastavitve.js
var userWrong = 0;
var passWrong = 0;
function checkInputOnKeUpUser(x)
{
    if (x.length < 3)
    {
        setTimeout(function()
            {
                document.querySelector('#error-user').style.display = "block";
                document.querySelector('#error-user').innerHTML = "Uporabniško ime rabi več<br />kot dva znaka."; 
                document.querySelector('#input-nastavitve-username').style.background = '#ad2424';
                document.querySelector('#input-nastavitve-username-submit').disabled = true;
                userWrong = 1;
            }, 200);
    }
    else if (x == "admin")
    {
        setTimeout(function()
            {
                document.querySelector('#error-user').style.display = "block";
                document.querySelector('#error-user').innerHTML = "Nedovoljeno ime."; 
                document.querySelector('#input-nastavitve-username').style.background = '#ad2424';
                document.querySelector('#input-nastavitve-username-submit').disabled = true;
                userWrong = 1;
            }, 200);
    }
    else
    {
        document.querySelector('#error-user').innerHTML = ""; 
        document.querySelector('#input-nastavitve-username').style.background = '#6faf48';
        document.querySelector('#error-user').style.display = "none";
        userWrong = 0;
        if (userWrong == 0 && passWrong == 0)
        {
            document.querySelector('#input-nastavitve-username-submit').disabled = false;
        }
    }
}

function checkInputOnKeUpPass(x)
{
    if (x.length < 8)
    {
        if (document.querySelector('#error-pass').innerHTML == "")
        {
            setTimeout(function()
            {
                document.querySelector('#error-pass').style.display = "block";
                document.querySelector('#error-pass').innerHTML = "Geslo je prekratko.";
                document.querySelector('#input-nastavitve-pass').style.background = '#ad2424';
                document.querySelector('#input-nastavitve-pass-submit').disabled = true;
                passWrong = 1;
            }, 200);
        }
    }
    else
    {
        document.querySelector('#error-pass').innerHTML = "";
        document.querySelector('#input-nastavitve-pass').style.background = '#6faf48';
        document.querySelector('#error-pass').style.display = "none";
        passWrong = 0;
        if (passWrong == 0 && userWrong == 0)
        {
            document.querySelector('#input-nastavitve-pass-submit').disabled = false;
        }
    }
}<file_sep>/admin/iud/dodaj_ponudnika.php
<?php
//Zahtevam povezavo na bazo
require_once ('../../x/dbconn.php');

//Preverim če je admin prijavljen
require_once ('../../x/checkadminlogin.php');

//Preverim če so bili podatki poslani
if (isset ($_POST['submit']))
{
    //Trim-am vse vrednosti, ki jih dobim iz poslanih podatkov in jih shranim v nove spremenljivke
    $email = trim ($_POST['email']);
    $username = trim ($_POST['email']);
    $password = trim ($_POST['password']);

    //V spremenljivko result si zabeležim če epošta že obstaja
    $sql = $pdo->prepare ("SELECT * FROM users WHERE email = ?");
    $sql->execute (array ($email));
    $result = $sql->fetch();

    //Nastavim spremenljivko error na 0
    $error = 0;

    //Preverim če epošta že obstaja
    if ($result)
    {
        echo "Epošta že obstaja.";
        $error = 1;
    }

    //Preverim če je geslo manjše od 8 znakov
    if (strlen ($password) < 8)
    {
        echo "Geslo mora biti večje od 8 znakov.";
        $error = 1;
    }

    //Preverim če ni bilo napak in ga vpišem v tabelo users
    if ($error == 0)
    {
        //Generiram hash gesla in vpišem ponudnika v DB
        $pass_hash = password_hash($password, PASSWORD_DEFAULT);
        $sql = $pdo->prepare ("INSERT INTO users(username, email, password, edit_hotels) VALUES (?,?,?,1)");
        try
        {
            $sql->execute (array ($email, $email, $pass_hash));
            echo "Ponudnik uspešno dodan!";
        }
        catch ( PDOException $err)
        {
            echo "Napaka!";
        }
    }
}
?>
<?php
$title = 'Admin - <NAME>';
$css = '../../css/main.css';
include '../../x/header.php';
?>
    <form method="post">
        <input class="input-standard" type="text" name="email" placeholder="Epošta" required><br />
        <input class="input-standard" type="<PASSWORD>" name="password" placeholder="<PASSWORD>" required><br />
        <input class="button-standard" type="submit" name="submit" value="Dodaj">
    </form>
<?php
include '../../x/footer.php';
?><file_sep>/js/registracija.js
var emailWrong = 0;
var userWrong = 0;
var passWrong = 0;
var passCheckWrong = 0;
function checkInputOnKeyUpMail(x)
{
    if( /(.+)@(.+){2,}\.(.+){2,}/.test(x) )
    {
        document.querySelector('#error-email').innerHTML = "";
        document.querySelector('#input-register-email').style.background = '#6faf48';
        document.querySelector('#error-email').style.display = "none";
        emailWrong = 0;
        if (emailWrong == 0 && userWrong == 0 && passWrong == 0 && passCheckWrong == 0)
        {
            document.querySelector('#input-register-submit').disabled = false;
        }
    } 
    else
    {
        if (document.querySelector('#error-email').innerHTML == "")
        {
            setTimeout(function()
            {
                document.querySelector('#error-email').style.display = "block";
                document.querySelector('#error-email').innerHTML = "Napačna e-pošta."; 
                document.querySelector('#input-register-email').style.background = '#ad2424';
                document.querySelector('#input-register-submit').disabled = true;
                emailWrong = 1;
            }, 500);
        }
    }
}

function checkInputOnKeyUpUser(x)
{
    if (x.length < 3)
    {
        setTimeout(function()
            {
                document.querySelector('#error-user').style.display = "block";
                document.querySelector('#error-user').innerHTML = "Uporabniško ime rabi več<br />kot dva znaka."; 
                document.querySelector('#input-register-user').style.background = '#ad2424';
                document.querySelector('#input-register-submit').disabled = true;
                userWrong = 1;
            }, 200);
    }
    else if (x == "admin")
    {
        setTimeout(function()
            {
                document.querySelector('#error-user').style.display = "block";
                document.querySelector('#error-user').innerHTML = "Nedovoljeno ime."; 
                document.querySelector('#input-register-user').style.background = '#ad2424';
                document.querySelector('#input-register-submit').disabled = true;
                userWrong = 1;
            }, 200);
    }
    else
    {
        document.querySelector('#error-user').innerHTML = ""; 
        document.querySelector('#input-register-user').style.background = '#6faf48';
        document.querySelector('#error-user').style.display = "none";
        userWrong = 0;
        if (emailWrong == 0 && userWrong == 0 && passWrong == 0 && passCheckWrong == 0)
        {
            document.querySelector('#input-register-submit').disabled = false;
        }
    }
}

function checkInputOnKeyUpPass(x)
{
    if (x.length < 8)
    {
        if (document.querySelector('#error-pass').innerHTML == "")
        {
            setTimeout(function()
            {
                document.querySelector('#error-pass').style.display = "block";
                document.querySelector('#error-pass').innerHTML = "Geslo je prekratko.";
                document.querySelector('#input-register-pass').style.background = '#ad2424';
                document.querySelector('#input-register-submit').disabled = true;
                passWrong = 1;
            }, 200);
        }
    }
    else
    {
        document.querySelector('#error-pass').innerHTML = "";
        document.querySelector('#input-register-pass').style.background = '#6faf48';
        document.querySelector('#error-pass').style.display = "none";
        passWrong = 0;
        if (emailWrong == 0 && userWrong == 0 && passWrong == 0 && passCheckWrong == 0)
        {
            document.querySelector('#input-register-submit').disabled = false;
        }
    }
}

function checkInputOnKeyUpPassCheck(x)
{
    var pass = document.querySelector('#input-register-pass').value;
    console.log(pass);
    if (pass === x)
    {
        document.querySelector('#error-passcheck').innerHTML = "";
        document.querySelector('#input-register-passcheck').style.background = '#6faf48';
        document.querySelector('#error-passcheck').style.display = "none";
        passCheckWrong = 0;
        if (emailWrong == 0 && userWrong == 0 && passWrong == 0 && passCheckWrong == 0)
        {
            document.querySelector('#input-register-submit').disabled = false;
        }
    }
    else
    {
        if (document.querySelector('#error-passcheck').innerHTML == "")
        {
            setTimeout(function()
            {
                document.querySelector('#error-passcheck').style.display = "block";
                document.querySelector('#error-passcheck').innerHTML = "Gesli se ne ujemata.";
                document.querySelector('#input-register-passcheck').style.background = '#ad2424';
                document.querySelector('#input-register-submit').disabled = true;
                passCheckWrong = 1;
            }, 200);
        }
    }
}<file_sep>/js/prijava.js
var emailWrong = 0;
var passWrong = 0;
function checkInputOnKeyUpMail (x)
{
    if( /(.+)@(.+){2,}\.(.+){2,}/.test(x) )
    {
        document.querySelector('#error-email').innerHTML = "";
        document.querySelector('#input-prijava-email').style.background = '#6faf48';
        document.querySelector('#error-email').style.display = "none";
        emailWrong = 0;
        if (emailWrong == 0 && passWrong == 0)
        {
            document.querySelector('#input-prijava-submit').disabled = false;
        }
    } 
    else
    {
        if (document.querySelector('#error-email').innerHTML == "")
        {
            setTimeout(function()
            {
                document.querySelector('#error-email').style.display = "block";
                document.querySelector('#error-email').innerHTML = "Napačna e-pošta."; 
                document.querySelector('#input-prijava-email').style.background = '#ad2424';
                document.querySelector('#input-prijava-submit').disabled = true;
                emailWrong = 1;
            }, 500);
        }
    }
}

function checkInputOnKeyUpPass (x)
{
    if (x.length < 8)
    {
        if (document.querySelector('#error-pass').innerHTML == "")
        {
            setTimeout(function()
            {
                document.querySelector('#error-pass').style.display = "block";
                document.querySelector('#error-pass').innerHTML = "<PASSWORD>.";
                document.querySelector('#input-prijava-pass').style.background = '#<PASSWORD>';
                document.querySelector('#input-prijava-submit').disabled = true;
                passWrong = 1;
            }, 200);
        }
    }
    else
    {
        document.querySelector('#error-pass').innerHTML = "";
        document.querySelector('#input-prijava-pass').style.background = '#6<PASSWORD>';
        document.querySelector('#error-pass').style.display = "none";
        passWrong = 0;
        if (passWrong == 0 && emailWrong == 0)
        {
            document.querySelector('#input-prijava-submit').disabled = false;
        }
    }
}<file_sep>/admin/index.php
<?php
//Nastavim naslov, css pot in dodam header
$title = 'Glavna stran - Admin';
$css = '../css/main.css';
include '../x/header.php';
//Preverim če je admin prijavljen
require_once ('../x/checkadminlogin.php');
?>
        <a class="button-standard" href="iud/dodaj_ponudnika.php">Dodaj ponudnika</a><br /><br />
        <a class="button-standard" href="iud/odstrani_ponudnika.php">Odstrani ponudnika</a><br />
<?php
include '../x/footer.php';
?><file_sep>/registracija/signup.php
<?php
//Zahtevam povezavo na bazo
require_once ('../x/dbconn.php');

//Preverim če so bili podatki poslani
if (isset ($_POST['submit']))
{
    //Trim-am vse vrednosti, ki jih dobim iz poslanih podatkov in jih shranim v nove spremenljivke
    $email = trim ($_POST['email']);
    $username = trim ($_POST['username']);
    $password = trim ($_POST['password']);
    $password_check = trim ($_POST['passwordcheck']);

    //V spremenljivko result si zabeležim če uporabniško ime že obstaja
    $sql = $pdo->prepare ("SELECT * FROM users WHERE username = ?");
    $sql->execute (array ($username));
    $result = $sql->fetch();

    //V spremenljivko result1 si zabeležim če epošta že obstaja
    $sql1 = $pdo->prepare ("SELECT * FROM users WHERE email = ?");
    $sql1->execute (array ($email));
    $result1 = $sql1->fetch();

    //Izpraznim session spremenljivko za errorje in nastavim err spremenljivko na 0
    session_start();
    $_SESSION['err'] = "";
    $error = 0;

    //Preverim če uporabniško ime že obstaja
    if ($result)
    {
        $_SESSION['err'] = "Uporabniško ime že obstaja.<br />";
        $error = 1;
    }
    //Preverim če epošta že obstaja
    if ($result1)
    {
        $_SESSION['err'] .= "Epošta že obstaja.<br />";
        $error = 1;
    }
    //Preverim če je uporabniško ime admin
    if ($username == "admin")
    {
        $_SESSION['err'] .= "Napačna izbira uporabniškega imena.<br />";
        $error = 1;
    }
    //Uporabniško ime mora biti vsaj 3 znake
    $usernamelen = strlen($username);
    if ($usernamelen < 3)
    {
        $_SESSION['err'] .= "Uporabniško ime je prekratko.<br />";
        $error = 1;
    }
    //Preverim če je geslo manjše od 8 znakov
    if (strlen ($password) < 8)
    {
        $_SESSION['err'] .= "Geslo mora biti večje od 8 znakov.<br />";
        $error = 1;
    }
    //Preverim če se geslo ujema
    if ($password != $password_check)
    {
        $_SESSION['err'] .= "Gesli se ne ujemata.";
        $error = 1;
    }

    //Preverim če ni bilo napak in ga vpišem v tabelo users
    if ($error == 0)
    {
        if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0)
        {
            $avatar_path = "../assets/avatars/";
            $target_file = $avatar_path . basename($_FILES["avatar"]["name"]);
            $ext = '.' . strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
            $profile_picture_db_path = "https://testing.aristovnik.com/hoteli/assets/avatars/" . $username . $ext;
            $uploadOk = 1;
            $check = getimagesize($_FILES["avatar"]["tmp_name"]);
            if($check !== false)
            {
                echo 'Datoteka je slika.';
                $uploadOk = 1;
            }
            else
            {
                echo 'Datoteka ni slika.';
                $uploadOk = 0;
            }
            if ($uploadOk == 1)
            {
                if (move_uploaded_file($_FILES["avatar"]["tmp_name"], $avatar_path . $username . $ext))
                {
                    echo 'Uspešno!';
                }
                else
                {
                    echo 'Neuspešno!';
                }
            }
            else
            {
                echo 'Napaka!';
            }
        }
        else
        {
            $profile_picture_db_path = 'https://testing.aristovnik.com/hoteli/assets/avatars/default/profile.png';
        }
        $pass_hash = password_hash($password, PASSWORD_DEFAULT);
        $sql2 = $pdo->prepare ("INSERT INTO users(username, email, password, avatar) VALUES (?,?,?,?)");
        try
        {
            $sql2->execute (array ($username, $email, $pass_hash, $profile_picture_db_path));
            header ("Location:../");
        }
        catch ( PDOException $err)
        {
            echo "Napaka!";
        }
    }
    //Preverim če je napaka in uporabnika pošljem nazaj na spletno stran s formo in mu izpišem napake
    else if ($error == 1)
    {
        header ("Location: ./");
    }
}
//Če podatki niso bili poslani ga preusmerim na stran s formo
else
{
    header ("Location: ./");
}
<file_sep>/index.php
<?php
$title = "Hoteli";
$css = "css/main.css";
$js = "js/main.js";
include ('x/header.php');
require ('x/dbconn.php');
//Preverim, če je uporabnik ponudnik hotelov
if ($_SESSION['editor'] == 1)
{
    //Prikažem gumb za dodajanje hotelov
    echo '<a href="iud/nov_hotel.php" class="button-standard">Nov hotel</a><br /><br />';
}
$stmt = $pdo->query ('SELECT id, name, address, date_from, date_to, filled_places, all_places, user_id, picture, city_id FROM hotels ORDER BY id');
foreach ($stmt as $row)
{
    $date_from = $row['date_from'];
    $date_to = $row['date_to'];
    $date_from = new DateTime($date_from);
    $date_to = new DateTime($date_to);
    $dateresult_from = $date_from->format("d. m. Y");
    $dateresult_to = $date_to->format("d. m. Y");

    $sql = $pdo->prepare ("SELECT name FROM cities WHERE id = ?");
    $sql->execute (array ($row['city_id']));
    $result = $sql->fetch(PDO::FETCH_ASSOC);
    $city = $result['name'];
    echo '<div class="hotel-box" id="hotel' . $row['id'] . '">
          <img class="hotel-picture" src="' . $row['picture'] . '" alt="HOTEL" height="150">
          <div class="hotel-content">
          <div class="ime-hotela">' . $row['name'] . '</div>
          <div class="naslov-hotela">' . $row['address'] . ', ' . $city . '</div>
          <div>' . $row['filled_places'] . '/' . $row['all_places'] . '</div>
          <div class="datum"><b>Od:</b> ' . $dateresult_from . ' <b>Do:</b> ' . $dateresult_to . '</div>
          </div>';

    if ($_SESSION['editor'] == 1 && $_SESSION['user_id'] == $row['user_id'])
    {
        echo '<div class="gumbi">
              <a class="button-standard" href="iud/uredi_hotel.php?y=' . $row['id'] . '">Uredi hotel</a>
              <a class="button-standard" href="iud/izbrisi_hotel.php?y=' . $row['id'] . '">Izbriši hotel</a>
              </div>';
    }
    else if ($_SESSION['editor'] == 0)
    {
        $sql = $pdo->prepare("SELECT user_id, hotel_id FROM hotel_logins WHERE user_id = ? AND hotel_id = ?");
        $sql->execute([$_SESSION['user_id'], $row['id']]);
        $result = $sql->fetch();
        if (!$result)
        {
            echo '<div class="gumbi">';
            $sql_prijava = $pdo->prepare("SELECT filled_places, all_places FROM hotels WHERE id = ?");
            $sql_prijava->execute([$row['id']]);
            $result_prijava = $sql_prijava->fetch();
            if ($result_prijava['filled_places'] != $result_prijava['all_places'])
            {
            echo '<a id="button-prijava" class="button-standard" href="prijava.php?y=' . $row['id'] . '">Prijava na hotel</a>';
            }
            echo '</div>';
        }
        else
        {
            echo '<div id="login-done">Na ta hotel ste že prijavljeni!</div><a id="button-odjava" class="button-standard" href="odjava.php?y=' . $row['id'] . '">Odjava</a>';
        }
    }
    echo '</div><br />';
}

include ('x/footer.php');
?>
<file_sep>/admin/iud/izbrisi_ponudnika.php
<?php
//Preverim če je admin prijavljen
require_once ('../../x/checkadminlogin.php');

//Zahtevam povezavo na bazo
include ('../../x/dbconn.php');

//Preverim, če so poslani podatki
if (isset ($_GET['y']))
{
    //Izbrišem vse hotele v lasti tega ponudnika
    $sql = 'DELETE FROM hotels WHERE user_id = ?';
    $pdo->prepare ($sql)->execute ([$_GET['y']]);

    //Izbrišem ponudnika iz uporabnikov
    $sql = 'DELETE FROM users WHERE id = ?';
    $pdo->prepare ($sql)->execute ([$_GET['y']]);
}
//Na koncu v vsakem primeru preusmerim na prejšnjo stran
header ('location: odstrani_ponudnika.php');
?><file_sep>/admin/iud/odstrani_ponudnika.php
<?php
//Preverim če je admin prijavljen
require_once ('../../x/checkadminlogin.php');
//Dodam header
$title = 'Admin - Odstrani Ponudnika';
$css = '../../css/main.css';
include '../../x/header.php';
?>
    <table class="table-standard">
        <thead id="table-thead">
            <td class="table-td">Epošta</td>
            <td class="table-td">Odstrani</td>
        </thead>
        <tbody>
            <?php
                //Zahtevam povezavo na bazo
                require_once ('../../x/dbconn.php');

                //Pripravim SELECT stavek
                $stmt = $pdo->query ('SELECT email, id FROM users WHERE edit_hotels = 1');

                //Zaženem foreach zanko v kateri izpišem vsakega ponudnika v svojo vrsto
                foreach ($stmt as $row)
                {
                    echo '<tr>
                          <td class="table-td">' . $row['email'] . '</td>
                          <td class="table-td"><a class="table-button" href="izbrisi_ponudnika.php?y=' . $row['id'] . '">Odstrani</a></td>
                          </tr>';
                }
            ?>
        </tbody>
    </table>
<?php
include '../../x/footer.php';
?><file_sep>/registracija/index.php
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> 
        <title>Registracija</title>
        <link rel="stylesheet" href="../css/main.css">
        <script src="../js/registracija.js"></script>
    </head>
    <body>
    <div id="login-wrapper">
            <div id="login-subwrapper">
                <form action="signup.php" method="POST" enctype="multipart/form-data">
                    <label for="email">E-pošta:</label><br /><input id="input-register-email" class="input-login-standard" type="text" name="email" placeholder="Epošta" onkeyup="checkInputOnKeyUpMail(this.value)" required><br />
                    <label for="username">Uporabniško ime:</label><br /><input id="input-register-user" class="input-login-standard" type="text" name="username" placeholder="Uporabniško ime" onkeyup="checkInputOnKeyUpUser(this.value)" required><br />
                    <label for="password">Geslo:</label><br /><input id="input-register-pass" class="input-login-standard" type="password" name="password" placeholder="<PASSWORD>" onkeyup="checkInputOnKeyUpPass(this.value)" required><br />
                    <label for="passwordcheck">Potrdite geslo:</label><br /><input id="input-register-passcheck" class="input-login-standard" type="password" name="passwordcheck" placeholder="Potrditev gesla" onkeyup="checkInputOnKeyUpPassCheck(this.value)" required><br />
                    <label for="avatar">Slika profila (ni obvezno):</label><br />
                    <input class="input-login-standard" type="file" name="avatar"><br />
                    <input id="input-register-submit" class="input-login-submit" type="submit" name="submit" value="Registracija">
                    <div class="errors" id="error-email"></div>
                    <div class="errors" id="error-user"></div>
                    <div class="errors" id="error-pass"></div>
                    <div class="errors" id="error-passcheck"></div>
                    <?php
                    //Zaženem sejo in v primeru napak le te izpišem
                    session_start();
                    if ((isset ($_SESSION['err'])) && ($_SESSION['err'] != ""))
                    {
                        echo '<div id="err">' . $_SESSION['err'] . '</div>';
                    }
                    $_SESSION['err'] = "";
                    ?>
                </form><br />
                <a href="../prijava/" class="button-standard">Prijavi se</a>
            </div>
        </div>
    </body>
</html><file_sep>/prijava.php
<?php
//Odprem sejo in dodam povezavo na bazo
session_start();
include ('x/dbconn.php');
//Dodam prijavo na hotel v podatkovno bazo
$sql = 'INSERT INTO hotel_logins(user_id, hotel_id) VALUES(?, ?)';
$stmt = $pdo->prepare ($sql)->execute ([$_SESSION['user_id'], $_GET['y']]);

$sql = 'UPDATE hotels SET filled_places = filled_places + 1 WHERE id = ?';
$stmt = $pdo->prepare ($sql)->execute ([$_GET['y']]);
header ('location:./');
?><file_sep>/iud/uredi_hotel.php
<?php
if (isset ($_POST['submit']))
{
    //Zahtevam povezavo na bazo
    include ('../x/dbconn.php');
    //Napišem in izvedem UPDATE stavek
    $sql = 'UPDATE hotels SET name = ?, address = ?, date_from = ?, date_to = ?, all_places = ?, city_id = ? WHERE id = ?';
    $stmt = $pdo->prepare ($sql)->execute ([$_POST['name'],$_POST['address'],$_POST['date_from'],$_POST['date_to'],$_POST['all_places'],$_POST['city'],$_GET['y']]);
    header ('location:../');
}
else if (isset ($_POST['submit-picture']))
{
    session_start();
    //Zahtevam povezavo na bazo
    include ('../x/dbconn.php');
    //Urejanje slike
    $username = $_SESSION['username'];
    $hotel_name = $_POST['name'];
    $picture_path = "../assets/hotels/";
    $target_file = $picture_path . basename($_FILES["picture"]["name"]);
    $ext = '.' . strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
    $newfile1 = $username . $hotel_name . $ext;
    $newfile1 = str_replace (' ', '', $newfile1);
    $picture_db_path = "https://testing.aristovnik.com/hoteli/assets/hotels/" . $newfile1;
    $uploadOk = 1;
    $check = getimagesize($_FILES["picture"]["tmp_name"]);
    if($check !== false)
    {
        echo 'Datoteka je slika.';
        $uploadOk = 1;
    }
    else
    {
        echo 'Datoteka ni slika.';
        $uploadOk = 0;
    }
    if ($uploadOk == 1)
    {
        $newfile = $picture_path . $username . $hotel_name . $ext;
        $newfile = str_replace (' ', '', $newfile);
        if (move_uploaded_file($_FILES["picture"]["tmp_name"], $newfile))
        {
            //Napišem in izvedem UPDATE stavek
            echo 'Uspešno!';
            $sql = 'UPDATE hotels SET picture = ? WHERE id = ?';
            $stmt = $pdo->prepare ($sql)->execute ([$picture_db_path, $_GET['y']]);
            header ('location:../');
            exit;
        }
        else
        {
            echo 'Neuspešno!';
        }
    }
    else
    {
            echo 'Napaka!';
    }
}
?>
<?php
$title = "Uredi hotel";
$css = "../css/main.css";
include ('../x/header.php');
?>
    <form method="post">
        <?php
        //Zahtevam povezavo na bazo
        include ('../x/dbconn.php');
        //Dobim podatke o hotelu, ki ga rabim
        $sql = $pdo->prepare ("SELECT * FROM hotels WHERE id = ?");
        $sql->execute (array ($_GET['y']));
        $result = $sql->fetch(PDO::FETCH_ASSOC);
        //Izpišem obrazec z vpisanimi podatki
        echo '<table>
        <tr><td><label for="name">Ime hotela: </label></td><td><input type="text" name="name" placeholder="Ime hotela" value="' . $result['name'] . '" class="input-standard" required></td></tr>
        <tr><td><label for="address">Naslov hotela: </label></td><td><input type="text" name="address" placeholder="Naslov hotela" value="' . $result['address'] . '" class="input-standard" required></td></tr>
        <tr><td><label for="city">Kraj hotela: </label></td><td><select name="city" class="input-standard">';
        $stmt = $pdo->query ('SELECT * FROM cities');
        foreach ($stmt as $row1)
        {
            if ($row1['id'] == $result['city_id'])
            {
                $selected = 'selected';
            }
            else
            {
                $selected = '';
            }
            echo '<option ' . $selected . ' value="' . $row1['id'] . '">' . $row1['name'] . '</option>';
        }
        $date_from = $result['date_from'];
        $date_to = $result['date_to'];
        $date_from = new DateTime($date_from);
        $date_to = new DateTime($date_to);
        $dateresult_from = $date_from->format("Y-m-d");
        $dateresult_to = $date_to->format("Y-m-d");
        echo '</select></td></tr>
        <tr><td><label for="date_from">Datum prihoda: </label></td><td><input type="date" name="date_from" value="' . $dateresult_from . '" class="input-standard" required></td></tr>
        <tr><td><label for="date_to">Datum odhoda: </label></td><td><input type="date" name="date_to" value="' . $dateresult_to . '" class="input-standard" required></td></tr>
        <tr><td><label for="all_places">Prosta mesta: </label></td><td><input type="numbers" name="all_places" value="' . $result['all_places'] . '" class="input-standard" required></td></tr>';
        ?>
    </table>
        <input class="button-standard" type="submit" name="submit" value="Uredi hotel">
    </form><br />
    <form method="post" enctype="multipart/form-data">
        <input type="hidden" name="name" value="<?php echo $result['name'] ?>">
        <label for="picture">Spremeni sliko hotela:</label><br />
        <input type="file" name="picture" class="input-standard" required><br />
        <input class="button-standard" type="submit" name="submit-picture" value="Uredi sliko hotela">
    </form>
</body>
</html><file_sep>/baza_model/script.sql
/*
Created		10. 09. 2018
Modified		10. 09. 2018
Project		
Model		
Company		
Author		
Version		
Database		mySQL 5 
*/


Create table hotels (
	id Int NOT NULL,
	city_id Int NOT NULL,
	user_id Int NOT NULL,
	name Varchar(200) NOT NULL,
	address Varchar(200) NOT NULL,
	date_from Timestamp NOT NULL,
	date_to Timestamp NOT NULL,
	insert_date Timestamp NOT NULL,
 Primary Key (id)) ENGINE = MyISAM;

Create table users (
	id Int NOT NULL,
	email Varchar(200) NOT NULL,
	username Varchar(200) NOT NULL,
	password V<PASSWORD>(200) NOT NULL,
	edit_hotels Int NOT NULL DEFAULT 0,
	avatar Varchar(200) NOT NULL,
 Primary Key (id)) ENGINE = MyISAM;

Create table admin (
	id Int NOT NULL,
	email Varchar(200) NOT NULL,
	username Varchar(200) NOT NULL,
	password Varchar(200) NOT NULL,
 Primary Key (id)) ENGINE = MyISAM;

Create table hotel_logins (
	id Int NOT NULL,
	user_id Int NOT NULL,
	hotel_id Int NOT NULL,
	login_date Timestamp NOT NULL,
 Primary Key (id)) ENGINE = MyISAM;

Create table cities (
	id Int NOT NULL,
	name Varchar(200) NOT NULL,
 Primary Key (id)) ENGINE = MyISAM;


<file_sep>/x/header.php
<?php
if (session_status() == PHP_SESSION_NONE)
{
    session_start();
}
if (!isset ($_SESSION['username']))
{
    header("location:https://testing.aristovnik.com/hoteli/prijava/");
    exit;
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> 
        <?php 
        echo '<link rel="stylesheet" href="' . $css . '">';
        echo '<script src="' . $js . '"></script>';
        echo '<title>' . $title . '</title>'; ?>
    </head>
    <body>
    <div id="header">
        <img src="<?php echo $_SESSION['avatar']; ?>" height="32" width="32" alt="PP" id="header-profile-picture"> <div id="header-username"><?php echo strtoupper($_SESSION['username']); ?></div>
        <div id="header-buttons">
            <a class="header-links" 
            <?php
            if ($_SESSION['username'] == 'admin')
            {
                echo 'href="/hoteli/admin/"';
            }
            else
            {
                echo 'href="/hoteli/"';
            }
            ?>
            >Glavna stran</a>
            <?php
            if ($_SESSION['username'] == 'admin')
            {
            }
            else
            {
                echo '<a class="header-links" href="/hoteli/nastavitve">Uredi profil</a>';
            }
            ?>
            <a class="header-links" href="/hoteli/logout.php">Odjava</a>
        </div>
    </div>
    <div id="main-wrapper">
<file_sep>/odjava.php
<?php
//Odprem sejo in dodam povezavo na bazo
session_start();
include ('x/dbconn.php');
//Izbrišem prijavo na hotel iz podatkovno bazo
$sql = 'DELETE FROM hotel_logins WHERE user_id = ? AND hotel_id = ?';
$stmt = $pdo->prepare ($sql)->execute ([$_SESSION['user_id'], $_GET['y']]);

$sql = 'UPDATE hotels SET filled_places = filled_places - 1 WHERE id = ?';
$stmt = $pdo->prepare ($sql)->execute ([$_GET['y']]);

header ('location:./');
?><file_sep>/x/checkadminlogin.php
<?php
if (session_status() == PHP_SESSION_NONE)
{
    session_start();
}
if (!isset ($_SESSION['username']) || $_SESSION['username'] != "admin")
{
    header("location:/hoteli/prijava/");
    exit;
}
else
{
    
}
?><file_sep>/prijava/index.php
<?php
session_start();
if (isset ($_SESSION['username']) && $_SESSION['username'] == "admin")
{
    header ('location:../admin/');
}
else if (isset ($_SESSION['username']))
{
    header ('location:../');
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"> 
        <title>Prijava</title>
        <link rel="stylesheet" href="../css/main.css">
        <script src="../js/prijava.js"></script>
    </head>
    <body>
        <div id="login-wrapper">
            <div id="login-subwrapper">
            <form action="checklogin.php" method="POST">
                <input id="input-prijava-email" type="text" name="email" placeholder="E-pošta" class="input-login-standard" onkeyup="checkInputOnKeyUpMail(this.value)" required><br />
                <input id="input-prijava-pass" type="<PASSWORD>" name="password" placeholder="<PASSWORD>" class="input-login-standard" onkeyup="checkInputOnKeyUpPass(this.value)" required><br />
                <input id="input-prijava-submit" type="submit" name="submit" value="Prijava" class="input-login-submit">
                <div class="errors" id="error-email"></div>
                <div class="errors" id="error-pass"></div>
                <?php
                if ((isset ($_SESSION['err'])) && ($_SESSION['err'] != ""))
                {
                    echo '<div id="err">' . $_SESSION['err'] . '</div>';
                }
                $_SESSION['err'] = "";
                ?>
            </form>
            <br />

            <?php require ('../vendor/autoload.php');
            include ('../x/dbconn.php');
            
            $g_client = new Google_Client();

            $g_client->setClientId("482990312667-lf56buca4n9gus09mj3scif7h0iqhk5i.apps.googleusercontent.com");
            $g_client->setClientSecret("-<KEY>");
            $g_client->setRedirectUri("https://testing.aristovnik.com/hoteli/prijava/index.php");
            $g_client->setScopes("email");
            
            $auth_url = $g_client->createAuthUrl();
            echo "<a href='$auth_url'><img src='../google-buttons/btn_google_signin_dark_normal_web.png'></a><br />";

            $code = isset($_GET['code']) ? $_GET['code'] : NULL;

            if(isset($code))
            {
                try
                {
                    $token = $g_client->fetchAccessTokenWithAuthCode($code);
                    $g_client->setAccessToken($token);
                }
                catch (Exception $e)
                {
                    echo $e->getMessage();
                }
                try
                {
                    $pay_load = $g_client->verifyIdToken();
                }
                catch (Exception $e)
                {
                    echo $e->getMessage();
                }
            }
            else
            {
                $pay_load = null;
            }
            if(isset($pay_load))
            {
                $sql = $pdo->prepare ('SELECT id, username, password, email, avatar FROM users WHERE email = ?');
                $sql->execute (array ($pay_load['email']));
                $result = $sql->fetch();
                if ($result)
                {
                    //Prijava
                    $hash = $result['password'];
                    $user_id = $result['id'];
                    $username = $result['username'];
                    $email = $result['email'];
                    $editor = 0;
                    $avatar = $result['avatar'];

                    if (password_verify ($pay_load['sub'], $hash))
                    {
                        $_SESSION['user_id'] = $user_id;
                        $_SESSION['username'] = $username;
                        $_SESSION['email'] = $email;
                        $_SESSION['editor'] = $editor;
                        $_SESSION['avatar'] = $avatar;
                        $_SESSION['google-user'] = 1;
                        header ('location:../');
                    }
                    else
                    {
                        echo 'Napačno geslo.';
                    }
                }
                else
                {
                    //Registracija
                    $token_hash = password_hash ($pay_load['sub'], PASSWORD_DEFAULT);
                    try
                    {
                        $sql = $pdo->prepare ('INSERT INTO users(username, email, password, edit_hotels, avatar) VALUES(?, ?, ?, ?, ?)');
                        $sql->execute (array ($pay_load['email'], $pay_load['email'], $token_hash, 0, 'https://testing.aristovnik.com/hoteli/assets/avatars/default/profile.png'));
                        
                        $sql1 = $pdo->prepare ('SELECT id, username, email, avatar FROM users WHERE email = ?');
                        $sql1->execute (array ($pay_load['email']));
                        $result1 = $sql1->fetch();
                        
                        $_SESSION['user_id'] = $result1['id'];
                        $_SESSION['username'] = $result1['username'];
                        $_SESSION['email'] = $result1['email'];
                        $_SESSION['editor'] = 0;
                        $_SESSION['avatar'] = $result1['avatar'];
                        $_SESSION['google-user'] = 1;

                        header ('location:../');
                    }
                    catch (PDOException $e)
                    {
                        echo 'Error: ' . $e->getMessage();
                    }
                }
            }
            ?>
            <br />
            <a href="../registracija/" class="button-standard">Registriraj se</a>
            </div>
        </div>
    </body>
</html>
<file_sep>/prijava/checklogin.php
<?php
//Zahtevam povezavo na bazo
require_once ('../x/dbconn.php');

//Preverim če so bili podatki poslani
if ( isset ($_POST['submit']))
{
    //Trim-am vse vrednosti, ki jih dobim iz poslanih podatkov in jih shranim v nove spremenljivke
    $email = trim ($_POST['email']);
    $password = trim ($_POST['password']);

    //V spremenljivko result si zabeležim geslo, id in uporabniško ime
    $sql = $pdo->prepare("SELECT password, id, username, edit_hotels, avatar FROM users WHERE email=?");
    $sql->execute(array($email));
    $result = $sql->fetch();

    //V spremenljivko result si zabeležim geslo, id in uporabniško ime
    $sql1 = $pdo->prepare("SELECT password, id, username FROM admin WHERE email=?");
    $sql1->execute(array($email));
    $result1 = $sql1->fetch();

    //Izpraznim session spremenljivko za errorje in nastavim err spremenljivko na 0
    session_start();
    $_SESSION['err'] = "";

    //Preverim če je epošta pravilna
    if (!$result && !$result1)
    {
        $_SESSION['err'] = "Epošta je napačna.";
        header ("Location: ./");
        exit;
    }

    //Shranim si vrednosti iz result v nove spremenljivke
    if ($result)
    {
        $hash = $result['password'];
        $user_id = $result['id'];
        $username = $result['username'];
        $editor = $result['edit_hotels'];
        $avatar = $result['avatar'];
    }
    else if ($result1)
    {
        $hash = $result1['password'];
        $user_id = $result1['id'];
        $username = $result1['username'];
    }

    //Preverim, če je geslo pravilno in si nato v sejo shranim id uporabnika, uporabniško ime in epošto
    if (password_verify ($password, $hash))
    {
        $_SESSION['user_id'] = $user_id;
        $_SESSION['username'] = $username;
        $_SESSION['email'] = $email;
        $_SESSION['editor'] = $editor;
        $_SESSION['avatar'] = $avatar;
        if ($username == "admin")
        {
            $_SESSION['admin'] = true;
            header("Location: ../admin/");
            exit;
        }
        else
        {
            header("Location: ../");
            exit;
        }
    }
    else
    {
        $_SESSION['err'] .= "Geslo je napačno.";
        header ('Location: ./');
        exit;
    }

}
//Če podatki niso bili poslani ga preusmerim na stran s formo
else
{
    header ("Location: ./");
    exit;
}
?><file_sep>/iud/izbrisi_hotel.php
<?php
include ('../x/dbconn.php');
$sql = 'DELETE FROM hotel_logins WHERE hotel_id = ?';
$stmt = $pdo->prepare ($sql)->execute ([$_GET['y']]);
$sql = 'DELETE FROM hotels WHERE id = ?';
$stmt = $pdo->prepare ($sql)->execute ([$_GET['y']]);
header ('location:../');
?><file_sep>/README.md
# Hoteli
V tej datoteki bom predstavil spletno aplikacijo te [GitHub](https://github.com) strani.
<br><br>
Ta aplikacija omogoča vnašanje hotelov in prijavo na njih.<br>
### Kazalo:
[Prijava in registracija](#prijava-in-registracija)<br>
[Administrator](#administrator)<br>
[Uporabniki](#uporabniki)<br>
[Upravljanje hotelov](#upravljanje-hotelov)<br>
[Slika baze](#slika-baze)
## Prijava in registracija
### 1. Registracija
V spletno aplikacijo se lahko prijaviš na dva načina:<br>
- preko navadne registracije na spletni strani (datoteke se nahajajo v /registracija)
- preko Google API (z svojim Google računom)
### 2. Prijava
Tako kot registracija, se lahko v to spletno aplikacijo prijavite na dva načina:<br>
- z navadno prijavo (nahaja se v /prijava)
- z Google API (ki shrani podatke, če si se že prijavil kdaj prej)

## Administrator
Administrator je v posebni tabeli in je ločen od ostalega dela podatkovne baze.<br>
Datoteke administratorske strani se nahajajo v /admin .
Funkcija administratorja je da upravlja s ponudniki hotelov.<br>
Ima pa možnost dveh funkcij:<br>
- Dodajanje ponudnikov (vpiše e-naslov in geslo)
- Brisanje ponudnikov (izbere iz seznama ponudnikov (ta funkcija izbriše tudi vse hotele tega ponudnika))

## Uporabniki
Vsi uporabniki, ko so prijavljeni, lahko spreminjajo uporabniško ime in sliko profila, in če niso prijavljeni preko Google API lahko spreminjajo tudi geslo.
### 1. Ponudniki
Ponudniki imajo tri funkcije:<br>
- Dodajanje hotelov
- Urejanje hotelov (le svojih)
- Brisanje hotelov (le svojih)
### 2. Navadni uporabniki
Navadni uporabniki so tisti, ki se registrirajo na normalen način, bodisi preko Google API ali preko /registracija .<br>
Nimajo nobenih posebnih možnosti razen:<br>
- Prijava na hotele, ki so na voljo

## Upravljanje hotelov
Pri upravljanu hotelov obstajajo tri funkcije:
- Dodajanje
- Urejanje
- Brisanje
<br>
Za dodajanje in urejanje je stvar podobna.<br>
Prikaže se nam obrazec, kjer imamo označene vse atribute, ki jih moramo vpisati, ko jih vpišemo/uredimo se to shrani v podatkovno bazo. Te funkcije pa se nahajajo v /iud . <br>

### Slika baze:

![SLIKA-BAZE](https://testing.aristovnik.com/hoteli/baza_model/baza-image.png)
