if ($txt_task_day) { $task_obj->setSub_time(strtotime($txt_task_day)); $task_obj->setEnd_time(strtotime($txt_task_day) + $task_config['choose_time'] * 24 * 3600); } $task_obj->setIndus_id($slt_indus_id); $task_obj->setTask_cash($task_cash); $task_obj->setReal_cash($task_cash * (1 - $task_info['profit_rate'] / 100)); $fds['task_cash_coverage'] and $task_obj->setTask_cash_coverage($fds['task_cash_coverage']); $fds['budget'] and $task_obj->setBudget($fds['budget']); $task_obj->setTask_desc($task_desc); $fields = kekezu::escape($fields); $task_obj->setSeo_title($fields['seo_title']); $task_obj->setSeo_keyword($fields['seo_keyword']); $task_obj->setSeo_desc($fields['seo_desc']); if ($_FILES['fle_task_pic']['name']) { $task_pic = keke_file_class::upload_file("fle_task_pic"); } else { $task_pic = $task_pic_path; } $task_obj->setTask_pic($task_pic); kekezu::admin_system_log($_lang['edit_task'] . ":{$task_title}"); $res = $task_obj->edit_keke_witkey_task(); $v_arr = array($_lang['admin_name'] => $myinfo_arr['username'], $_lang['time'] => date('Y-m-d H:i:s', time()), $_lang['model_name'] => $model_info['model_name'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title']); keke_msg_class::notify_user($task_info['uid'], $task_info['username'], 'task_edit', $_lang['edit_task'], $v_arr, 1); } elseif ($sbt_act) { switch ($sbt_act) { case "freeze": $res = keke_task_config::task_freeze($task_id); break; case "unfreeze": $res = keke_task_config::task_unfreeze($task_id);
} if (isset($sbt_edit)) { if ($hdn_case_id) { $case_obj->setCase_id($hdn_case_id); } else { if (case_obj_exists($fds['obj_id'], $case_type)) { $case_obj->setObj_id($fds['obj_id']); } } $case_obj->setObj_type($case_type); $case_obj->setCase_auther($fds['case_auther']); $case_obj->setCase_price($fds['case_price']); $case_obj->setCase_desc(kekezu::escape($fds['case_desc'])); $case_obj->setCase_title(kekezu::escape($fds['case_title'])); $case_obj->setOn_time(time()); $case_img = $hdn_case_img or $case_img = keke_file_class::upload_file("fle_case_img"); $case_obj->setCase_img($case_img); if ($hdn_case_id) { $res = $case_obj->edit_keke_witkey_case(); kekezu::admin_system_log($_lang['edit_case'] . ':' . $hdn_case_id); $res and kekezu::admin_show_msg($_lang['modify_case_success'], 'index.php?do=case&view=lise', 3, '', 'success') or kekezu::admin_show_msg($_lang['modify_case_fail'], 'index.php?do=case&view=lise', 3, '', 'warning'); } else { $res = $case_obj->create_keke_witkey_case(); kekezu::admin_system_log($_lang['add_case']); $res and kekezu::admin_show_msg($_lang['add_case_success'], 'index.php?do=case&view=lise', 3, '', 'success') or kekezu::admin_show_msg($_lang['add_case_fail'], 'index.php?do=case&view=add', 3, '', 'warning'); } } function case_obj_exists($id, $obj = 'task') { if ($obj == 'task') { $search_obj = db_factory::get_count(sprintf("select count(task_id) from %switkey_task where task_id='%d' ", TABLEPRE, $id));
if ($sbt_action) { $type = 'ad_type_' . $ad_type; switch ($ad_type) { case "image": if ($_FILES['ad_type_image_file']['name']) { $file_path = keke_file_class::upload_file('ad_type_image_file', '', 1, 'ad/'); } else { $file_path = $ad_type_image_path; } break; case "flash": if ($flash_method == 'url') { $file_path = $ad_type_flash_url; } if ($flash_method == 'file' && $_FILES['ad_type_flash_file']['name']) { $file_path = keke_file_class::upload_file('ad_type_flash_file', '', 1, 'ad/'); } break; } $file_path && $ad_obj->setAd_file($file_path); $ad_name = $hdn_ad_name ? $hdn_ad_name : $ad_name; $ad_obj->setAd_name($ad_name); $start_time && $ad_obj->setStart_time(strtotime($start_time)); $end_time && $ad_obj->setEnd_time(strtotime($end_time)); $ad_obj->setAd_type($ad_type); $ad_obj->setAd_position($ad_position); $width = ${$type . '_width'}; $width && $ad_obj->setWidth($width); $height = ${$type . '_height'}; $height && $ad_obj->setHeight($height); $content = ${$type . '_content'};
public function wap_upload($f = 'uploadedfile', $work_id = 0) { $work_id and $type = "work" or $type = "task"; $path = keke_file_class::upload_file($f); $file_obj = new Keke_witkey_file_class(); $file_obj->setFile_name($_FILES[$f][name]); $file_obj->setTask_id($this->_task_id); $file_obj->setObj_type($type); $file_obj->setSave_name($path); $file_obj->setOn_time(time()); $file_obj->setUid($this->_uid); $file_obj->setUsername($this->_username); $file_obj->create_keke_witkey_file(); if ($path) { $fid = db_factory::get_count(sprintf(" select file_id from %switkey_file where save_name='%s'", TABLEPRE, $path)); if ($work_id) { db_factory::execute(sprintf("update %switkey_task_work set work_file='%d' where task_id='%d' and work_id='%d'", TABLEPRE, $fid, $this->_task_id, $work_id)); db_factory::execute(sprintf(" update %switkey_file set obj_type='work',task_id='%d',obj_id='%d' where file_id='%d'", TABLEPRE, $this->_task_id, $work_id, $fid)); } else { db_factory::execute(sprintf("update %switkey_task set task_file='%d' where task_id='%d'", TABLEPRE, $fid, $this->_task_id)); db_factory::execute(sprintf(" update %switkey_file set obj_type='task',task_id='%d' where file_id='%d'", TABLEPRE, $this->_task_id, $fid)); } kekezu::echojson('', 1); } else { kekezu::echojson(array('r' => 'Upload failed'), 0); } die; }
kekezu::admin_check_role(30); $link_obj = new Keke_witkey_link_class(); if ($link_id) { $link_info = $link_obj->setWhere('link_id=' . $link_id); $link_info = $link_obj->query_keke_witkey_link(); $link_info = $link_info[0]; strpos($link_info['link_pic'], "data/") !== FALSE and $mode = 2 or $mode = 1; } if ($sbt_edit) { $link_obj->setLink_type(1); $link_obj->setLink_name($txt_link_name); if ($showMode == 1) { $link_pic = $txt_link_pic; } elseif ($showMode == 2) { if ($_FILES[fle_link_pic][name]) { $link_pic = keke_file_class::upload_file("fle_link_pic"); } } if (!$link_pic) { $link_pic = 0; } $link_obj->setLink_pic($link_pic); $link_obj->setLink_url($txt_link_url); $link_obj->setLink_status(1); $link_obj->setListorder(intval($txt_listorder)); $link_obj->setOn_time(time()); if ($hdn_link_id) { $link_obj->setLink_id($hdn_link_id); $res = $link_obj->edit_keke_witkey_link(); if ($res) { kekezu::admin_system_log($_lang['links_edit'] . $hdn_link_id);