-
Notifications
You must be signed in to change notification settings - Fork 0
/
women_retention.php
213 lines (189 loc) · 9.64 KB
/
women_retention.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
//require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php';
//use google\appengine\api\cloud_storage\CloudStorageTools;
require_once("c_transactions.php");
$inactive = 600;
if(!isset($_SESSION['timeout']) ) {
header("Location: logout.php");
}
else{
$session_life = time() - $_SESSION['timeout'];
if($session_life > $inactive) {
header("Location: logout.php");
}
}
//$options = [ 'motivatestudy' => 'motivatestudy-967.appspot.com' ];
//$upload_url = CloudStorageTools::createUploadUrl('/import_data.php', $options);
$_SESSION['timeout'] = time();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Women Retention</title>
<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.7/css/jquery.dataTables.css">
<!-- jQuery -->
<script type="text/javascript" charset="utf8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.7/js/jquery.dataTables.min.js"></script>
<script>
$( document ).ready(function() {
$('#retention').dataTable({
"bProcessing": true,
"fixedHeader": true,
"sAjaxSource": "retention_response.php",
aoColumns: [
{ mData: 'StudyID' },
{ mData: 'VisitDate' },
{ mData: 'Next_Visit_Date' },
{
"aTargets": [3], //Edit column
"mData": "VisitID", //Get value from RoleId column, I assumed you used "RoleId" as the name for RoleId in your JSON, in my case, I didn't assigned any name in code behind so i used "mData": "0"
"mRender": function (data, type, full) {
return '<a href=retention.php?action=edit&id=' + data +'>Edit</a> | <a href=retention.php?action=delete&id=' + data +'>Delete</a>';
}
}
]
});
});
</script>
<!-- Bootstrap Core CSS -->
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="dist/css/sb-admin-2.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
setTimeout(function() { window.location.href = "logout.php"; }, 6000000);
</script>
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<ul class="nav navbar-top-links navbar-right"><?php echo $_SESSION["name"]." is logged in."; ?>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<!--<li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
</li>
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
</li>-->
<li class="divider"></li>
<li><a href="logout.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
</li>
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
<li class="sidebar-search">
<div class="alert alert-success">
<a class="alert-link" href="dashboard.php"><?php include('version.php'); ?></a>
</div>
</li>
<li>
<a href="dashboard.php"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<!--<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Menus<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">-->
<?php foreach ($_SESSION["access"] as $key => $access) { ?>
<li>
<?php echo '<a href="#"><i class="fa fa-arrow-circle-right"></i>'. $access["top_menu_name"].'<span class="fa arrow"></span></a>'; ?>
<?php
echo '<ul class="nav nav-second-level">';
foreach ($access as $k => $val) {
if ($k != "top_menu_name") {
echo '<li><a href="' . ($val["page_name"]) . '">' . $val["menu_name"] . '</a></li>';
?>
<?php
}
}
echo '</ul>';
?>
</li>
<?php
}
?>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
<!-- /.navbar-static-side -->
</nav>
<div id="page-wrapper">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Women Retention form</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
Women Retention visit
</div>
<div class="panel-body">
<div class="table-responsive">
<a href="retention.php?action=add" class="fa fa-pencil"> Add new</a>
<!--
<button type="button" onclick="window.location.href='import_data.php?form=retention&action=import'" class="btn btn-outline btn-primary btn-xs">Data Import from CSV</button>
<form id="demographics" action="import_data.php?form=retention" method="post">
<button type="submit" name="btn_export">Data Export</button>
<button type="submit" name="btn_import">Data Import from CSV</button>
</form>-->
<form action="import_csv.php?form=retention&action=import" method="post" enctype="multipart/form-data">
Select CSV file for Women retention:
<input name="csv" type="file" />
<input type="submit" value="Import selected CSV file" class="btn btn-outline btn-primary btn-xs" />
</form>
<p> ---- </p>
<table id="retention" class="table table-striped table-bordered table-hover" >
<thead>
<tr>
<th>StudyID</th>
<th>VisitDate</th>
<th>Next_Visit_Date</th>
<th>Action</th>
</tr>
</thead>
</table>
</div>
<!-- /.row (nested) -->
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- jQuery -->
<!-- Bootstrap Core JavaScript -->
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="dist/js/sb-admin-2.js"></script>
</body>
</html>