Ejemplo n.º 1
0
       }*/
    $template->assign("allcust", $allcust);
    $template->display("admincustomers.tpl");
} elseif ($action == "addcust") {
    if (!$userpermissions["admin"]["add"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "{$errtxt}<br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    if (!$end) {
        $end = 0;
    }
    $data = array('company' => getArrayVal($_POST, "company"), 'contact' => getArrayVal($_POST, "contact"), 'email' => getArrayVal($_POST, "email"), 'phone' => getArrayVal($_POST, "tel1"), 'mobile' => getArrayVal($_POST, "tel2"), 'url' => getArrayVal($_POST, "web"), 'address' => getArrayVal($_POST, "address"), 'zip' => getArrayVal($_POST, "zip"), 'city' => getArrayVal($_POST, "city"), 'country' => getArrayVal($_POST, "country"), 'state' => getArrayVal($_POST, "state"), 'desc' => getArrayVal($_POST, "desc"));
    $add = $companyObj->add($data);
    if ($add) {
        header("Location: admin.php?action=customers&mode=added");
    }
} elseif ($action == "assigncustomer") {
} elseif ($action == "system") {
    $classes = array("overview" => "overview", "system" => "active", "users" => "users");
    $languages_fin = array();
    foreach ($languages as $lang) {
        $fin = countLanguageStrings($lang);
        if (!empty($langfile[$lang])) {
            $lang2 = $langfile[$lang];
            $lang2 .= " (" . $fin . "%)";
            $fin = array("val" => $lang, "str" => $lang2);
        } else {
            $lang2 = $lang . " (" . $fin . "%)";
Ejemplo n.º 2
0
    require 'components/query_string_standard.php';
    require 'subclasses/company.php';
    $dbh_company = new company();
    $object_name = 'dbh_company';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        redirect("listview_company.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button', $_SERVER['PHP_SELF']);
        $message .= $dbh_company->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_company->check_uniqueness($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
        }
        if ($message == "") {
            $dbh_company->add($arr_form_data);
            redirect("listview_company.php?{$query_string}");
        }
    }
}
require 'subclasses/company_html.php';
$html = new company_html();
$html->draw_header('Add Company', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_controls('add');
$html->draw_footer();