<?php $root = "../../../../../"; $KoolControlsFolder = "{$root}/KoolPHPSuite/KoolControls"; require $KoolControlsFolder . "/KoolListBox/koollistbox.php"; require_once "{$root}/class/autoload.inc"; if (isset($_POST['dept_id'])) { $dept_id = util::getInt('dept_id', -1); $major_id = util::getInt('major_id', -1); $class_id = util::getInt('class_id', -1); $s_role = util::getInt('s_role', -1); $s_role_to = $s_role + 1; $s_grade = util::getInt('s_grade', -1); $sel = 'select s_id, s_name, s_num, s_role from student join class using(class_id) join major using(major_id) join department using(dept_id) join education using(edu_id) '; $sel .= " where (s_role={$s_role} or s_role={$s_role_to})"; if ($class_id != -1) { $sel .= " and class_id= {$class_id}"; } else { if ($major_id != -1) { $sel .= " and major_id= {$major_id}"; } else { if ($dept_id != -1) { $sel .= " and dept_id= {$dept_id}"; } } } if ($s_grade != -1) { $sel .= " and s_grade={$s_grade}"; } $testBox = array(); for ($i = $s_role; $i <= $s_role_to; $i++) {
<?php require_once "../../../../../class/autoload.inc"; function doIt($s_role, $s_ids, $con) { foreach ($s_ids as $s_id) { $ex = "update student set s_role='{$s_role}' where s_id={$s_id}"; $con->exec($ex); } } $s_ids1 = explode(" ", $_POST['s_id1']); $s_ids2 = explode(" ", $_POST['s_id2']); $s_role1 = util::getInt('s_role1', -1); $s_role2 = util::getInt('s_role2', -1); $con = new DB_Connect(); doIt($s_role1, $s_ids1, $con); doIt($s_role2, $s_ids2, $con);
<?php error_reporting(E_ALL); ini_set('display_errors', 1); require_once "../../../../../class/util.php"; $where_cla = ""; $dept_id = util::getInt('st_depart', -1); $major_id = util::getInt('st_major', -1); $class_id = util::getInt('st_class', -1); if ($class_id != -1) { $where_cla = " where class_id= {$class_id}"; } else { if ($major_id != -1) { $where_cla = " where major_id= {$major_id}"; } else { if ($dept_id != -1) { $where_cla = " where dept_id= {$dept_id}"; } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>学生帐号查看</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="../../../../js/jquery-1.9.0.js" type='text/javascript'></script> <script src="index.js" type='text/javascript'></script> <link rel="stylesheet" href="../../../../css/common.css" /> </head> <body>