Ejemplo n.º 1
0
 /**
  * Assistant constructor.
  */
 public function __construct()
 {
     if (Assistant::$idCounter === null) {
         $this->id = 1;
         Assistant::$idCounter = 1;
     } else {
         $this->id = ++Assistant::$idCounter;
     }
     $this->group = null;
     $this->preferredGroup = null;
     $this->doublePosition = false;
     $this->availability = array();
 }
Ejemplo n.º 2
0
 /**
  * @return Users
  */
 public function getAssistants()
 {
     global $db;
     $time = time();
     $users = array();
     $query = "SELECT b.*, a.*\n                    FROM `permissions` AS a\n                    LEFT JOIN `" . AUTH_DATABASE . "`.`user_data` AS b\n                    ON b.`id` = a.`assigned_to`\n                    WHERE a.`assigned_by`=?\n                    AND (a.`valid_from` = '0' OR a.`valid_from` <= ?) AND (a.`valid_until` = '0' OR a.`valid_until` > ?)\n                    ORDER BY `valid_until` ASC";
     $results = $db->GetAll($query, array($this->getID(), $time, $time));
     if ($results) {
         foreach ($results as $result) {
             $user = Assistant::fromArray($result);
             $users[] = $user;
         }
     }
     return new Users($users);
 }
Ejemplo n.º 3
0
include "Modules/toolbar.php";
// small Toolbar
include "Modules/Tour/toolbar.php";
// main content
if ($action == "new") {
    include "Modules/Tour/new_form.php";
} elseif ($action == "edit" && $tour_id != "") {
    $data = $tour->get($tour_id);
    include "Modules/Tour/edit_form.php";
} 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;");
Ejemplo n.º 4
0
require_once "DataBase/Bill.php";
require_once "DataBase/Assistant.php";
require_once "DataBase/Customer.php";
require_once "DataBase/Product.php";
require_once "DataBase/Bill_Product.php";
require_once "DataBase/Price.php";
require_once "DataBase/Priceset.php";
require_once "DataBase/Tax.php";
$bill_id = var_get_post("bill_id", "");
$bill = new Bill();
$tmp = $bill->get($bill_id);
$bill_data = $tmp[0];
$customer = new Customer();
$tmp = $customer->get($bill_data[1]);
$customer_data = $tmp[0];
$assistant = new Assistant();
$tmp = $assistant->get($bill_data[4]);
$assistant_data = $tmp[0];
$priceset = new Priceset();
$tmp = $priceset->get($customer_data[11]);
$priceset_data = $tmp[0];
$bill_product = new Bill_Product();
$bill_product_data = $bill_product->getByBillId($bill_id);
$product = new Product();
$price = new Price();
$tax = new Tax();
include "Druckvorlagen/zeilen.php";
include "Druckvorlagen/rechnung.php";
?>

Ejemplo n.º 5
0
require_once "DataBase/Product.php";
require_once "DataBase/Group.php";
require_once "DataBase/Priceset.php";
require_once "DataBase/Price.php";
require_once "DataBase/Category.php";
require_once "DataBase/Tax.php";
require_once "DataBase/Assistant.php";
require_once "DataBase/Bill.php";
require_once "DataBase/Bill_Product.php";
$group = new Group();
$priceset = new Priceset();
$category = new Category();
$product = new Product();
$price = new Price();
$tax = new Tax();
$assistant = new Assistant();
$bill = new Bill();
$var_print = var_post("print", "");
$var_group_all = var_post("group_all", "");
$var_group = var_post("group", "");
$var_category_all = var_post("category_all", "");
$var_category = var_post("category", "");
$var_available = var_post("available", "");
$var_not_available = var_post("not_available", "");
$var_product_id_from = var_post("product_id_from", "");
$var_product_id_to = var_post("product_id_to", "");
$var_assistant = var_post("assistant", "");
$var_priceset = var_post("priceset", "");
$var_product_id = var_post("product_id", "");
$var_date_from = var_post("date_from", "");
$var_date_to = var_post("date_to", "");
Ejemplo n.º 6
0
 /**
  * @param Assistant $assistant
  * @param School $school
  * @param int $group
  * @param string $day
  */
 public function assignAssistantToSchool($assistant, $school, $group, $day)
 {
     $assistant->assignToSchool($school, $group, $day);
     $school->addAssistant($group, $day);
 }
Ejemplo n.º 7
0
<?php

require_once "util.php";
require_once "DataBase/Assistant.php";
$db_action = var_get_post("db_action", "");
$assistant = new Assistant();
switch ($db_action) {
    case "new":
        $assistant->create(var_post("assistant_id", ""), array(var_post("prename", ""), var_post("postname", ""), var_post("street", ""), var_post("streetnumber", ""), var_post("plz", ""), var_post("city", ""), var_post("telephone", ""), var_post("telefax", ""), var_post("email", ""), var_post("tax_number", ""), var_post("blz", ""), var_post("bank_account", ""), var_post("additional", ""), var_post("utax_id", ""), var_post("bank_name", ""), var_post("bill_ext", "")));
        break;
    case "edit":
        $assistant->update(var_post("assistant_id", ""), array(var_post("prename", ""), var_post("postname", ""), var_post("street", ""), var_post("streetnumber", ""), var_post("plz", ""), var_post("city", ""), var_post("telephone", ""), var_post("telefax", ""), var_post("email", ""), var_post("tax_number", ""), var_post("blz", ""), var_post("bank_account", ""), var_post("additional", ""), var_post("utax_id", ""), var_post("bank_name", ""), var_post("bill_ext", "")));
        break;
    case "delete":
        $assistant->delete(var_get("assistant_id", ""));
        break;
}