adds the dashboard menu punkt and adds greeting to the dashboard view

This commit is contained in:
SimonGschnell
2024-10-17 09:58:28 +02:00
parent 14aa98c223
commit e475fe568e
4 changed files with 65 additions and 9 deletions
+8 -1
View File
@@ -27,6 +27,13 @@ class Cis4 extends FHC_Controller
*/
public function index()
{
$this->load->view('CisVue/Dashboard.php');
$this->load->model('person/Person_model','PersonModel');
$begrüsung = $this->PersonModel->getFirstName(getAuthUID());
if(isError($begrüsung))
{
show_error("name couldn't be loaded for username ".getAuthUID());
}
$begrüsung = getData($begrüsung);
$this->load->view('CisVue/Dashboard.php',["name"=> $begrüsung]);
}
}
@@ -290,6 +290,21 @@ class Person_model extends DB_Model
return success($result->vorname. ' '. $result->nachname);
}
/**
* Get first name of given uid. (Vorname Nachname)
* @param $uid
* @return array
*/
public function getFirstName($uid)
{
$result = getData($this->getByUid($uid))[0];
if (!$result) {
show_error('Failed loading person');
}
return success($result->vorname);
}
public function checkDuplicate($person_id)
{
$qry = "SELECT person_id
+1 -1
View File
@@ -12,7 +12,7 @@ $this->load->view('templates/CISVUE-Header', $includesArray);
?>
<div id="content">
<h2>Dashboard</h2>
<h2>Hallo <?= $name?>!</h2>
<hr>
<fhc-dashboard dashboard="CIS"/>
</div>