public function actionView($id) { $sections = Section::find()->all(); $model = Section::find()->where(['id' => $id])->one(); $mips = Mip::find()->where(['section_id' => $id])->all(); return $this->render('view', ['sections' => $sections, 'model' => $model, 'mips' => $mips]); }
public function getSectionAction() { if ($this->request->isPost() == true) { $sections = Section::find(); foreach ($sections as $sectionItem) { } } }
/** * Update the specified resource in storage. * PUT /sections/{id} * * @param int $id * @return Response */ public function update($id) { $section = Section::where('id', $id)->update(Input::all()); if ($section) { $data = Section::find($id); return ['status' => true, 'data' => $data]; } else { return ['status' => false]; } }
function nav_sub_section($type,$sort) { $finder= new Section(AMP_Registry::getDbcon()); if(isset($sort) && $sort){ $finder_source = &$finder->getSearchSource(); $finder_source->addSort($sort); } $sections = $finder->find(array('parent'=>$type,'displayable'=>'1')); if (!$sections) return; $html = '<ul>'; foreach($sections as $section) { $html .= '<li><a href="section.php?id='.$section->id.'">'.$section->getName().'</a><img src="img/spacer.gif" height="4" width="3" align="left"> </li>'; } $html .= '</ul>'; return $html; }
function nav_sub_section($type, $sort) { $finder = new Section(AMP_Registry::getDbcon()); if (isset($sort) && $sort) { $finder_source =& $finder->getSearchSource(); $finder_source->addSort($sort); } $sections = $finder->find(array('parent' => $type, 'displayable' => '1')); if (!$sections) { return; } $html = '<ul>'; foreach ($sections as $section) { if (AMP_CONTENT_HUMANIZE_URLS) { $sectionURL = AMP_url_update('section.php', array('id' => $section->id)); } else { $sectionURL = 'section.php?id=' . $section->id; } $html .= '<li><a href="' . $sectionURL . '">' . $section->getName() . '</a><img src="img/spacer.gif" height="4" width="3" align="left"> </li>'; } $html .= '</ul>'; return $html; }
public function putAction() { if ($this->request()->isPost() == true) { $ans = []; try { $id = $this->request->getPost("id"); $sectionNewName = $this->request->getPost("name"); $existArticle = Article::find(array("conditions" => "id=?1", "bind" => array(1 => $id))); if (count($existArticle) == 0) { $ans['ret'] = -1; $ans['error'] = 204; echo json_encode($ans); throw new BaseException('文章不存在', 204); } else { $existSection = Section::find(array("conditions" => "name=?1", "bind" => array(1 => $sectionNewName))); if (count($existSection) == 0) { $ans['ret'] = -1; $ans['error'] = 105; echo json_encode($ans); throw new BaseException('栏目不存在', 105); } else { $existArticle->section_id = $existSection->id; if ($existArticle->save() == true) { $ans['ret'] = 0; echo json_encode($ans); } else { $ans['ret'] = -1; $ans['error'] = 102; echo json_encode($ans); throw new BaseException('参数存在非法数据', 102); } } } } catch (BaseException $e) { } } }
public function postDetach() { if (Input::has('id') && Input::has('section_id')) { $section_id = Input::get('section_id'); $id = Input::get('id'); Workorder::find($id)->sections()->detach(Section::find($section_id)); return ['status' => true]; } else { return ['status' => false]; } }
{{Form::button('Cancel', ['class' => 'btn btn-default cancel-edit mode2'])}} <a href="/workflow/replace/{{$section->id}}" title="Description" data-placement="top" data-method="post" data-replace="#description_body" class="btn ajax btn-info" data-toggle="modal" data-target="#description" onclick="empty_div()"><span class="glyphicon glyphicon-list-alt"></span></a><br> </td> </tr> @endif @endforeach </table> </div> </div> <!-- VOUCHER SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('8'); ?> <h3 class="panel-title">{{{ strtoupper($sectionName->sectionName) }}}</h3> </div> <div class="panel-body"> <!-- Displays form for adding new tasks to the workflow --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}"> </div> <div class="col-md-3"> {{ Form::submit('Add', array('class' => 'btn btn-success btn-block create-btn')) }}
public function getAction($id) { if ($this->request->isGet() == true) { $ans = []; try { $existArticle = Article::find(array("conditions" => "id=?1", "bind" => array(1 => $id))); if (count($existArticle) == 0) { $ans['ret'] = -1; $ans['error'] = 204; echo json_encode($ans); throw new BaseException("要查找的文章不存在", 204); } else { $data = []; $data['title'] = $existArticle->title; $data['date'] = $existArticle->date; $data['body'] = $existArticle->body; $sectionId = $existArticle->section_id; $conditions = "id =:id:"; $parameters = array("id" => $sectionId); $temp_section = Section::find(array($conditions, "bind" => $parameters)); $data['section'] = $temp_section->name; $ans['ret'] = 0; $ans['data'] = $data; echo json_encode($ans); } } catch (BaseException $e) { } } }
{{Form::button('Save', ['class' => 'btn btn-success save-edit mode2', 'id' => 'temp_alert'])}} {{Form::button('Cancel', ['class' => 'btn btn-default cancel-edit mode2'])}} <a href="/workflow/replace/{{$section->id}}" title="Description" data-placement="top" data-method="post" data-replace="#description_body" class="btn ajax btn-info" data-toggle="modal" data-target="#description" onclick="empty_div()"><span class="glyphicon glyphicon-list-alt"></span></a><br> </td> </tr> @endif @endforeach </table> </div> </div> <!-- VOUCHER SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('19'); ?> <h3 class="panel-title">{{{ strtoupper($sectionName->sectionName) }}}</h3> </div> <div class="panel-body"> <!-- Displays the tasks added through the add new task form --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}"> </div> <div class="col-md-3">
$langs = DB::table('langs')->lists('language', 'id'); $langs = array("0" => "Select") + $langs + array("-1" => "Others"); $levels = DB::table('levels')->lists('level', 'id'); $abilities = DB::table('abilities')->lists('ability', 'id'); return View::make('cvbuilder.section_views.language', array("langs" => $langs, "levels" => $levels, "abilities" => $abilities)); }); Route::post('/fetch_workex', 'CVController@postWorkex'); Route::post('/fetch_education', 'CVController@postEducation'); Route::post('/fetch_nysc', 'CVController@postNysc'); Route::post('/fetch_language', 'CVController@postLanguage'); Route::post('/save', 'CVController@postProfile'); Route::get('/fetch_ui_section', function () { return View::make('cvbuilder.section_views.add_new_section'); }); Route::get('/edit_ui_section/{id}', function ($id) { $section = Section::find($id); return View::make('cvbuilder.section_views.edit_new_section', ['section' => $section]); }); Route::get('/edit_ui_workex/{id}', function ($id) { $work = WorkExperience::find($id); return View::make('cvbuilder.section_views.edit_work', ['work' => $work]); }); Route::get('/edit_ui_education/{id}', function ($id) { $education = Education::find($id); return View::make('cvbuilder.section_views.edit_education', ['edu' => $education]); }); Route::get('/edit_ui_nysc/{id}', function ($id) { $nysc = Nysc::find($id); return View::make('cvbuilder.section_views.edit_nysc', ['nysc' => $nysc]); }); Route::get('/edit_ui_language/{id}', function ($id) {
public function postUpdateTrainerSection() { $sid = Input::get('sid'); $tid = Input::get('tid'); $section = Section::find($sid); $trainer = Trainer::find($tid); $trainer->section()->associate($section); $trainer->save(); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->section->find($id)->delete(); return Redirect::route('sections.index'); }
{{Form::button('Save', ['class' => 'btn btn-success save-edit mode2', 'id' => 'temp_alert'])}} {{Form::button('Cancel', ['class' => 'btn btn-default cancel-edit mode2'])}} <a href="/workflow/replace/{{$section->id}}" title="Description" data-placement="top" data-method="post" data-replace="#description_body" class="btn ajax btn-info" data-toggle="modal" data-target="#description" onclick="empty_div()"><span class="glyphicon glyphicon-list-alt"></span></a><br> </td> </tr> @endif @endforeach </table> </div> </div> <!-- VOUCHER SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('4'); ?> <h3 class="panel-title"> {{{ strtoupper($sectionName->sectionName) }}} </h3> </div> <div class="panel-body"> <!-- Displays the tasks added through the add new task form --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}"> </div> <div class="col-md-3">
public static function GetByName($sectionName) { return Section::find(array('section_name' => $sectionName)); }
public function putSection() { $cre = ['section_name' => Input::get('section_name')]; $rules = ['section_name' => 'required']; $validator = Validator::make($cre, $rules); if ($validator->passes()) { $section = Section::find(Input::get('section_id')); $cv = Cv::select('id')->where('cv_code', Input::get('cv_code'))->first(); if ($cv->id == $section->cv_id) { $section->section_name = Input::get('section_name'); $section->save(); $data["message"] = 'Section name is succefully updated'; $data["section_name"] = Input::get('section_name'); } else { $data["message"] = 'Error in editing section'; } return json_encode($data); } else { return 'Please fill all the inputs'; } }