query("insert into {$dbtbpre}enewsdo(doname,dotime,isopen,doing,classid,lasttime) values('$add[doname]',$add[dotime],$add[isopen],$add[doing],'$classid',$lasttime);"); $doid=$empire->lastid(); if($sql) { //操作日志 insert_dolog("doid=$doid&doname=$add[doname]"); printerror("AddDoSuccess","AddDo.php?enews=AddDo".hReturnEcmsHashStrHref2(0)); } else {printerror("DbError","history.go(-1)");} } //修改刷新任务 function EditDo($add,$userid,$username){ global $empire,$dbtbpre; $count=count($add[classid]); if(empty($add[doname])||($add[doing]&&!$count)) { printerror("EmptyDoname","history.go(-1)"); } //验证权限 CheckLevel($userid,$username,$classid,"do"); if($add[dotime]<5) { $add[dotime]=5; } //变量处理 $add[dotime]=(int)$add[dotime]; $add[isopen]=(int)$add[isopen]; $add[doing]=(int)$add[doing]; $classid=AddDoTogClassid($add[classid]); $add['doname']=hRepPostStr($add['doname'],1); $sql=$empire->query("update {$dbtbpre}enewsdo set doname='$add[doname]',dotime=$add[dotime],isopen=$add[isopen],doing=$add[doing],classid='$classid' where doid='$add[doid]'"); if($sql) { //操作日志 insert_dolog("doid=$add[doid]&doname=$add[doname]"); printerror("EditDoSuccess","ListDo.php".hReturnEcmsHashStrHref2(1)); } else {printerror("DbError","history.go(-1)");} } //删除刷新任务 function DelDo($doid,$userid,$username){ global $empire,$dbtbpre; $doid=(int)$doid; if(empty($doid)) {printerror("EmptyDoid","history.go(-1)");} //验证权限 CheckLevel($userid,$username,$classid,"do"); $r=$empire->fetch1("select doname from {$dbtbpre}enewsdo where doid='$doid'"); $sql=$empire->query("delete from {$dbtbpre}enewsdo where doid='$doid'"); if($sql) { //操作日志 insert_dolog("doid=$doid&doname=$r[doname]"); printerror("EditDoSuccess","ListDo.php".hReturnEcmsHashStrHref2(1)); } else {printerror("DbError","history.go(-1)");} } $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } //增加刷新任务 if($enews=="AddDo") { $add=$_POST; AddDo($add,$logininid,$loginin); } //修改刷新任务 elseif($enews=="EditDo") { $add=$_POST; EditDo($add,$logininid,$loginin); } //删除刷新任务 elseif($enews=="DelDo") { $doid=$_GET['doid']; DelDo($doid,$logininid,$loginin); } $search=$ecms_hashur['ehref']; $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $line=25;//每页显示条数 $page_line=12;//每页显示链接数 $offset=$page*$line;//总偏移量 $query="select * from {$dbtbpre}enewsdo"; $num=$empire->num($query);//取得总条数 $query=$query." order by doid desc limit $offset,$line"; $sql=$empire->query($query); $returnpage=page2($num,$line,$page_line,$start,$page,$search); ?>
位置:管理定时刷新任务 |
ID |
任务名 |
时间间隔 |
最后执行时间 |
开启 |
操作 |
=$r[doid]?>
|
=$r[doname]?>
|
=$r[dotime]?>
|
=date("Y-m-d H:i:s",$r[lasttime])?>
|
=$isopen?>
|
|
=$returnpage?> | |||||
说明:执行定时刷新任务需要开着后台或者点击这里开着这个页面才会执行。 |