<?php
session_start();

include('includes/ajax_check_login.php');

if( !isset($_POST['video_id']) || ( $static_uint_video_id = (int)$_REQUEST['video_id'] ) <= 0 )
	exit(json_encode(array('ErrCode'=>-1, 'ErrMessage'=>'輸入資料不足', 'RedirectURL'=>'')));

require_once('includes/common.php');

require_once('includes/author.php');
$obj_class_author = new class_author();

if( !( $arr_news_video = $obj_class_author->get_news_video_by_video_id($static_uint_video_id) ) )
{
	$_SESSION['init_info'] = '指定的影片不存在！';

	exit(json_encode(array('ErrCode'=>-1, 'ErrMessage'=>'', 'RedirectURL'=>'manage_news.php')));
}
else if( !$obj_class_author->delete_news_video($static_uint_video_id) )
	exit(json_encode(array('ErrCode'=>0, 'ErrMessage'=>'影片刪除失敗！', 'RedirectURL'=>'')));
else
	exit(json_encode(array('ErrCode'=>1, 'ErrMessage'=>'影片刪除成功', 'RedirectURL'=>'')));
?>