File manager - Edit - /home/missmand/public_html/learning/old/main/cooperation/refresh_left.php
Back
<?php // Require subrole methods require_once '../inc/global.inc.php'; require_once(api_get_path(SYS_PATH) . 'main/subrole/subrole.php'); require_once(api_get_path(SYS_PATH) . 'main/couple/model.php'); require_once(api_get_path(SYS_PATH) . 'main/couple/action.php'); require_once(api_get_path(SYS_PATH) . 'main/couple/agenda.php'); require_once(api_get_path(SYS_PATH) . 'main/couple/tchat.php'); require_once(api_get_path(SYS_PATH) . 'main/couple/doc.php'); require_once(api_get_path(SYS_PATH) . 'main/couple/doc_system.php'); $controller = new IndexManager("Ajax"); $my_user_id = api_get_user_id(); $my_subrole = get_subrole($my_user_id); // Get info about tabs if (isset($_GET['tab'])) { $current_tab = intval($_GET['tab']); if (!is_int($current_tab) || $current_tab < 0 || $current_tab > 2) { $current_tab = 0; } } else { $current_tab = 0; } //echo "Current tab = $current_tab"; exit; if ($my_subrole == TUTOR) { if (isset($_SESSION['mm_couple_id']) && isset($_SESSION['mm_couple_type'])) { $couple = couple_get_from_id($_SESSION['mm_couple_id'], $_SESSION['mm_couple_type']); } else { error_throw("Couple can't be computed, couple_id and _type are not set", "cooperation/refresh_let.php"); } } else { $couple = couple_get_coop_partner(); } // Get couples or partner $couple_id = $couple['couple_id']; $couple_type = strtoupper($couple['type']); if (!couple_id_is_valid($couple_id, $couple_type)) { error_throw("Couple is not valid ('$couple_id', '$couple_type')", "cooperation/refresh_let.php"); } try { switch ($current_tab) { case 0 : $docs = doc_read($couple_id, $couple_type); $controller->tpl->assign('docs', $docs); break; case 1 : $dates = agenda_read($couple_id, $couple_type); $controller->tpl->assign('dates', $dates); break; case 2 : $actions = action_read_and_format($couple_id, $couple_type); $controller->tpl->assign('actions', $actions); break; default : error_throw("Wrong tab number ($current_tab)" , "refresh_left"); } } catch (Exception $e) { echo "Une erreur est survenue."; exit; error_log($e->getMessage()); } // Tabs for ($i=0; $i < 3; $i++) { $labels = array('Documents', 'Agenda', 'Actions'); $tabs[] = array("href" => "?tab=$i", "class" => ($current_tab == $i ? 'mm_tab_selected' : 'mm_tab'), "label" => $labels[$i]); } // Images $css_path = api_get_path(WEB_CSS_PATH); $images = array('img_edit' => 'mm_edit', 'img_ok' => 'mm_checkmark', 'img_ok_green' => 'mm_checkmark_green', 'img_create' => 'mm_new', 'img_restore' => 'mm_restore', 'img_bin' => 'mm_bin'); foreach ($images as $key => $value) { $controller->tpl->assign($key, $css_path . $value . '.png'); } // Render template $controller->tpl->assign('current_tab', $current_tab); $controller->tpl->assign('couple', $couple); $controller->tpl->assign('web_path', api_get_path(WEB_PATH)); $controller->tpl->assign('my_user_id', $my_user_id); $controller->tpl->assign('my_subrole', get_subrole($my_user_id)); $controller->tpl->assign('tabs', $tabs); $controller->tpl->assign('part', 'cooperation'); $tpl = $controller->tpl->get_template('layout/mm_coop_left.tpl'); $controller->tpl->display($tpl); ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings