This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editSite.php
137 lines (95 loc) · 4.43 KB
/
editSite.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
<?php
include($_SERVER['DOCUMENT_ROOT'].'/php/user_session_check.php'); //checks if user is logged on
$permission_status = 0;
foreach ($_SESSION['permissions'] as $item) {
//echo $item;
if ($item['position'] == "sso_admin") {
$permission_status = 1;
}
}
if ($permission_status == 1) {
include ($_SERVER['DOCUMENT_ROOT'] . "/php/prepare_sql.php");
?>
<html>
<title>Edit Site</title> <!-- Name of site page in tab -->
<head>
<meta name="viewport" content="width=device-width, initial-scale=0.4, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="HomePage.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="/javascript/optionsTab.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<script type="text/javascript" src="/javascript/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/javascript/jscolor/jscolor.js"></script>
<?php include ($_SERVER['DOCUMENT_ROOT'] . "/javascript/color.php"); ?>
<script type="text/javascript">
window.onload = function()
{
CKEDITOR.replace( 'message',{width : '90%'} );
CKEDITOR.replace( 'notification',{width : '90%'} );
};
</script>
</head>
<body>
<p>
<?php
include('includes/toolbar.php');
include('includes/optionsTab.php');
?>
<center>
<div class="subtitle">
<p class="subtitle_title">
Edit Site
</p>
</div>
<div class="content">
<p id="home">
<div id="homePageContent">
<?php
$sql = "SELECT * FROM homePage";
$homePage = array_prepare_select ($sql, $pdo, []);
/*
while ($item = $results -> fetch(PDO::FETCH_ASSOC)) {
$homePage[] = array('title' => $item['title'], 'content' => $item['content']);
}*/
?>
<form action="/php/homepageContent.php" method="POST">
First input Title: <input class="mobileProgress" name = 'messageTitle' value="<?php echo $homePage[0]['title'] ?>" ></textarea>
<br></br>
First input Message: <br></br><center><textarea id="message" name = 'message' rows="6" col="40" ><?php echo $homePage[0]['content'] ?></textarea>
</center><br></br>
Second input Title: <input class="mobileProgress" name = 'notificationTitle' value="<?php echo $homePage[1]['title'] ?>" ></textarea>
<br></br>
Second input Message: <br></br><center><textarea id="notification" name = 'notification' rows="6" col="40" ><?php echo $homePage[1]['content'] ?></textarea>
</center><br></br>
<input class="mobileProgress" type="submit" value="Submit">
</form>
<?php
$sql = "SELECT * FROM theme";
$Pcolor = array_prepare_select ($sql, $pdo, []);
/*while ($item = $results -> fetch(PDO::FETCH_ASSOC)) {
$Pcolor[] = array('color' => $item['color']);
}*/
?>
</div>
<div id="themer">
<center><b>Site color Theme</b></center><br></br>
<form action="/php/colorPicker.php" method = "POST">
Select a Primary color: <input id ="mobileColor" class="color" name="Pcolor" value="<?php echo $Pcolor[0]['color'] ?>" ><br>
Select a Secondary color: <input id ="mobileColor" class="color" name="Scolor" value="<?php echo $Pcolor[1]['color'] ?>"><br>
Select a tertiary color:<input id ="mobileColor" class="color" name="Tcolor" value="<?php echo $Pcolor[2]['color'] ?>"><br>
Select Primary font color: <input id ="mobileColor" class="color" name="Fcolor" value="<?php echo $Pcolor[3]['color'] ?>"><br>
Select Secondary font color: <input id ="mobileColor" class="color" name="SFcolor" value="<?php echo $Pcolor[4]['color'] ?>"><br>
Select shadow color: <input id ="mobileColor" class="color" name="SHcolor" value="<?php echo $Pcolor[5]['color'] ?>"><br>
<input class="mobileProgress" type="submit">
</form>
<form action="/php/colorPicker.php">
select default colors: <input class="mobileProgress" value="Default" type="submit">
</form>
</div>
</p>
</div>
</center>
</p>
</body>
</html>
<?php } ?>