Ejemplo n.º 1
0
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>
</html>
Ejemplo n.º 2
0
    } else {
        $priority = 'priority';
    }
    for ($i = $id_str_num - 1; $i >= 0; $i--) {
        if ($priority_str[$i] == "") {
            $priority_str[$i] = "100";
        }
        $db = get_db();
        $sql = "update " . $_POST['db_table'] . " set " . $priority . "=" . $priority_str[$i] . " where id=" . $id_str[$i];
        $db->execute($sql);
    }
} elseif ("revocation" == $_POST['post_type']) {
    if ($_POST['id'] != '') {
        $post->find($_POST['id']);
    }
    $post->update_attribute("is_adopt", "0");
} elseif ("publish" == $_POST['post_type']) {
    if ($_POST['id'] != '') {
        $post->find($_POST['id']);
    }
    $post->update_attribute("is_adopt", "1");
} elseif ("set_up" == $_POST['post_type']) {
    if ($_POST['id'] != '') {
        $post->find($_POST['id']);
    }
    $post->update_attribute("set_up", "1");
} elseif ("set_down" == $_POST['post_type']) {
    if ($_POST['id'] != '') {
        $post->find($_POST['id']);
    }
    $post->update_attribute("set_up", "0");