-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsushi.php
executable file
·94 lines (65 loc) · 3.02 KB
/
sushi.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
<?php
/*
**************************************************************************************************************************
** CORAL Usage Statistics v. 1.1
**
** Copyright (c) 2010 University of Notre Dame
**
** This file is part of CORAL.
**
** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
**
** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************************************************************
*/
session_start();
include_once 'directory.php';
//print header
$pageTitle='SUSHI Import';
include 'templates/header.php';
//this a SUSHI Service ID has been passed in, it needs to be run
if ((isset($_POST['sushiServiceID'])) and ($_POST['sushiServiceID'] > 0)) {
$sushiServiceID = $_POST['sushiServiceID'];
$sushiService = new SushiService(new NamedArguments(array('primaryKey' => $sushiServiceID)));
$sushiService->setImportDates($_POST['startDate'], $_POST['endDate']);
//try to run!
try {
$logText = $sushiService->runAll($_POST['overwritePlatform']);
} catch (Exception $e) {
$logText = $e->getMessage();
}
$logText = "<div class='headerText'>Sushi Output Log:</div>" . nl2br($logText) . "<br /><br />";
}
?>
<script type="text/javascript" src="js/sushi.js"></script>
<table class="headerTable" style="background-image:url('images/header.gif');background-repeat:no-repeat;">
<tr><td>
<table style='width:897px;'>
<tr style='vertical-align:top'>
<td><span class="headerText">SUSHI Administration</span><br /></td>
<td style='text-align:right;'> </td>
</tr>
</table>
<a href='ajax_forms.php?action=getAddPlatformForm&height=150&width=325&modal=true' class='thickbox' id='uploadDocument'><img src="images/plus.gif" / > Add new platform for SUSHI</a>
<br /><br /><div id="div_run_feedback"><?php
if (isset($logText)) {
echo $logText;
}
?></div><br />
<div class="headerText" style='margin-bottom:9px;'>Outstanding Import Queue <span id='span_outstanding_feedback'></span></div>
<div id="div_OutstandingSushiImports"></div>
<br /><br /><br />
<div class="headerText" style='margin-bottom:9px;'>Last Failed SUSHI Imports <span id='span_failed_feedback'></span></div>
<div id="div_FailedSushiImports"></div>
<br /><br /><br />
<div class="headerText" style='margin-bottom:9px;'>All SUSHI Services <span id='span_upcoming_feedback'></span></div>
<div id="div_AllSushiServices"></div>
</td></tr>
</table>
<?php
//print footer
include 'templates/footer.php';
?>