-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdashboard.php
134 lines (131 loc) · 4.4 KB
/
dashboard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
require_once("simpledist.php");
error_reporting(E_ALL);
$helper = new SimpleDist();
$action = $helper->getActionFromURL("alist");
?>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable = no">
<script type="text/javascript" src="assets/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="assets/main.js" /></script>
<link rel="stylesheet" type="text/css" href="assets/main.css">
<link rel="stylesheet" type="text/css" href="assets/buttons.css">
<title>Dashboard</title>
</head>
<body>
<div class="content">
<?php if($action == "alist") {
/************************* alist action **/ ?>
<div class="sectionHeader">Applications</div>
<?php
$appnames = $helper->getAppNames();
foreach($appnames as $app) {
$recruit = $helper->getRecruitLinkForApp($app);
$devices = $helper->getDevicesLinkForApp($app);
$devicescount = $helper->getDevicesCountForApp($app);
$install = $helper->getInstallLinkForApp($app);
$crashes = $helper->getCrashesLinkForApp($app);
$crashcount = $helper->getCrashCountForApp($app);
$bundleid = $helper->getBundleIdForApp($app);
$icon = $helper->getIconPathForApp($app);
$crashlabel = "Crashes";
if($crashcount > 0) {
$crashlabel .= " (" . $crashcount . ")";
}
$deviceslabel = "Devices";
if($devicescount > 0) {
$deviceslabel .= " (" . $devicescount . ")";
}
?>
<div class="sectionRow">
<table cellpadding="0" cellspacing="0"><tr>
<td width="70">
<img class="sectionRowIcon" src="<?php echo $icon; ?>" width="50" height="50" />
</td>
<td>
<a href="?a=vlist&app=<?php echo $app;?>"><?php echo $app;?></a>
<div class="sectionRowAppLinks">
<a class="alink" href="<?php echo $recruit ?>">Register</a>
<a class="alink" href="<?php echo $install ?>">Install Latest</a>
<a class="alink" href="<?php echo $devices ?>"><?php echo $deviceslabel; ?></a>
<a class="alink" href="<?php echo $crashes ?>"><?php echo $crashlabel; ?></a>
</div>
</td>
</tr></table>
</div>
<?php } ?>
</div>
<?php } ?>
<?php if($action == "vlist") {
/************************* vlist action **/
$appname = $helper->getAppNameFromURL();
$appversions = $helper->getAppVersions($appname);
$icon = $helper->getIconPathForApp($appname);
$bundleid = $helper->getBundleIdForApp($appname);
?>
<div class="sectionHeader">
<table cellspacing=0 cellpadding=0><tr>
<td width="75"><img class="sectionHeaderIcon" src="<?php echo $icon; ?>" width="50" height="50" /></td>
<td><?php echo $appname; ?>
<div class="sectionHeaderAppBundleId"><?php echo $bundleid ?></div></td>
</tr></table>
</div>
<div class="sectionMenu">
<a href="?">Dashboard</a>
</div>
<?php if(count($appversions) < 1) { ?>
<div class="sectionRow">No versions.</div>
<?php } else {
foreach($appversions as $version) {
$versionencoded = urlencode($version);
$url = $helper->appsDirName . '/' . $appname . '/install/' . $version . '.html';
?>
<div class="sectionRow">
<table cellspacing=0 cellpadding=0><tr>
<td width="50%"><a href=" <?php echo $url; ?>"><?php echo $version?></a></td>
</tr></table>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if($action == "clist") {
/********************* crash list **/
$app = urldecode($_GET['app']);
$bundleid = $helper->getBundleIdForApp($app);
$icon = $helper->getIconPathForApp($app);
$crashes = $helper->getCrashesForApp($app);
?>
<div class="sectionHeader">
<table cellspacing=0 cellpadding=0><tr>
<td width="75"><img class="sectionHeaderIcon" src="<?php echo $icon; ?>" width="50" height="50" /></td>
<td><?php echo $app; ?>
<div class="sectionHeaderAppBundleId"><?php echo $bundleid ?></div></td>
</tr></table>
</div>
<div class="sectionMenu">
<a href="?">Dashboard</a>
</div>
<?php
if(count($crashes) < 1) { ?>
<div class="sectionRow">No Crash Reports</div>
<?php
} else {
foreach($crashes as $crash) {
$crashurl = $helper->getCrashLogPathForApp($app,$crash['crash']);
?>
<div class="sectionRow">
<table cellpadding=0 cellspacing=0><tr>
<td><a href="<?php echo $crashurl; ?>"><?php echo $crash['crash']; ?></a></td>
<td align="right"><?php echo date('m/d/Y - g:i:sa',$crash['mtime']); ?></td>
</tr></table>
</div>
<?php }
} ?>
<?php }?>
</div>
<pre class="session">
<?php var_dump($_SESSION); ?>
</pre>
</body>
</html>