-
Notifications
You must be signed in to change notification settings - Fork 2
/
profile.php
179 lines (165 loc) · 6 KB
/
profile.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
<?php
// Funciones de conexión con la base de dato
require 'funciones.php';
//error_reporting(E_ALL);
$link = conectar();
session_start();
seguridad();
/*
echo "<pre>";
echo var_dump($_SESSION);
echo "</pre>";
*/
/*
echo "<pre>";
echo var_dump($_POST);
echo "</pre>";
*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Chamilo - Setting</title>
<meta content="Chamilo - Members Management" name="description">
<!-- We need to emulate IE7 only when we are to use excanvas -->
<!--[if IE]> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <![endif]-->
<!-- Favicons -->
<!-- Main Stylesheet -->
<link type="text/css" href="css/style4.css" rel="stylesheet">
<!-- <link type="text/css" href="css/green.css" rel="stylesheet">-->
<!-- Your Custom Stylesheet -->
<!--<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.17.custom.css" media="screen">-->
<link rel="stylesheet" type="text/css" href="css/custom.css" media="screen">
<!-- jQuery with plugins -->
<script src="js/jquery-1.8.2.js" type="text/javascript"></script>
<!-- Could be loaded remotely from Google CDN : <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> -->
<script src="js/jquery.ui.core.min.js" type="text/javascript"></script>
<script src="js/jquery.ui.widget.min.js" type="text/javascript"></script>
<script src="js/jquery.ui.tabs.min.js" type="text/javascript"></script>
<!-- jQuery tooltips -->
<script src="js/jquery.tipTip.min.js" type="text/javascript"></script>
<!-- Superfish navigation -->
<script src="js/jquery.superfish.min.js" type="text/javascript"></script>
<script src="js/jquery.supersubs.min.js" type="text/javascript"></script>
<!-- Load TinyMCE -->
<script type="text/javascript" src="js/tiny_mce/jquery.tinymce.js"></script>
<!-- jQuery popup box -->
<script src="js/jquery.nyroModal.pack.js" type="text/javascript"></script>
<!-- Internet Explorer Fixes -->
<!--[if IE]> <link rel="stylesheet" type="text/css" media="all" href="css/ie.css"/> <script src="js/html5.js"></script> <![endif]-->
<!--Upgrade MSIE5.5-7 to be compatible with MSIE8: http://ie7-js.googlecode.com/svn/version/2.1(beta3)/IE8.js -->
<!--[if lt IE 8]> <script src="js/IE8.js"></script> <![endif]-->
<script type="text/javascript">
$(document).ready(function(){
/* setup navigation, content boxes, etc... */
Administry.setup();
$("#save_edit").click(function(e) {
e.preventDefault();
e.stopPropagation();
var vcod = $("#user_edit #cod").attr("value");
var usuario = $("#user_edit #user").attr("value");
var clave = $("#user_edit #password").attr("value");
var correo = $("#user_edit #email").attr("value");
var nombre = $("#user_edit #name").attr("value");
$.post("funciones/configuracion_setting.php",{tab:"editar",cod:vcod,name:nombre,user:usuario,email:correo,password:clave},
function(data){
if(data.status == "false"){
alert("Error while editing");
}else{
alert("updated correctly");
}
}, "json");
return false;
});
});
</script>
<script src="js/conf_setting.js" type="text/javascript"></script>
</head>
<body>
<!-- Header -->
<header id="top">
<div class="wrapper">
<!-- Title/Logo - can use text instead of image -->
<div id="title">
<img alt="Setting" src="images/logo.png">
<!--<span>Administry</span> demo-->
</div>
<!-- Top navigation -->
<div id="topnav">
Logged in as
<b><?php echo $_SESSION['usuario']; ?></b>
<span>|</span>
<a href="setting.php">Settings</a>
<span>|</span>
<a href="logout.php">Logout</a>
<br>
</div>
<!-- End of Top navigation -->
<!-- Main navigation -->
<?php include_once 'menu/top-menu.php'; ?>
<!-- End of Main navigation -->
</div>
</header>
<!-- End of Header -->
<!-- Page title -->
<div id="pagetitle">
<div class="wrapper">
<h1>Profile</h1>
</div>
</div>
<!-- End of Page title -->
<!-- Page content -->
<div id="page">
<?php
if(isset($_SESSION['info']) && $_SESSION['info']!=''){
echo '<div class="box box-success closeable">'.$_SESSION['info'].'</div>';
unset($_SESSION['info']);
}
?>
<!-- Wrapper -->
<div class="wrapper">
<!-- Left column/section -->
<section class="column width6 first">
<?php
$sql = "SELECT * FROM users WHERE cod='".$_SESSION['codusuario']."';";
$result = $link->query($sql);
$row = $result->fetch_assoc();
echo '<h3>Form edit user</h3>';
echo '<div class="box box-info">If the password is blank, will not change the current password</div>';
echo '<form id="user_edit" action="#" method="post"><fieldset>';
echo '<input type="hidden" id="cod" value="'.$_SESSION['codusuario'].'" />';
echo '<p><label class="required" for="user">User:</label><br>';
echo '<input id="user" class="half" type="text" name="user" value="'.htmlspecialchars($row['user']).'"></p>';
echo '<p><label for="password">Password:</label><br>';
echo '<input id="password" class="half" type="password" name="password" value=""></p>';
echo '<p><label class="required" for="name">Name:</label><br>';
echo '<input id="name" class="half" type="text" name="name" value="'.htmlspecialchars($row['name']).'"></p>';
echo '<p><label class="required" for="email">Email address:</label><br>';
echo '<input id="email" class="half" type="text" name="email" value="'.htmlspecialchars($row['email']).'"></p>';
echo '<p class="box"><input class="btn btn-green big" type="submit" id="save_edit" name="sendform" value="Save">';
?>
</section>
<!-- End of Left column/section -->
<!-- Right column/section -->
<?php include_once 'menu/right-menu.php'; ?>
<!-- End of Right column/section -->
</div>
<!-- End of Wrapper -->
</div>
<!-- End of Page content -->
<!-- Page footer -->
<?php include_once 'menu/footer-menu.php'; ?>
<!-- End of Animated footer -->
<!-- Scroll to top link -->
<a id="totop" style="display: block;">^ scroll to top</a>
<!-- Admin template javascript load -->
<script src="js/administry.js" type="text/javascript"></script>
<div id="tiptip_holder" style="max-width:200px;">
<div id="tiptip_arrow">
<div id="tiptip_arrow_inner"></div>
</div>
<div id="tiptip_content"></div>
</div>
</body>
</html>