Пример #1
0
                echo "true";
            } else {
                if ($row[0] == 1) {
                    echo "false";
                }
            }
        }
    }
} else {
    if ($action == "deselect") {
        if ($row[2] == 1) {
            echo "false";
        } else {
            $db->query("UPDATE Ples SET Zarezervovano=0,selTime=0 WHERE id='{$klik}'");
            echo "true";
        }
    } else {
        if ($action == "delete") {
            for ($i = 0; $i < count($sedacky); $i++) {
                if ($sedacky[$i] != "") {
                    $sedacka = $sedacky[$i];
                    $queryDel = $db->query("SELECT Validated,IP FROM Ples WHERE id='{$sedacka}'");
                    $rowDel = $queryDel->fetch_array();
                    if ($rowDel[0] == 0 && $rowDel[1] == $ip) {
                        ResetSedacky($sedacka);
                    }
                }
            }
        }
    }
}
Пример #2
0
 $vybrano = false;
 $vybraneSedacky = explode(',', $_GET['selected']);
 if (isset($_GET['selected'])) {
     for ($p = 0; $p < 308; $p++) {
         $row = $query->fetch_row();
         $id = $row[0];
         if ($row[2] == "1") {
             if ($row[5] == "1") {
                 $src = "p2";
                 $rezervace++;
             } else {
                 $src = "p4";
             }
         } else {
             if ($row[3] == "1" && intval($row[4]) + 15 < $time) {
                 ResetSedacky($id);
                 $src = "p1";
             } else {
                 if ($row[3] == "1") {
                     for ($i = 0; $i < count($vybraneSedacky); $i++) {
                         if ($vybraneSedacky[$i] != "") {
                             if ($vybraneSedacky[$i] == intval($id) && $row[6] == $ip) {
                                 $vybrano = true;
                                 break;
                             }
                         }
                     }
                     if ($vybrano) {
                         $src = "p3";
                     } else {
                         if (!$vybrano) {
Пример #3
0
<?php

require dirname(__FILENAME__) . "/db_connect.php";
$query = $db->query("SELECT id,Zarezervovano,Validated,valTime,Zaplaceno,valTime FROM Ples");
$time = time();
while ($row = $query->fetch_array()) {
    if ($row['Zarezervovano'] == 1) {
        $id = $row['id'];
        if ($row['Validated'] == 0) {
            if ($row['valTime'] + 7200 < $time) {
                ResetSedacky($row['id']);
            }
        } else {
            if ($row['Zaplaceno'] == 0) {
                if ($row['valTime'] + 3600 * 24 * 8 < $time) {
                    ResetSedacky($row['id']);
                }
            }
        }
    }
}