Exemplo n.º 1
0
*/
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
require ROOT_PATH . '/includes/cls_sms.php';
/*------------------------------------------------------ */
//-- 班级管理员帐号列表
/*------------------------------------------------------ */
$table = "hteacher.ht_admin_user";
if ($_REQUEST['act'] == 'list') {
    /* 检查权限 */
    admin_priv('classAdmin_manage');
    $smarty->assign('ur_here', "班级管理员列表");
    $smarty->assign('action_link', array('text' => "添加班级管理员", 'href' => 'classAdmin.php?act=add'));
    $classAdmin_list = classAdmin_list($table);
    $class_list = class_list();
    $grade_list = grade_list();
    $smarty->assign('classAdmin_list', $classAdmin_list['classAdmin_list']);
    $smarty->assign('class_list', $class_list);
    $smarty->assign('grade_list', $grade_list);
    $smarty->assign('filter', $classAdmin_list['filter']);
    $smarty->assign('record_count', $classAdmin_list['record_count']);
    $smarty->assign('page_count', $classAdmin_list['page_count']);
    $smarty->assign('full_page', 1);
    $smarty->assign('sort_classAdmin_id', '<img src="images/sort_desc.gif">');
    assign_query_info();
    $smarty->display('classAdmin_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $classAdmin_list = classAdmin_list($table);
    $smarty->assign('classAdmin_list', $classAdmin_list['classAdmin_list']);
    $smarty->assign('filter', $classAdmin_list['filter']);
    $smarty->assign('record_count', $classAdmin_list['record_count']);
Exemplo n.º 2
0
    $result = grade_list();
    /* 模板赋值 */
    $smarty->assign('ur_here', "年级列表");
    // 当前导航
    $smarty->assign('action_link', array('href' => 'grade.php?act=add', 'text' => "添加年级数据"));
    $smarty->assign('full_page', 1);
    // 翻页参数
    $smarty->assign('grade_list', $result);
    $smarty->assign('sort_grade_id', '<img src="images/sort_desc.gif">');
    /* 显示模板 */
    assign_query_info();
    $smarty->display('grade_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $sort_by = isset($_REQUEST['sort_by']) ? "" : trim($_REQUEST['sort_by']);
    $sort_order = isset($_REQUEST['sort_order']) ? "DESC" : trim($_REQUEST['sort_order']);
    $result = grade_list($sort_by, $sort_order);
    $smarty->assign('grade_list', $result);
    /* 排序标记 */
    $filter = array("sort_by" => $sort_by, "sort_order" => $sort_order);
    $sort_flag = sort_flag($filter);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('grade_list.htm'), '', array());
} elseif ($_REQUEST['act'] == 'remove') {
    $id = intval($_REQUEST['id']);
    $sql = "select * from " . $ecs->table('grade') . " WHERE grade_id = '{$id}'";
    $grade = $db->getRow($sql);
    if ($grade['grade_id']) {
        $sql = "DELETE FROM " . $ecs->table('grade') . "\r\n            WHERE grade_id = '{$id}'";
        $db->query($sql);
        /* 记日志 */
        admin_log($grade['name'], 'remove', 'grade');