-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugprojectscript.php
More file actions
80 lines (59 loc) · 1.7 KB
/
debugprojectscript.php
File metadata and controls
80 lines (59 loc) · 1.7 KB
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
<?php
/**
* File: debugprojectscript.php
* Description: Debugging utility and diagnostic tool
*
* @package StraboSpot Web Site
* @author Jason Ash <jasonash@ku.edu>
* @copyright 2025 StraboSpot
* @license https://opensource.org/licenses/MIT MIT License
* @link https://strabospot.org
*/
include("logincheck.php");
$project_id = $_GET['project_id'];
$raw = $_GET['r'];
if($project_id==""){
echo "no project id provided";exit();
}
if(!is_numeric($project_id)){
echo "invalid project id.";exit();
}
include("prepare_connections.php");
include("includes/straboClasses/straboOutputClass.php");
include("doi/doiOutputClass.php");
$count = $neodb->get_var("Match (p:Project) where p.id = $project_id and p.userpkey = $userpkey return count(p)");
if($count == 0) exit("Project not found.");
$straboOut = new straboOutputClass($strabo,$_GET);
$doiOut = new doiOutputClass($strabo, $_GET);
$uuid = $uuid->v4();
$project = $straboOut->doiDataOut($project_id);
$json = json_encode($project, JSON_PRETTY_PRINT);
if($raw){
header('Content-Type: application/json; charset=utf-8');
echo $json;
exit();
}else{
include("includes/mheader.php");
?>
<!-- Main -->
<div id="main" class="wrapper style1">
<div class="container">
<header class="major">
<h2>Project Data in Strabo JSON Format</h2>
</header>
<section id="content">
<h3><a href="/debugprojectscript?project_id=<?php echo $project_id?>&r=1" target="_blank">Click here to download raw combined JSON</a></h3>
<h2>Project JSON:</h2>
<pre>
<?php echo $json?>
</pre>
<br><br>
</section>
<div class="bottomSpacer"></div>
</div>
</div>
<?php
include("includes/mfooter.php");
}
exit();
?>