-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
107 lines (83 loc) · 2.94 KB
/
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
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
<?php
include "lib/am.php";
$debug = 2;
// Open connection with db
DataStoreConnect();
/// set headers and flags based on language
if(isset($_GET["language"])) { // if language var passed via url
$language = $_GET["language"];
} else {
$language = "en";
}
$languages[$language]['active'] = true;
$v = $languages[$language];
$thislang = "<div style=\"float: left\"><img alt=\"{$v['longlang']}\" src=\"img/${v['flag']}\" class=\"flag\"></div>\n";
$olangs = '<div style="float: right">';
foreach($languages as $l => $v) {
if(!$v['active']) {
$olangs .= "<a href=\"?language=$l\" title=\"${v['longlang']}\"><img alt=\"${v['longlang']}\" src=\"img/${v['flag']}\" class=\"flag\"></a>";
}
}
$olangs .= "</div>\n";
// Get the application name from the database.
$title = LocalString($language, MESSAGES, TITLE);
if(isset($_COOKIE['dev'])) {
$title .= ' (DEV MODE)';
}
$intro = LocalString($language, MESSAGES, INTRO);
$submitLabel = LocalString($language, MESSAGES, SUBMITLABEL);
$instructions = '<p class="nlead">' . implode("</p>\n<p class=\"nlead\">", explode("\n", LocalString($language, MESSAGES, INSTRUCTIONS))) . "</p>\n";
$uid = time();
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?=$title?></title>
<link rel="stylesheet" href="css/surveyStyle.css">
</head>
<body>
<div id="container">
<header>
<h1><?=$title?></h1>
</header>
<section>
<div style="width: 95%; margin-bottom: 4em">
<img src="img/activist-images-band.jpg" style="width: 100%">
<div style="margin-top: 1em; margin-bottom: 2em">
<?=$thislang?><?=$olangs?>
</div>
</div>
<form action="form.php" method="post" name="play">
<input type="hidden" name="language" value="<?=$language?>">
<input type="hidden" name="q1" value="0">
<input type="hidden" name="q2" value="0">
<input type="hidden" name="q3" value="0">
<input type="hidden" name="q4" value="0">
<input type="hidden" name="q5" value="0">
<input type="hidden" name="q6" value="0">
<input type="hidden" name="q7" value="0">
<input type="hidden" name="q8" value="0">
<input type="hidden" name="uid" value="<?=$uid?>">
<p class="nlead" id="demo"><i><?= $intro ?></i>
<input class="submitbutton nlead" type="submit" name="foo" value="<?=$submitLabel ?>"></p>
<script type="text/javascript">
var w = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
var h = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
var x = document.getElementById("demo");
x.innerHTML = x.innerHTML + "<input type=\"hidden\" name=\"screen_width\" value=\"" + w + "\"> <input type=\"hidden\" name=\"screen_height\" value=\"" + h + "\">";
</script>
</form>
<?= $instructions ?>
</section>
</div>
<footer>
The Public Sphere Project
</footer>
</body>
</html>