⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_1.php

📁 一款程序源代码发布管理系统的源码
💻 PHP
字号:
<?php 
@include("admin.inc");
$rst = mysql_query("SELECT * FROM $table_db WHERE id='$id' ORDER BY id;");
$row = mysql_fetch_array($rst);
?>
<script language="javascript">
function make_sure()
{
	if (change_form.dele.checked == true) {
		if (change_form.id.value == "") {
			alert("请选择一个一个ID!");
			return false;
		}
		return confirm("确认要删除"+change_form.id.value+"吗?");
	} else {
		if (change_form.prog_name.value == "") {
			alert("请输入程序全称!");
			return false;
		}
		if (change_form.short_name.value == "") {
			alert("请输入程序简称!");
			return false;
		}
		if (change_form.newtype.value == "") {
			alert("请选择程序类型!");
			return false;
		}
		if (change_form.introduction.value == "") {
			alert("请输入简介!");
			return false;
		}
		if (change_form.author.value == "") {
			alert("请输入作者!");
			return false;
		}
		tempstr = change_form.upfile.value.toLowerCase();
		a = tempstr.length-3;
		b = tempstr.length;
		if (tempstr!="" && tempstr.substring(a,b)!="zip") {
			alert("只能选择ZIP文件!");
			return false;
		}
		return true;
	}
}
</script>
</HEAD>
<FORM ENCTYPE="multipart/form-data" NAME="change_form"  ACTION="admin_1.do.php" METHOD="POST" onsubmit="return make_sure();">
<center>
<TABLE>
<tr>
<th colspan=3>文件管理
<tr>
<td>ID(插入留空)
<td><select name="type" onchange=" javascipt:location.reload('admin_1.php?type='+change_form.type.value);">
<option value="">全部类型</option>
<?php
#显示所有的种类
$type_rst = mysql_query("SELECT * FROM $table_type ORDER BY tid;");
while ($type_row=mysql_fetch_array($type_rst)) {
	echo "<option value=".$type_row["type"];
	if ($type == $type_row["type"]) echo " selected";
	echo ">".$type_row["type"];
}
?>
</select>
<select name="id" onchange=" javascipt:location.reload('admin_1.php?type='+change_form.type.value+'&id='+change_form.id.value);">
<option value="">新增数据</option>
<?php
if ($type != "") {
	$ud = "WHERE type='$type'";
} else {
	$ud = "";
}
#显示该种类的所有数据id和短名
$db_rst = mysql_query("SELECT * FROM $table_db $ud ORDER BY id;");
while ($db_row=mysql_fetch_array($db_rst)) {
	echo "<option value=".$db_row["id"];
	if ($id == $db_row["id"]) echo " selected";
	echo ">".$db_row["id"]." ".$db_row["short_name"];
}

?>
</select>
<td><input type="checkbox" name="dele" value="dele">删除
<tr>
<td align=right>程序全称*
<td><input type="text" size="30" name="prog_name" onchange="javascript:prog_name1.checked=true" value='<?php echo $row["prog_name"]?>'>
<td><input type="checkbox" name="prog_name1" value="prog_name1">更改
<tr>
<td align=right>程序简称*
<td><input type="text" size="30" name="short_name" onchange="javascript:short_name1.checked=true" value='<?php echo $row["short_name"]?>'>
<td><input type="checkbox" name="short_name1" value="short_name1">更改
<tr>
<td align=right>程序类型*
<td><select name="newtype" onchange="javascript:newtype1.checked=true">
<option value=""></option>
<?php
#显示所有的种类,选择当前的种类
$type_rst = mysql_query("SELECT * FROM $table_type ORDER BY tid;");
while ($type_row=mysql_fetch_array($type_rst)) {
	echo "<option value=".$type_row["type"];
	if ($row["type"] == $type_row["type"]) echo " selected";
	echo ">".$type_row["type"];
}
?>
</select>
<td><input type="checkbox" name="newtype1" value="newtype1">更改
<tr>
<td align=right>简介*
<td><textarea rows="4" cols="29" name="introduction" onchange="javascript:introduction1.checked=true"><?php echo $row["introduction"]?></textarea>
<td><input type="checkbox" name="introduction1" value="introduction1">更改
<tr>
<td align=right>作者*
<td><input type="text" size="30" name="author" onchange="javascript:author1.checked=true" value='<?php echo $row["author"]?>'>
<td><input type="checkbox" name="author1" value="author1">更改
<tr>
<td align=right>上传ZIP压缩包*
<td><INPUT size="20" NAME="upfile"  TYPE="File" onchange="javascript:upfile1.checked=true">
<td><input type="checkbox" name="upfile1" value="upfile1">更改
<tr>
<td align=right>分析扩展名
<td colspan=2><input type="text"  size="30" name="myext" value="">
<tr>
<Th colspan=3>
	<INPUT NAME="submit" VALUE="添加/修改"  TYPE="submit">
	<input type=reset value="清除">
</TABLE>
</center>


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -