예제 #1
0
echo Yii::t('view', 'student_info_lb');
?>
</legend>
	<?php 
echo $form->dropDownListRow($model->student, 'college_id', CHtml::listData(College::model()->findAll(), 'college_id', 'college_name'), array('prompt' => Yii::t('model', 'student.college_id_empty'), 'ajax' => array('type' => 'POST', 'url' => $this->createUrl('register/ajaxCollegePrograms'), 'update' => '#' . CHtml::activeId($model->student, 'program_id'), 'data' => array('college' => 'js:this.value'))));
?>
<!--
	<?php 
echo $form->dropDownListRow($model->student, 'program_id', CHtml::listData(College::getProgramsByCollege($model->student->college_id), 'program_id', 'program_name'), array('prompt' => Yii::t('model', 'student.program_id_empty')));
?>
	<?php 
echo $form->textFieldRow($model->student, 'program_code');
?>
-->
	<?php 
echo $form->dropDownListRow($model->student, 'education_level_id', CHtml::listData(EducationLevel::model()->findAll(), 'education_level_id', 'education_level_name'), array('prompt' => Yii::t('model', 'student.education_level_id_empty')));
?>
	<?php 
echo $form->textFieldRow($model->student, 'major_name');
?>
<!--
	<?php 
echo $form->datepickerRow($model->student, 'enrollment_date', array('options' => array('format' => 'yyyy-mm-dd')));
?>
-->

</fieldset>

<?php 
echo $form->checkBoxRow($model, 'consented');
?>
예제 #2
0
$app->group('/skills', function () use($app, $data) {
    $data['request_method'] = $app->request->getMethod();
    $app->get('/', function () use($app, $data) {
        $data['skills'] = Skill::all();
        $app->render('skills/overview.html', $data);
    })->name('skills_overview');
    $app->map('/delete/:id', function ($id) use($app, $data) {
        $data['skill'] = Skill::find($id);
        if ($app->request->isPost()) {
            $data['skill']->delete();
        }
        $app->render('skills/delete.html', $data);
    })->via('GET', 'POST')->name('skills_delete');
    $app->map('/new', function () use($app, $data) {
        if ($app->request->isPost()) {
            $edu_level = EducationLevel::find($app->request->post('educationlevel'));
            $skill = new Skill();
            $skill->name = $app->request->post('title');
            $skill->save();
            $data['new_skill'] = $skill;
        }
        $app->render('skills/new.html', $data);
    })->via('GET', 'POST')->name('skills_new');
    $app->map('/edit/:id', function ($id) use($app, $data) {
        $data['request_method'] = $app->request->getMethod();
        $skill = Skill::find($id);
        if ($app->request->isGet()) {
            $data['skill'] = $skill->toArray();
        } else {
            if ($app->request->isPost()) {
                $skill->name = $app->request->post('title');
예제 #3
0
    $app->response()->header('Content-Type', 'application/json');
    $talent = Talent::with('questions')->get();
    echo $talent->toJson();
});
$app->get('/talent/:name', function ($name) use($app) {
    $app->response()->header('Content-Type', 'application/json');
    try {
        $talent = Talent::with('questions')->where('name', '=', $name)->firstOrFail();
    } catch (ModelNotFoundException $e) {
        $app->halt(404, 'Talent niet gevonden');
    }
    echo $talent->toJson();
});
$app->get('/schooladvice', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo EducationLevel::SchoolAdvice()->get()->toJson();
});
$app->get('/schools', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo School::all()->toJson();
});
$app->get('/skills', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo Skill::all()->toJson();
});
$app->get('/occupation', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo Skill::all()->toJson();
});
$app->group('/user', function () use($app) {
    $app->options('/:name', function ($name) use($app) {