function save_comment($comment_arr, $obj_id, $is_reply = false) { global $_lang, $kekezu, $uid, $username; if (!$uid) { return -1; die; } $r = kekezu::check_session('task_leave', 2, 4); if ($r == false) { return -2; die; } strtolower(CHARSET) == 'gbk' and $comment_arr['content'] = kekezu::utftogbk(kekezu::escape($comment_arr['content'])); if (kekezu::k_match(array($kekezu->_sys_config['ban_content']), $comment_arr['content'])) { return -3; die; } $comment_id = $this->_comment_obj->save($comment_arr); $model_list = $kekezu->_model_list; if (!$is_reply) { if ($this->_comment_type == 'task') { $res = db_factory::execute(sprintf(" update %switkey_task set leave_num =ifnull(leave_num,0)+1 where task_id='%d'", TABLEPRE, $obj_id)); $obj_info = db_factory::get_one(sprintf("select * from %switkey_task where task_id=%d", TABLEPRE, $obj_id)); if ($obj_info['task_cash_coverage']) { $cash = $obj_info['task_cash_coverage']; } else { $cash = $obj_info['task_cash']; } } elseif ($this->_comment_type == 'service') { $res = db_factory::execute(sprintf(" update %switkey_service set leave_num =ifnull(leave_num,0)+1 where service_id='%d'", TABLEPRE, $obj_id)); $obj_info = db_factory::get_one(sprintf("select * from %switkey_service where service_id=%d", TABLEPRE, $obj_id)); } } return $comment_id; }
break; case 'workinfo': $workId = intval($workId); $arrWorkInfo = $objTask->get_task_work($workId); $arrWorkFiles = $objTask->get_work_file($arrWorkInfo['work_file']); $intFavorite = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and obj_id = %d and keep_type = "work"', TABLEPRE . 'witkey_favorite', intval($gUid), intval($arrWorkInfo['work_id']))); require keke_tpl_class::template('task/workinfo'); die; break; case 'reqedit': if (isset($formhash) && kekezu::submitcheck($formhash)) { if (strtoupper(CHARSET) == 'GBK') { $tar_content = kekezu::utftogbk($tar_content); } $tar_content = strip_tags(htmlspecialchars_decode($tar_content)); if ($kekezu->_sys_config['ban_content'] && kekezu::k_match(array($kekezu->_sys_config['ban_content']), $tar_content)) { $tips['errors']['tar_content'] = $_lang['sensitive_word']; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } $resText = $objTask->set_task_reqedit(kekezu::escape($tar_content)); if ($resText === true) { kekezu::show_msg('操作成功', 'index.php?do=task&id=' . $taskId, 3, NULL, 'ok'); } else { kekezu::show_msg($resText, 'index.php?do=task&id=' . $taskId, 3, NULL, 'fail'); } } else { $strExtDesc = $arrTaskInfo['ext_desc']; require keke_tpl_class::template('task/reqedit'); die; } die;