private function load()
 {
     $sql = 'SELECT * FROM user WHERE status = 1';
     //UID is preference
     if ($this->uid > 0) {
         $sql .= ' AND uid = :uid';
     } else {
         $sql .= ' AND (email = ":email" AND password = "******")';
     }
     $db = db()->dquery($sql)->arg(':password', $this->password)->arg(':email', $this->email)->arg(':uid', $this->uid)->execute();
     $res = $db->fetch_single();
     if (!empty($res)) {
         foreach ($res as $key => $val) {
             $this->{$key} = $val;
         }
         $this->uid = (int) $this->uid;
         if (!empty($this->picture) && !is_object($this->picture)) {
             $this->picture = new File($this->picture);
         } else {
             $this->picture = new File(var_get('DEFAULT_PROFILE_PIC', ''));
         }
         if ($this->include_entities) {
             $this->load_stories();
         }
         if (is_string($this->last_location)) {
             $this->last_location = json_decode($this->last_location);
         }
         if (is_string($this->location)) {
             $this->location = new Location($this->location);
         }
     } else {
         //load failed
         $this->set_default();
     }
 }
Beispiel #2
0
function cache_key()
{
    if ($key = var_get('CACHE_KEY', false)) {
        return $key;
    } else {
        $key = md5(time());
        var_set('CACHE_KEY', $key);
        return $key;
    }
}
function return_import_options()
{
    // we are automatically grabbing database connection information
    global $db_url;
    $db = parse_url($db_url);
    $db['path'] = trim($db['path'], '\\/\\');
    // make the default mail from at info@yourdomainname.com
    $default_mail = 'info@' . $_SERVER['HOST'];
    return array('cms_prefix' => var_get('civicrm_import_import_misc_cmsprefix', 'cms_'), 'line_split' => var_get('civicrm_import_import_misc_filesplit', 5000), 'db' => array('host' => $db['host'], 'name' => $db['path'], 'user' => $db['user'], 'pass' => $db['pass']), 'email' => array('toggle' => var_get('civicrm_import_import_email_logging', 0), 'from' => var_get('site_mail', $default_mail), 'to' => var_get('civicrm_import_email_to', '*****@*****.**'), 'cc' => var_get('civicrm_import_email_cc', '*****@*****.**'), 'host' => var_get('civicrm_import_email_host', 'smtp.example.com'), 'ssl' => var_get('civicrm_import_email_ssl', 1), 'port' => var_get('civicrm_import_email_port', 465), 'user' => var_get('civicrm_import_email_user', '*****@*****.**'), 'pass' => var_get('civicrm_import_email_pass', '123456'), 'to_greeting' => 'Administrator'), 'log' => array('logging' => var_get('civicrm_import_logging_toggle', 1) == 1 ? TRUE : FALSE, 'path' => var_get('civicrm_import_logging_path', 'path/to/log/files')));
}
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Category.php";
$db_action = var_get_post("db_action", "");
$category = new Category();
switch ($db_action) {
    case "new":
        $category->create(array(var_post("category_id", ""), var_post("name", ""), var_post("details", "")));
        break;
    case "edit":
        $category->update(var_post("category_id", ""), array(var_post("name", ""), var_post("details", "")));
        break;
    case "delete":
        $category->delete(var_get("category_id", ""));
        break;
}
 private function compile_js()
 {
     $this->js_complied = '';
     $js = '';
     foreach ($this->js as $file) {
         if (beginsWith($file, 'http://') || beginsWith($file, 'https://')) {
             $js .= file_get_contents($file);
         } else {
             $file = cwd() . $file;
             if (file_exists($file)) {
                 $js .= file_get_contents($file);
             }
         }
     }
     $id = md5($js) . '_' . var_get('CACHE_KEY', md5(time()));
     $path = UPLOAD_PATH . '/js/' . $id . '.js';
     if (!file_exists($path)) {
         file_put_contents($path, $js);
     }
     $this->js_complied = "\t" . '<script src="' . get_url('/' . $path) . '"></script>' . "\n";
 }
Beispiel #6
0
/**
 * @Implement of framework_element_x()
 */
function framework_element_dd_get_menu($menus = NULL, $first = true)
{
    if (!isset($menus)) {
        $menus = array();
        module_alter_all('site_menu', $menus);
        $class = 'site_menu nav navbar-nav';
    } else {
        $class = 'site_menu_children dropdown-menu';
    }
    if ($menus) {
        static $i;
        if (!empty($first)) {
            $custom_data = var_get('site_menu_system', array());
        }
        foreach ($menus as $key => $lists) {
            if (!empty($first)) {
                // 已禁用的导航
                if (!empty($custom_data['disabled']) && isset($custom_data['disabled'][$key])) {
                    continue;
                }
                // 可通过 hook_site_menu_alter() 覆写 menu
                module_alter_all('site_menu_alter', $key, $lists);
                // 自定义权重
                if (!empty($custom_data['weight']) && !empty($custom_data['weight'][$key])) {
                    if (is_array($lists)) {
                        $lists['#weight'] = $custom_data['weight'][$key];
                    } else {
                        $lists = array('#data' => $lists, '#weight' => $custom_data['weight'][$key]);
                    }
                }
            }
            if (is_array($lists)) {
                if ($lists['#data']) {
                    $data = '';
                    $data .= $lists['#data'];
                    if ($lists['#childrens']) {
                        $data .= framework_element_dd_get_menu($lists['#childrens'], 0);
                    }
                    $items[] = array('#data' => array('data' => $data, 'class' => 'site_menu_list site_menu_list_' . $key), '#weight' => $lists['#weight'] ? $lists['#weight'] : $weight);
                } else {
                    if (!$lists['#childrens']) {
                        foreach ($lists as $k => $child) {
                            if (is_array($child)) {
                                if ($child['#data']) {
                                    $data = '';
                                    $data .= $child['#data'];
                                    if ($child['#childrens']) {
                                        $data .= framework_element_dd_get_menu($child['#childrens'], 0);
                                    }
                                    $items[] = array('#data' => array('data' => $data, 'class' => 'site_menu_list site_menu_list_' . $k), '#weight' => $child['#weight'] ? $child['#weight'] : $weight);
                                }
                            } else {
                                $items[] = array('#data' => array('data' => $child, 'class' => 'site_menu_list site_menu_list_' . $k), '#weight' => $i);
                            }
                            ++$i;
                        }
                    }
                }
            } else {
                $items[] = array('#data' => array('data' => $lists, 'class' => 'site_menu_list site_menu_list_' . $key), '#weight' => $i);
            }
            ++$i;
        }
        if ($items) {
            uasort($items, 'dd_form_cmp');
            $j = 1;
            foreach ($items as $d) {
                if (!empty($first)) {
                    $d['#data']['class'] .= ' site_menu_list_index_' . $j;
                } else {
                    $d['#data']['class'] .= ' site_menu_list_index_sub_' . $j;
                }
                $item[] = $d['#data'];
                $j++;
            }
            $output = theme('item_list', $item, NULL, 'ul', array('class' => $class), 0);
        }
        return $output;
    }
}
Beispiel #7
0
function status($status)
{
    if (cgi()) {
        return header("Status: {$status}");
    } else {
        $protocol = var_isset('SERVER', 'SERVER_PROTOCOL') ? var_get('SERVER', 'SERVER_PROTOCOL') : 'HTTP/1.1';
        return header("{$protocol} {$status}");
    }
}
require_once "DataBase/Price.php";
$db_action = var_get_post("db_action", "");
$product = new Product();
$tax = new Tax();
$category = new Category();
$priceset = new Priceset();
$price = new Price();
$group = new Group();
switch ($db_action) {
    case "new":
        $product->create(var_post("product_id", ""), array(var_post("name", ""), var_post("details", ""), var_post("category_id", ""), var_post("tax_id", ""), var_post("available", ""), var_post("group_id", ""), var_post("order_number", ""), var_post("anmerkung", "")));
        $priceset_list = $priceset->get();
        for ($i = 0; $i < count($priceset_list); $i++) {
            $price->create(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
        }
        break;
    case "edit":
        $product->update(var_post("product_id", ""), array(var_post("name", ""), var_post("details", ""), var_post("category_id", ""), var_post("tax_id", ""), var_post("available", ""), var_post("group_id", ""), var_post("order_number", ""), var_post("anmerkung", "")));
        $priceset_list = $priceset->get();
        for ($i = 0; $i < count($priceset_list); $i++) {
            if ($price->exists(var_post("priceset_id_" . $i, ""), var_post("product_id", ""))) {
                $price->update(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
            } else {
                $price->create(var_post("priceset_id_" . $i, ""), var_post("product_id", ""), array(var_post("priceset_price_" . $i, "")));
            }
        }
        break;
    case "delete":
        $product->delete(var_get("product_id", ""));
        break;
}
    case "delete":
        $bill->delete(var_get("bill_id", ""));
        if ($fp_tour_id != "") {
            $onload .= "location.href = 'tour.php?action=list_tour&tour_id=" . $fp_tour_id . "&date=" . $fp_date . "';";
        }
        break;
    case "position_add":
        $bill_data = $bill->get(var_post("bill_id", ""));
        /* autoset anmerkung vom produkt, wenn nichts als anmerkung gegeben */
        $details = var_post("details", "");
        if ($details == "") {
            $product_data = $product->get(var_post("product_id", ""));
            $details = $product_data[0][8];
        }
        if ($bill_data[0][5] == -1) {
            $bill_product->create(array(var_post("bill_id", ""), var_post("product_id", ""), var_post("amount", ""), $details, var_post("rabatt", ""), 0, 0));
        } else {
            $customer_data = $customer->get($bill_data[0][1]);
            $price_data = $price->getPrice($customer_data[0][11], var_post("product_id", ""));
            $product_data = $product->get(var_post("product_id", ""));
            $tax_data = $tax->get($product_data[0][4]);
            $bill_product->create(array(var_post("bill_id", ""), var_post("product_id", ""), var_post("amount", ""), $details, var_post("rabatt", ""), $price_data[0][3], $tax_data[0][2]));
        }
        break;
    case "position_delete":
        $bill_product->delete(var_get("bill_product_id", ""));
        break;
    case "position_edit":
        $bill_product->update(var_post("bill_product_id", ""), array(var_post("bill_id", ""), var_post("product_id", ""), var_post("amount", ""), var_post("details", ""), var_post("rabatt", ""), var_post("price", ""), var_post("tax", "")));
        break;
}
Beispiel #10
0
 * cron 并不会泄露安全信息,故而这仅是一个很简单的验证
 */
if ($pass = var_get('cron_pass', false)) {
    if (!$_GET['pass'] || $_GET['pass'] != md5($pass)) {
        echo 'byebye';
        exit;
    }
}
// 获得上一次执行时间
$timestamp = var_get('cron_last_time', 0);
/**
 * 获得最小执行时间,默认为 3600 秒,防止频繁执行
 * $user->uid == 1 时,手动执行不受此限制
 */
if ($GLOBALS['user']->uid != 1) {
    $time_min = var_get('cron_min_time', 3600);
    if ($time_min && $timestamp > $_SERVER['REQUEST_TIME'] - $time_min) {
        echo 'byebye';
        exit;
    }
}
set_time_limit(600);
// 读取任务列表,每次最多 100 条
if ($fetch = db_query('SELECT * FROM {cron} WHERE status = 0 
ORDER BY weight ASC, cid ASC', NULL, array('limit' => 100))) {
    foreach ($fetch as $o) {
        if (!$o->data) {
            continue;
        }
        $data = unserialize($o->data);
        if ($data['includes']) {
<?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";
?>

<?php

require_once "util.php";
$group = new Group();
if ($action == "new") {
    $group->create(var_post("group_id", ""), array(var_post("group_name", "")));
} elseif ($action == "edit") {
    $group->update(var_post("group_id", ""), array(var_post("group_name", "")));
} elseif ($action == "delete") {
    $group->delete(var_get("group_id", ""));
}
$group_box = new NTKVBox("group_box", 0, 0, False);
$label = new NTKLabel("group_label", "<h3>Gruppen</h3>");
$group_box->add($label);
$group_list = $group->get('');
for ($i = 0; $i < count($group_list); $i++) {
    $group_box->add(new NTKEGroup($group_list[$i][0], $group_list[$i][1]));
}
$label = new NTKLabel("group_label", "<h4>neue Gruppe</h4>");
$group_box->add($label);
$group_box->add(new NTKEGroup("", "", True), -1);
$main_box->add($group_box, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
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;
}
Beispiel #14
0
<?php

$vm = proxmox_vm_info(var_get('vmid'), var_get('instance'));
$graphs = array('proxmox_traffic' => 'Traffic');
foreach ($vm['ports'] as $port) {
    foreach ($graphs as $key => $text) {
        $graph_type = 'proxmox_traffic';
        $graph_array['height'] = '100';
        $graph_array['width'] = '215';
        $graph_array['to'] = $config['time']['now'];
        $graph_array['id'] = $vm['app_id'];
        $graph_array['device_id'] = $vm['device_id'];
        $graph_array['type'] = 'application_' . $key;
        $graph_array['port'] = $port['port'];
        $graph_array['vmid'] = $vm['vmid'];
        $graph_array['cluster'] = $vm['cluster'];
        $graph_array['hostname'] = $vm['description'];
        echo '<h3>' . $text . ' ' . $port['port'] . '@' . $vm['description'] . '</h3>';
        echo "<tr bgcolor='{$row_colour}'><td colspan=5>";
        include 'includes/print-graphrow.inc.php';
        echo '</td></tr>';
    }
}
<?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;
}
<?php 
include "Modules/Category/db_action.php";
$main_box = new NTKVBox("main_box", 0, 0, False);
// Toolbar
$page = "category";
$printfile = "";
include "Modules/toolbar.php";
// small Toolbar
include "Modules/Category/toolbar.php";
// main content
$action = var_get_post("action", "");
$onload .= "document.getElementById('search_entry').focus();";
if ($action == "new") {
    include "Modules/Category/new_form.php";
} elseif ($action == "edit" && var_get("category_id", "") != "") {
    $data = $category->get(var_get("category_id", ""));
    include "Modules/Category/edit_form.php";
} elseif ($action == "search" && var_post("search_entry", "") != "") {
    $search = var_post("search_entry", "");
    $list_view = new NTKListView("list_view", array('Kategorienummer', 'Bezeichnung', 'Beschreibung'), "location.href = 'category.php?action=edit&category_id=%0%';");
    $list_view->addLines($category->get('', array('category_id', 'name', 'details'), "category_id LIKE '%{$search}%' OR name LIKE'%{$search}%' OR details LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    $list_view = new NTKListView("list_view", array('Kategorienummer', 'Bezeichnung', 'Beschreibung'), "location.href = 'category.php?action=edit&category_id=%0%';");
    $list_view->addLines($category->get('', array('category_id', 'name', 'details')));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
}
// main content
$main_box->add($spacer, -1, -1, "background-color:\t#dfe7f3;");
echo getHead();
echo $main_box->getHtml();
<?php

require_once "util.php";
$priceset = new Priceset();
if ($action == "new") {
    $priceset->create(var_post("priceset_id", ""), array(var_post("priceset_name", ""), var_post("priceset_netto", "")));
} elseif ($action == "edit") {
    $priceset->update(var_post("priceset_id", ""), array(var_post("priceset_name", ""), var_post("priceset_netto", "")));
} elseif ($action == "delete") {
    $priceset->delete(var_get("priceset_id", ""));
}
$priceset_box = new NTKVBox("priceset_box", 0, 1, False);
$label = new NTKLabel("priceset_label", "<h3>Preiss&auml;tze</h3>");
$priceset_box->add($label);
$priceset_list = $priceset->get('');
for ($i = 0; $i < count($priceset_list); $i++) {
    $priceset_box->add(new NTKEPriceset($priceset_list[$i][0], $priceset_list[$i][1], $priceset_list[$i][2]));
}
$label = new NTKLabel("priceset_label", "<h4>neuer Preissatz</h4>");
$priceset_box->add($label);
$priceset_box->add(new NTKEPriceset("", "", 1, True), -1);
$main_box->add($priceset_box, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
Beispiel #18
0
<?php

require_once "util.php";
$tax = new Tax();
if ($action == "new") {
    $tax->create(var_post("tax_id", ""), array(var_post("tax_name", ""), var_post("tax_rate", "")));
} elseif ($action == "edit") {
    $tax->update(var_post("tax_id", ""), array(var_post("tax_name", ""), var_post("tax_rate", "")));
} elseif ($action == "delete") {
    $tax->delete(var_get("tax_id", ""));
}
$tax_box = new NTKVBox("tax_box", 0, 0, False);
$label = new NTKLabel("tax_label", "<h3>Steuers&auml;tze</h3>");
$tax_box->add($label);
$taxlist = $tax->get('');
for ($i = 0; $i < count($taxlist); $i++) {
    $tax_box->add(new NTKETax($taxlist[$i][0], $taxlist[$i][1], $taxlist[$i][2]));
}
$label = new NTKLabel("tax_label", "<h4>neuer Steuersatz</h4>");
$tax_box->add($label);
$tax_box->add(new NTKETax("", "", "", True), -1);
$main_box->add($tax_box, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
<head>
	<title> Index </title>

<?php 
include "Modules/Customer/db_action.php";
$main_box = new NTKVBox("main_box", 0, 0, False);
// Toolbar
$page = "customer";
$printfile = "";
include "Modules/toolbar.php";
// small Toolbar
include "Modules/Customer/toolbar.php";
// main content
$action = var_get_post("action", "");
$search = var_post("search_entry", "");
$customer_id = var_get("customer_id", "");
$onload .= "document.getElementById('search_entry').focus();";
if ($action == "new") {
    include "Modules/Customer/new_form.php";
} elseif ($action == "edit" && $customer_id != "") {
    $data = $customer->get($customer_id);
    include "Modules/Customer/edit_form.php";
} elseif ($action == "search" && $search != "") {
    $list_view = new NTKListView("list_view", array('Kundennummer', 'Name', 'Details'), "location.href = 'customer.php?action=edit&customer_id=%0%';");
    $results = $customer->get('', array('customer_id', 'prename', 'postname'), "customer_id LIKE '%{$search}%' OR prename LIKE'%{$search}%' OR postname LIKE '%{$search}%'");
    if (count($results) == 1) {
        $onload = "location.href = 'customer.php?action=edit&customer_id=" . $results[0][0] . "';";
    }
    $list_view->addLines($results);
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Customer.php";
?>

<html>
<head>
	<title> Index </title>
	
<?php 
echo getHead();
$search = var_get("search", "");
if (strlen($search) >= 3) {
    $customer = new Customer();
    $main_box = new NTKVBox("main_box", 0, 0, False);
    $list_view = new NTKListView("list_view", array('Kundennummer', 'Vorname', 'Nachname'), "parent.frames['main'].document." . var_get("form", "") . "." . var_get("entry", "") . ".value = '%0%';parent.frames['main'].document." . var_get("form", "") . "." . var_get("next", "") . ".focus();");
    $list_view->addLines($customer->get('', array('customer_id', 'prename', 'postname'), "customer_id LIKE '%{$search}%' OR prename LIKE'%{$search}%' OR postname LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
    echo $main_box->getHtml();
}
?>

</body>
</html>
Beispiel #21
0
 * as published by the Free Software Foundation; version 2 dated June,
 * 1991.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * See http://www.gnu.org/licenses/gpl.txt for the full license
 */
include 'includes/application/proxmox.inc.php';
if (!isset($config['enable_proxmox']) || !$config['enable_proxmox']) {
    print_error('Proxmox agent was discovered on this host. Please enable Proxmox in your config.');
} else {
    $graphs = array('proxmox_traffic' => 'Traffic');
    foreach (proxmox_node_vms(var_get('device')) as $nvm) {
        $vm = proxmox_vm_info($nvm['vmid'], $nvm['cluster']);
        foreach ($vm['ports'] as $port) {
            foreach ($graphs as $key => $text) {
                $graph_type = 'proxmox_traffic';
                $graph_array['height'] = '100';
                $graph_array['width'] = '215';
                $graph_array['to'] = $config['time']['now'];
                $graph_array['id'] = $vm['app_id'];
                $graph_array['device_id'] = $vm['device_id'];
                $graph_array['type'] = 'application_' . $key;
                $graph_array['port'] = $port['port'];
                $graph_array['vmid'] = $vm['vmid'];
                $graph_array['cluster'] = $vm['cluster'];
                $graph_array['hostname'] = $vm['description'];
                echo '<h3>' . $text . ' ' . $port['port'] . '@' . $vm['description'] . '</h3>';
<head>
	<title> Index </title>
	
<?php 
include "Modules/Assistant/db_action.php";
$main_box = new NTKVBox("main_box", 0, 0, False);
// Toolbar
$page = "assistant";
$printfile = "";
include "Modules/toolbar.php";
// small Toolbar
include "Modules/Assistant/toolbar.php";
// main content
$action = var_get_post("action", "");
$search = var_post("search_entry", "");
$assistant_id = var_get("assistant_id", "");
if ($action == "new") {
    include "Modules/Assistant/new_form.php";
} elseif ($action == "edit" && $assistant_id != "") {
    $data = $assistant->get($assistant_id);
    include "Modules/Assistant/edit_form.php";
} elseif ($action == "search" && $search != "") {
    $list_view = new NTKListView("list_view", array('Mitarbeiternummer', 'Vorname', 'Nachname'), "location.href = 'assistant.php?action=edit&assistant_id=%0%';");
    $list_view->addLines($assistant->get('', array('assistant_id', 'prename', 'postname'), "assistant_id LIKE '%{$search}%' OR prename LIKE'%{$search}%' OR postname LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
} else {
    $list_view = new NTKListView("list_view", array('Mitarbeiternummer', 'Vorname', 'Nachname'), "location.href = 'assistant.php?action=edit&assistant_id=%0%';");
    $list_view->addLines($assistant->get('', array('assistant_id', 'prename', 'postname')));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
}
echo getHead();
<?php

require_once "util.php";
require_once "NTK/NTK.php";
require_once "DataBase/Product.php";
?>

<html>
<head>
	<title> Index </title>
	
<?php 
echo getHead();
$search = var_get("search", "");
if (strlen($search) >= 3) {
    $product = new Product();
    $main_box = new NTKVBox("main_box", 0, 0, False);
    $list_view = new NTKListView("list_view", array('Produktnummer', 'Name', 'Beschreibung'), "parent.frames['main'].document." . var_get("form", "") . "." . var_get("entry", "") . ".value = '%0%';parent.frames['main'].document." . var_get("form", "") . "." . var_get("next", "") . ".focus();");
    $list_view->addLines($product->get('', array('product_id', 'name', 'details'), " product_id LIKE '%{$search}%' OR name LIKE'%{$search}%' OR details LIKE '%{$search}%'"));
    $main_box->add($list_view, -1, -1, "background-color: #dfe7f3; vertical-align: top;");
    echo $main_box->getHtml();
}
?>

</body>
</html>
Beispiel #24
0
    if (var_eq('instance', $pmxc['app_instance']) || !isset($vars['instance']) && !isset($sep)) {
        echo "<span class='pagemenu-selected'>";
    }
    echo generate_link(nicecase($pmxc['app_instance']), array('page' => 'apps', 'app' => 'proxmox', 'instance' => $pmxc['app_instance']));
    if (var_eq('instance', $pmxc['app_instance'])) {
        echo '</span>';
    }
    $sep = ' | ';
}
print_optionbar_end();
$pagetitle[] = 'Proxmox';
$pagetitle[] = $instance;
if (!isset($vars['instance'])) {
    $instance = $pmxcl[0]['app_instance'];
} else {
    $instance = var_get('instance');
}
if (isset($vars['vmid'])) {
    include "pages/apps/proxmox/vm.inc.php";
    $pagetitle[] = $vars['vmid'];
} else {
    echo '
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <div class="row">';
    foreach (proxmox_cluster_vms($instance) as $pmxvm) {
        echo '
                <div class="col-sm-4 col-md-3 col-lg-2">' . generate_link($pmxvm['vmid'] . " (" . $pmxvm['description'] . ")", array('page' => 'apps', 'app' => 'proxmox', 'instance' => $instance, 'vmid' => $pmxvm['vmid'])) . '</div>';
    }
    echo '
<?php

require_once "util.php";
require_once "DataBase/Customer.php";
require_once "DataBase/Tour.php";
require_once "DataBase/Priceset.php";
$db_action = var_get_post("db_action", "");
$customer = new Customer();
$tour = new Tour();
$priceset = new Priceset();
switch ($db_action) {
    case "new":
        $customer->create(var_post("customer_number", ""), array(var_post("password", ""), 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("pricelist_id", ""), var_post("tour_id", ""), var_post("rabatt", ""), var_post("details", ""), var_post("bank_name", ""), var_post("bank_account", ""), var_post("blz", "")));
        break;
    case "edit":
        $customer->update(var_post("customer_number", ""), array(var_post("password", ""), 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("pricelist_id", ""), var_post("tour_id", ""), var_post("rabatt", ""), var_post("details", ""), var_post("bank_name", ""), var_post("bank_account", ""), var_post("blz", "")));
        break;
    case "delete":
        $customer->delete(var_get("customer_id", ""));
        break;
}