public function update() { $school = $this->_post('school'); $year = $this->_post('year'); $term = $this->_post('term'); $type = $this->_post('type'); set_info('INFO_SCHOOL', $school); set_info('INFO_YEAR', $year); set_info('INFO_TERM', $term); set_info('INFO_TYPE', $type); $this->redirect('Admin/Info/index'); }
case "appoint": appoint_minister(); show_menu(); show_parliament(); break; case "show_parliament": show_menu(); show_parliament(); break; case "sethomepage": set_homepage(); show_menu(); show_info(); break; case "setinfo": set_info(); show_menu(); show_info(); break; case "setpic": set_pic(); show_menu(); show_info(); break; case "setsymbol": set_symbol(); show_menu(); show_info(); break; case "info": show_menu();
<div align="left"> <?php include 'scripts/web_scripts/get_connection.php'; try { if (PHP_SAPI === 'cli') { $id = $argv[1]; } else { $id = $_GET['id']; } if (!empty($_POST)) { // 8/27/15 set_info($conn, $id); set_opinions($conn, $id); } get_info($conn, $id); get_opinions($conn, $id); } catch (PDOException $e) { echo "Connection failed: " . $e->getMessage(); return; } $conn = null; function set_opinions($conn, $id) { $form = $_POST; $query = "SELECT opinions.opin_descrip, user_opin.opinion FROM opinions JOIN user_opin ON opinions.id = user_opin.opin_id WHERE user_opin.user_id = :id;"; $query = $conn->prepare($query); $query->bindparam(':id', $id);