mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-20 05:29:29 +00:00
Daten fuer die Betriebsmittel und zutrittskarten_ausgegebenam gesammelt
This commit is contained in:
@@ -21,11 +21,13 @@ class Profil extends Auth_Controller
|
||||
|
||||
]);
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('ressource/student_model', 'StudentModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
|
||||
}
|
||||
@@ -50,7 +52,27 @@ class Profil extends Auth_Controller
|
||||
|
||||
public function getMitarbeiterAnsicht(){
|
||||
|
||||
|
||||
|
||||
|
||||
$zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId());
|
||||
if(isError($zutrittskarte_ausgegebenam)){
|
||||
// error handling
|
||||
}else{
|
||||
$zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0] : null;
|
||||
}
|
||||
|
||||
if(
|
||||
isSuccess($this->BetriebsmittelpersonModel->addSelect(["betriebsmitteltyp", "beschreibung","nummer","ausgegebenam"]))
|
||||
){
|
||||
$betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId());
|
||||
if(isError($betriebsmittelperson_res)){
|
||||
// error handling
|
||||
}else{
|
||||
$betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null;
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as bf_bezeichnung","tbl_organisationseinheit.bezeichnung as oe_bezeichnung","datum_von","datum_bis","wochenstunden"]))
|
||||
&& isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz"))
|
||||
@@ -119,7 +141,10 @@ class Profil extends Auth_Controller
|
||||
$res->ort = $adresse_res->ort;
|
||||
//? Benutzerfunktion Info
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
|
||||
//? Betriebsmittel Info
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam->ausgegebenam;
|
||||
$res->kontakt = $kontakte;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,28 @@ class Student_model extends DB_Model
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the user is a Student.
|
||||
* @param string $uid
|
||||
* @return array
|
||||
*/
|
||||
public function isStudent($uid)
|
||||
{
|
||||
$this->addSelect('1');
|
||||
|
||||
$result = $this->loadWhere(array('student_uid' => $uid));
|
||||
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Generiert die Matrikelnummer
|
||||
// * FORMAT: 0710254001
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
class Student_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_student';
|
||||
$this->pk = 'student_uid';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the user is a Student.
|
||||
* @param string $uid
|
||||
* @return array
|
||||
*/
|
||||
public function isStudent($uid)
|
||||
{
|
||||
$this->addSelect('1');
|
||||
|
||||
|
||||
$result = $this->loadWhere(array('student_uid' => $uid));
|
||||
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
|
||||
//! THIS FILE WAS CREATED USING THE Mitarbeiter_model.php FILE
|
||||
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ $this->load->view('templates/CISHTML-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
<h2>Profil2</h2>
|
||||
<h2>Profil22</h2>
|
||||
<hr>
|
||||
<p><?php echo $uid; ?></p>
|
||||
<!-- we can pass information from the php view file to the public js file through interpolating data from php into vue props -->
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
},
|
||||
created(){
|
||||
//error //! fhcapifactory.UserData.getUser().then(res => this.person = res.data);
|
||||
fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => this.role = res.data);
|
||||
fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => {console.log(res.data);this.role = res.data;});
|
||||
fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => {this.person_info = res.data;});
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user