forked from amirhamza05/Student-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme_action.php
42 lines (31 loc) · 934 Bytes
/
theme_action.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
<?php
include "layout/header_script.php";
if(isset($_POST['update'])){
$info['id']=$_POST['update'];
$info['theme']=$_POST['theme'];
$db->sql_action("user","update",$info,"no");
$info=$theme->get_theme($_POST['theme']);
$bg_color=$info['bg_color'];
$font_color=$info['font_color'];
?>
<style type="text/css">
:root {
--bg-color: <?php echo "$bg_color"; ?>;
--font-color: <?php echo "$font_color"; ?>;
}
</style>
<?php
}
else if(isset($_POST['insert'])){
$info['name']=$_POST['name'];
$st="#";
$info['bg_color']=$st.$_POST['bg_color'];
$info['sidebar_hover']=$st.$_POST['sidebar_hover'];
$info['sidebar_list']=$st.$_POST['sidebar_list'];
$info['sidebar_list_hover']=$st.$_POST['sidebar_list_hover'];
$info['font_color']=$st.$_POST['font_color'];
$info['date']=date("Y-m-d");
$info['added_by']=$login_user['id'];
$db->sql_action("theme","insert",$info,"yes");
}
?>