public function add_oitem_save() { $id = get_post_value('id'); $item = get_post_value('item'); $field = array('issue_id' => $id, 'item' => $item, 'selected' => 0, 'status' => '10000', 'type' => '20000'); $m = new Survey(); $m->clear(); $m->setField($field); $m->setTable(' vcb_survey_item '); $data = $m->insert(); if (!empty($data)) { header("Location:add_oitem?id=" . $id); } else { header("Location:error"); } }
$newMessages = $user->getNewMessages(); header('Content-Type:application/json'); echo json_encode($newMessages); break; case 'send': $user = new User($username); $check = $user->sendMessage($text); header('Content-Type:application/json'); echo json_encode($check); break; } case 'response': switch ($action) { case 'new': $survey = new Survey($title, $username, $response); $check = $survey->insert(); header('Content-Type:application/json'); echo json_encode($check); break; case 'request': $survey = new Survey(); $surveys = $survey->getAll(); header('Content-Type:application/json'); echo json_encode($surveys); break; case 'votes': $survey = new Survey($title); $votes = $survey->getVotes(); header('Content-Type:application/json'); echo json_encode($votes); break;
private function re_other($i, $content) { $field = array('content' => $content, 'user_name' => '', 'user_ip' => $_SERVER["REMOTE_ADDR"], 'issue_id' => $i); $m = new Survey(); $m->clear(); $m->setField($field); $m->setTable('vcb_survey_other'); $m->insert(); }