1<html>
2    <head>
3        <STYLE type="text/css">
4
5            body, td {
6                background-color: lightgrey;
7            }
8
9            table.outline, outlineFailure {
10                background-color: black;
11                border-width: 1px;
12            }
13
14            td {
15                padding: 2px;
16            }
17
18            th {
19                text-align: left;
20                color: white;
21                background-color: black;
22            }
23
24            .success {
25                background-color: lightgreen;
26            }
27
28            .failure {
29                background-color: orange;
30            }
31            .info {
32                padding: 2px;
33                color: orange;
34            }
35
36        </STYLE>
37    </head>
38    <body>
39        <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" name="optionsForm">
40            <table align="center" class="outline" width="70%">
41                <tr>
42                    <th colspan="10">
43                        Options
44                    </th>
45                </tr>
46                <tr>
47                    <td colspan="10">
48                        <input type="checkbox" onClick="unCheckAll()" name="allChecked">
49                        (un)check all
50                        &nbsp; &nbsp;
51                        show OK <input type="checkbox" name="showOK" <?php echo @$request['showOK']?'checked':''?>>
52                        &nbsp; &nbsp;
53                        <input type="submit" name="submitted" value="run tests">
54                    </td>
55                </tr>
56
57                <?php foreach($suiteResults as $aResult): ?>
58                    <tr>
59                        <th colspan="10">
60                            <input type="checkbox" name="<?php echo $aResult['name'] ?>" <?php echo @$request[$aResult['name']]?'checked':'' ?>>
61                            <?php echo $aResult['name'] ?>
62                            &nbsp;
63                            <?php if (isset($aResult['addInfo'])): ?>
64                                <font class="info"><?php echo @$aResult['addInfo'] ?></font>
65                            <?php endif ?>
66                        </th>
67                    </tr>
68
69                    <?php if(@$aResult['percent']): ?>
70                        <tr>
71                            <td colspan="10" nowrap="nowrap">
72                                <table style="width:100%; padding:2px;" cellspacing="0" cellspan="0" cellpadding="0">
73                                    <tr>
74                                        <td width="<?php echo $aResult['percent'] ?>%" class="success" align="center" style="padding:0;">
75                                            <?php echo $aResult['percent']?$aResult['percent'].'%':'' ?>
76                                        </td>
77                                        <td width="<?php echo 100-$aResult['percent'] ?>%" class="failure" align="center" style="padding:0;">
78                                            <?php echo (100-$aResult['percent'])?(100-$aResult['percent'].'%'):'' ?>
79                                        </td>
80                                    </tr>
81                                </table>
82                            </td>
83                        </tr>
84                    <?php endif ?>
85
86                    <?php if(@$aResult['counts']): ?>
87                        <tr>
88                            <td colspan="10">
89                                <?php foreach($aResult['counts'] as $aCount=>$value): ?>
90                                    <?php echo $aCount ?>s = <?php echo $value ?> &nbsp; &nbsp; &nbsp; &nbsp;
91                                <?php endforeach ?>
92                            </td>
93                        </tr>
94                    <?php endif ?>
95
96                    <?php if(isset($aResult['results']['failures']) && sizeof($aResult['results']['failures']))
97                        foreach($aResult['results']['failures'] as $aFailure): ?>
98                        <tr>
99                            <td class="failure"><?php echo $aFailure['testName'] ?></td>
100                            <td class="failure">
101                                <?php if(isset($aFailure['message']) && $aFailure['message']): ?>
102                                    <?php echo $aFailure['message'] ?>
103                                <?php else: ?>
104                                    <table class="outlineFailure">
105                                        <tr>
106                                            <td>expected</td>
107                                            <td><?php echo $aFailure['expected'] ?></td>
108                                        </tr>
109                                        <tr>
110                                            <td>actual</td>
111                                            <td><?php echo $aFailure['actual'] ?></td>
112                                        </tr>
113                                    </table>
114                                <?php endif ?>
115                            </td>
116                        </tr>
117                    <?php endforeach ?>
118
119                    <?php if(isset($aResult['results']['errors']) && sizeof($aResult['results']['errors']))
120                        foreach($aResult['results']['errors'] as $aError): ?>
121                        <tr>
122                            <td class="failure"><?php echo $aError['testName'] ?></td>
123                            <td class="failure">
124                                <?php echo $aError['message'] ?>
125                            </td>
126                        </tr>
127                    <?php endforeach ?>
128
129                    <?php if(isset($aResult['results']['passed']) && sizeof($aResult['results']['passed']))
130                        foreach($aResult['results']['passed'] as $aPassed): ?>
131                        <tr>
132                            <td class="success"><?php echo $aPassed['testName'] ?></td>
133                            <td class="success"><b>OK</b></td>
134                        </tr>
135                    <?php endforeach ?>
136
137                <?php endforeach ?>
138            </table>
139        </form>
140
141        <script>
142            var allSuiteNames = new Array();
143            <?php foreach($suiteResults as $aResult): ?>
144                allSuiteNames[allSuiteNames.length] = "<?php echo $aResult['name'] ?>";
145            <?php endforeach ?>
146            function unCheckAll()
147            {
148                _checked = document.optionsForm.allChecked.checked;
149                for (i=0;i<allSuiteNames.length;i++) {
150                    document.optionsForm[allSuiteNames[i]].checked = _checked;
151                }
152            }
153        </script>
154
155    </body>
156</html>
157