Пример #1
0
<?php

$Manufacturers = new Manufacturers();
// ---- center ----
unset($parsed_res);
if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) {
    $manufacturer_id = $GLOBALS['REQAR'][1];
} else {
    header('Location: ' . $GLOBALS['URL_base'] . '404/');
    exit;
}
if (!$Manufacturers->SetFieldsById($manufacturer_id, 1)) {
    die('Ошибка при выборе производителя.');
}
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Производители";
$GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/manufacturers/';
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Редактирование производителя";
$tpl->Assign('h1', $GLOBALS['IERA_LINKS'][$ii]['title']);
if (isset($_POST['smb'])) {
    require_once $GLOBALS['PATH_block'] . 't_fnc.php';
    // для ф-ции проверки формы
    list($err, $errm) = Manufacturer_form_validate();
    if (!$err) {
        if ($id = $Manufacturers->UpdateManufacturer($_POST)) {
            $tpl->Assign('msg', 'Производитель обновлен.');
            unset($_POST);
            if (!$Manufacturers->SetFieldsById($manufacturer_id, 1)) {
                die('Ошибка при выборе производителя.');
            }
        } else {