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

📄 log_mag.php

📁 本书主要介绍了从基础开始建立Portal的快速应用开发过程(RAD)的方法。通过本书你可以了解到关于Oracle 9iAS Portal产品的主要特性、入口的开发和组织、网络开发和管理、实际的关系型数
💻 PHP
📖 第 1 页 / 共 2 页
字号:
//echo "sqldo_c:".$sqldo_c;  
if($sqldo_c)
{
	$result=$cla->db_query($sqldo_c);
	$num=$result[0][0]; 
} //分页显示无匹配记
 //echo "num".$num;
$perpage=30;//每页显示文章数
$pages=ceil($num/$perpage);
$last_offset=($pages-1)*$perpage;
if (isset($jumpto))
{
	if ($jumpto<=$pages){
		$offset=($jumpto-1)*$perpage;
	} else{
		$offset=$last_offset;}
	}
//判断偏移量参数是否传递给了脚本,如果没有就使用默认值0
	 if (empty($offset))
	{
		 $offset=0;
	}
 ?>

							  	  <form method=post action=<?=$PHP_SELF;?>>

                    <table bordercolor="#ffffff" cellspacing="0" cellpadding="0" width="100%"

align= "center" border="1" bordercolorlight="#000000" class=>

                      <tr>

                        <td width=353 valign="middle"> 

                          <?if(isset($num)){

						  ?>

                          <a href="<?="$PHP_SELF";?>?offset=0&temp=1&num=<?="$num";?>&ser_type=<?php echo $ser_type;?>&txtvalue=<?php echo $txtvalue;?>&ser_t1=<?php for($k=0;$k<=7;$k++){echo $ser_t1[$k];}?>&ser_t2=<?php for($k=0;$k<=7;$k++){echo $ser_t2[$k];}?>">首 

                          页</a> 

                          <?}else{

						echo "首  页";

						}?>

						

                          <?

//如果偏移量是0,不显示前一页的链接

if($offset)
{
	$preoffset=$offset-$perpage;
?>

                          <a href="<? echo $PHP_SELF;?>?offset=<?echo $preoffset;?>&temp=1&ser_type=<? echo $ser_type;?>&txtvalue=<? echo $txtvalue;?>&ser_t1=<?php for($k=0;$k<=7;$k++){echo $ser_t1[$k];}?>&ser_t2=<?php for($k=0;$k<=7;$k++){echo $ser_t2[$k];}?>">前一页</a>&nbsp; 

                          <?
}else{
	print "前一页 ";
}
//计算总共需要的页数
$nextoffset=$offset+$perpage;
//检查是否是最后一页
if (($pages!=0) && ($nextoffset<$num))
{
?>

                          <a href="<? echo $PHP_SELF;?>?offset=<?echo $nextoffset;?>&temp=1&ser_type=<? echo $ser_type;?>&txtvalue=<? echo $txtvalue;?>&ser_t1=<?php for($k=0;$k<=7;$k++){echo $ser_t1[$k];}?>&ser_t2=<?php for($k=0;$k<=7;$k++){echo $ser_t2[$k];}?>">下一页</a>&nbsp; 

                          <?
//print "<a href=\"$PHP_SELF?offset=$nextoffset&temp=1&sqldo= $sqldo&sqldo_c=$sqldo_c\">下一页</a>&nbsp;";
}else{
	print "下一页 ";
}
$this_page_no=ceil($offset/$perpage)+1;
?>
                          <?if(!isset($num)){
						  echo "末  页";
						  }else{ ?>	  
                          <a href="<?=$PHP_SELF;?>?offset=<?=$last_offset;?>&temp=1&num=<?=$num;?>&ser_type=<?php echo $ser_type;?>&txtvalue=<?php echo $txtvalue;?>&ser_t1=<?php for($k=0;$k<=7;$k++){echo $ser_t1[$k];}?>&ser_t2=<?php for($k=0;$k<=7;$k++){echo $ser_t2[$k];}?>">末  页</a>
                          <?}?> </td>

                        <td width=400 valign="middle"> 

                          <div align="right">页次:<font class="red"> 

                            <?echo $this_page_no;?>

                            /</font> 

                            <?echo $pages;?>

                            页 共<font class="red"> 

                            <?if($num<>""){

							echo $num;

							}

							else{

							echo "0";

							}

							?>

                            </font>条记录 

                            <?echo $perpage;?>

                            记录/页 

                            <input name="temp" size="50"    type="hidden"  value="1">

                            <input name="sqldo" size="50"    type="hidden"  value="<?php print $sqldo;?>">

                            <input name="sqldo_c" size="50"    type="hidden"  value="<?php print $sqldo_c;?>">

                            <br>

                            <?

for ($i=0; $i < $pages; $i++)
{
	$newoffset=$perpage*$i;
}
?>

                          </div>

                        </td>

                      </tr>

                    </table>

                      </form>

                  <form name="listmail" method="post" action="">

                 <table border="1" cellspacing="0" cellpadding="3" align="center" width="754"bgcolor="#000060" class=border bordercolor="#111111">

                    <tr> 

                      <td height="2" width="7%"> 

                          <div align="center">全选

<input type="checkbox" name="allbox" value="Check All" onClick="CheckAll();">

                        </div>

                      </td>

                      <td height="2" width="10%"> 

                        <div align="center"><font color="#000000">日志编号</font></div>

                      </td>

                      <td height="2" width="10%"> 

                        <div align="center"><font color="#000000">用户姓名</font></div>

                      </td>

                      <td height="2" width="10%"> 

                        <div align="center"><font color="#000000">组名</font></div>

                      </td>

                      <td height="2" width="10%"> 

                        <div align="center"><font color="#000000">操作类型</font></div>

                      </td>

                      <td height="2" width="30%"> 

                        <div align="center"><font color="#000000">新闻标题</font></div>

                      </td>

                      <td height="2" width="15%" align="center"> 

                        <div align="center"><font color="#000000">操作时间</font></div>

                      </td>

                      <td height="2" width="8%" align="center"> 

                        <div align="center"><font color="#000000">删除</font></div>

                      </td>

                    </tr>

                    <?
$A_define=array( "log_id","user_name","group_name","news_id","news_title","act_type" ,"act_time"); 	
//$offset=2;
//$perpage=5;	
if($sqldo){	
	$res_array=$cla->db_query($sqldo,$A_define,$offset,$offset+$perpage);
}
$i=0;
while($res_array[$i][0]){
?>

                    <tr bgcolor="#f7f7f7"> 

                      <td align="center" width="7%"> 

                        <div align="center"> <font color="#FFFFFF"> 

                          <input type="checkbox" name="chk<? echo $res_array[$i]["LOG_ID"];?>" value=<? echo $res_array[$i]["LOG_ID"];?>>

                          </font></div>

                      </td>

                      <td align="center" width="10%"> <font color="#000000"> 

                        <? 
if($res_array[$i]["LOG_ID"]<>""){
	//	echo "offset\n".$offset;echo "perpage\n".$perpage;
	echo $res_array[$i]["LOG_ID"]; }
else{
	echo "&nbsp;";
}
?>

                        </font></td>

                      <td align="center" width="10%"> 

                        <div align="center"> <font color="#000000"> 

<? 
if($res_array[$i]["USER_NAME"]<>""){
	echo $res_array[$i]["USER_NAME"]; }
else{
	echo "&nbsp;";
}
?>

                          </font></div>

                      </td>

                      <td align="center" width="10%"> 

                        <div align="center"> <font color="#000000"> 

                          <? 
$group_name=$res_array[$i]["GROUP_NAME"]	  ;
$sqldo="select group_name from groups where group_id='$group_name'";
$res_group=$cla->db_query($sqldo);
if($res_group[0][0]<>""){
	echo $res_group[0][0]; }
else{
	echo "&nbsp;";
}
?>

                          </font></div>

                      </td>

                      <td align="center" width="10%"> 

                        <div align="center"> <font color="#000000"> 

                          <? 
if($res_array[$i]["ACT_TYPE"]<>""){
	echo $res_array[$i]["ACT_TYPE"]; }
else{
	echo "&nbsp;";
}
?>

                          </font></div>

                      </td>

                      <td align="center" width="30%"> 

                        <div align="center"> <font color="#000000"> 

                          <?
if($res_array[$i]["NEWS_TITLE"]<>""){
	echo $res_array[$i]["NEWS_TITLE"]; }
else{
	echo "&nbsp;";
}
?>

                          </font></div>

                      </td>

                      <td align="center" width="15%"> 

                        <div align="center"> <font color="#000000"> 

                            <? 

				//if($res_array[$i]["ACT_TIME"]<>""){

				//echo $res_array[$i]["ACT_TIME"]; }

				//else{

				//echo "&nbsp;";

				//}

				?>

                            <? 
$tstr=$res_array[$i]["ACT_TIME"];
if($tstr<>""){
	echo $tstr[0].$tstr[1].$tstr[2].$tstr[3]."/".$tstr[4].$tstr[5]."/".$tstr[6].$tstr[7]."<br>".$tstr[8].$tstr[9].":".$tstr[10].$tstr[11].":".$tstr[10].$tstr[11]; }
else{
	echo "&nbsp;";
}
?>

                            </font></div>

                      </td>

                      <td align="center" width="8%"> 

                        <div align="center"><font color="#FFFFFF"><a href="log_mag.php?action=del&lid=<? echo  $res_array[$i]['LOG_ID'] ;?>&cmdsearc=1&ser_type=<? echo  $ser_type ;?>&txtvalue=<? echo  $txtvalue ;?>&ser_t1=<? echo  $ser_t1 ;?>&ser_t2=<? echo  $ser_t2 ;?>"><font color="#FF0000">删除</font></a></font></div>

                      </td>

                    </tr>

                    <?$i++; }?>

                    <?//}?>

                  </table>

				                    

                    <p align="right">

                      <input name="ser_type" size="50"    type="hidden"  value="<? echo $ser_type;?>">

                      <input name="txtvalue" size="50"    type="hidden"  value="<? echo $txtvalue;?>">

                      <input name="ser_t1" size="50"    type="hidden"  value="<?php for($k=0;$k<=7;$k++){echo $ser_t1[$k];}?>">

					 <input name="ser_t2" size="50"    type="hidden"  value="<?php for($k=0;$k<=7;$k++){echo $ser_t2[$k];}?>">

					 <input name="offset" size="50"    type="hidden"  value="<? echo  $offset;?>">

					 <input name="temp" size="50"    type="hidden"  value="<? echo  $temp;?>">

					 <input name="nextoffset" size="50"    type="hidden"  value="<? echo  $nextoffset;?>">

					 <input name="preoffset" size="50"    type="hidden"  value="<? echo  $preoffset;?>">

                      <input type="submit" name="killbtn" value="批量删除" >

                      <input type="reset" name="cmdreset2" value="选择重置">

                    </p>

                  </form>

                  

                  <br>

                  <div align="right">
                  </div>

                </td>

              </tr>

            </table>

            <p>&nbsp; </p>

          </div>

          <div align="right"></div>



        </td>

      </tr>

    </table>

  </div>



  <p>&nbsp;</p>

  

  <p>&nbsp;</p>

</center>

<p>&nbsp;</p>

<div align="center"><br>

  <p>&nbsp;</p>

</div>



<script language="JavaScript">



<!--



function CheckAll()

  {

    for (var i=0;i<document.listmail.elements.length;i++)

    {

      var e = document.listmail.elements[i];

      if (e.name != 'allbox')

        e.checked = document.listmail.allbox.checked;

    }

  }

//-->



</script>



<?$cla->db_logoff();?>

</body>

</html>

⌨️ 快捷键说明

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