public static function del_auth($auth_code, $cash_name) { global $kekezu; global $_lang; $auth_item_obj = new Keke_witkey_auth_item_class(); if (isset($auth_code)) { switch (is_array($auth_code)) { case "0": $auth_item = keke_auth_base_class::get_auth_item($auth_code); $auth_item['auth_small_ico'] and keke_file_class::del_file($auth_item['auth_small_ico']); $auth_item['auth_small_n_ico'] and keke_file_class::del_file($auth_item['auth_small_n_ico']); $auth_item['auth_big_ico'] and keke_file_class::del_file($auth_item['auth_big_ico']); $auth_item_obj->setWhere("auth_code='{$auth_code}'"); $res = $auth_item_obj->del_keke_witkey_auth_item(); $res and $kekezu->_cache_obj->del($cash_name); $res and kekezu::admin_system_log($_lang['delete_auth_item'] . $auth_item['auth_title']); if (file_exists(S_ROOT . "./auth/" . $auth_item['auth_dir'] . "/admin/uninstall_sql.php")) { require S_ROOT . "./auth/" . $auth_item['auth_dir'] . "/admin/uninstall_sql.php"; } $res and kekezu::admin_show_msg($_lang['auth_item_delete_success_notice'], 'index.php?do=auth&view=item_list', '3', '', 'success') or kekezu::admin_show_msg($_lang['auth_item_delete_fail'], 'index.php?do=auth&view=item_list', '3', '', 'error'); break; case "1": $auth_code_str = implode(",", $auth_code); if (sizeof($auth_code_str)) { $auth_item_obj->setWhere(" FIND_IN_SET(auth_code,'{$auth_code_str}')>0"); $res = $auth_item_obj->del_keke_witkey_auth_item(); $res and kekezu::admin_system_log($_lang['delete_auth_item'] . "{$auth_code_str}"); $res and kekezu::admin_show_msg($_lang['auth_item_mulit_delete_success'], 'index.php?do=auth&view=item_list', '3', '', 'success') or $res and kekezu::admin_show_msg($_lang['auth_item_mulit_delete_fail'], 'index.php?do=auth&view=item_list', '3', '', 'error'); } break; } } }
$msg = '删除失败'; if ($id) { $objFileT = keke_table_class::get_instance('witkey_file'); $fileInfo = $objFileT->get_table_info('file_id', $id); if ($fileInfo['uid'] == $gUid || !$fileInfo['uid']) { if (QN_UPLOAD_OPEN) { $kekezu->include_qiniu_file(); $qn = new QiniuClass(); $qn->delete($fileInfo['file_name']); } else { keke_file_class::del_file($fileInfo['save_name']); $intFileLen = strrpos($fileInfo['save_name'], '/'); $strFileName = substr($fileInfo['save_name'], intval($intFileLen + 1)); $strFileNamePre = substr($fileInfo['save_name'], 0, intval($intFileLen + 1)); file_exists($strFileNamePre . '100_' . $strFileName) and keke_file_class::del_file($strFileNamePre . '100_' . $strFileName); file_exists($strFileNamePre . '210_' . $strFileName) and keke_file_class::del_file($strFileNamePre . '210_' . $strFileName); } $res = $objFileT->del('file_id', $id); if ($res) { $status = 1; $msg = '删除成功'; } } } echo json_encode(array('status' => $status, 'msg' => $msg)); die; } else { $err = 0; if (QN_UPLOAD_OPEN) { $kekezu->include_qiniu_file(); $file = $_FILES[$filename]['name'];
public static function del_sign_task($task_id, $model) { global $_lang; $taskInfo = db_factory::get_one(sprintf("select * from %switkey_task where task_id='%d' and task_status in(0,1,8,9,10)", TABLEPRE, $task_id)); if ($taskInfo) { CustomClass::delExtDataByObjId($taskInfo['task_id'], $taskInfo['model_id']); } if ($model === 1) { $sql = sprintf("delete from %switkey_task_work where task_id='%d'", TABLEPRE, $task_id); } else { $sql = sprintf("delete from %switkey_task_bid where task_id ='%d'", TABLEPRE, $task_id); } db_factory::execute($sql); $file_sql = sprintf("select save_name from %switkey_file where task_id = '%d' ", TABLEPRE, $task_id); $files = db_factory::query($file_sql); foreach ($files as $v) { keke_file_class::del_file($v['save_name']); } db_factory::execute(sprintf("delete from %switkey_file where task_id ='%d' ", TABLEPRE, $task_id)); $del_title = db_factory::get_count(sprintf("select task_title from %switkey_task where task_id='%d'", TABLEPRE, $task_id)); kekezu::admin_system_log($_lang['delete_task'] . ":{$del_title}"); }
<?php if ($action == 'delete') { $id = intval($id); if ($id) { $objFileT = keke_table_class::get_instance('witkey_file'); $fileInfo = $objFileT->get_table_info('file_id', $id); if ($fileInfo['uid'] == $gUid || !$fileInfo['uid']) { keke_file_class::del_file($fileInfo['save_name']); $objFileT->del('file_id', $id); echo json_encode(array('status' => 1)); die; } } die; } else { $___y = date('Y'); $___m = date('m'); $___d = date('d'); define('UPLOAD_RULE', "{$___y}/{$___m}/{$___d}/"); $fileFormat = explode('|', $kekezu->_sys_config['file_type']); $maxSize = intval($kekezu->_sys_config['max_size']) * 1024 * 1024; $pathDir = setUploadPath($fileType, $objType); //$bidId = $_POST['bid_id']; //$bidId = $_POST['bid_id'];//$someVar = $_POST['someKey']; $upload = new keke_upload_class(S_ROOT . $pathDir, $fileFormat, $maxSize); $savename = $upload->run($filename, 1); if (is_array($savename)) { $name = $savename[0]['name']; $path = $pathDir . $savename[0]['saveName']; if ($fileType == 'service') {