-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistOfProjects.php
183 lines (147 loc) · 5.96 KB
/
listOfProjects.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?php
require "../phplib/genlibraries.php";
redirectOutside();
require "../htmlib/header.inc.php";
// project list
$projects = getProjects_byOwner();
?>
<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white page-container-bg-solid page-sidebar-fixed">
<div class="page-wrapper">
<?php
require "../htmlib/top.inc.php";
require "../htmlib/menu.inc.php";
?>
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<!-- BEGIN CONTENT BODY -->
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<!-- BEGIN PAGE BAR -->
<div class="page-bar">
<ul class="page-breadcrumb">
<li>
<a href="home/">Home</a>
<i class="fa fa-circle"></i>
</li>
<li>
<a href="workspace/">Workspace</a>
<i class="fa fa-circle"></i>
</li>
<li>
<span>List of projects</span>
</li>
</ul>
</div>
<!-- END PAGE BAR -->
<!-- BEGIN PAGE TITLE-->
<h1 class="page-title"> List of projects
</h1>
<!-- END PAGE TITLE-->
<!-- END PAGE HEADER-->
<!-- BEGIN EXAMPLE TABLE PORTLET -->
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption">
<i class="icon-share font-dark hide"></i>
<span class="caption-subject font-dark bold uppercase">Select a project</span>
</div>
</div>
<!-- CHANGE: new id "portlet-ws" -->
<div class="portlet-body" id="portlet-lp">
<input type="hidden" id="base-url" value="<?php echo $GLOBALS['BASEURL']; ?>"/>
<?php
// TO MODIFY WITH NEW "secondary kws"
$kw = array();
foreach($projects as $t) {
$k = explode(",", $t['keywords']);
$kw = array_merge($kw, $k);
}
$kw = array_unique($kw);
sort($kw);
?>
<div class="row" style="margin-top:20px;">
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Search by text</label>
<input class="form-control form-field-enabled valid" type="text" name="simpSearch" id="simp-search" placeholder="Write something"/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label">Search by keywords</label>
<select class="form-control form-field-enabled valid" id="sel-keyword" name="selKey[]" aria-invalid="false" multiple="multiple">
<option value=""></option>
<?php foreach($kw as $k) { ?>
<option value="<?php echo $k; ?>"><?php echo $k; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="loading-datatable"><div id="loading-spinner">LOADING</div></div>
<table id="projects-list" class="table table-striped table-bordered">
<thead>
<tr>
<th>Project</th>
<th>Description</th>
<th>Created</th>
<th>Actions</th>
<!-- hidden columns -->
<th>Keywords</th>
</tr>
</thead>
<tbody>
<?php foreach($projects as $pr) { ?>
<tr>
<td><?php echo $pr["name"]; ?></td>
<td><?php echo $pr["description"]; ?></td>
<td><?php echo strftime('%Y/%m/%d %H:%M', $pr['atime']->sec) ?></td>
<td>
<a href="workspace/editProject.php?id=<?php echo $pr["_id"]; ?>">
<i class="fa fa-pencil-square-o tooltips" aria-hidden="true" data-container="body" data-html="true" data-placement="top" data-original-title="<p align='left' style='margin:0'>Click here to edit this project.</p>"></i>
</a>
<a href="javascript:deleteProject('<?php echo $pr["_id"]; ?>', '<?php echo $pr["name"]; ?>')">
<i class="fa fa-trash-o tooltips" aria-hidden="true" data-container="body" data-html="true" data-placement="top" data-original-title="<p align='left' style='margin:0'>Click here to delete this project.</p>"></i>
</a>
</td>
<td><?php echo $pr["keywords"]; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
</div>
<!-- END CONTENT BODY -->
</div>
<!-- END CONTENT -->
<div class="modal fade bs-modal" id="modalDeleteProject" tabindex="-1" role="basic" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Warning!</h4>
</div>
<div class="modal-body">Are you sure you want to delete the project <strong><?php echo getProject($_SESSION['User']['dataDir'])["name"]; ?></strong>
and <strong>ALL</strong> its executions and files? This action cannot be undone.
</div>
<div class="modal-footer">
<button type="button" class="btn dark btn-outline" data-dismiss="modal">Cancel</button>
<button type="button" class="btn red btn-modal-del">Delete</button>
</div>
</div>
</div>
</div>
<?php
require "../htmlib/footer.inc.php";
require "../htmlib/js.inc.php";
?>