Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Web报表表错误未知原因_Php_Mysql - Fatal编程技术网

Php Web报表表错误未知原因

Php Web报表表错误未知原因,php,mysql,Php,Mysql,因此,我目前正在测试我的web报告表。所以在初始测试中没有错误,表看起来像这样,和我设计的一样 但是在把它与硬件和其他东西连接起来之后,我发现桌子有时会变成这样 重新启动程序后,表格再次恢复正常。这个问题有时会发生,并不经常发生。是什么导致了这一切 下面是php代码 <?php require_once('Connections/sizeCount.php'); ?> <?php $to = date("Y-m-d",strtotime("+1 day".$_GET['to'

因此,我目前正在测试我的web报告表。所以在初始测试中没有错误,表看起来像这样,和我设计的一样

但是在把它与硬件和其他东西连接起来之后,我发现桌子有时会变成这样

重新启动程序后,表格再次恢复正常。这个问题有时会发生,并不经常发生。是什么导致了这一切

下面是php代码

<?php require_once('Connections/sizeCount.php'); ?>
<?php
$to = date("Y-m-d",strtotime("+1 day".$_GET['to']));
mysql_select_db($database_sizeCount, $sizeCount);
$query_Recordset1 = "SELECT * FROM temp_frm_mngmt_tbl";
$Recordset1 = mysql_query($query_Recordset1, $sizeCount) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

if (!function_exists("GetSQLValueString")) 
{
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

        $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
}

?>
<html>
<head>
    <title>Daily Former Management Report</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style>
        @page {size 8.5in 11in;}
        div.page { page-break-after: always}  <!-- break after printing -->
        <!-- type="text/css" media="print">.breakAfter{ -->
    </style>
    <link href="style.css" rel="stylesheet" type="text/css">
</head>
<thead>
</thead>

<body> <!-- Body1 as Page Header -->
    <div align="center">
    <?php
        #$mnthName =  $_GET['mnthName'];
        #$year =  $_GET['year'];
        $SelectedDate =  $_GET['from'];

        date_default_timezone_set('Asia/Kuala_Lumpur');
        $date = date('d M Y', time() + $timezone);
        $time = date('h:i:s A', time() + $timezone);

        $PageFormat = '<table width="900" border="1" align="center" rules="all" class="graypanel">';
        $TableHeaderStyle="<td style='text-align:center;face:Times New Roman;font-size:20;'>";
        $TableStyleLeft="<td style='text-align:left;face:Times New Roman;font-size:10.5;'>";
        $TableStyleRight="<td style='text-align:right;face:Times New Roman;font-size:10.5;'>";
        $TableStyleCenter="<td style='text-align:center;face:Times New Roman;font-size:10.5;'>";
        $TableStyleSubTotal="<td style='text-align:right;face:Times New Roman;font-size:10.5; background-color:#bebaa7;'>";
        $TableStyleSubTotal="<td style='text-align:right;face:Times New Roman;font-size:10.5;font-weight:bold;'>";
        $TableStyleSubTotalCenter="<td style='text-align:center;face:Times New Roman;font-size:10.5; background-color:#bebaa7;'>";
        #$TableStyleSubTotal="<td style='text-align:right;face:Times New Roman;font-size:10.5;font-weight:bold;background-color:#bebaa7;'>";
        $TableStyleSubTotalLeft="<td style='text-align:left;face:Times New Roman;font-size:10.5;font-weight:bold;'>";
        $TableStyleSubTotalRight="<td colspan = 2 style='text-align:center; face:Times New Roman;font-size:10.5;font-weight:bold;'>";
        #$TableStyleSubTotalLeft="<td style='text-align:left;face:Times New Roman;font-size:10.5; background-color:#bebaa7;'>";

        #$PageHeader1 = '<p align="center"><strong>Perusahaan Getah Asas Sdn Bhd (P2A)</strong><br>';
        #$PageHeader1 = '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; Report Generated: '.$date. "&nbsp;&nbsp;&nbsp;&nbsp;". $time;
        #$PageHeader2 = "<strong>Cummulative Glove Size Counting System</strong></p> <p> Line : ".$_GET['line']."&nbsp;&nbsp;&nbsp;&nbsp;Side : ".$_GET['side']."</p>";

        $PageHeader1 = '<strong style ="font-size:18px";>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Daily Former Management Report </strong><strong style ="font-size:10.5px";>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Report Date: '.$date. "&nbsp;". $time.'</strong>';                              
        $PageHeader2 = '<p align="center" style="margin-top: 0px; margin-bottom: 0px;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="style4">Plant</span> </strong><strong><span class="style4">P2A - All Lines</strong></p>';
        $PageHeader3 = '<p align="left" style="margin-top: 0px; margin-bottom: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Former Management by Line</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Day: '.$SelectedDate.'</strong></p>';
        #$PageHeader1 = '<div width="900" align="left" rules="all"><strong style ="font-size:18px";><span style="float:center;">Daily Glove Production Performance Report</span></strong><strong style ="font-size:10.5px";><span style="float:right;">Report Date: '.$date. "&nbsp;". $time.'</span></strong></div>';


        $TableHeader = '                    
                    <tr><bgcolor="#E1E1E1">
                    <th colspan = "1" width="40px" align="center"> </th>
                    <th colspan = "17" width="70px" align="center">Former Installation </th>                    
                    </tr>

                    <tr><bgcolor="#E1E1E1">
                    <th colspan = "1" width="40px" align="center"> </th>
                    <th colspan = "1" width="40px" align="center"> </th>
                    <th colspan = "2" width="40px" align="center">Size XS</th>
                    <th colspan = "2" width="40px" align="center">Size S</th>
                    <th colspan = "2" width="40px" align="center">Size M</th>
                    <th colspan = "2" width="40px" align="center">Size L</th>
                    <th colspan = "2" width="40px" align="center">Size XL</th>
                    <th colspan = "2" width="40px" align="center">Size XXL</th>
                    <th colspan = "4" width="40px" align="center">Total</th>
                    </tr>
                    <tr><bgcolor="#E1E1E1">
                    <th width="70px" align="center">Line</th>
                    <th width="70px" align="center">Side</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="77px" align="center">Shrtg (pcs)</th>
                    <th width="78px" align="center">Shrtg (%)</th>
                    <th width="78px" align="center">Instld (pcs)</th>
                    <th width="78px" align="center">Max. (pcs)</th>                                                            
                    </tr>'; 
    echo '<tbody>';
        $i = 0;
        echo $PageFormat;   # $PageFormat must be included here
        $PrevLine = "";
        $CurrLine = "";

        do
        {
                if (($i % 30) == 0)
                {               
                    if ($i > 0)
                    {
            echo '</td></tr></table>'.$PageFormat;  # $PageFormat must be included here
                        echo '<div class="page"></div>';  # leave blank for text inside div
                    }

                    echo $PageHeader1;
                    echo $PageHeader2;
                    echo $PageHeader3;
                    //echo $TableHeaderStyle; 
                    echo $TableHeader; echo '</td>';                    
                }

                $TestStr1 = $row_Recordset1['LineDayMonth'];
                $TestStr2 = "Total";                            

                $CurrLine = $row_Recordset1['LineDayMonth'];
                    if($CurrLine == $PrevLine)
                    {
                        $CurrLine = "";
                    }
                    if($CurrLine == 'Total')
                    {
                        $CurrLine = $row_Recordset1['LineDayMonth'];

                    }

$shrtg_Perc = $row_Recordset1['Shrtg_Perc'];

if($shrtg_Perc == null)
{
    $shrtg_Perc = 0;

}



                echo '<tr>';
                if($TestStr1 == $TestStr2) {
          echo $TableStyleSubTotalRight;
                        echo "&nbsp;".$CurrLine."&nbsp;&nbsp;&nbsp;";

                        echo "&nbsp;".$row_Recordset1['Side']; echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_XS']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_XS']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_S']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_S']); echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_M']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".$row_Recordset1['Instl_M']; echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_L']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_L']); echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_XL']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_XL']); echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_XXL']); echo '</td>';
                    echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_XXL']); echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_Total']); echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".$shrtg_Perc; echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_Total']); echo '</td>';
          echo $TableStyleSubTotal;
                        echo "&nbsp;".number_format ($row_Recordset1['MaxPcs']); echo '</td>';
                    }
                    else {
                    echo $TableStyleCenter;
                        echo "&nbsp;".$CurrLine."&nbsp;&nbsp;&nbsp;";
                    echo $TableStyleCenter;
                        echo "&nbsp;".$row_Recordset1['Side']; echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_XS']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_XS']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_S']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_S']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_M']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_M']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_L']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_L']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_XL']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_XL']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_XXL']); echo '</td>';
                    echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_XXL']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Shrtg_Total']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".$shrtg_Perc; echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['Instl_Total']); echo '</td>';
          echo $TableStyleRight;
                        echo "&nbsp;".number_format ($row_Recordset1['MaxPcs']); echo '</td>';
                    }
                    $PrevLine = $row_Recordset1['LineDayMonth'];
                    echo'</tr>';
            ++$i;
        } while($row_Recordset1 = mysql_fetch_assoc($Recordset1));
    echo '</tbody>';
    ?>
</table>
</div>
</body>
</html>
<?php
    mysql_free_result($Recordset1);
    ?>


请您为我们这些问题不明显的人概述一下问题表中的问题是什么,谢谢。哦,我很抱歉,问题表,表不是按照编号排列的,例如,问题表中应该是L1、L2、L3而不是L4、L6、L1谢谢您的解释,你能告诉我们你是如何整理表格的吗?如果你是指代码,我会告诉你。但是如果你想看看它应该是什么样子,你可以参考表报告默认设计,看看表应该是什么样子。我已经编辑了这个问题并包含了php代码