-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·36 lines (25 loc) · 986 Bytes
/
index.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
<?php
require_once("template.php");
require_once("database.php");
date_default_timezone_set('America/New_York');
$t = preg_replace('/\.php$/', '.tmpl', __FILE__);
$dbh = connect_database();
$data = array();
$stmt = $dbh->query("SELECT count(urn) FROM etd where upper(degree) = 'PHD'");
// $stmt->setFetchMode(PDO::FETCH_ASSOC);
$r = $stmt->fetch();
$data['phdcount'] = $r['count(urn)'];
$stmt = $dbh->query("SELECT * FROM etd WHERE upper(degree) = 'PHD' ORDER BY date DESC LIMIT 10");
// $stmt->setFetchMode(PDO::FETCH_ASSOC);
foreach($stmt as $r)
$data['phdetds'][] = $r;
$stmt = $dbh->query("SELECT count(urn) FROM etd WHERE UPPER(`degree`) = 'MS'");
// $stmt->setFetchMode(PDO::FETCH_ASSOC);
$r = $stmt->fetch();
$data['mscount'] = $r['count(urn)'];
$stmt = $dbh->query("SELECT * FROM etd WHERE UPPER(`degree`) = 'MS' ORDER BY date DESC LIMIT 10");
// $stmt->setFetchMode(PDO::FETCH_ASSOC);
foreach ($stmt as $r)
$data['msetds'][] = $r;
echo gen_template($t, $data);
?>