public static function getInstance()
 {
     if (self::$_instance == null) {
         self::$_instance = new Kalendar();
     }
     return self::$_instance;
 }
 public function __construct()
 {
     parent::__construct();
     $this->load->model('Korisnik_model');
     $this->load->model('Sobe_model');
     $this->load->model('Vrsta_model');
     $this->load->model('Operacije_model');
     $this->load->model('Onk_model');
     $this->load->model('Djelatnik_model');
 }
Exemple #3
0
<?php

$page->addToDrobeckovaNavigace('<a href="admin.php?page=foto&id=admin.php?page=kalendar">Kalendář</a>');
$page->setTitle("Kalendář | KVH Ústí nad Labem");
$kalendarClass = new Kalendar();
$member = $profil->getMember($profil->getId());
$thisYear = date('Y');
if (isset($_GET['year']) && $_GET['year'] != '') {
    $thisYear = $_GET['year'];
}
$nextYear = $thisYear + 1;
$previousYear = $thisYear - 1;
$from = strtotime("{$thisYear}-01-01");
$to = strtotime("{$nextYear}-01-01");
$event = $kalendarClass->getAllFromTo($from, $to);
$months = array('prosinec', 'leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec');
$kalendar = (include 'views/admin/kalendar/kalendar.php');
return include 'views/admin/kalendar/basic.php';
Exemple #4
0
<?php

require_once 'includes/functions.php';
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Task Two</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="public/css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <script src="public/js/jquery.js" type="text/javascript"></script>
        <script src="public/js/custom.js" type="text/javascript"></script>
    </head>
    <body>
        <div>
            <?php 
Kalendar::getInstance();
?>
        </div>
    </body>
</html>
Exemple #5
0
<?php

if (!isset($_GET['id']) || $_GET['id'] == "") {
    return include 'controllers/admin/kalendar.php';
}
$page->addToDrobeckovaNavigace('<a href="index.php?page=kalendar">Kalendář</a>');
$kalendar = new Kalendar();
$event = $kalendar->getEvent($_GET['id']);
$page->addToDrobeckovaNavigace('<a href="index.php?page=udalost&id=' . $event['id'] . '">' . $event['title'] . '</a>');
$page->setTitle("{$event['title']} | Kalendář | KVH Ústí nad Labem");
return include 'views/kalendar/event.php';
Exemple #6
0
<?php

$member = $profil->getMember($profil->getId());
if ($member['addEvent'] != 1) {
    return include 'views/admin/kalendar/basic.php';
}
if (!isset($_GET['id']) || $_GET['id'] == "") {
    return include 'views/admin/kalendar/basic.php';
}
$kalendar = new Kalendar();
$event = $kalendar->delEvent($_GET['id']);
header('location: admin.php?page=kalendar');
Exemple #7
0
<?php

$member = $profil->getMember($profil->getId());
if ($member['addEvent'] != 1) {
    return include 'views/admin/kalendar/basic.php';
}
if (!isset($_GET['id']) || $_GET['id'] == "") {
    return include 'views/admin/kalendar/basic.php';
}
$page->addToDrobeckovaNavigace('<a href="admin.php?page=foto&id=admin.php?page=kalendar">Kalendář</a>');
$page->setTitle("Kalendář | Fotogalerie | KVH Ústí nad Labem");
$page->addScript('<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>');
$kalendar = new Kalendar();
$event = $kalendar->getEvent($_GET['id']);
if (isset($_POST['nadpis'])) {
    if ($_POST['nadpis'] && ($_POST['od'] != '' || $_POST['do'] != '')) {
        $kalendar->updateEvent($event['id'], $_POST['od'], $_POST['do'], $_POST['nadpis'], $_POST['poradatel'], $_POST['text'], $_POST['misto']);
        header('location: admin.php?page=kalendar');
    }
}
$od = date("Y-m-d", $event['from']);
if ($event['to'] == 0) {
    $do = "";
} else {
    $do = date("Y-m-d", $event['to']);
}
$nadpis = $event['title'];
$poradatel = $event['poradatel'];
$text = $event['popis'];
$misto = $event['misto'];
return include 'views/admin/kalendar/new.php';
Exemple #8
0
<?php

$member = $profil->getMember($profil->getId());
if ($member['addEvent'] != 1) {
    return include 'views/admin/kalendar/basic.php';
}
$page->addToDrobeckovaNavigace('<a href="admin.php?page=foto&id=admin.php?page=kalendar">Kalendář</a>');
$page->setTitle("Kalendář | Fotogalerie | KVH Ústí nad Labem");
$page->addScript('<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>');
$kalendar = new Kalendar();
$od = '';
$do = '';
$nadpis = '';
$poradatel = '';
$text = '';
$misto = '';
if (isset($_POST['nadpis'])) {
    if ($_POST['nadpis'] && ($_POST['od'] != '' || $_POST['do'] != '')) {
        $kalendar->saveNew($_POST['od'], $_POST['do'], $_POST['nadpis'], $_POST['poradatel'], $_POST['text'], $_POST['misto']);
        header('location: admin.php?page=kalendar');
    }
}
return include 'views/admin/kalendar/new.php';
Exemple #9
0
$CONF =& $GLOBALS["config"];
/* -- SQL připojení -- */
mysql_connect($CONF["sqlHost"], $CONF["sqlUser"], $CONF["sqlPass"]);
mysql_select_db($CONF["dbName"]);
mysql_query("SET character_set_results=utf8, character_set_connection=utf8, character_set_client=utf8");
mysql_query("SET NAMES utf8");
/*----------------------------------------------------------------------------*/
/* -- Příprava proměnných -- */
$rok = $_POST["rok"] ? $_POST["rok"] : date("Y");
$mesic = $_POST["mesic"] ? $_POST["mesic"] : date("n");
$pokoj = $_POST["pokoj"];
$minYear = $_POST["minDate"] ? date("Y", strtotime($_POST["minDate"])) : date("Y");
$minMonth = $_POST["minDate"] ? date("n", strtotime($_POST["minDate"])) : date("n");
$minDay = $_POST["minDate"] ? date("j", strtotime($_POST["minDate"])) : date("j");
/* -- Kalendář -- */
$kalendar = new Kalendar($rok, $mesic);
// Volné a Zablokované dny
for ($i = 1; $i <= cal_days_in_month(CAL_GREGORIAN, $mesic, $rok); $i++) {
    if ($i >= $minDay and $mesic == $minMonth and $rok == $minYear or $mesic > $minMonth and $rok == $minYear or $rok > $minYear) {
        $kalendar->setDenTyp($i, "volno");
    }
}
// Obsazené dny
//$dotaz = Mysql_query("SELECT * FROM $CONF[sqlPrefix]rezervRezervace WHERE pokojId=$pokoj AND (MONTH(datumStart)=$mesic OR MONTH(datumEnd)=$mesic) AND (YEAR(datumStart)=$rok OR YEAR(datumEnd)=$rok) AND potvrzeno=1 ORDER BY datumStart ASC");
$dotaz = Mysql_query("SELECT * FROM {$CONF['sqlPrefix']}rezervRezervace WHERE pokojId={$pokoj} AND (datumStart<='{$rok}-{$mesic}-31' AND datumEnd>={$rok}-{$mesic}-01) AND potvrzeno=1 ORDER BY datumStart ASC");
while ($radek = mysql_fetch_assoc($dotaz)) {
    $timeStart = strtotime($radek["datumStart"]);
    $timeEnd = strtotime($radek["datumEnd"]);
    /*If($_POST["typ"]=='prijezd') $timeEnd-= 24*60*60;
      If($_POST["typ"]=='odjezd') $timeStart+= 24*60*60;*/
    while ($timeStart <= $timeEnd) {
Exemple #10
0
<?php

require_once 'includes/functions.php';
if (isset($_GET['action'])) {
    if ($_GET['action'] == "Predhodni mesec") {
        //mesec se samjnije za jedan i iscrtava se novi
        $calenadar = Kalendar::getInstance();
        if ($_GET['month'] > 1) {
            $calenadar->month = $_GET['month'] - 1;
            $calenadar->year = $_GET['year'];
        } else {
            $calenadar->month = 12;
            $calenadar->year = $_GET['year'] - 1;
        }
        $calenadar->render();
    } elseif ($_GET['action'] == "Sledeći mesec") {
        //mesec se povećava za jedan i iscrtava se novi
        $calenadar = Kalendar::getInstance();
        if ($_GET['month'] < 12) {
            $calenadar->month = $_GET['month'] + 1;
            $calenadar->year = $_GET['year'];
        } else {
            $calenadar->month = 1;
            $calenadar->year = $_GET['year'] + 1;
        }
        $calenadar->render();
    }
}