public function memberLinkInfo($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('studentAssocationMemberItem' => 'stu_union_member', 'studentInfoItem' => 'stu_basic_info'); $table = array('stu_union_member', 'stu_basic_info'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function stuLinkClass($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('studentIdentityItem' => 'stu_identification_info', 'studentInfoItem' => 'stu_basic_info'); $table = array('stu_identification_info', 'stu_basic_info'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function logLinkGroupMember($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('researchGroupMemberItem' => 'res_member', 'researchGroupLogItem' => 'res_group_log'); $table = array('res_member', 'res_group_log'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function messageLinkContent($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('messageContentItem' => 'message', 'messageContraceItem' => 'message_interconnect'); $table = array('message', 'message_interconnect'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function awardLinkTeacher($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('teacherInfoItem' => 'teacher_basic_info', 'teacherAwardItem' => 'teacher_award'); $table = array('teacher_award', 'teacher_basic_info'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function projectLinkGroup($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('researchGroupProjectItem' => 'res_group_achievement', 'researchGroupItem' => 'res_group'); $table = array('res_group_achievement', 'res_group'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function classLinkStaff($req, $lk, $arg) { $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $map = array('classItem' => 'class', 'staffInfoItem' => 'emp_basic_info'); $table = array('class', 'emp_basic_info'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); $res = $db->query($sql); return $res; }
public function test2Action() { require $_SERVER['DOCUMENT_ROOT'] . '/school' . '/model/pod.php'; $db = new POD(); $p = $db->connect(); if ($p == false) { throw new Exception('Database connect failed'); } $req = array(); $lk = array('account'); $req[0] = array('key' => 'account', 'account' => '111', 'table' => 'p'); $arg = array('name', 'password'); $table = array('Person', 'Account'); $map = array('p' => 'Person', 'a' => 'Account'); $sql = $db->genLinkSql($req, $lk, $arg, $table, $map); //echo $sql; //exit; $res = $db->query($sql); return $res; }
public function showScoreAction() { $sql1 = "select c.Course_ID,c.Course,sc.Score,c.Property,c.credit,c.intro from Course as c,Stu_Course as sc where c.Course_ID = sc.Course_ID and c.Course_year_term = {$_POST['Course_year_term']} and sc.Stu_ID = {$_POST['Account']}"; require_once $_SERVER['DOCUMENT_ROOT'] . '/school' . '/model/pod.php'; $pod = new POD(); $pod->connect(); $result = $pod->query($sql1); foreach ($result as $key => $value) { $where = $result[$key]['Course_ID']; $sql2 = "select Stu_ID from Stu_Course where Course_ID='{$where}' order by Score desc"; $ids = $pod->query($sql2); foreach ($ids as $rank => $id) { if ($id['Stu_ID'] == $_POST['Account']) { $result[$key]['rank'] = $rank + 1; break; } } } $pod->close(); return json_encode($result); }