Exemplo n.º 1
0
 public function create()
 {
     $region = Region::lists('name', 'id');
     $page_title = 'Provinces';
     return view('province.create', compact('region', 'page_title'));
 }
Exemplo n.º 2
0
 public function edit_announcement($id)
 {
     $fields = Field::orderBy('name')->lists('name', 'id');
     $terms = Term::lists('name', 'id');
     $municipalities = Municipality::lists('name', 'id');
     $regions = Region::lists('name', 'id');
     $type = array(0 => 'ვატარებ', 1 => 'ვეძებ');
     $quarter = Quarter::all()->lists('name', 'id');
     $months = Month::all()->lists('name', 'id');
     $select = DB::select(' SELECT trainings.id, field_training.field_id, term_training.term_id, municipality_training.municipality_id, month_training.month_id
                             FROM trainings
                             JOIN field_training ON trainings.id = field_training.training_id
                             JOIN term_training ON trainings.id = term_training.training_id
                             JOIN municipality_training ON trainings.id = municipality_training.training_id
                             JOIN month_training ON trainings.id = month_training.training_id
                             where trainings.id = ' . $id . '
                             group by trainings.id
                ');
     $select = $select[0];
     $training_filtered = new \stdClass();
     $training_instance = Training::find($select->id);
     $training_field = Field::find($select->field_id);
     $training_municipality = Municipality::find($select->municipality_id);
     $training_months = DB::select('SELECT months.name FROM month_training JOIN months ON months.id = month_training.month_id WHERE training_id = ' . $training_instance->id);
     $training_terms = DB::select('SELECT terms.name FROM term_training JOIN terms ON terms.id = term_training.term_id WHERE training_id = ' . $training_instance->id);
     foreach ($training_months as $month) {
         $training_months_array[] = $month->name;
     }
     foreach ($training_terms as $term) {
         $training_terms_array[] = $term->name;
     }
     $training_filtered->id = $training_instance->id;
     $training_filtered->header = $training_instance->name;
     $training_filtered->description = $training_instance->description;
     $training_filtered->file = $training_instance->file;
     $training_filtered->link = $training_instance->link;
     $training_filtered->field['name'] = $training_field->name;
     $training_filtered->field['id'] = $training_field->id;
     $training_filtered->months = $training_months_array;
     $training_filtered->terms = $training_terms_array;
     $training_filtered->municipality['name'] = $training_municipality->name;
     $training_filtered->municipality['id'] = $training_municipality->id;
     $training_filtered->region = $training_municipality->region_id;
     $training_filtered->isAdmin = Auth::check();
     return view('edit.edit_announcement', ['fields' => $fields, 'terms' => $terms, 'regions' => $regions, 'municipalities' => $municipalities, 'quarter' => $quarter, 'month' => $months, 'type' => $type, 'training' => $training_filtered]);
 }
Exemplo n.º 3
0
 public function add_seek_announcement()
 {
     if (!Auth::user() || Auth::user()->role != 2) {
         return redirect('/');
     }
     $fields = Field::orderBy('name')->lists('name', 'id');
     $terms = Term::lists('name', 'id');
     $municipalities = Municipality::all();
     $municipality_regions = array();
     foreach ($municipalities as $m) {
         $municipality_regions[] = array('municipality' => $m, 'region' => $m->region);
     }
     $regions = Region::lists('name', 'id');
     $type = array(0 => 'ვატარებ', 1 => 'ვეძებ');
     return view('add_forms.add_seek_announcement', ['fields' => $fields, 'terms' => $terms, 'regions' => $regions, 'municipality_regions' => $municipality_regions, 'type' => $type]);
 }
Exemplo n.º 4
0
 public function render_seek_form_data()
 {
     $fields = Field::orderBy('name')->lists('name', 'id');
     $terms = Term::lists('name', 'id');
     $municipalities = Municipality::all();
     $municipality_regions = array();
     foreach ($municipalities as $m) {
         $municipality_regions[] = array('municipality' => $m, 'region' => $m->region);
     }
     $regions = Region::lists('name', 'id');
     return view('search_forms.seek', ['fields' => $fields, 'terms' => $terms, 'regions' => $regions, 'municipality_regions' => $municipality_regions]);
 }
 public function edit($id)
 {
     $region = Region::lists('name', 'id');
     $provinces = Province::findorFail($id);
     return view('province.edit', compact('provinces', 'region', 'page_title'));
 }
Exemplo n.º 6
0
<?php

$regions = \App\Region::lists('name', 'id')->sortBy('name');
$institutions = \App\Institution::lists('name', 'id')->sortBy('name');
?>

<div class="col-md-8 col-md-offset-2">

@if($submitButtonText=='Update')

    <div class="form-group">
        {!! Form::label('name', 'School Name : ') !!}
        {!! Form::text('name', null, ['placeholder' => 'School Name',
                                      'class' => 'form-control',
                                      'value' => '{{ old("name") }}']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('year_establish', 'Year Establish : ') !!}
        {!! Form::input('date', 'year_establish', null, ['placeholder' => '', 'class' => 'form-control']) !!}
    </div>

    <div class="form-group">
        {!! Form::label('status', 'Status : ') !!}
        {!! Form::select('status', array('Cluster Head' => 'Cluster Head',
                                        'Polytechnic College' => 'Polytechnic College',
                                        'College' => 'College',
                                        'Institute' => 'Institute'
                                      ), $status,
                                      ['class' => 'form-control']) !!}
    </div>