【php开源代码栏目提醒】:网学会员为广大网友收集整理了,sort.php,希望对大家有所帮助!
<?
//------------------------------------------------创建分类
if($act=='make'){
$selectname=selectname('sortid');
$showtop="创建新的分类";
$form="mode=sort&action=make";
$show="
<table width='100%' cellspacing='1' cellpadding='3' bgcolor='#CCCCCC'>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'>现有旧的分类:</div>
</td>
<td colspan=2> $selectname </td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'><font color='#FF0000'>新的分类名称:</font></div>
</td>
<td colspan=2>
<input class=mmcinb type='text' name='srtname'>
</td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'>新的分类图片:</div>
</td>
<td width='17%'>
<input class=mmcinb type='text' name='other'>
</td>
<td width='42%'><IFRAME name='mainFrame2' frameBorder=0 height=23 scrolling=no src='upload_mode.php?inputname=other' width=310></IFRAME> </td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'>新的分类描述:</div>
</td>
<td colspan=2>
<textarea name='describes' rows='5' cols='40'>可不填</textarea>
</td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'></div>
</td>
<td colspan=2>
<input class=mmcinb type='submit' name='Submit' value='提交数据'>
</td>
</tr>
</table>
";
}
//-----------------------------------------------------------处理创建分类
elseif($action=='make'){
$db->query("insert into sort (srtname,posttime,describes,other) values ('$srtname','$timestamp','$describes','$other')");
$showtop="创建分类";
$show=reto("分类创建成功<br><br>点击返回",'?mode=sort&act=make');
}
//-----------------------------------------------------------修改分类
elseif($act=='mod'){
$selectname=selectname('sortid',$sortid,'?mode=sort&act=mod');
$showtop="修改现有分类名称";
$form="mode=sort&action=mod";
if($sortid)
@extract( $db->get_one("select * from sort where id='$sortid' ") );
$show="<table width='100%' cellspacing='1' cellpadding='3' bgcolor='#CCCCCC'>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'>现有旧的分类:</div>
</td>
<td colspan=2> $selectname </td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'><font color='#FF0000'>修改之后的名称:</font></div>
</td>
<td colspan=2>
<input class=mmcinb type='text' name='srtname' value=$srtname>
</td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'>修改之后的LOGO:</div>
</td>
<td width='16%'>
<input class=mmcinb type='text' name='other' value=$other>
</td>
<td width='43%'><IFRAME name='mainFrame2' frameBorder=0 height=23 scrolling=no src='upload_mode.php?inputname=other' width=310></IFRAME></td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'>修改之后的描述:</div>
</td>
<td colspan=2>
<textarea name='describes' rows='5' cols='40'>$describes</textarea>
</td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='41%'>
<div align='right'></div>
</td>
<td colspan=2>
<input class=mmcinb type='submit' name='Submit' value='提交数据'>
</td>
</tr>
</table> ";
}
//-----------------------------------------------------------处理修改分类
elseif($action=='mod'){
if(!$sortid){
$showtop="错误提示";
$show=showmsg("你没有选择旧的分类名称");
}
else{
$db->query("update sort set srtname='$srtname',other='$other',describes='$describes' where id='$sortid'");
//$db->query("update movieinfo set sortid='$sortid' where sortid='$sortid'");//改分类名后,文章全部要跟着改
$showtop="修改分类";
$show=reto("分类修改成功");
}
}
//-----------------------------------------------------------处理创建分类
elseif($action=='make'){
$db->query("insert into sort (srtname,posttime,describes,other) values ('$srtname','$timestamp','$describes','$other')");
$showtop="创建分类";
$show=reto("分类创建成功");
}
//-----------------------------------------------------------删除分类
elseif($act=='del'){
$selectname=selectname('sortid');
$showtop="删除现有分类名称";
$form="mode=sort&action=del";
$show=" <table width='100%' cellspacing='1' cellpadding='3' bgcolor='#CCCCCC'>
<tr bgcolor='#FFFFFF'>
<td width='51%'>
<div align='right'>请选择要删除的分类:</div>
</td>
<td width='49%'> $selectname </td>
</tr>
<tr bgcolor='#FFFFFF'>
<td width='51%'>
<div align='right'></div>
</td>
<td width='49%'>
<input class=mmcinb type='submit' name='Submit' value='提交数据'>
</td>
</tr>
</table>";
}
//-----------------------------------------------------------处理删除分类
elseif($action=='