Ejemplo n.º 1
0
 public function viewNoResult()
 {
     // Filtering
     $filter_excursion = Tour::get();
     $filter_cities = City::get();
     return array('filter_excursion' => $filter_excursion, 'filter_cities' => $filter_cities);
 }
Ejemplo n.º 2
0
 function getTourObject()
 {
     $q = "select Tours.ID from Shows, Tours where Shows.date >= Tours.start_date and Shows.date <= Tours.end_date and Shows.ID = " . $this->ID;
     $r = mysql_query($q);
     if (!$r) {
         return Error::MySQL();
     }
     $row = mysql_fetch_assoc($r);
     $to = Tour::get($row['ID']);
     return $to;
 }
Ejemplo n.º 3
0
<?php

include 'base.php';
User::protect();
include_class('tours');
include_class('m2');
// type is only used on initial entry, not on an actual submit
$to = Tour::get($_GET['id']);
if (!db::isError($to)) {
    $doSubmit = false;
    if (!$_POST['area']) {
        $type = $_REQUEST['type'] == 'av' ? 'av' : 'photos';
        $ma = $type == 'av' ? $to->getAVAreaObject() : $to->getPhotoAreaObject();
    } else {
        if ($_POST['area'] == $to->getAVAreaID() || $_POST['area'] == $to->getPhotoAreaID()) {
            $doSubmit = true;
        }
    }
    if ($doSubmit) {
        $ma = MediaArea::get($_POST['area']);
        if (!db::isError($ma)) {
            if ($_POST['localfile']) {
                $res = $ma->addMediaUpload('mediafile', $to);
            } else {
                if ($_POST['url']) {
                    $res = $ma->addMediaRemote($_POST['url'], $to);
                } else {
                    if ($_POST['toAdd'] == 'all') {
                        $keepCopy = $_POST['copyFromIncoming'] ? 1 : 0;
                        $res = $ma->addAllMediaIncoming($keepCopy, $to);
                    } else {
Ejemplo n.º 4
0
<?php

require_once "util.php";
require_once "DataBase/Product.php";
require_once "DataBase/Bill.php";
require_once "DataBase/Tour.php";
require_once "DataBase/Bill_Product.php";
$tour_id = var_get("tour_id", "");
$date = var_get("date", "");
$bill = new Bill();
$bill_data = $bill->get("", array("bill_id"), "tour_id='" . $tour_id . "' AND date='" . $date . "'");
$tour = new Tour();
$tmp = $tour->get($tour_id);
$tour_data = $tmp[0];
$bill_product = new Bill_Product();
$product = new Product();
$product_data = $product->get();
include "Druckvorlagen/tour.php";
?>

Ejemplo n.º 5
0
 public function privacyAndPolicy()
 {
     if (Session::has('st_date')) {
         $st_date = Session::get('st_date');
     } else {
         $st_date = date("Y/m/d");
     }
     //Session::flush();
     if (Session::has('ed_date')) {
         $ed_date = Session::get('ed_date');
     } else {
         $ed_date = date("Y/m/d", strtotime($st_date . ' + 2 days'));
     }
     $filter_tours = Tour::get();
     $filter_cities = City::get();
     $path = array();
     //        dd(DB::getQueryLog());
     return View::make('pages.privacy_policy')->with(array('path' => $path, 'st_date' => $st_date, 'ed_date' => $ed_date, 'filter_tours' => $filter_tours, 'filter_cities' => $filter_cities));
 }
Ejemplo n.º 6
0
 function add($postArray)
 {
     $db = new db();
     if (!User::isAdmin()) {
         return Error::create("Only an administrator may add tours.");
     }
     $title = $db->sanitize_to_db($postArray['title']);
     $start_date = $db->sanitize_to_db($postArray['start_date']);
     $end_date = $db->sanitize_to_db($postArray['end_date']);
     $sd = strtotime($start_date);
     $start_date = date('Y-m-d', $sd);
     $ed = strtotime($end_date);
     $end_date = date('Y-m-d', $ed);
     $description = $db->sanitize_to_db($postArray['description']);
     if (!$title) {
         $title = '(untitled tour)';
     }
     $r = @mysql_query("insert into Tours (title, start_date, end_date, description, is_active) values ('{$title}', '{$start_date}', '{$end_date}', '{$description}','" . DEFAULT_ACTIVE . "')");
     if ($r) {
         return Tour::get(mysql_insert_id());
     } else {
         return Error::MySQL();
     }
 }
Ejemplo n.º 7
0
} elseif ($action == "search" && var_post("search_entry", "") != "") {
    $search = var_post("search_entry", "");
    $list_view = new NTKListView("list_view", array('Tournummer', 'Bezeichner'), "location.href = 'tour.php?action=edit&tour_id=%0%';");
    $list_view->addLines($tour->get('', array('tour_id', 'name'), "tour_id LIKE '%{$search}%' OR name LIKE'%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} elseif ($action == "list_tour") {
    $assistant = new Assistant();
    $tour = new Tour();
    $bill_box = new NTKHBox("bill_box", 0, 0);
    $bill_box->add(new NTKLabel("", "<b>Tournummer: " . $tour_id . " - Datum: " . $datum . "</b>"), False, False, "background-color: #dfe7f3;");
    $bill_box->add(new NTKLabel("", "Kundennummer:"), 150);
    $bill_box->add(new NTKEntry("customer_id", ""), 120);
    $bill_box->add(new NTKLabel("", "Mitarbeiter:"), 120);
    $bill_box->add(new NTKComboBox("assistant_id", $assistant->get()), 120);
    $bill_box->add(new NTKLabel("", "Tour:"), 80);
    $bill_box->add(new NTKComboBox("tour_id", $tour->get()), 120);
    $bill_box->add(new NTKButton("bill_button", "Erstelle Rechnung", "document.forms['bill_form'].submit();"), 200);
    $bill_form = new NTKForm("bill_form", "tour.php", $bill_box);
    $bill_form->addAttribute("db_action", "tour_to_bill");
    $bill_form->addAttribute("date", $datum);
    $bill_form->addAttribute("current_tour_id", $tour_id);
    $main_box->add($bill_form, 0, 0, "background-color: #dfe7f3; vertical-align: top;");
    $list_view = new NTKListView("list_view", array('Rechnungsnummer', 'Kunde'), "location.href = 'bill.php?from_page=tour&fp_tour_id={$tour_id}&fp_date=" . $datum . "&action=edit&bill_id=%0%';");
    $list_view->addLines($bill->get('', array('bill_id', 'bill.customer_id'), "bill.tour_id='{$tour_id}' AND date='" . $datum . "'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    $list_view = new NTKListView("list_view", array('Tournummer', 'Bezeichner'), "location.href = 'tour.php?action=edit&tour_id=%0%';");
    $list_view->addLines($tour->get('', array('tour_id', 'name')));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
}
// main content
Ejemplo n.º 8
0
 $bill_product = new Bill_Product();
 $bill_import = new Bill_Import();
 $bill_product_import = new Bill_Product_Import();
 $customer = new Customer();
 $tour = new Tour();
 if ($bill_import->import("mysql_import/bill.csv") == 0 && $bill_product_import->import("mysql_import/bill_product.csv") == 0) {
     /* import bills from bill_import and products from bill_product_import */
     $bills = $bill_import->get();
     for ($i = 0; $i < count($bills); $i++) {
         if (!$bill->hasTimestamp($bills[$i][6])) {
             $customer_data = $customer->get($bills[$i][1]);
             if (count($customer_data) == 0) {
                 echo "Fehler: websync.php import bills from bill_import no customer data";
                 continue;
             }
             $tour_data = $tour->get($customer_data[0][12]);
             $date = getdate(time());
             $new_bill_id = $bill->create("", array($bills[$i][1], $customer_data[0][12], $date['year'] . "-" . $date['mon'] . "-" . $date['mday'], $tour_data[0][2], -2, $bills[$i][6]));
             $bill_products = $bill_product_import->getByBillId($bills[$i][0]);
             for ($j = 0; $j < count($bill_products); $j++) {
                 $bill_product->create(array($new_bill_id, $bill_products[$j][2], $bill_products[$j][3], $bill_products[$j][4], 0, 0, 0));
             }
         }
     }
     $main_box->add($spacer, True, True, "background-color: #dfe7f3;");
     $main_box->add(new NTKLabel("", "Fertig"), False, False, "font-style: bold; background-color: #dfe7f3;");
     $main_box->add($spacer, True, True, "background-color: #dfe7f3;");
 } else {
     $main_box->add($spacer, True, True, "background-color: #dfe7f3;");
     $main_box->add(new NTKLabel("", "neue Bestellungen laden schlug fehl.<br>In ein paar Minuten nochmal versuchen."), False, False, "color: #ff0000; font-style: bold; background-color: #dfe7f3;");
     $main_box->add($spacer, True, True, "background-color: #dfe7f3;");
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Customer.php";
require_once "DataBase/Tour.php";
$customer = new Customer();
$tour = new Tour();
if (var_post("print", "") == "print") {
    $search = "";
    $tour_data = "";
    if (!var_post("tour_all", "")) {
        $search = " tour_id='" . var_post("tour", "") . "' ";
        $tour_data = $tour->get(var_post("tour", ''), array());
    }
    $customer_data = $customer->get('', array(), $search);
    include "Druckvorlagen/zeilen.php";
    include "Druckvorlagen/customer_list.php";
} else {
    $toolbar_box = new NTKVBox("toolbar_box", 0, 0, False);
    $main_box = new NTKTable("main_box", 3, 2, False);
    $main_box->setStyle("background-color: #dfe7f3;");
    $main_box->add(new NTKLabel("", "alle Touren"), 0, 0);
    $main_box->add(new NTKCheckbox("tour_all", 1, False), 0, 1);
    $main_box->add(new NTKLabel("", "aus Tour"), 1, 0);
    $main_box->add(new NTKComboBox("tour", $tour->get("")), 1, 1);
    $main_box->add(new NTKButton("submit", "Druckvorschau", "document.forms['print'].submit();"), 2, 1);
    $form = new NTKForm("print", "stat_customer_list.php", $main_box);
    $form->addAttribute("print", "print");
    $toolbar_box->add($form, 0, 0);
    echo getHead();
Ejemplo n.º 10
0
require_once "DataBase/Assistant.php";
require_once "DataBase/Bill_Product.php";
$db_action = var_get_post("db_action", "");
$tour = new Tour();
$bill = new Bill();
$assistant = new Assistant();
switch ($db_action) {
    case "new":
        $tour->create(array(var_post("name", ""), var_post("assistant_id", "")));
        break;
    case "edit":
        $tour->update(var_post("tour_id", ""), array(var_post("name", ""), var_post("assistant_id", "")));
        break;
    case "delete":
        $tour->delete(var_get("tour_id", ""));
        break;
    case "tour_to_bill":
        $tour = new Tour();
        $tmp = $tour->get(var_get("tour_id", ""));
        $tour_data = $tmp[0];
        $bill = new Bill();
        $new_bill_id = $bill->create('', array(var_post("customer_id", ""), var_post("tour_id", ""), var_post("date", ""), var_post("assistant_id", ""), -1, 0));
        $bill_product = new Bill_Product();
        $product = new Product();
        $product_data = $product->get();
        $result = $bill_product->getTourZusammenfassung(var_post("current_tour_id", ""), var_post("date", ""));
        for ($i = 0; $i < count($result); $i++) {
            $bill_product->create(array($new_bill_id, $result[$i][0], $result[$i][2], '', '', '', ''));
        }
        break;
}