-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile.php
executable file
·249 lines (229 loc) · 8.13 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<?php include("includes/header.php"); ?>
<body class="page-header-fixed">
<?php include("includes/head.php"); ?>
<!-- BEGIN CONTAINER -->
<div class="page-container">
<?php include("includes/sidebar.php"); ?>
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<div class="row">
<div class="col-md-12">
<!-- BEGIN PAGE TITLE & BREADCRUMB-->
<h3 class="page-title">
<?php echo CMS_TITULO; ?>
</h3>
<ul class="page-breadcrumb breadcrumb">
<li>
<i class="fa fa-home"></i>
<a>Perfil</a>
</li>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row profile">
<div class="col-md-12">
<!--BEGIN TABS-->
<div class="tabbable tabbable-custom tabbable-full-width">
<ul class="nav nav-tabs">
<li class="active">
<a href="#tab_1_3" data-toggle="tab">
Cuenta </a>
</li>
</ul>
<div class="tab-content">
<?php
$sql="SELECT * FROM users WHERE user_id=:user_id";
$database->query($sql);
$database->bind(':user_id', $_SESSION['id']);
$row = $database->single();
?>
<!--tab_1_2-->
<div class="tab-pane active" id="tab_1_3">
<div class="row profile-account">
<div class="col-md-3">
<ul class="ver-inline-menu tabbable margin-bottom-10">
<li>
<img src="<?php echo $_SESSION['avatar']; ?>" class="img-responsive" alt=""/>
</li>
<li <?php if($_GET['section']=="") { echo 'class="active"'; } ?>>
<a data-toggle="tab" href="#tab_1-1">
<i class="fa fa-cog"></i> información </a>
<span class="after">
</span>
</li>
<li <?php if($_GET['section']=="avatar") { echo 'class="active"'; } ?>>
<a data-toggle="tab" href="#tab_2-2">
<i class="fa fa-picture-o"></i> Cambia tu Avatar</a>
</li>
<li <?php if($_GET['section']=="passwd") { echo 'class="active"'; } ?>>
<a data-toggle="tab" href="#tab_3-3">
<i class="fa fa-lock"></i> Tu password </a>
</li>
</ul>
</div>
<div class="col-md-9">
<div class="tab-content">
<div id="tab_1-1" class="tab-pane <?php if($_GET['section']=="") { echo 'active'; } ?>">
<?php
$forma = array(
"action" => "profile_proc.php",
"id" => "profile_form",
"method" => "post",
"enctype" => 0,
"edit" => 1,
"edit_values" => array(
array("name"=>"user_id","value"=>$_SESSION['id'])
),
"color" => "",
"submit" => "Guardar"
);
$fields = array (
array(
"type" => "text",
"label" => "Nombre completo",
"icon" => "fa-user",
"required" => true,
"name" => "user_fullname",
"value" => $row['user_fullname'],
"placeholder" => "Nombre del usuario",
"disabled" => false,
"data_values" => array(),
"editor" => false
),
array(
"type" => "text",
"label" => "Login",
"icon" => "",
"required" => true,
"name" => "user_login",
"value" => $row['user_login'],
"placeholder" => "Acceso",
"disabled" => false,
"data_values" => array(),
"editor" => false
),
array(
"type" => "email",
"label" => "Email",
"icon" => "fa-envelope",
"required" => true,
"name" => "user_email",
"value" => $row['user_email'],
"placeholder" => "Email",
"disabled" => false,
"data_values" => array(),
"editor" => false
)
);
echo create_form($forma, $fields);
?>
</div>
<div id="tab_2-2" class="tab-pane <?php if($_GET['section']=="avatar") { echo 'active'; } ?>">
<p>
Tu foto deberá ser de por lo menos 600px de ancho. Solo en formato JPG
</p>
<?php
$forma = array(
"action" => "avatar_upload.php",
"id" => "profile_avatar_form",
"method" => "post",
"enctype" => 1,
"edit" => 0,
"color" => "",
"submit" => "Subir"
);
$fields = array (
array(
"type" => "file",
"label" => "",
"icon" => "fa-picture-o",
"required" => true,
"name" => "avatar",
"value" => "",
"placeholder" => "",
"disabled" => false,
"data_values" => array(),
"editor" => false
)
);
echo create_form($forma, $fields);
?>
</div>
<div id="tab_3-3" class="tab-pane <?php if($_GET['section']=="passwd") { echo 'active'; } ?>">
<?php
$forma = array(
"action" => "passwd_proc.php",
"id" => "profile_passwd_form",
"method" => "post",
"enctype" => 0,
"edit" => 1,
"edit_values" => array(
array("name"=>"user_id","value"=>$_SESSION['id'])
),
"color" => "",
"submit" => "Guardar"
);
$fields = array (
array(
"type" => "password",
"label" => "Password actual",
"icon" => "fa-lock",
"required" => true,
"name" => "current",
"value" => "",
"placeholder" => "",
"disabled" => false,
"data_values" => array(),
"editor" => false
),
array(
"type" => "password",
"label" => "Nuevo Password",
"icon" => "fa-lock",
"required" => true,
"name" => "user_passwd",
"value" => "",
"placeholder" => "",
"disabled" => false,
"data_values" => array(),
"editor" => false
),
array(
"type" => "password",
"label" => "Confirma tu password",
"icon" => "fa-lock",
"required" => true,
"name" => "user_passwd2",
"value" => "",
"placeholder" => "",
"disabled" => false,
"data_values" => array(),
"editor" => false
)
);
echo create_form($forma, $fields);
?>
</div>
</div>
</div>
<!--end col-md-9-->
</div>
</div>
<!--end tab-pane-->
</div>
</div>
<!--END TABS-->
</div>
</div>
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<?php include("includes/footer.php"); ?>