//insert into st_stateresult. Debug("\n[" . __FILE__ . "][" . __LINE__ . "]intostateresult:\n" . $sql . "\n"); #################################################################################################################################################################### if ($intostateresult && $inserttoissuestateresult) { //插入成功,提交成功然后发邮件 echo $intostateresult . " line insert into st_stateresult successfully!<br/>"; echo $inserttoissuestateresult . " line insert into st_issueresult successfully!<br/>"; Debug("\n[" . __FILE__ . "][" . __LINE__ . "]#send all mail\n" . $dailytest_id . "\n"); #send all mail SendAllMail($dailytest_id); Debug("\n[" . __FILE__ . "][" . __LINE__ . "]#send all mail\n" . $dailytest_id . "\n"); Debug("\n[" . __FILE__ . "][" . __LINE__ . "]#send testsuite mail按照模块分组发送邮件 \n" . $dailytest_id . "\n"); #send testsuite mail按照模块分组发送邮件 SendTestsuiteMail($dailytest_id); Debug("\n[" . __FILE__ . "][" . __LINE__ . "]#send testsuite mail按照模块分组发送邮件 \n" . $dailytest_id . "\n"); } else { //插入st_stateresult 表格失败时 echo $dailytest_id . " dailytest_id<br/>"; echo $intostateresult . "insert into st_stateresult Fail!<br/>"; $sql = "delete from st_dailytest where dailytest_id='{$dailytest_id}'"; Dosql($sql); Debug("\n[" . __FILE__ . "][" . __LINE__ . "]delete:\n" . $sql . "\n"); } //end if() } ?> </form> </body> </html>
echo "<td width=\"10%\">{$modifyplatformonlineto}</td>\n "; echo "</tr>\n"; echo "</table>\n"; ?> <h3>After Modify Platform:</h3> <table class="altrowstable" width="30%"> <tr bgcolor="#d2d2d2" align="center"> <td>Platform</td><td>Description</td><td>Online</td> </tr> <?php if ($updateplatformresult) { $modifyplatform = $modifyplatformto; } $sql = "select platform,platformdescription,platform_online as online from st_platform where platform='{$modifyplatform}'"; $platresult = Dosql($sql); $plat_num = $platresult->num_rows; for ($i = 0; $i < $plat_num; $i++) { $row = $platresult->fetch_assoc(); echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['platform'])) . "</td>\n"; echo "<td width=\"70%\">" . htmlspecialchars(stripslashes($row['platformdescription'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['online'])) . "</td>\n"; echo "</tr>\n"; } $platresult->free(); ?> </table> <h3>You can :<a href="/smoketest/php/createplatform.php" target="mainFrame">Create Platform</a></h1>
</table> <input type="submit" value="commit" /> </form> <h3 style="font-family:arial">已有的 Testsuite:</h3> <table class="altrowstable" width="60%"> <tr bgcolor="#d2d2d2"> <td>ID</td><td>Testsuite</td><td>DepartmentID</td><td>Department</td><td>Description</td><td>Online</td> </tr> <?php $sql = "select testsuite_id, testsuite, testsuitedescription, st_testsuite.department_id as department_id, department, testsuite_online as online \n from st_testsuite, st_department\n where st_testsuite.department_id=st_department.department_id order by testsuite_id"; $testsuiteresult = Dosql($sql); $testsuite_num = $testsuiteresult->num_rows; for ($i = 0; $i < $testsuite_num; $i++) { $row = $testsuiteresult->fetch_assoc(); if ($i % 2) { $bgcolor = "#ffffff"; } else { $bgcolor = "#f2f2f2"; } echo "<tr bgcolor=\"{$bgcolor}\">\n"; echo "<td width=\"5%\">" . htmlspecialchars(stripslashes($row['testsuite_id'])) . "</td>\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['testsuite'])) . "</td>\n"; echo "<td width=\"5%\">" . htmlspecialchars(stripslashes($row['department_id'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['department'])) . "</td>\n"; echo "<td width=\"70%\">" . htmlspecialchars(stripslashes($row['testsuitedescription'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['online'])) . "</td>\n";
</head> <?php require_once "./libraries/common.inc.php"; $newbranch = $_POST['newbranch']; $newbranchdesc = $_POST['newbranchdesc']; if (!$newbranch) { echo 'You have not entered all details.<br/>Branch name mull fill'; exit; } if (!$newbranchdesc) { $newbranchdesc = "no description!"; } if (!get_magic_quotes_gpc()) { $newbranch = addslashes($newbranch); $newbranchdesc = addslashes($newbranchdesc); } $sql = "insert into st_branch(branch, branchdescription, branch_online) values('{$newbranch}', '{$newbranchdesc}', 1)"; $insertresult = Dosql($sql); if (!$insertresult) { echo "<h1>Insert Fail!\n</h1>"; } else { echo 'insertresult = ' . $insertresult . '<br/>' . "\n"; echo "Insert st_branch Successfully!\n<br/>"; } ?> <h1>You can :<a href="/smoketest/php/createbranch.php" target="mainFrame">Create Branch</a></h1> <h1>Or :<a href="/smoketest/php/modifybranch.php" target="mainFrame">Modify Branch</a></h1>
function PrintAllNoDetailandTable($platform, $branch, $testsuiteid, $testcasestateid, $date) { $sql = "select st_platform_branch.platform as platform,st_platform_branch.branch as branch\n from\n st_branch,st_platform,st_platform_branch\n where\n st_platform.platform = st_platform_branch.platform\n and st_branch.branch = st_platform_branch.branch\n and st_branch.branch = '{$branch}'\n and platform_online = 1\n and branch_online = 1\n and st_platform_branch.pb_online=1"; $pbresult = Dosql($sql); $num_pb = $pbresult->num_rows; for ($i = 0; $i < $num_pb; $i++) { $rowpb = $pbresult->fetch_assoc(); if ($testsuite == -1) { if ($testcasestateid == -1) { #00,11 SearchNoNoAllAll($rowpb['platform'], $rowpb['branch'], $testsuiteid, $testcasestateid, $date); } else { #00,10 SearchNoNoAllNo($rowpb['platform'], $rowpb['branch'], $testsuiteid, $testcasestateid, $date); } //end if() } else { #00,01 if ($testcasestateid == -1) { SearchNoNoNoAll($rowpb['platform'], $rowpb['branch'], $testsuiteid, $testcasestateid, $date); } else { #00,00 SearchNoNoNoNo($rowpb['platform'], $rowpb['branch'], $testsuiteid, $testcasestateid, $date); } //end if() } //end if() echo "<br/>\n"; } $pbresult->free(); }
?> var strURL = "/smoketest/php/showalldetail.php?platformbranchproduct=" + pbp + "&date=" + datetime + str; $.ajax({ type:"GET", url:strURL, success:function(msg){ $('#detail').html(msg); } }); } $(function () { <?php echo "var failtestsuite=new Array();\n"; $sql = "select st_platform_branch.platform as platform,branch,product\n from\n st_platform_branch,st_platform_product\n where\n st_platform_branch.platform = st_platform_product.platform\n and pb_online='1'\n and pp_online=1\n and st_platform_branch.online='1'\n and st_platform_product.online='1'\n "; $pbpresult = Dosql($sql); $num_pbp = $pbpresult->num_rows; for ($pbi = 0; $pbi < $num_pbp; $pbi++) { $row = $pbpresult->fetch_assoc(); $platformbranchproduct = $row['platform'] . $row['branch'] . "_" . $row['product']; $failtestsuitearray = $allfailtestsuite[$platformbranchproduct]; $failtestdatearray = $alltestdate[$platformbranchproduct]; echo "var {$platformbranchproduct} = new Array();\n"; foreach ($failtestdatearray as $i => $date) { echo "{$platformbranchproduct}" . "[\"{$date}\"] = \"" . $failtestsuitearray[$i] . "\";\n"; } echo "failtestsuite[\"{$platformbranchproduct}\"] = {$platformbranchproduct};\n"; } $pbpresult->free(); ?> var chart;
$platform = addslashes($platform); $product = addslashes($product); $online = intval($online); } $sql = "update st_platform_product set pp_online='{$online}' where platform='{$platform}' and product='{$product}'"; $updateresult = Dosql($sql); ?> <h3>修改后的platform product relation:</h3> <table class="altrowstable" width="30%"> <tr bgcolor="#d2d2d2" align="center"> <td>Platform</td><td>Product</td><td>Online</td><td>Platform * Product</td> </tr> <?php $sql = "select platform,product,online, pp_online from st_platform_product"; $relationresult = Dosql($sql); $num_relation = $relationresult->num_rows; for ($i = 0; $i < $num_relation; $i++) { $row = $relationresult->fetch_assoc(); if ($row['pp_online'] && $row['online']) { echo "<tr bgcolor=\"#ffffff\" align=\"center\">\n"; } else { echo "<tr bgcolor=\"#ce0000\" align=\"center\">\n"; } echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['platform'])) . "</td>\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['product'])) . "</td>\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['pp_online'])) . "</td>\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['online'])) . "</td>\n"; echo "</tr>\n"; } $relationresult->free();
if (!get_magic_quotes_gpc()) { $platform = addslashes($platform); $branch = addslashes($branch); } if ($fromflag == "platform") { $sql = "select st_platform_branch.platform as platform,st_platform_branch.branch as branch ,branchname,createdate,purpose,androidversion\n from\n st_branch,st_platform,st_platform_branch,st_branchdetail\n where\n st_platform.platform=st_platform_branch.platform\n and st_platform_branch.platform='{$platform}'\n and st_branchdetail.branch=st_platform_branch.branch\n and st_branch.branch=st_platform_branch.branch\n "; } if ($fromflag == "branch") { $sql = "select distinct st_platform_branch.branch as branch ,branchname,createdate,purpose,androidversion\n from\n st_branch,st_platform,st_platform_branch,st_branchdetail\n where\n st_platform.platform=st_platform_branch.platform\n and st_platform_branch.branch='{$branch}'\n and st_branchdetail.branch=st_platform_branch.branch\n and st_branch.branch=st_platform_branch.branch\n "; } $branchresult = Dosql($sql); $num_branch = $branchresult->num_rows; echo "<table class=\"altrowstable\" width=40%>\n"; for ($i = 0; $i < $num_branch; $i++) { $row = $branchresult->fetch_assoc(); echo "<tr bgcolor=\"d2d2d2\"><th colspan=2>" . $row['branchname'] . "</th></tr>\n"; echo "<tr><td width=30%>Create Date</td><td>" . $row['createdate'] . "</td></tr>\n"; echo "<tr><td>Android Version</td><td>" . $row['androidversion'] . "</td></tr>\n"; echo "<tr><td>Purpose</td><td>" . $row['purpose'] . "</td></tr>\n"; $sql = "select releasename,codedroplink from st_release where branchname='" . $row['branchname'] . "'"; $releaseresult = Dosql($sql); $num_release = $releaseresult->num_rows; for ($j = 0; $j < $num_release; $j++) { $rowrelease = $releaseresult->fetch_assoc(); $array = split('[\\]', $rowrelease['codedroplink']); echo "<tr><td colspan=2><b>" . $rowrelease['releasename'] . ": </b><a href=\"file://" . $rowrelease['codedroplink'] . "\">" . $array[count($array) - 1] . "</a></td></tr>\n"; } $releaseresult->free(); } echo "</table>\n"; $branchresult->free();
<html> <head> <title>create tester</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="/smoketest/css/main.css"> </head> <body> <h3 style="font-family:arial">已有的 Tester:</h3> <table class="altrowstable" width="40%"> <tr bgcolor="#d2d2d2" align="center"> <td>Name</td><td>E-mail</td><td>Description</td><td>Level</td> </tr> <?php $sql = "select tester,email,testerdescription,tester_level as level from st_tester"; $testerresult = Dosql($sql); $tester_num = $testerresult->num_rows; for ($i = 0; $i < $tester_num; $i++) { $row = $testerresult->fetch_assoc(); echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['tester'])) . "</td>\n"; echo "<td width=\"30%\">" . htmlspecialchars(stripslashes($row['email'])) . "</td>\n"; echo "<td width=\"40%\">" . htmlspecialchars(stripslashes($row['testerdescription'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['level'])) . "</td>\n"; echo "</tr>\n"; } $testerresult->free(); ?> </table> <form action="commitcreatetester.php" method="post">
<head> <title>modify branch</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="/smoketest/css/main.css"> </head> <body> <form action="commitmodifybranch.php" method="post" > <h3>已有的Branch:</h3> <table class="altrowstable" width="30%"> <tr bgcolor="#d2d2d2"> <td>Branch</td><td>Description</td><td>Online</td> </tr> <?php $sql = "select branch,branchdescription,branch_online as online from st_branch"; $branchresult = Dosql($sql); $branch_num = $branchresult->num_rows; $brancharray = array(); for ($i = 0; $i < $branch_num; $i++) { $row = $branchresult->fetch_assoc(); $brancharray[$i] = $row; echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['branch'])) . "</td>\n"; echo "<td width=\"70%\">" . htmlspecialchars(stripslashes($row['branchdescription'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['online'])) . "</td>\n"; echo "</tr>\n"; } $branchresult->free(); ?> </table> <script language="JavaScript">
$pbresult->free(); $platform_to_product = array(); $sql = "select st_platform_product.platform as platform,st_platform_product.product as product\r\n from\r\n st_product,st_platform,st_platform_product\r\n where\r\n st_platform.platform=st_platform_product.platform and\r\n st_product.product=st_platform_product.product and\r\n platform_online=1 and product_online=1 and\r\n st_platform_product.pp_online=1"; $ppresult = Dosql($sql); $num_pp = $ppresult->num_rows; for ($i = 0; $i < $num_pp; $i++) { $row = $ppresult->fetch_assoc(); $platform_to_product[$row['platform']][] = $row['product']; } $ppresult->free(); $platform_to_boardno = array(); $platform_to_hardware = array(); $platform_to_imageinfo = array(); $platform_to_note = array(); $sql = "select platform,branch,boardno,hardware,imageinfo,note\r\n from (select platform,branch, boardno, hardware, imageinfo, note\r\n from st_dailytest\r\n where tester='" . $_SESSION['tester'] . "'\r\n order by testdate desc) as temptable\r\n group by platform"; $platformresult = Dosql($sql); $num_p = $platformresult->num_rows; for ($i = 0; $i < $num_p; $i++) { $row = $platformresult->fetch_assoc(); $platform_to_boardno[$row['platform']] = htmlspecialchars(stripslashes($row['boardno'])); $platform_to_hardware[$row['platform']] = htmlspecialchars(stripslashes($row['hardware'])); $platform_to_imageinfo[$row['platform']] = $row['imageinfo']; $platform_to_note[$row['platform']] = htmlspecialchars(stripslashes($row['note'])); } $platformresult->free(); ?> <html> <head> <link rel="stylesheet" href="/smoketest/css/jquery-ui.css" /> <link rel="stylesheet" href="/smoketest/css/newtest.css" />
# modify to name $modifystatecolorto = $_POST['modifystatecolorto']; #modify to color if (!get_magic_quotes_gpc()) { $modifystateto = addslashes($modifystateto); $modifystatecolorto = addslashes($modifystatecolorto); } if ($_SESSION['level'] > 1 && $modifystateto) { $updatesql = "update st_state set state = '" . $modifystateto . "' "; $updatesql .= " where state_id = '" . $modifystateid . "' "; $updatestateresult = Dosql($updatesql); } if ($modifystatecolorto) { $updatesql = "update st_state set color= '" . $modifystatecolorto . "' "; $updatesql .= " where state_id = '" . $modifystateid . "' "; $updateresult = Dosql($updatesql); } echo '<table cellspacing="1" cellpadding="0" border="0" bgcolor="#000000" width="30%">'; echo '<tr bgcolor="#6dc22c">'; echo '<td>ID</td><td>State</td><td>Color</td><td></td>'; echo '</tr>'; echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td >{$modifystateid}</td>\n "; echo "<td >{$modifystateto}</td>\n "; echo "<td >{$modifystatecolorto}</td>\n "; echo "<td > </td>\n "; echo "</tr>\n"; echo "</table>\n"; ?>
$num_count = $countresult->num_rows; for ($i = 0; $i < $num_count; $i++) { $row = $countresult->fetch_assoc(); $totalpages = $row['num']; } $countresult->free(); $page = $_GET['page']; $targetpage = "/smoketest/php/searchissuehistory.php"; $limit = 10; if ($page) { $start = ($page - 1) * $limit; } else { $start = 0; } $sql = "select dailytest_id,testdate,testdetailtime,imageinfo,platform,branch,product,st_tester.testerdescription as tester,email,newissue,remainissue\n from\n st_dailytest,st_tester\n where\n st_tester.tester=st_dailytest.tester\n order by testdetailtime desc limit {$start},{$limit}"; $issueresult = Dosql($sql); $num_issue = $issueresult->num_rows; $table = "<table class=\"altrowstable\" width=\"80%\">\n"; $table .= "<tr bgcolor=\"#ffffff\" align=\"center\" ><th colspan=\"7\">Issue History Table</th></tr>\n"; $table .= "<tr bgcolor=\"#d2d2d2\" align=\"center\">\n"; $table .= "\n <td widht=\"20%\">Image</td>\n <td widht=\"15%\">Platform</td>\n <td width=\"15%\">Branch</td>\n <td width=\"10%\">Product</td>\n <td width=\"15%\" align=\"center\">Tester</td>\n <td width=\"10%\">Detail</td>\n <td width=\"15%\">TestDetailDateTime</td>\n \n"; $table .= "</tr>\n"; for ($i = 0; $i < $num_issue; $i++) { $row = $issueresult->fetch_assoc(); if ($i % 2) { // 隔行换色 $bgcolor = "#ffffff"; } else { $bgcolor = "#f2f2f2"; } $table .= "<tr bgcolor=\"{$bgcolor}\" align=\"center\">\n";
function SendTestsuiteMail($dailytest_id) { # 按照模块分别发送mail Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $dailytest_id . "\n"); $message .= PrintCss(); //打印链接 $message .= PrintDetailLink($dailytest_id); $message .= "<br/>\n"; //打印每个模块的测试详细信息 $message .= PrintTestsuiteTestDetail($dailytest_id); $sql = "select st_tester.testerdescription, st_tester.email,testdate,platform,branch,product,imageinfo\n from\n st_tester,st_dailytest\n where\n st_dailytest.tester=st_tester.tester and\n st_dailytest.dailytest_id='{$dailytest_id}'"; Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $sql . "\n"); $testerresult = Dosql($sql); $num_tester = $testerresult->num_rows; for ($i = 0; $i < $num_tester; $i++) { $row = $testerresult->fetch_assoc(); $testername = $row['testerdescription']; $testeremail = $row['email']; $reportdate = $row['testdate']; $platform = $row['platform']; $branch = $row['branch']; $product = $row['product']; $imageinfo = stripslashes($row['imageinfo']); } $testerresult->free(); $sql = "select distinct st_testsuite.department_id ,department,department_email\n from\n st_testsuite,st_department\n where\n st_testsuite.department_id = st_department.department_id\n and st_testsuite.testsuite_online = '1'\n and st_department.department_online = '1'\n order by department_id"; Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $sql . "\n"); $departmentresult = Dosql($sql); $num_depart = $departmentresult->num_rows; for ($depart = 0; $depart < $num_depart; $depart++) { $rowdepart = $departmentresult->fetch_assoc(); //收件人//$to ="$testeremail,mamh@marvell.com"; $to = "{$testeremail},mamh@marvell.com," . $rowdepart['department_email']; $sql = "select testsuite_id,testsuite from st_testsuite where testsuite_online = '1' and department_id = '" . $rowdepart['department_id'] . "'"; Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $sql . "\n"); $suiteresult = Dosql($sql); $num_suite = $suiteresult->num_rows; for ($suite = 0; $suite < $num_suite; $suite++) { $rowsuite = $suiteresult->fetch_assoc(); $suitenewissueemessage .= PrintTestsuiteNewIssue($dailytest_id, $rowsuite['testsuite_id']); $suiteremainissuemessage .= PrintTestsuiteRemainIssue($dailytest_id, $rowsuite['testsuite_id']); //fail 状态的表 $suitefailmessage .= "<h3 style=font-family:arial;>Fail Testcase <font style=color:blue>" . $rowsuite['testsuite'] . "</font></h3>\n"; $suitefailmessage .= PrintFailStateTable($dailytest_id, $rowsuite['testsuite_id']); $suitefailmessage .= "<br/>\n"; //统计各个状态的个数的表 //$suitefailmessage .= PrintStateStatisticsTable($dailytest_id, $rowsuite['testsuite_id']); //所有状态的统计表 $suitestatusmessage .= PrintTestsuiteTable($dailytest_id, $rowsuite['testsuite_id'], $rowsuite['testsuite']); $rowsuitestr .= " - " . $rowsuite['testsuite']; } $suiteresult->free(); $messagetemp .= "<h3 style=font-family:arial;color:red>New Issues</h3>\n"; $messagetemp .= $suitenewissueemessage; $messagetemp .= "<h3 style=font-family:arial;color:red>Remaining Issues</h3>\n"; $messagetemp .= $suiteremainissuemessage; $messagetemp .= "<br/>\n"; $messagetemp .= $suitefailmessage; $messagetemp .= "<h3 style=font-family:arial>Feature Status</h3>\n"; $messagetemp .= $suitestatusmessage; $smoketest_imagedate = get_imageinfo_imagedate($imageinfo); if ($smoketest_imagedate) { $subject = "[Daily Smoke Test][" . stripslashes($product) . "][{$smoketest_imagedate}] " . $rowsuitestr; } else { $subject = "[Daily Smoke Test] - " . stripslashes($reportdate) . "_" . stripslashes($platform) . "_" . stripslashes($branch) . " _ " . stripslashes($product) . " " . $rowsuitestr; } Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $subject . "\n"); $from = "{$testername}<{$testeremail}>"; $headers = "Content-type:text/html; charset=utf-8\n"; $headers .= "From:{$from}"; //$to="*****@*****.**"; $sendmailresult = mail($to, $subject, $message . $messagetemp, $headers); echo "SendTestsuiteMail:sendmailresult = {$sendmailresult}<br/>\n"; echo "From = {$from}<br/>\n"; echo "To = {$to}<br/>\n"; Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $to . "\n"); Debug("\n[" . __FILE__ . "][" . __LINE__ . "]:\n" . $from . "\n"); $messagetemp = ""; $suiteremainissuemessage = ""; $suitenewissueemessage = ""; $suitefailmessage = ""; $suitestatusmessage = ""; $rowsuitestr = ""; } //end for() $departmentresult->free(); }
<title>create product</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="/smoketest/css/main.css"> </head> <body> <h3 style="font-family:arial">Product:</h3> <table class="altrowstable" width="30%"> <tr bgcolor="#d2d2d2"> <td>Product</td><td>Description</td><td>Online</td> </tr> <?php $sql = "select product,productdescription,product_online as online from st_product order by product"; $productresult = Dosql($sql); $pro_num = $productresult->num_rows; for ($i = 0; $i < $pro_num; $i++) { $row = $productresult->fetch_assoc(); echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['product'])) . "</td>\n"; echo "<td width=\"70%\">" . htmlspecialchars(stripslashes($row['productdescription'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['online'])) . "</td>\n"; echo "</tr>\n"; } $productresult->free(); ?> </table> <form action="commitcreateproduct.php" method="post">
$id_to_state = array(); $sql = "select state,testcase_id\n from\n st_stateresult,st_state\n where\n st_stateresult.state_id=st_state.state_id and\n dailytest_id='{$dailytest_id}'"; $stateresult = Dosql($sql); $num_state = $stateresult->num_rows; for ($i = 0; $i < $num_state; $i++) { $row = $stateresult->fetch_assoc(); $id_to_state[$row['testcase_id']] = $row['state']; } $stateresult->free(); for ($tables = 0; $tables < $num_suite; $tables++) { $row = $testsuite->fetch_assoc(); echo '<table class="altrowstable" width="60%" >' . "\n"; echo '<tr><th colspan="2" ><font style="font-family:arial;font-size:200%">' . $row['testsuite'] . '</font></th></tr>' . "\n"; echo '<tr bgcolor="#d2d2d2" ><td width="90%" align="center">Feature</td><td align="center" width="10%">Last State</td></tr>'; $sql = "select testcase_id, description\n from\n st_testcase\n where testsuite_id = " . $row['testsuite_id'] . " and\n testcase_online='1'\n order by testcase_id"; $testcase = Dosql($sql); $num_t = $testcase->num_rows; for ($i = 0; $i < $num_t; $i++) { $row = $testcase->fetch_assoc(); if ($i % 2) { $bgcolor = "#ffffff"; } else { $bgcolor = "#f2f2f2"; } echo "<tr bgcolor=\"{$bgcolor}\">\n"; echo "<td>"; echo htmlspecialchars(stripslashes($row['description'])); echo "</td>\n"; echo "<td align=\"center\" bgcolor=\"" . $state_to_color[$id_to_state[$row['testcase_id']]] . "\">"; echo $id_to_state[$row['testcase_id']]; echo "</td>\n";
<html> <head> <title>modify state</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="/smoketest/css/main.css"> </head> <body> <h3 style="font-family:arial">已有的 State:</h3> <table class="altrowstable" width="30%"> <tr bgcolor="#d2d2d2" align="center"> <td>ID</td><td>State</td><td>Color</td><td></td> </tr> <?php $sql = "select state_id, state, color from st_state"; $stateresult = Dosql($sql); $state_num = $stateresult->num_rows; $statearray = array(); for ($i = 0; $i < $state_num; $i++) { $row = $stateresult->fetch_assoc(); $statearray[$i] = $row; echo "<tr bgcolor=\"#ffffff\">\n"; echo "<td width=\"5%\">" . htmlspecialchars(stripslashes($row['state_id'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['state'])) . "</td>\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['color'])) . "</td>\n"; echo "<td width=\"10%\" bgcolor=\"" . htmlspecialchars(stripslashes($row['color'])) . "\"></td>\n"; echo "</tr>\n"; } $stateresult->free(); ?> </table>
<td><input name="newdepartmentbelongto"/></td> </tr> </table> <input type="submit" value="commit" /> </form> <h3 style="font-family:arial">已有的All Department:</h3> <table class="altrowstable" width="60%"> <tr bgcolor="#d2d2d2"> <td width="10%">Department</td><td width="40%">E-mail</td><td>Description</td><td>Online</td><td>Belong to</td> </tr> <?php $sql = "select alldepartment,alldepartment_email as email ,alldepartment_description,alldepartment_online as online,belongto from st_alldepartment"; $departresult = Dosql($sql); $depart_num = $departresult->num_rows; for ($i = 0; $i < $depart_num; $i++) { $row = $departresult->fetch_assoc(); if ($i % 2) { $bgcolor = "#ffffff"; } else { $bgcolor = "#f2f2f2"; } echo "<tr bgcolor=\"{$bgcolor}\">\n"; echo "<td width=\"10%\">" . htmlspecialchars(stripslashes($row['alldepartment'])) . "</td>\n"; echo "<td width=\"40%\">" . htmlspecialchars(stripslashes($row['email'])) . "</td>\n"; echo "<td width=\"40%\">" . htmlspecialchars(stripslashes($row['alldepartment_description'])) . "</td>\n"; echo "<td width=\"5%\">" . htmlspecialchars(stripslashes($row['online'])) . "</td>\n"; echo "<td width=\"5%\">" . htmlspecialchars(stripslashes($row['belongto'])) . "</td>\n"; echo "</tr>\n";
$issueresult->free(); ?> <br/> <table class="altrowstable" width="30%"> <tr bgcolor="#ffffff" align="center" ><th colspan="2">State Statistics Table</th></tr> <tr bgcolor="#d2d2d2"> <td>State</td><td>Count</td> </tr> <?php //统计每个状态个数 if ($testsuiteid == 0) { $sql = "select state,count(state) as count\n from st_stateresult,st_dailytest,st_state\n where\n platform='{$platform}'\n and branch='{$branch}'\n and testdate='{$date}'\n and st_dailytest.dailytest_id=st_stateresult.dailytest_id\n and st_dailytest.dailytest_id='{$dailytestid}'\n and st_state.state_id=st_stateresult.state_id\n group by state"; } else { $sql = "select state,count(state) as count\n from st_stateresult,st_dailytest,st_state ,st_testcase,st_testsuite\n where\n platform='{$platform}'\n and branch='{$branch}'\n and testdate='{$date}'\n and st_dailytest.dailytest_id=st_stateresult.dailytest_id\n and st_dailytest.dailytest_id='{$dailytestid}'\n and st_state.state_id=st_stateresult.state_id\n and st_stateresult.testcase_id = st_testcase.testcase_id\n and st_testcase.testsuite_id = st_testsuite.testsuite_id\n and st_testsuite.testsuite_id = '{$testsuiteid}'\n group by state"; } //end if() $countresult = Dosql($sql); $num_count = $countresult->num_rows; for ($i = 0; $i < $num_count; $i++) { $row = $countresult->fetch_assoc(); echo "<tr>\n"; echo "<td>" . htmlspecialchars(stripslashes($row['state'])) . "</td>\n"; echo "<td>" . htmlspecialchars(stripslashes($row['count'])) . "</td>\n"; echo "</tr>\n"; } $countresult->free(); ?> </table>
<body> <form action="commitmodifytestcase.php" method="post"> <?php $sql = "select testsuite_id, testsuite from st_testsuite where testsuite_online=1"; $suiteresult = Dosql($sql); $num_suite = $suiteresult->num_rows; echo "<table class=\"altrowstable\" width=\"60%\">"; echo "<tr bgcolor=\"#d2d2d2\">"; echo "<td align=\"center\" width=\"10%\">Testsuite</td><td align=\"center\" width=\"5%\">ID</td><td align=\"center\">Description</td><td align=\"center\" width=\"5%\">Online</td>"; echo "</tr>"; for ($i = 0; $i < $num_suite; $i++) { $row = $suiteresult->fetch_assoc(); $testsuite_id = $row['testsuite_id']; $sql = "select testcase_id, description, testsuite,testcase_online as online from st_testcase,st_testsuite\n where\n st_testcase.testsuite_id = st_testsuite.testsuite_id\n and st_testsuite.testsuite_id='{$testsuite_id}'"; $caseresult = Dosql($sql); $num_case = $caseresult->num_rows; for ($j = 0; $j < $num_case; $j++) { $row = $caseresult->fetch_assoc(); if ($j % 2) { $bgcolor = "#ffffff"; } else { $bgcolor = "#f2f2f2"; } echo "<tr bgcolor=\"{$bgcolor}\">\n"; if ($j == 0) { echo "<td bgcolor=\"#ffffff\" rowspan=\"{$num_case}\" align=\"center\">" . htmlspecialchars(stripslashes($row['testsuite'])) . "</td>\n"; } echo "<td align=\"center\">" . $row['testcase_id'] . "</td>\n"; echo "<td>" . htmlspecialchars(stripslashes($row['description'])) . "</td>\n"; $checked = "";
function printJavaScript($alltestdate, $allfailtestsuite) { $jsstring = ""; $jsstring .= "var failtestsuite = new Array();\n"; $sql = "select distinct platform,branch,product from st_dailytest"; $pbpresult = Dosql($sql); $num_pbp = $pbpresult->num_rows; for ($pbi = 0; $pbi < $num_pbp; $pbi++) { $row = $pbpresult->fetch_assoc(); $pl = $row['platform']; $br = $row['branch']; $pr = $row['product']; $platformbranchproduct = $pl . $br . "_" . $pr; $failtestsuitearray = $allfailtestsuite[$platformbranchproduct]; $failtestdatearray = $alltestdate[$platformbranchproduct]; $jsstring .= "var {$platformbranchproduct} = new Array();\n"; foreach ($failtestdatearray as $i => $date) { $jsstring .= "{$platformbranchproduct}" . "[\"{$date}\"] = \"" . $failtestsuitearray[$i] . "\";\n"; } $jsstring .= "failtestsuite[\"{$platformbranchproduct}\"] = {$platformbranchproduct};\n"; } $pbpresult->free(); return $jsstring; }
<?php require_once "./libraries/common.inc.php"; # include common.inc.php $sql = "select st_platform_branch.platform as platform,st_platform_branch.branch as branch from\r\n st_branch,st_platform,st_platform_branch\r\n where st_platform.platform=st_platform_branch.platform and\r\n st_branch.branch=st_platform_branch.branch"; $pbresult = Dosql($sql); $num_pb = $pbresult->num_rows; $platform_to_branch = array(); for ($i = 0; $i < $num_pb; $i++) { $row = $pbresult->fetch_assoc(); $platform_to_branch[$row['platform']][] = $row['branch']; } $pbresult->free(); ?> <script type="text/javascript" src="/smoketest/javascript/jquery-1.9.1.js"></script> <script language="JavaScript"> var platform_to_branch=new Array(); <?php foreach ($platform_to_branch as $k => $v) { echo " var {$k}=new Array();\n"; foreach ($platform_to_branch[$k] as $value) { echo " {$k}.push(\"{$value}\");\n"; } echo " platform_to_branch[\"{$k}\"]={$k};\n"; } ?> window.onload=addoption; function addoption(){
<input type="submit" value="Commit" /> <h3 style="font-family:arial">已有的testsuite:</h3> <table class="altrowstable" width="60%"> <tr bgcolor="#d2d2d2"> <td>ID</td><td>Testsuite</td> <td>ID</td> <td>Department</td> <td>Description</td> <td>Online</td> </tr> <?php $sql = "select testsuite_id,testsuite,testsuitedescription,st_department.department_id as department_id,department,testsuite_online as online\n from st_testsuite,st_department where\n st_department.department_id = st_testsuite.department_id\n order by testsuite_id"; $suiteresult = Dosql($sql); $suite_num = $suiteresult->num_rows; $suitearray = array(); for ($i = 0; $i < $suite_num; $i++) { $row = $suiteresult->fetch_assoc(); $suitearray[$i] = $row; if ($i % 2) { $bgcolor = "#ffffff"; } else { $bgcolor = "#f2f2f2"; } echo "<tr bgcolor=\"{$bgcolor}\">\n"; echo "<td width=\"5%\">" . $row['testsuite_id'] . "</td>\n"; echo "<td width=\"20%\">" . htmlspecialchars(stripslashes($row['testsuite'])) . "</td>\n"; echo "<td width=\"5%\">" . $row['department_id'] . "</td>\n"; echo "<td width=\"30%\">" . htmlspecialchars(stripslashes($row['department'])) . "</td>\n";
echo '</td>'; echo '<td>'; $newissuetemp = $testsuiteid_to_newissue[$testsuite_id]; $remainissuetemp = $testsuiteid_to_remainissue[$testsuite_id]; $ts = $row['testsuite']; $ts = "<b style=font-family:arial>[{$ts}]</b><br/>"; $remainissuetemp = str_replace($ts, "", $remainissuetemp); $newissuetemp = str_replace($ts, "", $newissuetemp); echo '<div style="width:100%;height:100%; "><textarea id="remainissueId_' . $testsuite_id . '" name="remainissue_' . $testsuite_id . '" cols=80 rows=8 >' . $newissuetemp . "\r" . $remainissuetemp . '</textarea></div>'; echo '</td>'; echo "</tr>"; echo '</table>'; } $testsuiteresult->free(); } echo '<br/><input type="submit" name="commit" value="Commit" onclick="if(confirm(\'Confirm to submit?\'))return true;else return false;">'; $sql = "select testsuite_id,testsuite from st_testsuite where testsuite_online='1' order by testsuite_id"; $testsuite = Dosql($sql); $num_suite = $testsuite->num_rows; for ($i = 0; $i < $num_suite; $i++) { $rowsuite = $testsuite->fetch_assoc(); $id = $rowsuite['testsuite_id']; printTextArearCss($id); } $testsuite->free(); ?> </form> </body> </html>