private function entry($role, $customer, $start, $end)
 {
     $catalog = Catalog::create(array('title' => $role . ' - ' . $customer, 'description' => '', 'user_id' => 1, 'tags' => ''));
     Car::create(['role' => $role, 'customer' => $customer, 'start' => $start, 'end' => $end, 'main_pic' => '', 'catalog_id' => $catalog->id, 'user_id' => 1]);
 }
Пример #2
0
     break;
 }
 ob_end_flush();
 if (!strlen($_POST['type']) || $_POST['type'] == 'none') {
     Error::add('general', T_('Error: Please select a catalog type'));
 }
 if (!strlen($_POST['name'])) {
     Error::add('general', T_('Error: Name not specified'));
 }
 if (!Core::form_verify('add_catalog', 'post')) {
     UI::access_denied();
     exit;
 }
 // If an error hasn't occured
 if (!Error::occurred()) {
     $catalog_id = Catalog::create($_POST);
     if (!$catalog_id) {
         require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';
         break;
     }
     $catalog = Catalog::create_from_id($catalog_id);
     // Run our initial add
     $catalog->add_to_catalog($_POST);
     UI::show_box_top(T_('Catalog Created'), 'box box_catalog_created');
     echo "<h2>" . T_('Catalog Created') . "</h2>";
     Error::display('general');
     Error::display('catalog_add');
     UI::show_box_bottom();
     show_confirmation('', '', AmpConfig::get('web_path') . '/admin/catalog.php');
 } else {
     require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php';