数据库资料显示/修改的基本操作

SQL:
[coolcode]
# 表的结构 `staff_level`
#

CREATE TABLE `staff_level` (
`id` tinyint(2) unsigned NOT NULL auto_increment,
`code` char(4) NOT NULL,
`name` varchar(20) NOT NULL,
`time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

#
# 导出表中的数据 `staff_level`
#

INSERT INTO `staff_level` VALUES (1, ‘G1’, ‘公司总经理’, ‘2006-11-22 22:30:19’);
INSERT INTO `staff_level` VALUES (2, ‘G2’, ‘分公司经理’, ‘2006-11-23 09:15:33’);
INSERT INTO `staff_level` VALUES (3, ‘G3’, ‘部门总经理’, ‘2006-11-23 09:15:39’);
INSERT INTO `staff_level` VALUES (4, ‘G4’, ‘部门经理’, ‘2006-11-23 08:49:52’);
INSERT INTO `staff_level` VALUES (5, ‘A1’, ‘系统管理员’, ‘2006-11-23 09:16:44’);
INSERT INTO `staff_level` VALUES (6, ‘T1’, ‘讲师’, ‘2006-11-23 09:11:03’);
INSERT INTO `staff_level` VALUES (7, ‘S1’, ‘学员’, ‘2006-11-23 09:11:11’);
INSERT INTO `staff_level` VALUES (8, ‘G5’, ‘员工’, ‘2006-11-23 11:13:50’);
[/coolcode]

列表:
[coolcode]
127)
{
$i = $i+2;
}
else
{
$i++;
}
}
$start = $i;
$end = $start+$length;
while($i<$end) { if(ord($string[$i])>127)
{
$i = $i+2;
}
else
{
$i++;
}
}
if($end != $i-1)
{
$end = $i;
}
else
{
$end–;
}
$length = $end-$start;
return substr($string,$start,$length);
}

if(!empty($_POST[‘title’])){
$plan[‘title’] = $_POST[‘title’];
$plan[‘kind’] = $_POST[‘kind’];
$plan[‘classname’] = $_POST[‘classname’];
$plan[‘department’] = $_POST[‘department’];
$plan[‘personaccount’] = $_POST[‘personaccount’];
$plan[‘time’] = $_POST[‘time’];
$plan[‘content’] = $_POST[‘content’];
$plan[‘teacher’] = $_POST[‘teacher’];
$plan[‘schoolbook’] = $_POST[‘schoolbook’];
$plan[‘place’] = $_POST[‘place’];
$plan[‘note’] = $_POST[‘note’];
$n=1;
$field = ”;
$values = ”;
foreach($plan as $key=>$value){
if(!empty($value)){

$field .= (‘`’.$key.’`,’);
$values .= (‘”‘.$value.'”,’);
}

}
//$field = preg_replace(‘/,$/i’,”,$field);
//$values = preg_replace(‘/,$/i’,”,$values);
$sql =”INSERT INTO training_plan ($field `update_time`) VALUES ($values NOW())”;

$result=api_sql_query($sql,__FILE__,__LINE__);
if($result){
echo ““;
}
}
$currentpage = isset($_GET[‘page’]) ? $_GET[‘page’] : ‘1’;
?>

您的位置:年度培训计划

欢迎您: ,今天是

当前 “.get_lang(‘UsersOnline’).”: “.$number.”人“;
}?>


年度培训计划

‘;
}
else
{
$total=mysql_num_rows($result);
if($total>15)
{ if(empty($_REQUEST[‘page’]))
{
$sql.=” order by id desc limit 0,15″;
}
else
{
$page=$_REQUEST[‘page’];
$f=($page-1)*15;
$sql.=” order by id desc limit $f,15″;
}
}
else
{
$sql.=” order by id desc”;
}
$result=api_sql_query($sql,__FILE__,__LINE__);
if(mysql_num_rows($result)>=1)
{
while ($row=mysql_fetch_array($result))
{
$n += 1;
if( !($n%2) )
{
$class = ‘class=”interval”‘;
}
else
{
$class = ”;
}

echo “

“;
//echo “

“;

}
}
else
{
echo ‘

‘;
}
}
}
echo “

编号 计划名称 更新时间 管理功能
目前没有信息!
“.$row[0].” “.get_substr($row[1],0,20).” “.substr($row[2],0,10).” 查看  修改  删除
2025 “.get_substr(‘管理型态的变革对主管产生的影响管理型态的变革对主管产生的影响’,0,40).” “.substr($row[2],0,10).” 查看  修改  删除
目前没有信息!

“;

?>

“;
if($currentpage==1 && $currentpage<$totalpage){ $foot .= '

‘;
}
elseif($currentpage>1 && $currentpage<$totalpage){ $foot .= '<< 首页   上一页   下一页   末页 >>‘;
}
elseif($currentpage>1 && $currentpage==$totalpage){
$foot .= ‘

‘;
}
$foot .=”

总计 $total 门课程,共 $totalpage 页. 当前显示第 $currentpage 页”;
echo $foot;
}
?>

添加新计划

序号 12
计划名称
培训类别
培训班名称
举办部门
培训人数
培训时间
培训内容
教师
教材
培训地点
备注

[/coolcode]

显示:
[coolcode]
alert(‘非法请求!’);“;
exit;
}
?>

您的位置:年度培训计划

欢迎您: ,今天是

当前 “.get_lang(‘UsersOnline’).”: “.$number.”人“;
}?>


年度培训计划

序号
计划名称
培训类别
培训班名称
举办部门
培训人数
培训时间
培训内容
教师
教材
培训地点
备注

[/coolcode]
修改:
[coolcode]alert(‘非法请求!’);“;
exit;
}
?>

您的位置:年度培训计划

欢迎您: ,今天是

当前 “.get_lang(‘UsersOnline’).”: “.$number.”人“;
}?>


年度培训计划

序号
计划名称 培训类别 培训班名称 举办部门 培训人数 培训时间 培训内容
教师 教材 培训地点 备注
    

[/coolcode]

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据