<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('story_Edit');
if(!isset($action)) $action = '';
$dsql = new DedeSql(false);

//¶ÁÈ¡ËùÓÐÀ¸Ä¿
$dsql->SetQuery("Select id,classname,pid,rank From #@__story_catalog order by rank asc");
$dsql->Execute();
$ranks = Array();
$btypes = Array();
$stypes = Array();
while($row = $dsql->GetArray()){
	if($row['pid']==0) $btypes[$row['id']] = $row['classname'];
	else $stypes[$row['pid']][$row['id']] = $row['classname'];
	$ranks[$row['id']] = $row['rank'];
}
$lastid = $row['id'];
$msg = '';

$books = $dsql->GetOne("Select * From #@__story_books where id='$bookid' ");

require_once(dirname(__FILE__)."/templets/story_edit.htm");

$dsql->Close();
?>