mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
added first version of uhstat1 form, added unique constraint for person_id in uhstat1daten table, added permissions for uhstat1daten sequence
This commit is contained in:
@@ -0,0 +1,301 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class UHSTAT1 extends FHC_Controller
|
||||
{
|
||||
const CODEX_OESTERREICH = 'A';
|
||||
const LOWER_BOUNDARY_YEARS = 160;
|
||||
const UPPER_BOUNDARY_YEARS = 20;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'admin:r',
|
||||
'saveUHSTAT1Data' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// load ci libs
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// load ci helpers
|
||||
$this->load->helper(array('form', 'url'));
|
||||
|
||||
// load models
|
||||
$this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->load->model('codex/Abschluss_model', 'AbschlussModel');
|
||||
$this->load->model('codex/Uhstat1daten_model', 'Uhstat1datenModel');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui',
|
||||
'uhstat'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$formData = $this->_getFormData();
|
||||
|
||||
if (!hasData($formData)) show_error("No form data could be loaded");
|
||||
|
||||
$this->load->view("codex/uhstat1.php", array('formData' => getData($formData)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or update UHSTAT1 data
|
||||
*/
|
||||
public function saveUHSTAT1Data()
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
|
||||
if (!isset($person_id) || !is_numeric($person_id)) show_error("Person Id missing");
|
||||
|
||||
$this->form_validation->set_error_delimiters('<span class="text-danger">', '</span>');
|
||||
|
||||
// check required fields
|
||||
$this->form_validation->set_rules('geburtsstaat', 'Geburtsstaat', 'required', array('required' => $this->p->t('uhstat', 'feldFehlt')));
|
||||
$this->form_validation->set_rules(
|
||||
'mutter_geburtsstaat',
|
||||
'Geburtsstaat Mutter',
|
||||
'required',
|
||||
array('required' => $this->p->t('uhstat', 'feldFehlt'))
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'mutter_bildungsstaat',
|
||||
'Bildungsstaat Mutter',
|
||||
'required',
|
||||
array('required' => $this->p->t('uhstat', 'feldFehlt'))
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'mutter_geburtsjahr',
|
||||
'Geburtsjahr Mutter',
|
||||
'required',
|
||||
array('required' => $this->p->t('uhstat', 'feldFehlt'))
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'mutter_bildungmax',
|
||||
'Höchste Ausbildung Mutter',
|
||||
'required|callback_bildungsstaat_bildungmax_check[m]',
|
||||
array(
|
||||
'required' => $this->p->t('uhstat', 'feldFehlt'),
|
||||
'bildungsstaat_bildungmax_check' => $this->p->t('uhstat', 'ausbildungBildungsstaatUebereinstimmung')
|
||||
//'Land der höchsten Ausbildung muss mit Bildungsstaat übereinstimmen'
|
||||
// Bildungsstaat should correspond to state of bildung max
|
||||
)
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'vater_geburtsstaat',
|
||||
'Geburtsstaat Vater',
|
||||
'required',
|
||||
array('required' => $this->p->t('uhstat', 'feldFehlt'))
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'vater_bildungsstaat',
|
||||
'Bildungsstaat Vater',
|
||||
'required',
|
||||
array('required' => $this->p->t('uhstat', 'feldFehlt'))
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'vater_geburtsjahr',
|
||||
'Geburtsjahr Vater',
|
||||
'required',
|
||||
array('required' => $this->p->t('uhstat', 'feldFehlt'))
|
||||
);
|
||||
$this->form_validation->set_rules(
|
||||
'vater_bildungmax',
|
||||
'Höchste Ausbildung Vater',
|
||||
'required|callback_bildungsstaat_bildungmax_check[v]',
|
||||
array(
|
||||
'required' => $this->p->t('uhstat', 'feldFehlt'),
|
||||
'bildungsstaat_bildungmax_check' => $this->p->t('uhstat', 'ausbildungBildungsstaatUebereinstimmung')
|
||||
)
|
||||
);
|
||||
|
||||
$uhstat1datenRes = null;
|
||||
if ($this->form_validation->run()) // if valid
|
||||
{
|
||||
// get post fields
|
||||
$geburtsstaat = $this->input->post('geburtsstaat');
|
||||
$mutter_geburtsstaat = $this->input->post('mutter_geburtsstaat');
|
||||
$mutter_geburtsjahr = $this->input->post('mutter_geburtsjahr');
|
||||
$mutter_bildungsstaat = $this->input->post('mutter_bildungsstaat');
|
||||
$mutter_bildungmax = $this->input->post('mutter_bildungmax');
|
||||
$vater_geburtsstaat = $this->input->post('vater_geburtsstaat');
|
||||
$vater_geburtsjahr = $this->input->post('vater_geburtsjahr');
|
||||
$vater_bildungsstaat = $this->input->post('vater_bildungsstaat');
|
||||
$vater_bildungmax = $this->input->post('vater_bildungmax');
|
||||
|
||||
$uhstat1datenloadRes = $this->Uhstat1datenModel->loadWhere(array('person_id' => $person_id));
|
||||
|
||||
if (hasData($uhstat1datenloadRes))
|
||||
{
|
||||
$uhstat1datenRes = $this->Uhstat1datenModel->update(
|
||||
array('person_id' => $person_id),
|
||||
array(
|
||||
'geburtsstaat' => $geburtsstaat,
|
||||
'mutter_geburtsstaat' => $mutter_geburtsstaat,
|
||||
'mutter_geburtsjahr' => $mutter_geburtsjahr,
|
||||
'mutter_bildungsstaat' => $mutter_bildungsstaat,
|
||||
'mutter_bildungmax' => $mutter_bildungmax,
|
||||
'vater_geburtsstaat' => $vater_geburtsstaat,
|
||||
'vater_geburtsjahr' => $vater_geburtsjahr,
|
||||
'vater_bildungsstaat' => $vater_bildungsstaat,
|
||||
'vater_bildungmax' => $vater_bildungmax
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$uhstat1datenRes = $this->Uhstat1datenModel->insert(
|
||||
array(
|
||||
'geburtsstaat' => $geburtsstaat,
|
||||
'mutter_geburtsstaat' => $mutter_geburtsstaat,
|
||||
'mutter_geburtsjahr' => $mutter_geburtsjahr,
|
||||
'mutter_bildungsstaat' => $mutter_bildungsstaat,
|
||||
'mutter_bildungmax' => $mutter_bildungmax,
|
||||
'vater_geburtsstaat' => $vater_geburtsstaat,
|
||||
'vater_geburtsjahr' => $vater_geburtsjahr,
|
||||
'vater_bildungsstaat' => $vater_bildungsstaat,
|
||||
'vater_bildungmax' => $vater_bildungmax,
|
||||
'person_id' =>$person_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$formData = $this->_getFormData();
|
||||
|
||||
if (!hasData($formData)) show_error("No data found");
|
||||
|
||||
// pass success/error messages to view
|
||||
$successMessage = isset($uhstat1datenRes) && isSuccess($uhstat1datenRes) ? $this->p->t('uhstat', 'erfolgreichGespeichert') : '';
|
||||
$errorMessage = isset($uhstat1datenRes) && isError($uhstat1datenRes) ? $this->p->t('uhstat', 'fehlerBeimSpeichern') : '';
|
||||
|
||||
// load view with form data
|
||||
$this->load->view("codex/uhstat1.php", array(
|
||||
'formData' => getData($formData),
|
||||
'successMessage' => $successMessage,
|
||||
'errorMessage' => $errorMessage
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check callback for Bildungsstaat - if Bildungsstaat is Austria, a highest education should be in Austria.
|
||||
* @param $bildungmax
|
||||
* @param $bildungsstaat_typ - mother (m) or father (v)
|
||||
* @return bool true if valid, false otherwise
|
||||
*/
|
||||
public function bildungsstaat_bildungmax_check($bildungmax, $bildungsstaat_typ)
|
||||
{
|
||||
// valid if no type passed
|
||||
if (!isset($bildungsstaat_typ)) return true;
|
||||
|
||||
// get correct input
|
||||
if ($bildungsstaat_typ == 'm') // mutter
|
||||
$bildungsstaat = $this->input->post('mutter_bildungsstaat');
|
||||
elseif ($bildungsstaat_typ == 'v') // vater
|
||||
$bildungsstaat = $this->input->post('vater_bildungsstaat');
|
||||
else
|
||||
return true;
|
||||
|
||||
if (!isset($bildungsstaat)) return true;
|
||||
|
||||
// find out if abschluss is in Austria
|
||||
$this->AbschlussModel->addSelect("in_oesterreich");
|
||||
$abschlussRes = $this->AbschlussModel->load($bildungmax);
|
||||
|
||||
if (hasData($abschlussRes))
|
||||
{
|
||||
$in_oesterreich = getData($abschlussRes)[0]->in_oesterreich;
|
||||
// invalid if abschluss in Austria, but not Bildungsstaat, or abschluss not in Austria, but Bildungsstaat in Austria
|
||||
return ($in_oesterreich && $bildungsstaat == self::CODEX_OESTERREICH) || (!$in_oesterreich && $bildungsstaat != self::CODEX_OESTERREICH);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets initial data needed to display UHSTAT1 form.
|
||||
*/
|
||||
private function _getFormData()
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
|
||||
if (!isset($person_id) || !is_numeric($person_id)) return error("Person Id missing");
|
||||
|
||||
$formData = array(
|
||||
'nation' => array(),
|
||||
'abschluss_oesterreich' => array(),
|
||||
'abschluss_nicht_oesterreich' => array(),
|
||||
'jahre' => array(),
|
||||
'languageIdx' => $this->_getLanguageIndex(),
|
||||
'person_id' => $person_id
|
||||
);
|
||||
|
||||
$nationTextFieldName = $formData['languageIdx'] == 1 ? 'langtext' : 'engltext';
|
||||
|
||||
// get nation list
|
||||
$this->load->model('codex/Nation_model', 'NationModel');
|
||||
|
||||
$this->NationModel->addSelect("nation_code, $nationTextFieldName AS nation_text");
|
||||
$this->NationModel->addOrder("nation_text");
|
||||
$nationRes = $this->NationModel->load();
|
||||
|
||||
if (isError($nationRes)) return $nationRes;
|
||||
|
||||
if (hasData($nationRes)) $formData['nation'] = getData($nationRes);
|
||||
|
||||
// get abschluss list
|
||||
$abschlussRes = $this->AbschlussModel->getActiveAbschluesse();
|
||||
|
||||
if (isError($abschlussRes)) return $abschlussRes;
|
||||
|
||||
$abschlussData = getData($abschlussRes);
|
||||
|
||||
if (hasData($abschlussRes))
|
||||
{
|
||||
foreach (getData($abschlussRes) as $abschluss)
|
||||
{
|
||||
if ($abschluss->in_oesterreich === true)
|
||||
$formData['abschluss_oesterreich'][] = $abschluss;
|
||||
elseif ($abschluss->in_oesterreich === false)
|
||||
$formData['abschluss_nicht_oesterreich'][] = $abschluss;
|
||||
else
|
||||
{
|
||||
$formData['abschluss_oesterreich'][] = $abschluss;
|
||||
$formData['abschluss_nicht_oesterreich'][] = $abschluss;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get realistic birth years, dated back from current year
|
||||
$currYear = date("Y");
|
||||
$formData['jahre'] = range($currYear - self::UPPER_BOUNDARY_YEARS, $currYear - self::LOWER_BOUNDARY_YEARS);
|
||||
|
||||
return success($formData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets language index of currently logged in user.
|
||||
* @return int (the index, start at 1)
|
||||
*/
|
||||
private function _getLanguageIndex()
|
||||
{
|
||||
$idx = 1;
|
||||
$this->SpracheModel->addSelect('index');
|
||||
$langRes = $this->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
|
||||
|
||||
if (hasData($langRes))
|
||||
{
|
||||
$idx = getData($langRes)[0]->index;
|
||||
}
|
||||
|
||||
return $idx;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
class Abschluss_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'bis.tbl_abschluss';
|
||||
$this->pk = 'ausbildung_code';
|
||||
}
|
||||
|
||||
public function getActiveAbschluesse()
|
||||
{
|
||||
return $this->execQuery(
|
||||
'
|
||||
SELECT
|
||||
ausbildung_code, bezeichnung, in_oesterreich
|
||||
FROM
|
||||
bis.tbl_abschluss
|
||||
WHERE
|
||||
aktiv
|
||||
ORDER BY CASE WHEN in_oesterreich THEN 0 ELSE 1 END, ausbildung_code'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Uhstat1daten_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'bis.tbl_uhstat1daten';
|
||||
$this->pk = 'uhstat1daten_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'UHSTAT1Formular',
|
||||
'jquery3' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome4' => true,
|
||||
'dialoglib' => true,
|
||||
'phrases' => array(
|
||||
'ui' => array('speichern')
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="tab-content">
|
||||
<h3>
|
||||
<?php echo $this->p->t('uhstat', 'uhstat1AnmeldungUeberschrift') ?>
|
||||
</h3>
|
||||
<form class="form-horizontal" method="POST" action="<?php echo site_url('codex/UHSTAT1/saveUHSTAT1Data').'?person_id='.$formData['person_id'] ?>">
|
||||
<fieldset>
|
||||
<legend><?php echo $this->p->t('uhstat', 'persoenlicheAngaben') ?></legend>
|
||||
<div class="form-group">
|
||||
<label for="geburtsstaat" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'geburtsstaat') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="geburtsstaat" id="geburtsstaat" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['nation'] as $nation): ?>
|
||||
<option
|
||||
value="<?php echo $nation->nation_code ?>"
|
||||
<?php echo set_value('geburtsstaat') == $nation->nation_code ? " selected" : "" ?>>
|
||||
<?php echo $nation->nation_text ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('geburtsstaat'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?php echo $this->p->t('uhstat', 'angabenErziehungsberechtigte') ?></legend>
|
||||
<h4><?php echo $this->p->t('uhstat', 'erziehungsberechtigtePersonEins') ?></h4>
|
||||
<div class="form-group">
|
||||
<label for="mutter_geburtsjahr" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'mutterGeburtsjahr') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="mutter_geburtsjahr" id="mutter_geburtsjahr" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['jahre'] as $jahr): ?>
|
||||
<option
|
||||
value="<?php echo $jahr ?>"
|
||||
<?php echo set_value('mutter_geburtsjahr') == $jahr ? " selected" : "" ?>>
|
||||
<?php echo $jahr ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('mutter_geburtsjahr'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mutter_geburtsstaat" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'mutterGeburtsstaat') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="mutter_geburtsstaat" id="mutter_geburtsstaat" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['nation'] as $nation): ?>
|
||||
<option
|
||||
value="<?php echo $nation->nation_code ?>"
|
||||
<?php echo set_value('mutter_geburtsstaat') == $nation->nation_code ? " selected" : "" ?>>
|
||||
<?php echo $nation->nation_text ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('mutter_geburtsstaat'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mutter_bildungsstaat" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'hoechsterAbschlussStaat') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="mutter_bildungsstaat" id="mutter_bildungsstaat" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['nation'] as $nation): ?>
|
||||
<option
|
||||
value="<?php echo $nation->nation_code ?>"
|
||||
<?php echo set_value('mutter_bildungsstaat') == $nation->nation_code ? " selected" : "" ?>>
|
||||
<?php echo $nation->nation_text ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('mutter_bildungsstaat'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mutter_bildungmax" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'hoechsterAbschluss') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="mutter_bildungmax" id="mutter_bildungmax" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussInOesterreich') ?>">
|
||||
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
|
||||
</optgroup>
|
||||
<?php foreach ($formData['abschluss_oesterreich'] as $abschluss): ?>
|
||||
<option
|
||||
value="<?php echo $abschluss->ausbildung_code ?>"
|
||||
<?php echo set_value('mutter_bildungmax') == $abschluss->ausbildung_code ? " selected" : "" ?>>
|
||||
<?php echo $abschluss->bezeichnung[$formData['languageIdx']] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussNichtInOesterreich') ?>">
|
||||
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
|
||||
</optgroup>
|
||||
<?php foreach ($formData['abschluss_nicht_oesterreich'] as $abschluss): ?>
|
||||
<option
|
||||
value="<?php echo $abschluss->ausbildung_code ?>"
|
||||
<?php echo set_value('mutter_bildungmax') == $abschluss->ausbildung_code ? " selected" : "" ?>>
|
||||
<?php echo $abschluss->bezeichnung[$formData['languageIdx']] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('mutter_bildungmax'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<h4><?php echo $this->p->t('uhstat', 'erziehungsberechtigtePersonZwei') ?></h4>
|
||||
<div class="form-group">
|
||||
<label for="vater_geburtsjahr" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'vaterGeburtsjahr') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="vater_geburtsjahr" id="vater_geburtsjahr" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['jahre'] as $jahr): ?>
|
||||
<option
|
||||
value="<?php echo $jahr ?>"
|
||||
<?php echo set_value('vater_geburtsjahr') == $jahr ? " selected" : "" ?>>
|
||||
<?php echo $jahr ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('vater_geburtsjahr'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="vater_geburtsstaat" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'vaterGeburtsstaat') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="vater_geburtsstaat" id="vater_geburtsstaat" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['nation'] as $nation): ?>
|
||||
<option
|
||||
value="<?php echo $nation->nation_code ?>"
|
||||
<?php echo set_value('vater_geburtsstaat') == $nation->nation_code ? " selected" : "" ?>>
|
||||
<?php echo $nation->nation_text ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('vater_geburtsstaat'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="vater_bildungsstaat" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'hoechsterAbschlussStaat') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="vater_bildungsstaat" id="vater_bildungsstaat" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<?php foreach ($formData['nation'] as $nation): ?>
|
||||
<option
|
||||
value="<?php echo $nation->nation_code ?>"
|
||||
<?php echo set_value('vater_bildungsstaat') == $nation->nation_code ? " selected" : "" ?>>
|
||||
<?php echo $nation->nation_text ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('vater_bildungsstaat'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="vater_bildungmax" class="col-sm-3 control-label"><?php echo $this->p->t('uhstat', 'hoechsterAbschluss') ?></label>
|
||||
<div class="col-sm-9">
|
||||
<select type="text" name="vater_bildungmax" id="vater_bildungmax" class="form-control">
|
||||
<option disabled selected value=""><?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?></option>
|
||||
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussInOesterreich') ?>">
|
||||
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
|
||||
</optgroup>
|
||||
<?php foreach ($formData['abschluss_oesterreich'] as $abschluss): ?>
|
||||
<option
|
||||
value="<?php echo $abschluss->ausbildung_code ?>"
|
||||
<?php echo set_value('vater_bildungmax') == $abschluss->ausbildung_code ? " selected" : "" ?>>
|
||||
<?php echo $abschluss->bezeichnung[$formData['languageIdx']] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
<optgroup label="<?php echo $this->p->t('uhstat', 'wennAbschlussNichtInOesterreich') ?>">
|
||||
<?php echo $this->p->t('uhstat', 'bitteAuswaehlen') ?>
|
||||
</optgroup>
|
||||
<?php foreach ($formData['abschluss_nicht_oesterreich'] as $abschluss): ?>
|
||||
<option
|
||||
value="<?php echo $abschluss->ausbildung_code ?>"
|
||||
<?php echo set_value('vater_bildungmax') == $abschluss->ausbildung_code ? " selected" : "" ?>>
|
||||
<?php echo $abschluss->bezeichnung[$formData['languageIdx']] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php echo form_error('vater_bildungmax'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="text-right">
|
||||
<?php if (isset($successMessage)): ?>
|
||||
<span class='text-success'><?php echo $successMessage ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($errorMessage)): ?>
|
||||
<span class='text-danger'><?php echo $errorMessage ?></span>
|
||||
<?php endif; ?>
|
||||
<button class="btn btn-success" type="submit">
|
||||
<?php echo $this->p->t('ui', 'speichern') ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
+5
-1
@@ -12,7 +12,7 @@ if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_abschluss LIMIT 1'))
|
||||
bezeichnung character varying(128)[],
|
||||
aktiv boolean NOT NULL DEFAULT true,
|
||||
in_oesterreich boolean,
|
||||
CONSTRAINT tbl_abschluss_pk PRIMARY KEY (ausbildung_code)
|
||||
CONSTRAINT pk_tbl_abschluss PRIMARY KEY (ausbildung_code)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE bis.tbl_abschluss IS 'Key-Table of graduation';
|
||||
@@ -102,6 +102,8 @@ if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_uhstat1daten LIMIT 1'))
|
||||
REFERENCES public.tbl_person (person_id) MATCH SIMPLE
|
||||
ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE bis.tbl_uhstat1daten ADD CONSTRAINT uk_uhstat1daten_person_id UNIQUE(person_id);
|
||||
|
||||
COMMENT ON TABLE bis.tbl_uhstat1daten IS 'UHSTAT1 data for a person (statistical data)';
|
||||
COMMENT ON COLUMN bis.tbl_uhstat1daten.geburtsstaat IS 'Birthplace of person';
|
||||
COMMENT ON COLUMN bis.tbl_uhstat1daten.mutter_geburtsstaat IS 'Birth country of mother of person';
|
||||
@@ -115,6 +117,8 @@ if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_uhstat1daten LIMIT 1'))
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON bis.tbl_uhstat1daten TO web;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON bis.tbl_uhstat1daten TO vilesci;
|
||||
GRANT SELECT, UPDATE ON bis.tbl_uhstat1daten_uhstat1daten_id_seq TO vilesci;
|
||||
GRANT SELECT, UPDATE ON bis.tbl_uhstat1daten_uhstat1daten_id_seq TO web;
|
||||
";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
|
||||
Reference in New Issue
Block a user