Esempio n. 1
0
include_once 'classes/html.php';
include_once 'classes/database.php';
$xml = new xml_parser(getcwd() . "/bus.xml");
if (time() >= $xml->startTime() && time() <= $xml->stopTime() || $xml->debug()) {
    $form = new form($xml);
    $bus = new bus($xml, $form);
    $kiitos = null;
    //da shit starts here
    if (isset($_POST["form"])) {
        if ($bus->validatePost($_POST)) {
            $bus->newToDB();
            $kiitos = $bus->listAndBill();
        }
    }
    if ($kiitos == null) {
        top($xml->getSubject("person"));
    } else {
        top("kiitos!");
    }
    if ($kiitos == null) {
        echo '<p>' . $xml->getInfo("person") . '</p><br />';
        $count = 0;
        foreach ($bus->errors() as $error) {
            echo " - " . $error . '<br />' . "\n";
            $count++;
        }
        if ($count > 0) {
            echo '<hr />';
        }
        $bus->form($bus->keys());
        echo '<hr />';
Esempio n. 2
0
 //da shit starts here
 if (isset($_POST) && isset($_GET["category_id"])) {
     $_POST["category_id"] = $_GET["category_id"];
     if (isset($_POST["form"])) {
         if ($group->validatePost($_POST)) {
             $id = $group->newToDB();
             nextFile($id);
         }
     } elseif (isset($_POST["select"])) {
         $group_id = $group->groupID($_POST["nimi"]);
         if ($group->validateSelect($_POST, $group_id)) {
             nextFile($group_id);
         }
     }
 }
 top($xml->getSubject("group"));
 echo '<p>' . $xml->getInfo("group") . '</p><br />';
 $count = 0;
 foreach ($group->errors() as $error) {
     echo " - " . $error . '<br />' . "\n";
     $count++;
 }
 if ($count > 0) {
     echo '<hr />';
 }
 $keys = $group->keys();
 if (isset($_GET["category_id"])) {
     $keys["category"] = $_GET["category_id"];
     $group->form($keys);
     echo '<hr />' . "\n";
     $group->printGroups($_GET["category_id"]);
Esempio n. 3
0
$xml = new xml_parser();
if (time() >= $xml->startTime() && time() <= $xml->stopTime() || $xml->debug()) {
    $form = new form($xml);
    $category = new category($xml, $form);
    //da shit starts here
    if (isset($_POST["form"])) {
        //        if ($_POST["form"] == "Lähetä") {
        //            if ($category->validatePost($_POST)) {
        //                $category->newToDB();
        //            }
        //        } else
        if ($_POST["form"] == "Valitse" && isset($_POST["category_id"])) {
            header('Location: group.php?category_id=' . $_POST["category_id"], true, 303);
        }
    }
    top($xml->getSubject("category"));
    echo '<p>' . $xml->getInfo("category") . '</p><br />';
    $category->printCategorys();
    echo '<hr />';
    $category->printStats();
    //    $count = 0;
    //    foreach ($category->errors() as $error) {
    //        echo " - " . $error . '<br />' . "\n";
    //        $count++;
    //    }
    //    if ($count > 0)
    //        echo '<hr />';
    //
    //    echo '<p>Haluatko luoda uuden ryhmän?<p>';
    //    $category->form($category->keys());
} elseif (time() <= $xml->startTime()) {