<?php
session_start();
$myyear=($_SESSION['MMshbyear']);
$mymonth=($_SESSION['MMshbmon']);
$tablename=($_SESSION['MMtablename']);
$username=($_SESSION['MM_Username']);
$SHBdanwei=($_SESSION["MMshbdanwei"]);
set_time_limit(0);
?>
<?php require_once('../Connections/connmyguding.php'); ?>
<?php
mysql_select_db($database_connmyguding, $connmyguding);
$query_Recordset1 = "SELECT * FROM $tablename";
$Recordset1 = mysql_query($query_Recordset1, $connmyguding) or die(mysql_error());
//$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {
font-size: 30px;
font-family: "华文隶书";
font-weight: bold;
}
.style6 {font-size: 14px; font-family: "楷体_GB2312"; }
.style10 {font-size: 14px; font-family: "幼圆"; font-weight: bold; }
.style11 {
font-size: 14px;
font-weight: bold;
}
.style12 {
font-size: 14px;
font-family: "幼圆";
}
.style13 {font-size: 12px}
.style15 {font-size: 12px; font-family: "幼圆"; }
-->
</style>
</head>
<body>
<?php
for($i=1;$i<=ceil($totalRows_Recordset1/16);$i++)
{
$pagesum_yuan=0;
$pagesum_yue=0;
$pagesum_nian=0;
$pagesum_lei=0;
$pagesum_jing=0;
echo "<table width='936' height='339' border='0' cellpadding='0' cellspacing='0'>";
echo "<tr>";
echo "<td width='934' height='77'><div align='center'><span class='style1'>固 定 资 产 计 提 表</span></div></td>";
echo "</tr>";
echo "<tr>";
echo "<td height='43'><div align='center' class='style12'>".$myyear."<strong>年</strong>".$mymonth."<strong>月</strong></div></td>";
echo "</tr>";
echo "<tr>";
echo "<td><span class='style6'><strong>填报单位:</strong>燃气销售二分公司".$SHBdanwei."</span></td>";
echo "</tr>";
echo "<tr>";
echo "<td><table width='934' border='2' cellpadding='0' cellspacing='0' bordercolor='fda316' style=' border-collapse: collapse;'>";
echo "<tr>";
echo "<td width='73' height='40'><div align='center'><span class='style10'>设备编号</span></div></td>";
echo "<td width='73'><div align='center'><span class='style10'>启用日期</span></div></td>";
echo "<td width='90'><div align='center'><span class='style10'>设备名称</span></div></td>";
echo "<td width='45'><div align='center'><span class='style10'>数量</span></div></td>";
echo "<td width='40'><div align='center'><span class='style10'>使用年限</span></div></td>";
echo "<td width='80'><div align='center'><span class='style11'>原值(元)</span></div></td>";
echo "<td width='67'><div align='center'><span class='style10'>月折旧率</span></div></td>";
echo "<td width='80'><div align='center'><span class='style11'>月折旧额(元)</span></div></td>";
echo "<td width='67'><div align='center'><span class='style10'>年折旧率</span></div></td>";
echo "<td width='80'><div align='center'><span class='style10'>年折旧额(元)</span></div></td>";
echo "<td width='80'><div align='center'><span class='style10'>累计折旧额(元)</span></div></td>";
echo "<td width='80'><div align='center'><span class='style10'>净值(元)</span></div></td>";
echo "</tr>";
echo "<tr>";
if ($i!=ceil($totalRows_Recordset1/16))
{
for ($j=1;$j<=16;$j++)
{
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$pagesum_yuan=sprintf("%.2f",($pagesum_yuan+$row_Recordset1['shb_yuanzhi']));
$pagesum_yue=sprintf("%.2f",($pagesum_yue+$row_Recordset1['shb_yuezhejiu']));
$pagesum_nian=sprintf("%.2f",($pagesum_nian+$row_Recordset1['shb_nianzhejiu']));
$pagesum_lei=sprintf("%.2f",($pagesum_lei+$row_Recordset1['shb_leijizhejiu']));
$pagesum_jing=sprintf("%.2f",($pagesum_jing+$row_Recordset1['shb_jingzhi']));
$sum_yuan=sprintf("%.2f",($sum_yuan+$row_Recordset1['shb_yuanzhi']));
$sum_yue=sprintf("%.2f",($sum_yue+$row_Recordset1['shb_yuezhejiu']));
$sum_nian=sprintf("%.2f",($sum_nian+$row_Recordset1['shb_nianzhejiu']));
$sum_lei=sprintf("%.2f",($sum_lei+$row_Recordset1['shb_leijizhejiu']));
$sum_jing=sprintf("%.2f",($sum_jing+$row_Recordset1['shb_jingzhi']));
echo "<td height='25'><div align='center'><span class='style13'>".$row_Recordset1['shb_id']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_qiyongdate']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_name']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_number']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianxian']."年</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_yuanzhi']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_yuezhelv']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_yuezhejiu']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianzhelv']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianzhejiu']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_leijizhejiu']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_jingzhi']."</span></div></td>";
echo "</tr>";
}
echo "<tr>";
echo "<td height='25'> </td>";
echo "<td> </td>";
echo "<td><div align='center' class='style12'><strong>本页合计</strong></div></td>";
echo "<td> </td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_yuan."</span></div></td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_yue."</span></div></td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_nian."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_lei."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_jing."</span></div></td>";
echo "</tr>";
}
else
{
for ($j=1;$j<=15;$j++)
{
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$pagesum_yuan=sprintf("%.2f",($pagesum_yuan+$row_Recordset1['shb_yuanzhi']));
$pagesum_yue=sprintf("%.2f",($pagesum_yue+$row_Recordset1['shb_yuezhejiu']));
$pagesum_nian=sprintf("%.2f",($pagesum_nian+$row_Recordset1['shb_nianzhejiu']));
$pagesum_lei=sprintf("%.2f",($pagesum_lei+$row_Recordset1['shb_leijizhejiu']));
$pagesum_jing=sprintf("%.2f",($pagesum_jing+$row_Recordset1['shb_jingzhi']));
$sum_yuan=sprintf("%.2f",($sum_yuan+$row_Recordset1['shb_yuanzhi']));
$sum_yue=sprintf("%.2f",($sum_yue+$row_Recordset1['shb_yuezhejiu']));
$sum_nian=sprintf("%.2f",($sum_nian+$row_Recordset1['shb_nianzhejiu']));
$sum_lei=sprintf("%.2f",($sum_lei+$row_Recordset1['shb_leijizhejiu']));
$sum_jing=sprintf("%.2f",($sum_jing+$row_Recordset1['shb_jingzhi']));
echo "<td height='25'><div align='center'><span class='style13'>".$row_Recordset1['shb_id']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_qiyongdate']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_name']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_number']."</span></div></td>";
if ($j<=$totalRows_Recordset1%16)
{
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianxian']."年</span></div></td>";
}
else
{
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianxian']."</span></div></td>";
}
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_yuanzhi']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_yuezhelv']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_yuezhejiu']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianzhelv']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_nianzhejiu']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_leijizhejiu']."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$row_Recordset1['shb_jingzhi']."</span></div></td>";
echo "</tr>";
}
echo "<tr>";
echo "<td height='25'> </td>";
echo "<td> </td>";
echo "<td><div align='center' class='style12'><strong>本页合计</strong></div></td>";
echo "<td> </td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_yuan."</span></div></td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_yue."</span></div></td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_nian."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_lei."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$pagesum_jing."</span></div></td>";
echo "</tr>";
echo "<tr>";
echo "<td height='25'> </td>";
echo "<td> </td>";
echo "<td><div align='center' class='style12'><strong>总计</strong></div></td>";
echo "<td> </td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$sum_yuan."</span></div></td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$sum_yue."</span></div></td>";
echo "<td> </td>";
echo "<td><div align='center'><span class='style13'>".$sum_nian."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$sum_lei."</span></div></td>";
echo "<td><div align='center'><span class='style13'>".$sum_jing."</span></div></td>";
echo "</tr>";
}
echo "</table></td>";
echo "</tr>";
echo "<tr>";
echo "<td height='28' width='150' valign='middle'><span class='style15'><strong>第</strong>".$i."<strong>页</strong> <strong>共</strong>".ceil($totalRows_Recordset1/16)."<strong>页</strong> </span></td>";
echo "</tr>";
echo "</table>";
}
?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
这是完整的代码. |
|