* Time: 下午3:16 */ header("Content-type: application/json"); require_once "../config/config.inc"; require_once "contentinfo.class.php"; $type = $_POST['type']; switch (strtolower($type)) { case "addinfo": $title = $_POST['title']; $content = $_POST['content']; $url = $_POST['url']; $contenttype = $_POST['datatype']; $iorder = $_POST['iorder']; $id = $_POST['id']; $userAction = new Contentinfo(); $userAction->addData($title, $content, $url, $contenttype, $iorder, $id); unset($userAction); echo "1"; break; case "delinfo": $items = $_POST['items']; $id = explode(",", $items); $userAction = new Contentinfo(); foreach ($id as $ide) { $userAction->delData($ide); } unset($userAction); echo "1"; break; case "getinfo": $recid = $_POST['id'];