<?php include '../global.php'; include '../common.func.php'; define('ROOTPATH', '../../'); if ($_POST) { $id = $_POST['id']; $pic = $_POST['oldpic']; $url = $_POST['url']; $intro = $_POST['intro']; $enurl = $_POST['enurl']; $enintro = $_POST['enintro']; $picFile = $_FILES['upfile']; if (empty($picFile['tmp_name']) === false) { delPic($pic); $pic = upPic($picFile, 'rec/'); } $db->update('th_rec', 'pic=\'' . $pic . '\',url=\'' . $url . '\',intro=\'' . $intro . '\',enurl=\'' . $enurl . '\',enintro=\'' . $enintro . '\'', 'id=' . $id); header('location:index.php?suc=edit_suc'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>推介位Operate</title> <link href="../css/manager.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="../js/common.js"></script> <script type="text/javascript" src="../js/pro.js"></script> <link href="../../lightbox/style_4/style.css" rel="stylesheet" type="text/css" />
$query = $db->query($sql); $row = $db->fetch_array($query); delPic($row['spic']); delPic($row['bpic']); $db->delete('th_pro_class', 'ord=' . $ord); echo 'y'; exit; } } if ($postAction == 'del_allcat') { $ord = $_POST['ord']; $query = $db->select('th_pro_class', 'path,spic,bpic', 'ord=' . $ord); $row = $db->fetch_array($query); $path = $row['path']; delPic($row['spic']); delPic($row['bpic']); if ($db->delete('th_pro_class', 'path like \'' . $path . '%\'')) { echo $db->db_affected_rows(); exit; } } if ($postAction == 'del_img') { $id = $_POST['id']; $pid = (int) $_POST['pid']; $idx = $id . ','; if ($pid != 0) { $sql = "update `th_pro_content` set `pic`=replace(`pic`,'" . $idx . "','') where id=" . $pid; $query = $db->query($sql); } $sql = "select url,thumb from `th_uploads` where id=" . $id; $query = $db->query($sql);
$id = $_GET['id']; if ($id) { $sql = "select cid,id,title,entitle,author,enauthor,pic,content,encontent,dis,endis,ord from `th_news_content` where id=" . $id; $query = $db->query($sql); $row = $db->fetch_array($query); } if ($getAction == 'update_news' && !empty($_POST['id'])) { $cid = $_POST['cid']; $id = $_POST['id']; $title = $_POST['title']; $entitle = $_POST['entitle']; $author = $_POST['author']; $enauthor = $_POST['enauthor']; $picFile = $_FILES['pic']; if (empty($picFile['tmp_name']) === false) { delPic($_POST['oldpic']); $pic = upPic($picFile, 'news/'); } else { $pic = $_POST['oldpic']; } $content = $_POST['content']; $encontent = $_POST['encontent']; $dis = $_POST['dis']; $endis = $_POST['endis']; $ord = $_POST['ord']; $dis = empty($dis) ? 0 : $dis; $endis = empty($endis) ? 0 : $endis; $ord = empty($ord) ? 0 : $ord; $updatetime = mktime(); if ($db->update('th_news_content', 'cid=' . $cid . ',title=\'' . $title . '\',entitle=\'' . $entitle . '\',author=\'' . $author . '\',enauthor=\'' . $enauthor . '\',content=\'' . $content . '\',encontent=\'' . $encontent . '\',dis=' . $dis . ',endis=' . $endis . ',ord=' . $ord . ',pic=\'' . $pic . '\'', 'id=' . $id)) { }
<?php require_once "include.php"; if (is_connected()) { $request = delPic($_POST, $connect); } else { $request = 0; } echo $request;