if (IN_DEV) { if (isset($_GET['json'])) { $programIn = $_GET['json']; $incoming_data = json_decode($programIn, TRUE); } $action = $_GET['action']; } else { $programIn = file_get_contents('php://input'); $incoming_data = json_decode($programIn, TRUE); $action = $incoming_data['action']; } $outgoing_data = array(); switch ($action) { case 'update': case 'update_asm': $outgoing_data = get_update_info(); break; case 'sign_in': $outgoing_data = user_sign_in($incoming_data); break; case 'cache_data': $outgoing_data = get_cached_data($incoming_data); break; // case 'memory_game_list': // $outgoing_data = get_memory_game_list($incoming_data); // break; // case 'test': // $outgoing_data['foo'] = 'bar'; // break; // case 'memory_game_list': // $outgoing_data = get_memory_game_list($incoming_data);
function mod_report_cols() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $ref =& $_SESSION['report_tempdata']['columns_filter_category']; if (isset($_POST['columns_filter'])) { $ref = $_POST['columns_filter']; } $idrep = Get::req('modid', DOTY_INT, false); $lang =& DoceboLanguage::createInstance('report'); $obj_report = openreport($idrep); $obj_report->back_url = 'index.php?modname=public_report_admin&op=modify_rows&modid=' . $idrep; $obj_report->jump_url = 'index.php?modname=public_report_admin&op=modify_cols&modid=' . $idrep; $obj_report->next_url = 'index.php?modname=public_report_admin&op=modify_save&modid=' . $idrep; //page title $page_title = getTitleArea(array('index.php?modname=public_report_admin&op=reportlist' => $lang->def('_REPORT'), 'index.php?modname=public_report_admin&op=modify_name&modid=' . $idrep => $lang->def('_REPORT_MOD_NAME'), 'index.php?modname=public_report_admin&op=modify_rows&modid=' . $idrep => $lang->def('_REPORT_MOD_ROWS'), $lang->def('_REPORT_MOD_COLUMNS'))) . '<div class="std_block">'; /*$info = get_update_info(); if($info) $GLOBALS['page']->add( getInfoUi($info) );*/ if ($obj_report->useStandardTitle_Columns()) { $GLOBALS['page']->add($page_title, 'content'); $info = get_update_info(); if ($info) { $GLOBALS['page']->add(getInfoUi($info), 'content'); } $GLOBALS['page']->add(Form::openForm('user_report_columns_courses_mod', str_replace('&', '&', $obj_report->jump_url)), 'content'); } else { //this is used just to pass std title string to object functions, who may use it $obj_report->page_title = $page_title; } $query = "SELECT filter_data FROM " . $GLOBALS['prefix_lms'] . "_report_filter WHERE id_filter='" . (int) $idrep . "'"; list($old_data_serialized) = mysql_fetch_row(mysql_query($query)); $old_data = unserialize($old_data_serialized); $category = $old_data['columns_filter_category']; $_SESSION['report_tempdata']['columns_filter_category'] = $category; unset($old_data); unset($old_data_serialized); $output = $obj_report->get_columns_filter($category); //($_SESSION['report_tempdata']['columns_filter_category']); $GLOBALS['page']->add($output, 'content'); if ($obj_report->useStandardTitle_Columns()) { $GLOBALS['page']->add(Form::openButtonSpace(), 'content'); $GLOBALS['page']->add(Form::getBreakRow() . Form::getButton('pre_filter', 'pre_filter', $lang->def('_SHOW_NOSAVE', 'report')) . Form::getButton('ok_filter', 'import_filter', $lang->def('_SAVE_BACK', 'report')) . Form::getButton('show_filter', 'show_filter', $lang->def('_SAVE_SHOW', 'report')) . Form::getButton('undo_filter', 'undo_filter', $lang->def('_UNDO', 'report')), 'content'); $GLOBALS['page']->add(Form::closeButtonSpace(), 'content'); $GLOBALS['page']->add(Form::closeForm(), 'content'); $GLOBALS['page']->add('</div>', 'content'); //close std_block div } }
function report_modify_columns() { checkPerm('mod'); require_once _base_ . '/lib/lib.form.php'; $ref =& $_SESSION['report_tempdata']['columns_filter_category']; if (isset($_POST['columns_filter'])) { $ref = $_POST['columns_filter']; } $idrep = Get::req('modid', DOTY_INT, false); $lang =& DoceboLanguage::createInstance('report'); $obj_report = openreport(); $obj_report->back_url = 'index.php?modname=report&op=modify_rows&modid=' . $idrep; $obj_report->jump_url = 'index.php?modname=report&op=modify_cols&modid=' . $idrep; $obj_report->next_url = 'index.php?modname=report&op=report_save&modid=' . $idrep; //page title $page_title = getTitleArea(array('index.php?modname=report&op=reportlist' => $lang->def('_REPORT'), 'index.php?modname=report&op=modify_name&modid=' . $idrep => $lang->def('_MOD'), 'index.php?modname=report&op=modify_rows&modid=' . $idrep => $lang->def('_REPORT_MOD_ROWS'), $lang->def('_REPORT_MOD_COLUMNS'))) . '<div class="std_block">'; /*$info = get_update_info(); if($info) cout( getInfoUi($info) );*/ if ($obj_report->useStandardTitle_Columns()) { cout($page_title); $info = get_update_info(); if ($info) { cout(getInfoUi($info)); } cout(Form::openForm('user_report_columns_courses_mod', $obj_report->jump_url)); } else { //this is used just to pass std title string to object functions, who may use it $obj_report->page_title = $page_title; } $obj_report->get_columns_filter($_SESSION['report_tempdata']['columns_filter_category']); if ($obj_report->useStandardTitle_Columns()) { cout(Form::openButtonSpace()); cout(Form::getBreakRow() . Form::getButton('pre_filter', 'pre_filter', $lang->def('_SHOW_NOSAVE', 'report')) . Form::getButton('ok_filter', 'import_filter', $lang->def('_SAVE_BACK', 'report')) . Form::getButton('show_filter', 'show_filter', $lang->def('_SAVE_SHOW', 'report')) . Form::getButton('undo_filter', 'undo_filter', $lang->def('_UNDO', 'report'))); cout(Form::closeButtonSpace()); cout(Form::closeForm()); cout('</div>'); //close std_block div } }