Разделение функционала действий на разных страницах
This commit is contained in:
parent
efbe2903cb
commit
46ef2c85fb
|
@ -118,7 +118,9 @@ class attendancelog {
|
|||
$awn = json_decode(file_get_contents($url),1);
|
||||
return $awn['week_cur'];
|
||||
}
|
||||
public function headmanAddEdit(){
|
||||
|
||||
}
|
||||
public function predmetsAddEdit($predmet_name){
|
||||
//принимает имя предмета. Делает запись в таблицу предметов, если такой нет. В любом случае возвращает айди предмета
|
||||
$sql_search = 'SELECT id, name FROM acs_attendancelog_predmets WHERE name="'. $predmet_name .'"';
|
||||
|
@ -200,6 +202,11 @@ class attendancelog {
|
|||
return $out;
|
||||
}
|
||||
}
|
||||
function headmanPageAction(){
|
||||
$des = ''; if(isset($_GET['des'])) $des = $_GET['des'];
|
||||
if($des == 'add_edit'){
|
||||
}
|
||||
}
|
||||
function HTML()
|
||||
{
|
||||
GLOBAL $smarty;
|
||||
|
@ -207,19 +214,20 @@ class attendancelog {
|
|||
$currentUserInfo = $this->currentUserInfo();
|
||||
$currentTime = $this->currentTime();
|
||||
$AttendanceAddEdit = $this->AttendanceAddEdit();// должен вызываться перед mainPageAction
|
||||
$actionResult = $this->mainPageAction();
|
||||
$mainPageActionResult = $this->mainPageAction();
|
||||
$headmanPageActionResult = $this->headmanPageAction();
|
||||
$predmetsAddEdit = $this->predmetsAddEdit('Исследование операций и методы оптимизации');
|
||||
|
||||
|
||||
//$html .= '<pre>'. print_r($groups,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($currentUserInfo,1) . '</pre>';
|
||||
$html .= '<pre>'. print_r($actionResult,1) . '</pre>';
|
||||
$html .= '<pre>'. print_r($predmetsAddEdit,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($mainPageActionResult,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($predmetsAddEdit,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($currentTime,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($_SESSION,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($AttendanceAddEdit,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($_GET,1) . '</pre>';
|
||||
$html .= '<pre>'. print_r($_POST,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($_POST,1) . '</pre>';
|
||||
//$html .= '<pre>'. print_r($_SESSION,1) . '</pre>';
|
||||
|
||||
$page = ''; if(isset($_GET['page'])) $page = $_GET['page'];
|
||||
|
@ -229,6 +237,9 @@ class attendancelog {
|
|||
$smarty->assign('currentTime', $currentTime);
|
||||
$smarty->assign('currentUserInfo', $currentUserInfo);
|
||||
if($page == 'headman') {
|
||||
$facult_groups = $this->getAllGrupps($currentUserInfo['facult']['facult_id']);
|
||||
$smarty->assign('facult_groups',$facult_groups);
|
||||
$smarty->assign('headmanPageActionResult', $headmanPageActionResult);
|
||||
$smarty->clearCache('moduls/attendancelog/tpl/headman.html');
|
||||
$html .= $smarty->fetch('moduls/attendancelog/tpl/headman.html');
|
||||
}
|
||||
|
@ -245,10 +256,10 @@ class attendancelog {
|
|||
$html .= $smarty->fetch('moduls/attendancelog/tpl/main_page.html');
|
||||
|
||||
}
|
||||
if ($page == 'main'){//Староста
|
||||
if ($page == 'main'){
|
||||
if ($des == 'show'){
|
||||
$smarty->assign('AttendanceAddEdit', $AttendanceAddEdit);
|
||||
$smarty->assign('actionResult', $actionResult);
|
||||
$smarty->assign('mainPageActionResult', $mainPageActionResult);
|
||||
$groupName = $this->getGroupNameByID((int)$_GET['id']);
|
||||
$groupName = $groupName[1]['sokr'];
|
||||
$smarty->assign('groupName', $groupName);
|
||||
|
|
Loading…
Reference in New Issue