| <?php |
| |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"; |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"; |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"; |
| $App = new App(); |
| $Nav = new Nav(); |
| $Menu = new Menu(); |
| include($App->getProjectCommon()); |
| |
| $pageTitle = "Committer Statistics"; |
| $pageKeywords = "dashboard,committers"; |
| $pageAuthor = "Diego Figueroa, Feb 27"; |
| |
| ob_start(); |
| ?> |
| <div id="maincontent"> |
| <div id="midcolumn"> |
| <h1><?= $pageTitle ?></h1> |
| |
| <?php |
| |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/projects/stats/hostname.php"; |
| require_once $_SERVER['DOCUMENT_ROOT'] . "/projects/stats/committers_db.class.php"; |
| |
| $cdb = New CommittersDB(); // Committer DB object |
| |
| if (!isset($_GET['view']) && // Not calling projects or orgs |
| !isset($_GET['project']) && // Not calling projects |
| !isset($_GET['org'])){ // Not calling orgs |
| $count = $cdb->getCommitterCount(); |
| ?> |
| |
| <h2>Committer Statistics</h2> |
| |
| <p> |
| This page displays different statistics related to the committers at |
| Eclipse.org. The information here contained is taken directly from the |
| Eclipse Foundation database and is displayed in real-time. |
| <div style="border: solid thin black; padding: 4px 4px 4px 4px; "> |
| Total number of committers at Eclipse.org: <b><?=$count?></b> |
| </div> |
| </p> |
| <br> |
| <p> |
| <a href="<?=$_SERVER['PHP_SELF']?>?view=cpp">Committers per Project</a> |
| </p> |
| <p> |
| <a href="<?=$_SERVER['PHP_SELF']?>?view=cpo">Committers per Organization</a> |
| </p> |
| |
| <?php |
| // Code for committers per project |
| } else if (isset($_GET['view']) && ($_GET['view'] == "cpp")){ |
| ?> |
| |
| <h2>Committers per Project</h2> |
| <div style="border-bottom-style: solid; border-width: 0.03cm;"></div> |
| <p>Select a project from below</p> |
| |
| <?php |
| echo "<table>\r\n"; |
| $projects = $cdb->getProjects(); |
| for($i=0;$i<count($projects);$i++){ |
| $htmlStr = "<tr>\r\n<td><a href=\"".$_SERVER['PHP_SELF']; |
| $htmlStr .= "?project=".$projects[$i]."\">".ucfirst($projects[$i]); |
| $htmlStr .= "</a></td>\r\n</tr>"; |
| echo $htmlStr; |
| } |
| echo "</table>\r\n"; |
| ?> |
| |
| <?php |
| // Code for individual projects |
| } else if (isset($_GET['project'])) { |
| $project = $_GET['project']; |
| |
| $pcount = $cdb->getCommitterCount($project); |
| |
| echo "<h2>".ucfirst($project)."</h2>\r\n<p>"; |
| echo "<div style=\"border: solid thin black; padding: 4px 4px 4px 4px; \">"; |
| echo "Number of committers for project ".ucfirst($project); |
| echo ": <i>$pcount</i>\r\n</div>\r\n</p>"; |
| |
| $comm = $cdb->getCommittersByOrganization($project); |
| |
| if ($comm){ |
| echo "<p>\r\nComposition by Organization:\r\n</p>"; |
| echo "<table border=0>"; |
| |
| $total = 0; |
| for($i=0;$i<count($comm);$i++){ |
| echo "<tr>\r\n<td><b>".$comm[$i][0]."</b></td>"; |
| echo "<td align=right>".$comm[$i][1]."</td>\r\n</tr>"; |
| $total += $comm[$i][1]; |
| } |
| if ($total < $pcount){ |
| echo "<tr>\r\n<td><b>Unknown<i>*</i></b></td>"; |
| echo "<td align=right>".($pcount - $total)."</td>\r\n</tr>"; |
| } |
| echo "</table>\r\n"; |
| } else { |
| echo "<p>No committers found for this project.</p>"; |
| } |
| ?> |
| |
| <?php |
| // Code for committers per organization |
| } else if (isset($_GET['view']) && ($_GET['view'] == "cpo")){ |
| ?> |
| |
| <h2>Committers per Organization</h2> |
| <div style="border-bottom-style: dotted; border-width: 0.05cm;"></div> |
| |
| <?php |
| //echo "<table>\r\n"; |
| $orgs = $cdb->getOrganizations(); |
| $titleMark = "1"; |
| for($i=0;$i<count($orgs);$i++){ |
| if (strtoupper(substr(ltrim($orgs[$i][1]),0,1)) != $titleMark){ |
| $titleMark = strtoupper(substr(ltrim($orgs[$i][1]),0,1)); |
| echo "<h3>$titleMark</h3>"; |
| } |
| $htmlStr = "<a href=\"".$_SERVER['PHP_SELF']; |
| $htmlStr .= "?org=".$orgs[$i][0]."\">".$orgs[$i][1]; |
| $htmlStr .= "</a><br>\r\n"; |
| echo $htmlStr; |
| } |
| //echo "</table>\r\n"; |
| ?> |
| |
| <?php |
| // Code for individual organizations |
| } else if (isset($_GET['org'])) { |
| $organization = $_GET['org']; |
| |
| $ocount = $cdb->getOrganizationCount($organization); |
| $oname = $cdb->getNameFromOrganization($organization); |
| |
| echo "<h2>".$oname."</h2>\r\n<p>"; |
| echo "<div style=\"border: solid thin black; padding: 4px 4px 4px 4px; \">"; |
| echo "Number of committers for ".$oname.": "; |
| echo "<i>$ocount</i>\r\n</div>\r\n</p>"; |
| |
| $comm = $cdb->getCommittersByProject($organization); |
| |
| if ($comm){ |
| echo "<p>\r\nComposition by Project:\r\n</p>"; |
| echo "<table border=0>"; |
| |
| $total = 0; |
| for($i=0;$i<count($comm);$i++){ |
| echo "<tr>\r\n<td><b>".$comm[$i][0]."</b></td>"; |
| echo "<td align=right>".$comm[$i][1]."</td>\r\n</tr>"; |
| $total += $comm[$i][1]; |
| } |
| if ($total < $pcount){ |
| echo "<tr>\r\n<td><b>Unknown<i>*</i></b></td>"; |
| echo "<td align=right>".($ocount - $total)."</td>\r\n</tr>"; |
| } |
| echo "</table>\r\n"; |
| } else { |
| echo "<p>No committers found for this organization.</p>"; |
| } |
| } |
| ?> |
| |
| <br><br> |
| <br><br> |
| </div> |
| </div> |
| |
| <?php |
| # Paste your HTML content between the EOHTML markers! |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |