コード例 #1
0
ファイル: bdedit.post.php プロジェクト: sauger/forbes_old
<?php

require "../../frame.php";
$id = $_POST['id'];
$f_mrb = new table_class('fb_fhb');
if ($id != '') {
    $f_mrb->find($id);
}
$f_mrb->update_attributes($_POST['fhb'], false);
if ($_FILES['image_src']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    if (!($upload_name = $upload->handle('image_src', 'filter_pic'))) {
        alert('上传图片失败!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $f_mrb->image_src = '/upload/news/' . $upload_name;
}
$f_mrb->save();
redirect('index.php');
コード例 #2
0
ファイル: edit_info.post.php プロジェクト: sauger/forbes
<?php

session_start();
include_once '../../frame.php';
$role = judge_role();
$yh_id = intval($_POST['id']);
$db = get_db();
$info = $db->query("select id from fb_yh_xx where yh_id={$yh_id}");
if ($db->record_count == 1) {
    $id = $info[0]->id;
} else {
    $id = 0;
}
$info = new table_class('fb_yh_xx');
if ($id != 0) {
    $info->find($id);
}
$info->update_attributes($_POST['info'], false);
if ($_FILES['tx']['name'] != null) {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/user/";
    $img = $upload->handle('tx', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $info->tx = "/upload/user/{$img}";
}
$info->yh_id = $yh_id;
$info->save();
redirect('index.php');
コード例 #3
0
ファイル: image.post.php プロジェクト: sauger/forbes_old
		<?php 
include "../../frame.php";
?>
	</head>
	<body>
		<?php 
$image = new table_class('fb_magazine_image');
$id = intval($_POST['id']);
if ($id != '') {
    $image->find($id);
} else {
    $image->created_at = date("Y-m-d H:i:s");
}
//var_dump($_POST);
if ($_FILES['image']['name'] != null) {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/images/";
    $img = $upload->handle('image', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $image->src = "/upload/images/{$img}";
}
if ($_POST['image']["priority"] == null) {
    $image->update_attribute("priority", "100");
}
$image->update_attributes($_POST['image']);
redirect('img_list.php?id=' . $image->magazine_id);
?>
	</body>
コード例 #4
0
ファイル: ad_edit.post.php プロジェクト: justin1986/eachbb
    $upload->save_dir = "/upload/jj/";
    $vid = $upload->handle('video', 'filter_video');
    if ($vid === false) {
        alert('上传视频失败 !');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $ad->video = "/upload/jj/{$vid}";
}
if ($_FILES['flash']['name'] != null) {
    if ($_FILES['flash']['size'] > 2000000) {
        alert('上传flash不得大于2M,请重新上传 !');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/jj/";
    $flash = $upload->handle('flash');
    if ($flash === false) {
        alert('上传flash失败 !');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $ad->flash = "/upload/jj/{$flash}";
}
$ad->save();
if (!$_POST['url']) {
    redirect('channel.php');
} else {
    redirect('ad_list.php?bid=' . $ad->banner_id . '&cid=' . $ad->channel_id);
}
コード例 #5
0
ファイル: news.post.php プロジェクト: justin1986/eachbb
judge_role();
$db = get_db();
$news_id = $_POST['id'] ? $_POST['id'] : 0;
$news = new table_class($tb_news);
if ($news_id) {
    $news->find($news_id);
}
$news->update_attributes($_POST['news'], false);
if (!$news->publisher) {
    $news->publisher = $_SESSION['admin_user_id'];
}
if ($news->priority == "") {
    $news->priority = 100;
}
if ($_FILES['news_pic']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    $news->video_photo_src = '/upload/news/' . $upload->handle('news_pic', 'filter_pic');
}
$table_change = array('<p>' => '');
$table_change += array('</p>' => '');
$news->title = strtr($news->title, $table_change);
$news->short_title = strtr($news->short_title, $table_change);
$news->last_edited_at = date("Y-m-d H:i:s");
if (!$news->id) {
    //insert news
    $news->created_at = date("Y-m-d H:i:s");
    $news->click_count = 0;
}
if ($news->is_adopt) {
    publish_news($news);
コード例 #6
0
ファイル: ajax.post.php プロジェクト: sauger/forbes
				<script>
					parent.remove_tb2();
				</script>
				<?php 
        die;
    }
    $vote->photo_url = "/upload/images/" . $img;
}
//如果投票上传图片,做处理
$vote->update_attributes($_POST['vote'], false);
$vote->save();
$count = count($_POST['vote_item']['title']);
$old_count = count($_POST['old_item']['title']);
$item = new table_class("fb_vote_item");
if ($_POST['vote']['vote_type'] == 'image_vote') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/images/';
    $img = $upload->handle('vote_item', 'filter_pic');
    $old_img = $upload->handle('old_item', 'filter_pic');
}
for ($i = 0; $i < $count; $i++) {
    $item->id = 0;
    $item->vote_id = $vote->id;
    if ($_POST['vote']['vote_type'] == 'image_vote') {
        if ($img[$i]['result']) {
            $item->photo_url = "/upload/images/" . $img[$i]['name'];
        } else {
            $item->photo_url = "";
        }
        //投票项目图片处理
    }
コード例 #7
0
ファイル: category.post.php プロジェクト: justin1986/eachbb
	</head>
	<body>
		<?php 
$cate = new table_class($tb_category);
if ($_REQUEST['id']) {
    $cate->find($_REQUEST['id']);
}
$cate->update_attributes($_POST['post'], false);
if ($_REQUEST['post']['parent_id'] != '0') {
    $category = new category_class('news');
    $parent_ids = $category->tree_map($_REQUEST['post']['parent_id']);
    if (count($parent_ids) > 1) {
        $cate->sort_id = $parent_ids[count($parent_ids) - 1];
    } else {
        $cate->sort_id = $_REQUEST['post']['parent_id'];
    }
} else {
    $cate->sort_id = 0;
}
#$cate->update_file_attributes();
if ($_FILES['show_image']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/category/';
    $cate->show_image = '/upload/category/' . $upload->handle('show_image', 'filter_pic');
}
//$cate->echo_sql = true;
$cate->save();
redirect('category_list.php?type=' . $_POST['post']['category_type'] . '');
?>
	</body>
</html>
コード例 #8
0
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    if (!($upload_name = $upload->handle('pdf_src', 'filter_pdf'))) {
        alert('上传PDF失败!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $news->pdf_src = '/upload/news/' . $upload_name;
}
if ($_FILES['news_pic']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    $news->video_photo_src = '/upload/news/' . $upload->handle('news_pic', 'filter_pic');
}
if ($_FILES['author_image']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    $news->author_image = '/upload/news/' . $upload->handle('author_image', 'filter_pic');
}
$table_change = array('<p>' => '');
$table_change += array('</p>' => '');
$news->title = strtr($news->title, $table_change);
$news->short_title = strtr($news->short_title, $table_change);
$news->news_type = 1;
if ($news_id == '') {
    //insert news
    $news->created_at = date("Y-m-d H:i:s");
    $news->last_edited_at = date("Y-m-d H:i:s");
    $news->publisher_id = $_SESSION['admin_user_id'];
    $news->click_count = 0;
    $news->is_adopt = 1;
コード例 #9
0
ファイル: post.php プロジェクト: sauger/forbes_old
<?php

require_once '../../frame.php';
require_once 'reader.php';
$db = get_db();
$upload = new upload_file_class();
$upload->save_dir = "/upload/xls/";
$xls = $upload->handle('xls');
$file = ROOT_DIR . 'upload/xls/' . $xls;
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('utf-8');
$data->read($file);
if ($_POST['table'] == 'rich_list') {
    for ($i = 2; $i <= $data->sheets[0]['numRows']; $i++) {
        $name = array();
        $value = array();
        $set = array();
        if ($_POST['fh_id'] != '') {
            $f_id = $data->sheets[0]['numRows'][$i][$_POST['fh_id']];
            $db->query("select id from fb_fh where name='{$data->sheets[0]['cells'][$i][$_POST['fh_id']]}'");
            if ($db->move_first()) {
                array_push($name, "fh_id");
                array_push($value, $db->field_by_index(0));
                array_push($set, "fh_id={$db->field_by_index(0)}");
                if ($_POST['pm'] != '') {
                    array_push($name, "pm");
                    array_push($value, $data->sheets[0]['cells'][$i][$_POST['pm']]);
                    array_push($set, "pm={$data->sheets[0]['cells'][$i][$_POST['pm']]}");
                }
                if ($_POST['sr'] != '') {
                    array_push($name, "sr");
コード例 #10
0
ファイル: doajaxfileupload.php プロジェクト: sauger/forbes
        case '6':
            $error = 'Missing a temporary folder';
            break;
        case '7':
            $error = 'Failed to write file to disk';
            break;
        case '8':
            $error = 'File upload stopped by extension';
            break;
        case '999':
        default:
            $error = 'No error code avaiable';
    }
} elseif (empty($_FILES['fileToUpload']['tmp_name']) || $_FILES['fileToUpload']['tmp_name'] == 'none') {
    $error = 'No file was uploaded..';
} else {
    if (@filesize($_FILES['fileToUpload']['tmp_name']) > 1000000) {
        $error = '请上传小于1M的图片';
    } else {
        $upload = new upload_file_class();
        $upload->save_dir = '/upload/subject/';
        $file_path = '/upload/subject/' . $upload->handle('fileToUpload');
        $msg .= $file_path;
    }
    //for security reason, we force to remove all uploaded file
    #@unlink(ROOT_DIR_NONE.$file_path);
}
echo "{";
echo "error: '" . $error . "',\n";
echo "msg: '" . $msg . "'\n";
echo "}";
コード例 #11
0
ファイル: sign.post.php プロジェクト: sauger/forbes
        die;
    }
    if (!in_array($_FILES['post']['type'], $filter)) {
        alert('请上传word\\PPT\\PDF文档!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    if ($_FILES['post']['size'] > 2097152) {
        alert('请上传大小不大于2M文档!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
}
$sign = new table_class("fb_investor_sign");
if ($_FILES['post']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/files/";
    $files = $upload->handle('post');
    if ($files === false) {
        alert('上传失败 !');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $sign->item_doc = "/upload/files/{$files}";
}
#$post_filter = array('doc','docx','ppt','pdf');
#$sign->update_file_attributes2('post','/files');
$sign->update_attributes($_POST['post'], false);
$sign->phone = $_POST['phone1'] . '-' . $_POST['phone2'] . '-' . $_POST['phone3'];
$sign->save();
$income = new table_class("fb_investor_sign_income");
コード例 #12
0
ファイル: video.post.php プロジェクト: sauger/forbes
<?php

include "../../frame.php";
$id = $_POST['id'];
$item_id = $_POST['item_id'];
$subject_item = new table_class('fb_subject_items');
$video = new table_class('fb_video');
if ($id) {
    $video = $video->find($id);
    $subject_item = $subject_item->find($item_id);
}
$video->update_attributes($_POST['video'], false);
$subject_item->update_attributes($_POST['item'], false);
$upload = new upload_file_class();
if ($_FILES['image']['name'] != null) {
    $upload->save_dir = "/upload/images/";
    $img = $upload->handle('image', 'filter_pic');
    if ($img === false) {
        alert('上传图片失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $video->photo_url = "/upload/images/" . $img;
}
if ($_FILES['video']['name'] != null) {
    $upload->save_dir = "/upload/video/";
    $vid = $upload->handle('video', 'filter_video');
    if ($vid === false) {
        alert('上传视频失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $video->video_url = "/upload/video/" . $vid;
コード例 #13
0
ファイル: information.post.php プロジェクト: justin1986/hoau
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv=Content-Type content="text/html; charset=utf-8">
	<meta http-equiv=Content-Language content=zh-CN>
	<title>天地华宇-中国公路快运领导者</title><meta name="Keywords" content="天地华宇,天地华宇物流,天地华宇物流查询,华宇,华宇物流,华宇物流查询,天地华宇俱乐部,华宇俱乐部"/><meta name="Description" content="天地华宇-中国公路快运领导者"/>
</head>
<?php 
require_once "../frame.php";
rights($_SESSION["hoaurights"], '2');
if (empty($_POST)) {
    alert('上传文件太大,不能上传!');
    redirect($_SERVER['HTTP_REFERER']);
    die;
}
$upload = new upload_file_class();
if ($_POST['id'] != '') {
    if ($_FILES['information']['size'] > 5000000) {
        alert('上传文件太大,不能上传!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $information = new table_class("hoau_information");
    $information->find($_POST['id']);
    if ($_FILES['information']['name'] != '') {
        $upload->save_dir = "/upload/information/";
        $vid = $upload->handle('information');
        if ($vid === false) {
            alert('上传资料失败 !');
            redirect($_SERVER['HTTP_REFERER']);
            die;
        }
コード例 #14
0
ファイル: user.post.php プロジェクト: sauger/forbes
    }
    if ($_FILES['word']['size'] > 2097152) {
        alert('请上传大小不大于2M文档!');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
}
$id = $_POST['id'];
$sign = new table_class("zzh_member");
if ($id != '') {
    $sign->find($id);
} else {
    $sign->created_at = now();
}
if ($_FILES['word']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/files/";
    $files = $upload->handle('word');
    if ($files === false) {
        alert('上传失败 !');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $sign->item_doc = "/upload/files/{$files}";
}
#$post_filter = array('doc','docx','ppt','pdf');
#$sign->update_file_attributes2('post','/files');
$sign->update_attributes($_POST['post'], false);
$sign->update_file_attributes('post');
if ($_POST['is_show'] == 'on') {
    $db = get_db();
コード例 #15
0
ファイル: news.post.php プロジェクト: justin1986/frame2
    $news->priority = 100;
}
if ($_FILES['video_src']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/video/';
    $upload_name = $upload->handle('video_src', 'filter_video');
    $news->video_src = '/upload/video/' . $upload_name;
    $news->video_flag = 1;
}
if ($_FILES['video_pic']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/video/';
    $news->video_photo_src = '/upload/video/' . $upload->handle('video_pic', 'filter_pic');
}
if ($_FILES['file_name']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/file/';
    $upload_name = $upload->handle('file_name');
    $news->file_name = '/upload/file/' . $upload_name;
}
$table_change = array('<p>' => '');
$table_change += array('</p>' => '');
if ($news_id == '') {
    //insert news
    $news->created_at = date("Y-m-d H:i:s");
    $news->last_edited_at = date("Y-m-d H:i:s");
    $news->publisher_id = $_SESSION['admin'];
    $news->click_count = 0;
    $news->is_adopt = 1;
    $news->save();
} else {
コード例 #16
0
</html>
<?php 
include '../../frame.php';
$user = new table_class('fb_user');
$user = $user->find($_SESSION['admin_user_id']);
if ($_POST['new_password']) {
    if ($_POST['old_password'] != $user->password) {
        alert('原有密码错误!请重新输入!');
        redirect('modify_user_info.php');
        die;
    }
    $user->password = $_POST['new_password'];
    $changed = true;
}
if ($_FILES['image_src']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = '/upload/news/';
    $user->image_src = '/upload/news/' . $upload->handle('image_src', 'filter_pic');
    $changed = true;
}
if ($_POST['description'] != $user->description) {
    $user->description = $_POST['description'];
    $changed = true;
}
if ($_POST['column_name'] != $user->column_name) {
    $user->column_name = $_POST['column_name'];
    $changed = true;
}
if ($changed) {
    if ($user->save()) {
        alert('修改成功!');
コード例 #17
0
ファイル: test_employ.post.php プロジェクト: justin1986/hoau
<?php

require_once "../frame.php";
var_dump($_POST);
$upload = new upload_file_class();
$employ = new table_class("hoau_employ");
if ($_FILES['url']['name'] != '') {
    $upload->save_dir = "/upload/employ/";
    $em = $upload->handle('url');
    if ($em === false) {
        alert('上传失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $employ->url = "/upload/employ/" . $em;
}
$employ->id_read = 0;
$employ->date = date("Y-m-d H:i:s");
$employ->update_attributes($_POST['post']);
redirect($_POST['url']);
コード例 #18
0
ファイル: edit.post.php プロジェクト: sauger/forbes_old
        $famous = new table_class('fb_famous_ad');
        $famous->title = $_POST['title'][$i];
        $famous->famous_id = $_POST['id'];
        if ($_FILES['photo']['name'][$i] != '') {
            if ($img[$i]['result'] === false) {
                alert('上传照片' . ($i + 1) . '失败!');
                redirect($_SERVER['HTTP_REFERER']);
            }
            $famous->photo = "/upload/famous_ad/" . $img[$i]['name'];
        }
        $famous->save();
    }
}
//var_dump($_FILES);
if ($_FILES['old_photo']['name'] != '') {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/famous_ad/";
    $o_img = $upload->handle('old_photo', 'filter_pic');
}
//var_dump($o_img);
for ($i = 0; $i < count($_POST['old_title']); $i++) {
    if ($_POST['old_title'][$i] != '') {
        $famous = new table_class('fb_famous_ad');
        $famous->find($_POST['old_id'][$i]);
        $famous->title = $_POST['old_title'][$i];
        if ($_FILES['old_photo']['name'][$i] != '') {
            if ($o_img[$i]['result'] === false) {
                alert('上传照片' . ($i + 1) . '失败!');
                redirect($_SERVER['HTTP_REFERER']);
            }
            $famous->photo = "/upload/famous_ad/" . $o_img[$i]['name'];
コード例 #19
0
ファイル: edit.post.php プロジェクト: sauger/forbes_old
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv=Content-Type content="text/html; charset=utf-8">
	<meta http-equiv=Content-Language content=zh-CN>
</head>
<?php 
require "../../frame.php";
$id = $_POST['id'];
$city = new table_class('fb_city');
if ($id != '') {
    $city->find($id);
}
if ($_FILES['city_photo']['name'] != null) {
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/city/";
    $img = $upload->handle('city_photo', 'filter_pic');
    if ($img === false) {
        alert('上传文件失败 !');
        redirect($_SERVER['HTTP_REFERER']);
    }
    $city->photo = "/upload/city/{$img}";
}
if (!$city->update_attributes($_POST['city'])) {
    alert('城市已存在或执行错误!');
    redirect($_SERVER['HTTP_REFERER']);
}
redirect('index.php');
?>
</html>
コード例 #20
0
ファイル: file.post.php プロジェクト: sauger/forbes
    redirect('word.html');
    die;
}
if ($_FILES['word']['size'] > 200000) {
    alert("WORD文档太大,请修改后重新上传");
    redirect('word.html');
    die;
}
$ip = $_SERVER["REMOTE_ADDR"];
$db = get_db();
$db->query("select * from lcs_word where ip='{$ip}'");
if ($db->record_count < 3) {
    $lcs = new table_class('lcs_word');
    $lcs->ip = $ip;
    $lcs->created_at = now();
    $upload = new upload_file_class();
    $upload->save_dir = "/upload/lcs/";
    $word = $upload->handle('word');
    if ($word === false) {
        alert('上传文档失败 !');
        redirect($_SERVER['HTTP_REFERER']);
        die;
    }
    $lcs->url = "/upload/lcs/{$word}";
    $lcs->save();
    alert('上传成功');
    redirect('/event/lcs/');
} else {
    alert('一个IP只能上传3次,请不要重复上传');
    redirect($_SERVER['HTTP_REFERER']);
}