计算并打印每个表的每个应用程序的传递(%)

时间:2017-06-11 07:11:03

标签: php jquery html

现在我可以在表格中列出每个应用程序/(内部团队名称)名称。现在我想找出每个应用程序的每个表传递(%)并在html页面上打印。每个“aw ...”表都包含所有应用程序/(内部团队名称)名称和相应的结果。 database and table

Current output

<html>
<?php
$Show= htmlspecialchars($_GET["Show"]);
$team= htmlspecialchars($_GET["team"]);
$tablename = htmlspecialchars($_GET["tablename"]);

$servername="localhost";
$username="root";
$password="";
?>

<?php

// Create connection with mySQL
$conn = mysqli_connect($servername, $username, $password);

// Check connection
if (!$conn) {
    die("Connection failed:" . mysqli_connect_error());
}

//echo "Connected to mysql successfully";

//select a database to work with
mysqli_query( $conn , "USE plm_dashboard" );

Echo "<Body bgcolor="."white".">" ;
//echo $Show;
Echo "<br>";
Echo "<br>";
Echo "Applied Filters Are <br> ";
//echo "Team =  $team ";    echo "TableName= $tablename ";
$Local_team= "Reports";

if ($Show == "failed"){
        $Result_status = "passed";
    } else {
        // in this case the value of the $Result_status is 'all'
        $Result_status = "";
                }

echo "Result = $Show  <br>";    
    //$result =mysqli_query($conn ,"SELECT * FROM aw34_0605_tc1122 where Application="."'".$team."'");

$result = mysqli_query($conn ,"SELECT * FROM teamnames");
$result1 =mysqli_query($conn ,"SELECT * FROM aw34_0530_tc1015 (Select count(id) from aw34_0530_tc1015 where result ='passed' and application='ace')/(Select count(id) from aw34_0530_tc1015 where application='ace')*100");

    //$result =mysqli_query($conn ,"SELECT * FROM ". $tablename );
    //********** determine number of rows result set **********/
  // $row_cnt = $result->num_rows;

//mysqli_query()
//echo "Showing  $row_cnt Results ";    
//echo "<table border="."1".">
echo "<table border="."1"."align="."right".">
        <tr>
            <th>ID</th>
            <th>Internal Team Names</th>            
            <th width="."10px"." >Passed % for aw34_0530_tc1015</th>

        </tr>";


    while($row = mysqli_fetch_array($result)) {
            echo "<tr>";
            echo "<td>" . $row['ID'] . "</td>";
            echo "<td>" . $row['TeamInternalNames'] . "</td>";
            echo "<td>" . $row['TeamName'] . "</td>";
            // if ($row['Result'] == "passed") {
                // echo "<td style="."background-color:#33FF38".">P</td>";
            // } else {
                // echo "<td style="."background-color:#FF334C".">F</td>";
                // }

            echo "</tr>";

}
echo "</table>";
ECHO "BYE";

mysqli_close($conn);
Echo "<Body>";

?>
</html>

0 个答案:

没有答案