121
$this->smarty->assign('theTikets', $this->getTikets('default'));
$this->smarty->display('work/workspace.tpl');
$this->smarty->display('work/footer.tpl');
}
}
public function getInternContent(){
if(isset($_GET['param_1']) && $_GET['param_1'] == 'bolt'){
$this->smarty->assign('title', "Болты и ждуны - рабочая зона");
$this->smarty->display('header.tpl');
$this->smarty->assign('logined', $_SESSION['logined']);
$this->smarty->display('work/navbar.tpl');
$this->json = json_decode(file_get_contents('config.json'), true);
$this->smarty->assign('config', $this->json);
$this->smarty->display('work/workspace_waiting+bolt.tpl');
$this->smarty->display('work/footer.tpl');
}else{
$this->smarty->assign('title', "Рабочая зона");
$this->smarty->display('header.tpl');
$this->smarty->assign('logined', $_SESSION['logined']);
$this->smarty->display('work/navbar.tpl');
$this->json = json_decode(file_get_contents('config.json'), true);
$this->smarty->assign('config', $this->json);
$this->smarty->assign('masters', $this->getArrFromTableBYQuery("SELECT mng.id,
mng.synonym, mng.rights FROM managers as mng WHERE mng.rights <> 'noAccess'"));
$this->smarty->assign('newUserPassword', $this->getPassword());
$clients['data'] = $this->getArrFromTableBYQuery("
SELECT
cl.id,cl.surname,cl.firstname,cl.middlename,cl.email,cl.phone,cl.password,cls.id as
clientStatus
FROM clients as cl
join clientStatuses as cls on cl.clientStatus = cls.id");
foreach ($this->json['clients']['columns'] as $jsnKey => $jsnVal){
if(!isset($clients['refs'][$jsnKey]) && $jsnVal['colType'] == 'select'){
$clients['refs'][$jsnKey] = $this->getArrFromTableBYQuery("SELECT
".$jsnVal['selectColumns']." FROM ".$jsnVal['relatedTable']);
}
}
$this->smarty->assign('clients', $clients);
unset($clients);
$this->smarty->assign('toDoListArr', $this->getArrFromTableBYQuery("
SELECT
tdl.id,tdl.taskText,tdl.authorId,tdl.taskDate,tdl.target,mg.synonym as taskAuthor
FROM toDoList as tdl join managers as mg on tdl.authorID =
mg.id
WHERE tdl.target = 'main' ORDER BY tdl.taskDate ASC"));
$this->smarty->assign('tasksListArr', $this->getArrFromTableBYQuery("
SELECT
tdl.id,tdl.taskText,tdl.authorId,tdl.taskDate,tdl.target,mg.synonym as taskAuthor