Exemple #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $sections = [130 => 'Велосипеды шоссе', 131 => 'Велосипеды МТБ', 128 => 'Рамы шоссе', 129 => 'Рамы МТБ', 95 => 'Услуги', 60 => 'Колёса', 61 => 'Вилки и амортизаторы', 62 => 'Сидим и рулим', 63 => 'Крутим', 64 => 'Переключаем', 65 => 'Тормозим', 66 => 'Одежда, обувь и защита', 73 => 'Туристическое снаряжение', 80 => 'Свет и электричество', 70 => 'Aксессуары', 87 => 'Не велосипедное', 69 => 'Меняю', 81 => 'Подарю!', 72 => 'Украли!'];
     foreach ($sections as $id => $title) {
         Section::create(['id' => $id, 'title' => $title]);
     }
 }
 protected static function newSection($id, $name, $items)
 {
     $section = Section::create(['cv_id' => $id, 'name' => $name]);
     foreach ($items as $item) {
         $item = (object) $item;
         static::newItem($section->id, $item->name, $item->headers, $item->entries);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param Requests\CreateEditSectionsRequest $request
  * @param StoreFile $storeFile
  * @param \App\Section $section
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(Requests\Sections\CreateSectionRequest $request, StoreFile $storeFile, \App\Section $section)
 {
     $image_path = $storeFile->move($request->file('image'), 'images/sections/', 16);
     $modified_request = array_merge($request->all(), ['image' => $image_path]);
     $section->create($modified_request);
     //Redirect
     return redirect()->action('Panel\\SectionsController@index');
 }
Exemple #4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('sections')->truncate();
     Section::create(['name' => 'Saint Paul']);
     Section::create(['name' => 'Saint Francis']);
     Section::create(['name' => 'Saint Therese']);
     Section::create(['name' => 'Saint John']);
     Section::create(['name' => 'Saint Peter']);
     Section::create(['name' => 'Saint Luke']);
 }
 public function createSection(Request $request)
 {
     $section['name'] = $request->input('name');
     $section['description'] = $request->input('description');
     try {
         $result = Section::create($section);
     } catch (\Exception $e) {
         return response()->json(['error' => ['message' => 'Could not save cancer type' . $e->getMessage(), 'code' => 101]]);
     }
     return response()->json(['section' => $result]);
 }
Exemple #6
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Section::create(['description' => 'Saint Francis']);
     Section::create(['description' => 'Saint Paul']);
     Section::create(['description' => 'Saint Therese']);
     Section::create(['description' => 'Saint John']);
     Section::create(['description' => 'Saint Peter']);
     Section::create(['description' => 'Saint Luke']);
     factory(App\User::class)->create(['email' => '*****@*****.**']);
     factory(App\User::class, 10)->create();
     factory(App\Student::class, 180)->create();
 }
 public function run()
 {
     DB::table('sections')->delete();
     Section::create(['crn' => 124578, 'course_id' => 1, 'instructor' => "Kamal", 'time' => "1:00 pm - 4:00 pm", 'days' => "M", 'time_code' => 2, 'capacity' => 30, 'description' => "Course 1 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 789456, 'course_id' => 1, 'instructor' => "Faja", 'time' => "1:00 pm - 4:00 pm", 'days' => "T", 'time_code' => 2, 'capacity' => 30, 'description' => "Course 1 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 456785, 'course_id' => 1, 'instructor' => "Narsimham", 'time' => "1:00 pm - 4:00 pm", 'days' => "W", 'time_code' => 2, 'capacity' => 30, 'description' => "Course 1 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 415263, 'course_id' => 2, 'instructor' => "Sam", 'time' => "1:00 pm - 4:00 pm", 'days' => "W", 'time_code' => 2, 'capacity' => 30, 'description' => "Course 2 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 458741, 'course_id' => 2, 'instructor' => "Blake", 'time' => "6:00 pm - 9:00 pm", 'days' => "F", 'time_code' => 3, 'capacity' => 30, 'description' => "Course 2 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 968574, 'course_id' => 2, 'instructor' => "Prasad", 'time' => "9:00 am - 11:00 am", 'days' => "S", 'time_code' => 1, 'capacity' => 30, 'description' => "Course 2 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 968274, 'course_id' => 3, 'instructor' => "Abhijith", 'time' => "9:00 am - 11:00 am", 'days' => "S", 'time_code' => 1, 'capacity' => 30, 'description' => "Course 3 Section", 'location' => 'Warrensburg']);
     Section::create(['crn' => 960574, 'course_id' => 3, 'instructor' => "Abhijith", 'time' => "9:00 am - 11:00 am", 'days' => "F", 'time_code' => 1, 'capacity' => 30, 'description' => "Course 3 Section", 'location' => 'Warrensburg']);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $name = $request->get('name');
     $section = Section::where('name', $name)->first();
     if (count($section) > 0) {
         return response()->json(['success' => false, 'message' => 'Section name already exist']);
     }
     $section = Section::create(['name' => $request->get('name')]);
     if (!$section->save()) {
         return response()->json(['success' => false, 'message' => 'Failed to save record']);
     }
     return response()->json(['success' => true, 'message' => 'New section saved successfully!']);
 }
 public function store(Request $request)
 {
     $grade_id = $request->get('grade_id');
     $rules = ['grade_id' => 'required|exists:grades,id', 'name' => 'required|max:255|unique:sections,name,NULL,id,grade_id,' . $grade_id];
     $messages = ['name.required' => 'Es necesario asignar un nombre al periodo.', 'name.max' => 'Ingrese un nombre adecuado.', 'name.unique' => 'Los nombres de sección no se pueden repetir en un mismo grado.'];
     $v = Validator::make($request->all(), $rules, $messages);
     if ($v->fails()) {
         return back()->withErrors($v)->withInput();
     }
     if (isset($errors)) {
         return back()->withErrors($errors)->withInput();
     }
     Section::create($request->all());
     return back()->with('success', 'Sección registrada exitosamente.');
 }
Exemple #10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     if (App::environment() === 'production') {
         exit('Do not seed in production environment');
     }
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     // disable foreign key constraints
     DB::table('sections')->truncate();
     Section::create(['id' => 1, 'name' => 'Lifestyle Habits', 'description' => 'This section focuses on lifestyle and habits of a patient']);
     Section::create(['id' => 2, 'name' => 'Family History', 'description' => 'This section focuses on medical history of family of a patient']);
     Section::create(['id' => 3, 'name' => 'Complaints', 'description' => 'This section deals with recent complaints of pateint']);
     Section::create(['id' => 4, 'name' => 'Clinical Examination', 'description' => 'This section deals with various clinical reports of a patient']);
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
     // enable foreign key constraints
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     // validate
     // read more on validation at http://laravel.com/docs/validation
     $rules = array('crn' => 'required|numeric|unique:sections,crn', 'instructor' => 'required', 'alias' => 'required', 'time' => 'required');
     $input = $request->all();
     $validator = Validator::make($input, $rules);
     // process the login
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator)->withInput($input);
     } else {
         // store
         $course = Section::create($input);
         // redirect
         Session::flash('message', 'Successfully created sections');
         return redirect('courses/' . $input['course_id'] . "/sections");
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // General
     \App\Language::create(['code' => 'es', 'name' => 'Español', 'image' => 'es.png']);
     \App\Site::create(['name' => 'Plataforma ', 'domain' => 'http://mimg.dev/', 'root' => '/', 'es' => ['title' => 'PROGRAMA MUNICIPAL DE RECONOCIMIENTO Y FOMENTO A INICIATIVAS SOSTENIBLES', 'description' => 'Nuestro objetivo es programar la plataforma del Programa Municipal de Reconocimiento y Fomento a Iniciativas Sostenibles en formato es php y sql para entorno web, en base a un contenido y diseño previamente definido.', 'keywords' => 'programa, municipal, iniciativas sostenibles, medio ambiente, guayaquil, ecuador'], 'google_verification' => '', 'analytics' => '']);
     // Nodos
     $node_registry_a = \App\Node::create(['name' => 'registry-a', 'table_name' => 'registry_a', 'type' => 'form']);
     \App\NodeExtra::create(['parent_id' => $node_registry_a->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status', 'company_type', 'guayaquil_zone'])]);
     \App\NodeExtra::create(['parent_id' => $node_registry_a->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status', 'company_type', 'guayaquil_zone'])]);
     $node_registry_b = \App\Node::create(['name' => 'registry-b', 'table_name' => 'registry_b', 'type' => 'form']);
     \App\NodeExtra::create(['parent_id' => $node_registry_b->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status', 'clasification', 'guayaquil_belongs'])]);
     \App\NodeExtra::create(['parent_id' => $node_registry_b->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status', 'clasification', 'guayaquil_belongs'])]);
     $node_postulation_a = \App\Node::create(['name' => 'postulation-a', 'table_name' => 'postulation_a', 'type' => 'form']);
     \App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status'])]);
     \App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'parent_field', 'value_array' => json_encode([['name' => 'guayaquil_zone', 'parent' => 'registry-a', 'data' => 'registry_a_id'], ['name' => 'company_type', 'parent' => 'registry-a', 'data' => 'registry_a_id']])]);
     \App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status'])]);
     \App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'parent_graph', 'parameter' => 'pie', 'value_array' => json_encode([['name' => 'guayaquil_zone', 'parent' => 'registry_a', 'data' => 'registry_a_id'], ['name' => 'company_type', 'parent' => 'registry_a', 'data' => 'registry_a_id']])]);
     $node_postulation_b = \App\Node::create(['name' => 'postulation-b', 'table_name' => 'postulation_b', 'type' => 'form']);
     \App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status'])]);
     \App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'parent_field', 'value_array' => json_encode([['name' => 'guayaquil_belongs', 'parent' => 'registry-b', 'data' => 'registry_b_id'], ['name' => 'clasification', 'parent' => 'registry-b', 'data' => 'registry_b_id']])]);
     \App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status'])]);
     \App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'parent_graph', 'parameter' => 'pie', 'value_array' => json_encode([['name' => 'guayaquil_belongs', 'parent' => 'registry_b', 'data' => 'registry_b_id'], ['name' => 'clasification', 'parent' => 'registry_b', 'data' => 'registry_b_id']])]);
     $node_deadlines = \App\Node::create(['name' => 'deadline']);
     $node_social_network = \App\Node::create(['name' => 'social-network', 'table_name' => 'social_networks', 'location' => 'app', 'type' => 'global', 'model' => '\\App\\SocialNetwork']);
     $node_title = \App\Node::create(['name' => 'title']);
     $node_content = \App\Node::create(['name' => 'content']);
     $node_banner = \App\Node::create(['name' => 'banner']);
     $node_agenda = \App\Node::create(['name' => 'agenda']);
     $node_sponsor = \App\Node::create(['name' => 'sponsor']);
     $node_contact = \App\Node::create(['name' => 'contact', 'table_name' => 'contact']);
     $node_form_contact = \App\Node::create(['name' => 'form-contact', 'type' => 'form', 'table_name' => 'form_contact']);
     // Menu: Home
     $page_home = \App\Page::create(['type' => 'customized', 'customized_name' => 'home', 'es' => ['name' => 'Inicio']]);
     \App\Menu::create(['page_id' => $page_home->id]);
     \App\Section::create(['id' => 1, 'page_id' => $page_home->id, 'node_id' => $node_title->id]);
     \App\Section::create(['id' => 2, 'page_id' => $page_home->id, 'node_id' => $node_content->id]);
     \App\Section::create(['id' => 3, 'page_id' => $page_home->id, 'node_id' => $node_title->id]);
     \App\Section::create(['id' => 4, 'page_id' => $page_home->id, 'node_id' => $node_agenda->id]);
     \App\Section::create(['id' => 5, 'page_id' => $page_home->id, 'node_id' => $node_title->id]);
     \App\Section::create(['id' => 6, 'page_id' => $page_home->id, 'node_id' => $node_sponsor->id]);
     // Menu: Sobre el Programa
     $page_programa = \App\Page::create(['es' => ['name' => 'Sobre el Programa']]);
     \App\Menu::create(['page_id' => $page_programa->id]);
     \App\Section::create(['id' => 7, 'page_id' => $page_programa->id, 'node_id' => $node_content->id]);
     // Menu: Categorias
     $page_categorias = \App\Page::create(['es' => ['name' => 'Categorias']]);
     \App\Menu::create(['page_id' => $page_categorias->id]);
     \App\Section::create(['id' => 8, 'page_id' => $page_categorias->id, 'node_id' => $node_content->id]);
     // Menu: Premios
     $page_premios = \App\Page::create(['es' => ['name' => 'Premios']]);
     \App\Menu::create(['page_id' => $page_premios->id]);
     \App\Section::create(['id' => 9, 'page_id' => $page_premios->id, 'node_id' => $node_content->id]);
     // Menu: Cronograma
     $page_cronograma = \App\Page::create(['es' => ['name' => 'Cronograma']]);
     \App\Menu::create(['page_id' => $page_cronograma->id]);
     \App\Section::create(['id' => 10, 'page_id' => $page_cronograma->id, 'node_id' => $node_content->id]);
     // Menu: Registro
     $menu_registro = \App\Menu::create(['type' => 'blank', 'es' => ['name' => 'Registro']]);
     $page_registro_a = \App\Page::create(['es' => ['name' => 'Registro A']]);
     \App\Menu::create(['level' => 2, 'parent_id' => $menu_registro->id, 'es' => ['name' => 'A. Distinción a empresas ambientalmente sostenibles', 'link' => 'registro-a']]);
     \App\Section::create(['id' => 11, 'page_id' => $page_registro_a->id, 'node_id' => $node_content->id]);
     \App\Section::create(['id' => 12, 'page_id' => $page_registro_a->id, 'node_id' => $node_registry_a->id]);
     $page_registro_b = \App\Page::create(['es' => ['name' => 'Registro B']]);
     \App\Menu::create(['level' => 2, 'parent_id' => $menu_registro->id, 'es' => ['name' => 'B. Capital semilla a iniciativas sostenibles', 'link' => 'registro-b']]);
     \App\Section::create(['id' => 13, 'page_id' => $page_registro_b->id, 'node_id' => $node_content->id]);
     \App\Section::create(['id' => 14, 'page_id' => $page_registro_b->id, 'node_id' => $node_registry_b->id]);
     // Page: Postulación A
     $page_postulacion_a = \App\Page::create(['es' => ['name' => 'Postulacion A']]);
     \App\Section::create(['id' => 15, 'page_id' => $page_postulacion_a->id, 'node_id' => $node_content->id]);
     \App\Section::create(['id' => 16, 'page_id' => $page_postulacion_a->id, 'node_id' => $node_postulation_a->id]);
     // Page: Postulación B
     $page_postulacion_b = \App\Page::create(['es' => ['name' => 'Postulacion B']]);
     \App\Section::create(['id' => 17, 'page_id' => $page_postulacion_b->id, 'node_id' => $node_content->id]);
     \App\Section::create(['id' => 18, 'page_id' => $page_postulacion_b->id, 'node_id' => $node_postulation_b->id]);
     // Menu: Contacto
     $page_contacto = \App\Page::create(['es' => ['name' => 'Contacto']]);
     \App\Menu::create(['page_id' => $page_contacto->id]);
     \App\Section::create(['id' => 19, 'page_id' => $page_contacto->id, 'node_id' => $node_contact->id]);
     \App\Section::create(['id' => 20, 'page_id' => $page_contacto->id, 'node_id' => $node_form_contact->id]);
     // Panel: Postulaciones
     $page_postulaciones = \App\Page::create(['type' => 'customized', 'customized_name' => 'postulaciones', 'es' => ['name' => 'Postulaciones']]);
     \App\Section::create(['id' => 21, 'page_id' => $page_postulaciones->id, 'node_id' => $node_content->id]);
     // Home Segunda Parte
     \App\Section::create(['id' => 22, 'page_id' => $page_home->id, 'node_id' => $node_banner->id]);
     // Crear menu en Admin
     /*$m_list = \App\Menu::create(['menu_type'=>'admin', 'icon'=>'th-list', 'es'=>['name'=>'Listas de Correos', 'link'=>'admin/model-list/target-list']]);
       $m_email = \App\Menu::create(['menu_type'=>'admin', 'icon'=>'th-list', 'es'=>['name'=>'Enviar Emails', 'link'=>'admin/model-list/email']]);
       $m_history = \App\Menu::create(['menu_type'=>'admin', 'icon'=>'th-list', 'es'=>['name'=>'Emails Enviados', 'link'=>'admin/model-list/sent-email']]);*/
     // Variables
     \App\Variable::create(['name' => 'admin_email', 'type' => 'string', 'es' => ['value' => '*****@*****.**']]);
     \Solunes\Master\App\Variable::create(['name' => 'footer_name', 'type' => 'string', 'es' => ['value' => 'GAD MUNICIPAL DE GUAYAQUIL - GUAYAQUIL, ECUADOR']]);
     \Solunes\Master\App\Variable::create(['name' => 'footer_rights', 'type' => 'string', 'es' => ['value' => 'TODOS LOS DERECHOS RESERVADOS']]);
     // Social Networks
     \App\SocialNetwork::create(['code' => 'facebook', 'url' => 'https://www.facebook.com/alcaldiaguayaquil/']);
     \App\SocialNetwork::create(['code' => 'twitter', 'url' => 'https://twitter.com/alcaldiagye/']);
     \App\SocialNetwork::create(['code' => 'youtube', 'url' => 'https://www.youtube.com/user/municipioguayaquil/']);
     \App\SocialNetwork::create(['code' => 'instagram', 'url' => 'https://www.instagram.com/municipiogye/']);
     /*factory(App\Customer::class, 30)->create();
       factory(App\CustomerPoint::class, 150)->create();
       factory(App\Operator::class, 100)->create(['city_id'=>$lpz->id]);
       factory(App\Operator::class, 100)->create(['city_id'=>$scz->id]);
       factory(App\OperatorAttendance::class, 100)->create(['operator_id'=>1, 'status'=>'1/2']);
       factory(App\OperatorAttendance::class, 100)->create(['operator_id'=>2, 'status'=>'O']);
       factory(App\Product::class, 20)->create(['type'=>'product']);
       factory(App\Product::class, 30)->create(['type'=>'implement']);*/
     /*factory(App\FilledForm::class, 50)->create(['form_id'=>1]);
       factory(App\FilledForm::class, 50)->create(['form_id'=>2]);
       factory(App\FilledForm::class, 50)->create(['form_id'=>3]);
       factory(App\FilledForm::class, 50)->create(['form_id'=>4]);
       factory(App\FilledForm::class, 50)->create(['form_id'=>5]);
       factory(App\FilledField::class, 50)->create(['filled_form_id'=>rand(1,50), 'field_id'=>rand(1,9)]);
       factory(App\FilledField::class, 50)->create(['filled_form_id'=>rand(51,100), 'field_id'=>rand(10,15)]);
       factory(App\FilledField::class, 50)->create(['filled_form_id'=>rand(101,150), 'field_id'=>rand(16,26)]);
       factory(App\FilledField::class, 50)->create(['filled_form_id'=>rand(151,200), 'field_id'=>rand(27,65)]);
       factory(App\FilledField::class, 50)->create(['filled_form_id'=>rand(201,250), 'field_id'=>rand(66,77)]);*/
     //factory(App\Questionnaire::class, 100)->create(['user_id'=>1]);
 }
 public function storeSection(SectionRequest $request)
 {
     Section::create($request->all());
     flash()->success('Sekcja <b>' . $request->input('name') . '</b> dla zapytań została dodana!');
     return redirect('/admin');
 }
 /**
  * Add a section
  *
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function addSection(Request $request)
 {
     $sectionId = $request['sectionId'];
     $dCode = $request['dCode'];
     Section::create(['sectionId' => $sectionId, 'dCode' => $dCode]);
     return redirect()->back()->with('status', 'Success');
 }
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required']);
     Section::create($request->all());
     return \Redirect('/admin/sections')->with(['flash_message' => 'Section Successfully Created']);
 }