mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Haciendo perfil
This commit is contained in:
40
.idea/workspace.xml
generated
40
.idea/workspace.xml
generated
@ -5,8 +5,12 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="7c8f7059-cd40-417c-936e-48dbc0507d86" name="Changes" comment="Add static Vuexy files">
|
||||
<change afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/general_settings_layout.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Home.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Home.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ci4/app/Config/Routes.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Config/Routes.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ci4/app/Controllers/Profile.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Controllers/Profile.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/profile/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/form/profile/index.php" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/header.php" beforeDir="false" afterPath="$PROJECT_DIR$/ci4/app/Views/themes/backend/vuexy/main/header.php" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -28,28 +32,28 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"last_opened_file_path": "D:/Safekat/safekat/ci4/app/Views/themes/_commonPartialsBs",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"last_opened_file_path": "C:/temp-sk/safekat/ci4/app/Views/themes/backend/vuexy/main",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="D:\Safekat\safekat\ci4\app\Views\themes\_commonPartialsBs" />
|
||||
<recent name="C:\temp-sk\safekat\ci4\app\Views\themes\backend\vuexy\main" />
|
||||
<recent name="C:\temp-sk\safekat\ci4\app\Views\themes\backend\vuexy\form\profile" />
|
||||
<recent name="D:\Safekat\safekat\ci4\app\Views\themes\_commonPartialsBs" />
|
||||
<recent name="C:\temp-sk\safekat\httpdocs\themes\vuexy\vendor\libs\toastr" />
|
||||
<recent name="C:\temp-sk\safekat\ci4\app\Language\es-ES" />
|
||||
<recent name="C:\temp-sk\safekat\ci4\app\Views\themes\backend\vuexy\form\user" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\temp-sk\safekat\ci4\app\Controllers\Usuarios" />
|
||||
@ -82,6 +86,8 @@
|
||||
<workItem from="1684313352573" duration="9284000" />
|
||||
<workItem from="1684350581362" duration="2244000" />
|
||||
<workItem from="1684415370137" duration="889000" />
|
||||
<workItem from="1684761592479" duration="626000" />
|
||||
<workItem from="1684829967827" duration="8241000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Starting Vuexy Theme creation">
|
||||
<created>1682339938559</created>
|
||||
|
||||
@ -123,6 +123,19 @@ $routes->group('', [], function($routes) {
|
||||
$routes->post('menuitems', 'Tipologias::menuItems', ['as' => 'menuItemsOfTipologiasLibros']);
|
||||
});
|
||||
|
||||
$routes->group('profile', ['namespace' => 'App\Controllers'], function ($routes) {
|
||||
$routes->get('', 'Profile::index', ['as' => 'profileList']);
|
||||
$routes->get('index', 'Profile::index', ['as' => 'profileIndex']);
|
||||
$routes->get('list', 'Profile::index', ['as' => 'profileList2']);
|
||||
// $routes->get('add', 'Profile::add', ['as' => 'newProfile']);
|
||||
// $routes->post('add', 'Profile::add', ['as' => 'createProfile']);
|
||||
// $routes->get('edit/(:num)', 'Profile::edit/$1', ['as' => 'editTipologiaLibros']);
|
||||
// $routes->post('edit/(:num)', 'Profile::edit/$1', ['as' => 'updateTipologiaLibros']);
|
||||
// $routes->get('delete/(:num)', 'Profile::delete/$1', ['as' => 'deleteTipologiaLibros']);
|
||||
// $routes->post('allmenuitems', 'Profile::allItemsSelect', ['as' => 'select2ItemsOfTipologiasLibros']);
|
||||
// $routes->post('menuitems', 'Profile::menuItems', ['as' => 'menuItemsOfTipologiasLibros']);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -56,8 +56,9 @@ class Profile extends BaseController
|
||||
$session = session();
|
||||
|
||||
$data['obj'] = $this->user_model->where('id_user',$this->id_user)->first();
|
||||
if(!empty($data['obj']['date_birth'])){
|
||||
$data['obj']['date_birth'] = dateFormatWeb($data['obj']['date_birth']);
|
||||
|
||||
if(!empty($data['obj']->date_birth)){
|
||||
$data['obj']->date_birth = dateFormatWeb($data['obj']->date_birth);
|
||||
}
|
||||
$data['country'] = $this->countries_model->select('code,name')->where('data_lang',session()->get('lang')??'en')->findAll();
|
||||
|
||||
|
||||
@ -1,255 +1,490 @@
|
||||
<!--Style-->
|
||||
<link href="<?=site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css")?>" rel="stylesheet">
|
||||
<style>
|
||||
.input_hidden {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
</style>
|
||||
<?= $this->extend('themes/backend/vuexy/main/general_settings_layout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
|
||||
<!--Content Body-->
|
||||
<div class="content-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row page-titles mx-0">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<div class="welcome-text">
|
||||
<h4><i class="<?= $title['icon']??'' ?>"></i> <?= $title['module']??'' ?></h4>
|
||||
<span class="ml-1"><?= $title['page']??'' ?></span>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ul class="nav nav-pills flex-column flex-md-row mb-4">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="javascript:void(0);"
|
||||
><i class="ti-xs ti ti-users me-1"></i> Account</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="pages-account-settings-security.html"
|
||||
><i class="ti-xs ti ti-lock me-1"></i> Security</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Profile Details</h5>
|
||||
<!-- Account -->
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-start align-items-sm-center gap-4">
|
||||
<img
|
||||
src="../../assets/img/avatars/14.png"
|
||||
alt="user-avatar"
|
||||
class="d-block w-px-100 h-px-100 rounded"
|
||||
id="uploadedAvatar"
|
||||
/>
|
||||
<div class="button-wrapper">
|
||||
<label for="upload" class="btn btn-primary me-2 mb-3" tabindex="0">
|
||||
<span class="d-none d-sm-block">Upload new photo</span>
|
||||
<i class="ti ti-upload d-block d-sm-none"></i>
|
||||
<input
|
||||
type="file"
|
||||
id="upload"
|
||||
class="account-file-input"
|
||||
hidden
|
||||
accept="image/png, image/jpeg"
|
||||
/>
|
||||
</label>
|
||||
<button type="button" class="btn btn-label-secondary account-image-reset mb-3">
|
||||
<i class="ti ti-refresh-dot d-block d-sm-none"></i>
|
||||
<span class="d-none d-sm-block">Reset</span>
|
||||
</button>
|
||||
|
||||
<div class="text-muted">Allowed JPG, GIF or PNG. Max size of 800K</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<ol class="breadcrumb">
|
||||
<?php foreach ($breadcrumb??[] as $item) : ?>
|
||||
<?php if (!$item['active']) : ?>
|
||||
<li class="breadcrumb-item"><a href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
||||
<?php else : ?>
|
||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<hr class="my-0"/>
|
||||
<div class="card-body">
|
||||
<form id="formAccountSettings" method="POST" action="<?= site_url("profile/store") ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="first_name" class="form-label"><?= lang("App.profile_first_name") ?></label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="first_name"
|
||||
name="first_name"
|
||||
placeholder="<?= lang("App.profile_first_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->first_name : set_value('first_name'); ?>"
|
||||
autofocus
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="last_name" class="form-label"><?= lang("App.profile_last_name") ?></label>
|
||||
<input class="form-control"
|
||||
type="text"
|
||||
name="last_name"
|
||||
id="last_name"
|
||||
placeholder="<?= lang("App.profile_last_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="email" class="form-label"><?= lang("App.profile_email") ?></label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="email"
|
||||
name="email"
|
||||
placeholder="<?= lang("App.profile_email_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="organization" class="form-label">Organization</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="organization"
|
||||
name="organization"
|
||||
value="Pixinvent"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label class="form-label" for="mobile"><?= lang("App.profile_mobile") ?></label>
|
||||
<div class="input-group input-group-merge">
|
||||
<span class="input-group-text">US (+1)</span>
|
||||
<input
|
||||
type="text"
|
||||
id="mobile"
|
||||
name="mobile"
|
||||
class="form-control"
|
||||
placeholder="<?= lang("App.profile_mobile_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->mobile : set_value('mobile'); ?>"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="address" class="form-label"><?= lang("App.profile_address") ?></label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="address"
|
||||
name="address"
|
||||
placeholder="<?= lang("App.profile_address_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->address : set_value('address'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="state" class="form-label">State</label>
|
||||
<input class="form-control" type="text" id="state" name="state" placeholder="California"/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="zipCode" class="form-label">Zip Code</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="zipCode"
|
||||
name="zipCode"
|
||||
placeholder="231465"
|
||||
maxlength="6"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label class="form-label" for="country"><?= lang("App.profile_country") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->country ?? [] : set_value('country'); ?>
|
||||
<select name="country" id="country" class="select2 form-select">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<?php foreach ($country ?? [] as $item) : ?>
|
||||
<option value="<?= $item['code'] ?? '' ?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?= $item['name'] ?? '' ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="language" class="form-label"><?= lang("App.profile_language") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->language ?? [] : set_value('language'); ?>
|
||||
<select name="language" id="language" class="select2 form-select">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?= lang("App.lang_en") ?></option>
|
||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?= lang("App.lang_es") ?></option>
|
||||
<option value="pt" <?= $id_select == "pt" ? 'selected' : '' ?>><?= lang("App.lang_pt") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="timeZones" class="form-label">Timezone</label>
|
||||
<select id="timeZones" class="select2 form-select">
|
||||
<option value="">Select Timezone</option>
|
||||
<option value="-12">(GMT-12:00) International Date Line West</option>
|
||||
<option value="-11">(GMT-11:00) Midway Island, Samoa</option>
|
||||
<option value="-10">(GMT-10:00) Hawaii</option>
|
||||
<option value="-9">(GMT-09:00) Alaska</option>
|
||||
<option value="-8">(GMT-08:00) Pacific Time (US & Canada)</option>
|
||||
<option value="-8">(GMT-08:00) Tijuana, Baja California</option>
|
||||
<option value="-7">(GMT-07:00) Arizona</option>
|
||||
<option value="-7">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
|
||||
<option value="-7">(GMT-07:00) Mountain Time (US & Canada)</option>
|
||||
<option value="-6">(GMT-06:00) Central America</option>
|
||||
<option value="-6">(GMT-06:00) Central Time (US & Canada)</option>
|
||||
<option value="-6">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option>
|
||||
<option value="-6">(GMT-06:00) Saskatchewan</option>
|
||||
<option value="-5">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option>
|
||||
<option value="-5">(GMT-05:00) Eastern Time (US & Canada)</option>
|
||||
<option value="-5">(GMT-05:00) Indiana (East)</option>
|
||||
<option value="-4">(GMT-04:00) Atlantic Time (Canada)</option>
|
||||
<option value="-4">(GMT-04:00) Caracas, La Paz</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="currency" class="form-label">Currency</label>
|
||||
<select id="currency" class="select2 form-select">
|
||||
<option value="">Select Currency</option>
|
||||
<option value="usd">USD</option>
|
||||
<option value="euro">Euro</option>
|
||||
<option value="pound">Pound</option>
|
||||
<option value="bitcoin">Bitcoin</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn btn-primary me-2">Save changes</button>
|
||||
<button type="reset" class="btn btn-label-secondary">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /Account -->
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h5 class="card-header">Delete Account</h5>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 col-12 mb-0">
|
||||
<div class="alert alert-warning">
|
||||
<h5 class="alert-heading mb-1">Are you sure you want to delete your account?</h5>
|
||||
<p class="mb-0">Once you delete your account, there is no going back. Please be certain.</p>
|
||||
</div>
|
||||
</div>
|
||||
<form id="formAccountDeactivation" onsubmit="return false">
|
||||
<div class="form-check mb-4">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
name="accountActivation"
|
||||
id="accountActivation"
|
||||
/>
|
||||
<label class="form-check-label" for="accountActivation"
|
||||
>I confirm my account deactivation</label
|
||||
>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-danger deactivate-account">Deactivate Account</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= $title['page']??'' ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form class="form" action="<?=site_url("profile/store")?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?=lang("App.profile_msg_desc_1")?></label>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?=lang("App.profile_first_name")?></label>
|
||||
<input type="text" id="first_name" name="first_name" class="form-control" placeholder="<?=lang("App.profile_first_name_ph")?>" value="<?= (isset($obj)) ? $obj['first_name'] : set_value('first_name');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?=lang("App.profile_last_name")?></label>
|
||||
<input type="text" id="last_name" name="last_name" class="form-control" placeholder="<?=lang("App.profile_last_name_ph")?>" value="<?= (isset($obj)) ? $obj['last_name'] : set_value('last_name');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?=lang("App.profile_date_birth")?></label>
|
||||
<input type="text" class="form-control" placeholder="<?=lang("App.profile_date_birth_ph")?>" id="date_birth" name="date_birth" value="<?= (isset($obj)) ? $obj['date_birth'] : set_value('date_birth');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?=lang("App.profile_email")?></label>
|
||||
<input type="text" id="email" name="email" class="form-control" placeholder="<?=lang("App.profile_email_ph")?>" value="<?= (isset($obj)) ? $obj['email'] : set_value('email');?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="mobile" class="text-dark"><?=lang("App.profile_mobile")?></label>
|
||||
<input type="text" id="mobile" name="mobile" class="form-control" placeholder="<?=lang("App.profile_mobile_ph")?>" value="<?= (isset($obj)) ? $obj['mobile'] : set_value('mobile');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="password" class="text-dark"><?=lang("App.profile_password")?></label>
|
||||
<input type="password" id="password" name="password" class="form-control" placeholder="<?=lang("App.profile_password_ph")?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="confirm_password" class="text-dark"><?=lang("App.profile_confirm_password")?></label>
|
||||
<input type="password" id="confirm_password" name="confirm_password" class="form-control" placeholder="<?=lang("App.profile_confirm_password_ph")?>">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row page-titles mx-0">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<div class="welcome-text">
|
||||
<h4><i class="<?= $title['icon'] ?? '' ?>"></i> <?= $title['module'] ?? '' ?></h4>
|
||||
<span class="ml-1"><?= $title['page'] ?? '' ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<ol class="breadcrumb">
|
||||
<?php foreach ($breadcrumb ?? [] as $item) : ?>
|
||||
<?php if (!$item['active']) : ?>
|
||||
<li class="breadcrumb-item"><a
|
||||
href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
||||
<?php else : ?>
|
||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= $title['page'] ?? '' ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form class="form" action="<?= site_url("profile/store") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?= lang("App.profile_msg_desc_1") ?></label>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_first_name") ?></label>
|
||||
<input type="text" id="first_name" name="first_name" class="form-control"
|
||||
placeholder="<?= lang("App.profile_first_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->first_name : set_value('first_name'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?=lang("App.profile_msg_desc_2")?></label>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_last_name") ?></label>
|
||||
<input type="text" id="last_name" name="last_name" class="form-control"
|
||||
placeholder="<?= lang("App.profile_last_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>">
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?=lang("App.profile_address")?></label>
|
||||
<input type="text" id="address" name="address" class="form-control" placeholder="<?=lang("App.profile_address_ph")?>" value="<?= (isset($obj)) ? $obj['address'] : set_value('address');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_date_birth") ?></label>
|
||||
<input type="text" class="form-control"
|
||||
placeholder="<?= lang("App.profile_date_birth_ph") ?>"
|
||||
id="date_birth" name="date_birth"
|
||||
value="<?= (isset($obj)) ? $obj->date_birth : set_value('date_birth'); ?>">
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="city" class="text-dark"><?=lang("App.profile_city")?></label>
|
||||
<input type="text" id="city" name="city" class="form-control" placeholder="<?=lang("App.profile_city_ph")?>" value="<?= (isset($obj)) ? $obj['city'] : set_value('city');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_email") ?></label>
|
||||
<input type="text" id="email" name="email" class="form-control"
|
||||
placeholder="<?= lang("App.profile_email_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
|
||||
disabled>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="state" class="text-dark"><?=lang("App.profile_state")?></label>
|
||||
<input type="text" id="state" name="state" class="form-control" placeholder="<?=lang("App.profile_state_ph")?>" value="<?= (isset($obj)) ? $obj['state'] : set_value('state');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="mobile"
|
||||
class="text-dark"><?= lang("App.profile_mobile") ?></label>
|
||||
<input type="text" id="mobile" name="mobile" class="form-control"
|
||||
placeholder="<?= lang("App.profile_mobile_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->mobile : set_value('mobile'); ?>">
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="country" class="text-dark"><?=lang("App.profile_country")?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj['country']??[] : set_value('country');?>
|
||||
<select name="country" id="country" class="form-control">
|
||||
<option value=""><?=lang("App.global_select")?></option>
|
||||
<?php foreach ($country??[] as $item) : ?>
|
||||
<option value="<?=$item['code']??''?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?=$item['name']??''?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="password"
|
||||
class="text-dark"><?= lang("App.profile_password") ?></label>
|
||||
<input type="password" id="password" name="password" class="form-control"
|
||||
placeholder="<?= lang("App.profile_password_ph") ?>">
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="language" class="text-dark"><?=lang("App.profile_language")?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj['language']??[] : set_value('language');?>
|
||||
<select name="language" id="language" class="form-control">
|
||||
<option value=""><?=lang("App.global_select")?></option>
|
||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?=lang("App.lang_en")?></option>
|
||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?=lang("App.lang_es")?></option>
|
||||
<option value="pt" <?= $id_select == "pt" ? 'selected' : '' ?>><?=lang("App.lang_pt")?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="confirm_password"
|
||||
class="text-dark"><?= lang("App.profile_confirm_password") ?></label>
|
||||
<input type="password" id="confirm_password" name="confirm_password"
|
||||
class="form-control"
|
||||
placeholder="<?= lang("App.profile_confirm_password_ph") ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<a href="<?= site_url($btn_return['route']??'#') ?>" class="<?= $btn_return['class']??''?>">
|
||||
<i class="<?= $btn_return['icon']??'' ?>"></i> <?= $btn_return['title']??'' ?>
|
||||
</a>
|
||||
<button type="submit" class="<?= $btn_submit['class']??''?>">
|
||||
<i class="<?= $btn_submit['icon']??'' ?>"></i> <?= $btn_submit['title']??'' ?>
|
||||
</button>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?= lang("App.profile_msg_desc_2") ?></label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_address") ?></label>
|
||||
<input type="text" id="address" name="address" class="form-control"
|
||||
placeholder="<?= lang("App.profile_address_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->address : set_value('address'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="city" class="text-dark"><?= lang("App.profile_city") ?></label>
|
||||
<input type="text" id="city" name="city" class="form-control"
|
||||
placeholder="<?= lang("App.profile_city_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->city : set_value('city'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="state"
|
||||
class="text-dark"><?= lang("App.profile_state") ?></label>
|
||||
<input type="text" id="state" name="state" class="form-control"
|
||||
placeholder="<?= lang("App.profile_state_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->state : set_value('state'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="country"
|
||||
class="text-dark"><?= lang("App.profile_country") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->country ?? [] : set_value('country'); ?>
|
||||
<select name="country" id="country" class="form-control">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<?php foreach ($country ?? [] as $item) : ?>
|
||||
<option value="<?= $item['code'] ?? '' ?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?= $item['name'] ?? '' ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="language"
|
||||
class="text-dark"><?= lang("App.profile_language") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->language ?? [] : set_value('language'); ?>
|
||||
<select name="language" id="language" class="form-control">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?= lang("App.lang_en") ?></option>
|
||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?= lang("App.lang_es") ?></option>
|
||||
<option value="pt" <?= $id_select == "pt" ? 'selected' : '' ?>><?= lang("App.lang_pt") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<a href="<?= site_url($btn_return['route'] ?? '#') ?>"
|
||||
class="<?= $btn_return['class'] ?? '' ?>">
|
||||
<i class="<?= $btn_return['icon'] ?? '' ?>"></i> <?= $btn_return['title'] ?? '' ?>
|
||||
</a>
|
||||
<button type="submit" class="<?= $btn_submit['class'] ?? '' ?>">
|
||||
<i class="<?= $btn_submit['icon'] ?? '' ?>"></i> <?= $btn_submit['title'] ?? '' ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?=lang("App.profile_subtitle_image")?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex" >
|
||||
<img src="<?= $obj['picture']??''?>" class="btn-circle btn-circle-md">
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-3" >
|
||||
<span><b><?= $obj['first_name']??''?></b></span><br>
|
||||
<span><?= $obj['email']??''?></span>
|
||||
</div>
|
||||
<div class="col-lg-12 mt-3">
|
||||
<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#photoModalCenter"><i class="fas fa-camera"></i> <?=lang("App.profile_change_photo")?></button>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="photoModalCenter">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-2">
|
||||
<h5><?=lang("App.profile_change_image")?></h5>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_upload" class="form" action="<?=site_url("profile")?>" enctype="multipart/form-data" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="file" name="file" id="file" class="input_hidden" onchange="form_upload.submit()" accept="image/*">
|
||||
<div class="btn btn-light btn-circle btn-circle-md"><a href="#" class="file-upload"><i class="fas fa-cloud-upload-alt fa-2xl"></i></a></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1" >
|
||||
<b><i class="fas fa-upload"></i> <?=strtoupper(lang("App.profile_upload_msg"))?></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex" >
|
||||
<form name="form_not" action="<?=site_url("profile")?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_not" name="image_not" value="<?=site_url("assets/img/default-user.png")?>">
|
||||
<a href="javascript:form_not.submit()"><img src="<?=site_url("assets/img/default-user.png")?>" class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1" >
|
||||
<b><i class="fas fa-user-slash"></i> <?=strtoupper(lang("App.profile_no_image_msg"))?></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex" >
|
||||
<form name="form_gravatar" action="<?=site_url("profile")?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_gravatar" name="image_gravatar" value="https://s.gravatar.com/avatar/<?=MD5($obj['email']??'')?>?s=150">
|
||||
<a href="javascript:form_gravatar.submit()"><img src="https://s.gravatar.com/avatar/<?=MD5($obj['email']??'')?>?s=150" class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1" >
|
||||
<b><i class="fas fa-user-circle"></i> <?=strtoupper(lang("App.profile_gravatar_msg"))?></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach ($oauth??[] as $item) : ?>
|
||||
<?php
|
||||
$icon = '';
|
||||
switch ($item['provider']) {
|
||||
case "vkontakte":
|
||||
$icon = '<i class="fab fa-vk"></i> ';
|
||||
break;
|
||||
case "wechat":
|
||||
$icon = '<i class="fab fa-weixin"></i> ';
|
||||
break;
|
||||
default:
|
||||
$icon = '<i class="fab fa-'.$item['provider'].'"></i> ';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex" >
|
||||
<form name="form_<?=$item['provider']??''?>" action="<?=site_url("profile")?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_<?=$item['provider']??''?>" name="image_<?=$item['provider']??''?>" value="<?=$item['picture']??''?>">
|
||||
<a href="javascript:form_<?=$item['provider']??''?>.submit()"><img src="<?=$item['picture']??''?>" class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_image") ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<img src="<?= $obj->picture ?? '' ?>" class="btn-circle btn-circle-md">
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-3">
|
||||
<span><b><?= $obj->first_name ?? '' ?></b></span><br>
|
||||
<span><?= $obj->email ?? '' ?></span>
|
||||
</div>
|
||||
<div class="col-lg-12 mt-3">
|
||||
<button type="button" class="btn btn-primary btn-block" data-toggle="modal"
|
||||
data-target="#photoModalCenter"><i
|
||||
class="fas fa-camera"></i> <?= lang("App.profile_change_photo") ?></button>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="photoModalCenter">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-2">
|
||||
<h5><?= lang("App.profile_change_image") ?></h5>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_upload" class="form"
|
||||
action="<?= site_url("profile") ?>"
|
||||
enctype="multipart/form-data" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="file" name="file" id="file"
|
||||
class="input_hidden"
|
||||
onchange="form_upload.submit()" accept="image/*">
|
||||
<div class="btn btn-light btn-circle btn-circle-md"><a
|
||||
href="#" class="file-upload"><i
|
||||
class="fas fa-cloud-upload-alt fa-2xl"></i></a>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1" >
|
||||
<b><?=$icon?><?=strtoupper($item['provider']??'')?></b>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-upload"></i> <?= strtoupper(lang("App.profile_upload_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_not" action="<?= site_url("profile") ?>"
|
||||
method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_not" name="image_not"
|
||||
value="<?= site_url("assets/img/default-user.png") ?>">
|
||||
<a href="javascript:form_not.submit()"><img
|
||||
src="<?= site_url("assets/img/default-user.png") ?>"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-user-slash"></i> <?= strtoupper(lang("App.profile_no_image_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_gravatar"
|
||||
action="<?= site_url("profile") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_gravatar"
|
||||
name="image_gravatar"
|
||||
value="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150">
|
||||
<a href="javascript:form_gravatar.submit()"><img
|
||||
src="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-user-circle"></i> <?= strtoupper(lang("App.profile_gravatar_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -260,66 +495,76 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $settings = session()->get('settings'); ?>
|
||||
<?php if ($settings['two_factor_auth']) : ?>
|
||||
<form name="form_otp" class="form" action="<?=site_url("profile/store")?>" method="post" id="sendFormTFA">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
</div>
|
||||
<?php $settings = session()->get('settings'); ?>
|
||||
|
||||
<?php if ($settings['two_factor_auth']) : ?>
|
||||
<form name="form_otp" class="form" action="<?= site_url("profile/store") ?>" method="post" id="sendFormTFA">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row mx-0" style="width: 100%;">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<h4 class="card-title"><?=lang("App.profile_subtitle_tfa")?></h4>
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_tfa") ?></h4>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<div class="custom-control custom-switch ml-2">
|
||||
<input type="checkbox" id="tfa" name="tfa" class="custom-control-input" onchange="tfaView()" <?=$obj['tfa']??false ?'checked':''?>>
|
||||
<label for="tfa" class="custom-control-label"><?= lang("App.profile_tfa_msg") ?></label>
|
||||
<input type="checkbox" id="tfa" name="tfa" class="custom-control-input"
|
||||
onchange="tfaView()" <?= $obj['tfa'] ?? false ? 'checked' : '' ?>>
|
||||
<label for="tfa"
|
||||
class="custom-control-label"><?= lang("App.profile_tfa_msg") ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="otp" style="display: <?=$obj['tfa']??false ?'block':'none'?>">
|
||||
<div id="otp" style="display: <?= $obj['tfa'] ?? false ? 'block' : 'none' ?>">
|
||||
<?php
|
||||
$tfa = new \App\Libraries\Authenticator();
|
||||
$name = $obj['first_name']??'';
|
||||
if($obj['tfa'] && !empty($obj['tfa_secret'])) {
|
||||
$tfa_secret = $obj['tfa_secret']??'';
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
} else {
|
||||
$tfa_secret = $tfa->createSecret();
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
}
|
||||
$tfa = new \App\Libraries\Authenticator();
|
||||
$name = $obj['first_name'] ?? '';
|
||||
if ($obj['tfa'] && !empty($obj['tfa_secret'])) {
|
||||
$tfa_secret = $obj['tfa_secret'] ?? '';
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
} else {
|
||||
$tfa_secret = $tfa->createSecret();
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p><b><?=lang("App.profile_qrcode")?></b></p>
|
||||
<p><b><?= lang("App.profile_qrcode") ?></b></p>
|
||||
<img src="<?php echo $qrcode; ?>" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p><b><?=lang("App.profile_backup_code")?></b></p>
|
||||
<p><b><?= lang("App.profile_backup_code") ?></b></p>
|
||||
<?php
|
||||
$codes = "";
|
||||
if(!empty($obj['tfa_code']??'')) {
|
||||
$codes = explode(',' , $obj['tfa_code']??'');
|
||||
foreach($codes as $item) {
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">'.$item.'</span>';
|
||||
if (!empty($obj['tfa_code'] ?? '')) {
|
||||
$codes = explode(',', $obj['tfa_code'] ?? '');
|
||||
foreach ($codes as $item) {
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $item . '</span>';
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$codes = array();
|
||||
for($i = 1 ; $i <= 8 ; $i++) {
|
||||
for ($i = 1; $i <= 8; $i++) {
|
||||
$code = random_string('numeric', 6);
|
||||
$codes[] = $code;
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">'.$code.'</span>';
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $code . '</span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="mt-2"><b><?=lang("App.profile_tfa_secret")?></b><br><b class="text-primary"><?=$tfa_secret?></b></p>
|
||||
<input type="hidden" id="tfa_secret" name="tfa_secret" value="<?=$tfa_secret?>">
|
||||
<input type="hidden" id="tfa_code" name="tfa_code" value="<?=implode(',',$codes)?>">
|
||||
<button type="button" class="btn btn-primary btn-block mt-2" onclick="download('<?=lang("App.profile_qrcode")?>\n<?=implode(",",$codes)?>\n<?=lang("App.profile_tfa_secret")?>\n<?=$tfa_secret?>','backup_codes.txt')"><i class="fas fa-download mr-1"></i> <?=lang("App.profile_tfa_download")?></button>
|
||||
<p class="mt-2"><b><?= lang("App.profile_tfa_secret") ?></b><br><b
|
||||
class="text-primary"><?= $tfa_secret ?></b></p>
|
||||
<input type="hidden" id="tfa_secret" name="tfa_secret"
|
||||
value="<?= $tfa_secret ?>">
|
||||
<input type="hidden" id="tfa_code" name="tfa_code"
|
||||
value="<?= implode(',', $codes) ?>">
|
||||
<button type="button" class="btn btn-primary btn-block mt-2"
|
||||
onclick="download('<?= lang("App.profile_qrcode") ?>\n<?= implode(",", $codes) ?>\n<?= lang("App.profile_tfa_secret") ?>\n<?= $tfa_secret ?>','backup_codes.txt')">
|
||||
<i class="fas fa-download mr-1"></i> <?= lang("App.profile_tfa_download") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -327,24 +572,27 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!-- Required vendors -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/global/global.min.js")?>">></script>
|
||||
<script src="<?=site_url("themes/focus2/js/quixnav-init.js")?>">></script>
|
||||
<script src="<?=site_url("themes/focus2/js/custom.min.js")?>">></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/select2/js/select2.full.min.js")?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/global/global.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/js/quixnav-init.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/js/custom.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/select2/js/select2.full.min.js") ?>">></script>
|
||||
<!-- Alert -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js")?>">></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/toastr/js/toastr.min.js")?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/toastr/js/toastr.min.js") ?>">></script>
|
||||
<!-- Date Range Picker -->
|
||||
<!-- momment js is must -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/moment/moment.min.js")?>">></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/bootstrap-daterangepicker/daterangepicker.js")?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/moment/moment.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/bootstrap-daterangepicker/daterangepicker.js") ?>">></script>
|
||||
<!-- Material color picker -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js")?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js") ?>">></script>
|
||||
<!-- Form -->
|
||||
<script>
|
||||
"use strict";
|
||||
@ -357,11 +605,12 @@
|
||||
time: false
|
||||
});
|
||||
});
|
||||
$('.file-upload').on('click', function(e) {
|
||||
$('.file-upload').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#file').trigger('click');
|
||||
});
|
||||
function download(text, filename){
|
||||
|
||||
function download(text, filename) {
|
||||
let blob = new Blob([text], {type: "text/plain;charset=utf-8"});
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
@ -369,7 +618,8 @@
|
||||
a.download = filename;
|
||||
a.click();
|
||||
}
|
||||
function tfaView(){
|
||||
|
||||
function tfaView() {
|
||||
document.getElementById("sendFormTFA").submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
444
ci4/app/Views/themes/backend/vuexy/form/profile/index_old.php
Normal file
444
ci4/app/Views/themes/backend/vuexy/form/profile/index_old.php
Normal file
@ -0,0 +1,444 @@
|
||||
<!--Style-->
|
||||
<link href="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css") ?>"
|
||||
rel="stylesheet">
|
||||
<style>
|
||||
.input_hidden {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
</style>
|
||||
<!--Content Body-->
|
||||
<div class="content-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row page-titles mx-0">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<div class="welcome-text">
|
||||
<h4><i class="<?= $title['icon'] ?? '' ?>"></i> <?= $title['module'] ?? '' ?></h4>
|
||||
<span class="ml-1"><?= $title['page'] ?? '' ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<ol class="breadcrumb">
|
||||
<?php foreach ($breadcrumb ?? [] as $item) : ?>
|
||||
<?php if (!$item['active']) : ?>
|
||||
<li class="breadcrumb-item"><a
|
||||
href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
||||
<?php else : ?>
|
||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= $title['page'] ?? '' ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form class="form" action="<?= site_url("profile/store") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?= lang("App.profile_msg_desc_1") ?></label>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_first_name") ?></label>
|
||||
<input type="text" id="first_name" name="first_name" class="form-control"
|
||||
placeholder="<?= lang("App.profile_first_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->first_name : set_value('first_name'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_last_name") ?></label>
|
||||
<input type="text" id="last_name" name="last_name" class="form-control"
|
||||
placeholder="<?= lang("App.profile_last_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_date_birth") ?></label>
|
||||
<input type="text" class="form-control"
|
||||
placeholder="<?= lang("App.profile_date_birth_ph") ?>"
|
||||
id="date_birth" name="date_birth"
|
||||
value="<?= (isset($obj)) ? $obj->date_birth : set_value('date_birth'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_email") ?></label>
|
||||
<input type="text" id="email" name="email" class="form-control"
|
||||
placeholder="<?= lang("App.profile_email_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
|
||||
disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="mobile"
|
||||
class="text-dark"><?= lang("App.profile_mobile") ?></label>
|
||||
<input type="text" id="mobile" name="mobile" class="form-control"
|
||||
placeholder="<?= lang("App.profile_mobile_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->mobile : set_value('mobile'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="password"
|
||||
class="text-dark"><?= lang("App.profile_password") ?></label>
|
||||
<input type="password" id="password" name="password" class="form-control"
|
||||
placeholder="<?= lang("App.profile_password_ph") ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="confirm_password"
|
||||
class="text-dark"><?= lang("App.profile_confirm_password") ?></label>
|
||||
<input type="password" id="confirm_password" name="confirm_password"
|
||||
class="form-control"
|
||||
placeholder="<?= lang("App.profile_confirm_password_ph") ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?= lang("App.profile_msg_desc_2") ?></label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_address") ?></label>
|
||||
<input type="text" id="address" name="address" class="form-control"
|
||||
placeholder="<?= lang("App.profile_address_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->address : set_value('address'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="city" class="text-dark"><?= lang("App.profile_city") ?></label>
|
||||
<input type="text" id="city" name="city" class="form-control"
|
||||
placeholder="<?= lang("App.profile_city_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->city : set_value('city'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="state"
|
||||
class="text-dark"><?= lang("App.profile_state") ?></label>
|
||||
<input type="text" id="state" name="state" class="form-control"
|
||||
placeholder="<?= lang("App.profile_state_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->state : set_value('state'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="country"
|
||||
class="text-dark"><?= lang("App.profile_country") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->country ?? [] : set_value('country'); ?>
|
||||
<select name="country" id="country" class="form-control">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<?php foreach ($country ?? [] as $item) : ?>
|
||||
<option value="<?= $item['code'] ?? '' ?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?= $item['name'] ?? '' ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="language"
|
||||
class="text-dark"><?= lang("App.profile_language") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->language ?? [] : set_value('language'); ?>
|
||||
<select name="language" id="language" class="form-control">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?= lang("App.lang_en") ?></option>
|
||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?= lang("App.lang_es") ?></option>
|
||||
<option value="pt" <?= $id_select == "pt" ? 'selected' : '' ?>><?= lang("App.lang_pt") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<a href="<?= site_url($btn_return['route'] ?? '#') ?>"
|
||||
class="<?= $btn_return['class'] ?? '' ?>">
|
||||
<i class="<?= $btn_return['icon'] ?? '' ?>"></i> <?= $btn_return['title'] ?? '' ?>
|
||||
</a>
|
||||
<button type="submit" class="<?= $btn_submit['class'] ?? '' ?>">
|
||||
<i class="<?= $btn_submit['icon'] ?? '' ?>"></i> <?= $btn_submit['title'] ?? '' ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_image") ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<img src="<?= $obj->picture ?? '' ?>" class="btn-circle btn-circle-md">
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-3">
|
||||
<span><b><?= $obj->first_name ?? '' ?></b></span><br>
|
||||
<span><?= $obj->email ?? '' ?></span>
|
||||
</div>
|
||||
<div class="col-lg-12 mt-3">
|
||||
<button type="button" class="btn btn-primary btn-block" data-toggle="modal"
|
||||
data-target="#photoModalCenter"><i
|
||||
class="fas fa-camera"></i> <?= lang("App.profile_change_photo") ?></button>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="photoModalCenter">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-2">
|
||||
<h5><?= lang("App.profile_change_image") ?></h5>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_upload" class="form"
|
||||
action="<?= site_url("profile") ?>"
|
||||
enctype="multipart/form-data" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="file" name="file" id="file"
|
||||
class="input_hidden"
|
||||
onchange="form_upload.submit()" accept="image/*">
|
||||
<div class="btn btn-light btn-circle btn-circle-md"><a
|
||||
href="#" class="file-upload"><i
|
||||
class="fas fa-cloud-upload-alt fa-2xl"></i></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-upload"></i> <?= strtoupper(lang("App.profile_upload_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_not" action="<?= site_url("profile") ?>"
|
||||
method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_not" name="image_not"
|
||||
value="<?= site_url("assets/img/default-user.png") ?>">
|
||||
<a href="javascript:form_not.submit()"><img
|
||||
src="<?= site_url("assets/img/default-user.png") ?>"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-user-slash"></i> <?= strtoupper(lang("App.profile_no_image_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_gravatar"
|
||||
action="<?= site_url("profile") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_gravatar"
|
||||
name="image_gravatar"
|
||||
value="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150">
|
||||
<a href="javascript:form_gravatar.submit()"><img
|
||||
src="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-user-circle"></i> <?= strtoupper(lang("App.profile_gravatar_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach ($oauth ?? [] as $item) : ?>
|
||||
<?php
|
||||
$icon = '';
|
||||
switch ($item['provider']) {
|
||||
case "vkontakte":
|
||||
$icon = '<i class="fab fa-vk"></i> ';
|
||||
break;
|
||||
case "wechat":
|
||||
$icon = '<i class="fab fa-weixin"></i> ';
|
||||
break;
|
||||
default:
|
||||
$icon = '<i class="fab fa-' . $item['provider'] . '"></i> ';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_<?= $item['provider'] ?? '' ?>"
|
||||
action="<?= site_url("profile") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden"
|
||||
id="image_<?= $item['provider'] ?? '' ?>"
|
||||
name="image_<?= $item['provider'] ?? '' ?>"
|
||||
value="<?= $item['picture'] ?? '' ?>">
|
||||
<a href="javascript:form_<?= $item['provider'] ?? '' ?>.submit()"><img
|
||||
src="<?= $item['picture'] ?? '' ?>"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><?= $icon ?><?= strtoupper($item['provider'] ?? '') ?></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $settings = session()->get('settings'); ?>
|
||||
|
||||
<?php if ($settings['two_factor_auth']) : ?>
|
||||
<form name="form_otp" class="form" action="<?= site_url("profile/store") ?>" method="post" id="sendFormTFA">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row mx-0" style="width: 100%;">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_tfa") ?></h4>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<div class="custom-control custom-switch ml-2">
|
||||
<input type="checkbox" id="tfa" name="tfa" class="custom-control-input"
|
||||
onchange="tfaView()" <?= $obj['tfa'] ?? false ? 'checked' : '' ?>>
|
||||
<label for="tfa"
|
||||
class="custom-control-label"><?= lang("App.profile_tfa_msg") ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="otp" style="display: <?= $obj['tfa'] ?? false ? 'block' : 'none' ?>">
|
||||
<?php
|
||||
$tfa = new \App\Libraries\Authenticator();
|
||||
$name = $obj['first_name'] ?? '';
|
||||
if ($obj['tfa'] && !empty($obj['tfa_secret'])) {
|
||||
$tfa_secret = $obj['tfa_secret'] ?? '';
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
} else {
|
||||
$tfa_secret = $tfa->createSecret();
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p><b><?= lang("App.profile_qrcode") ?></b></p>
|
||||
<img src="<?php echo $qrcode; ?>" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p><b><?= lang("App.profile_backup_code") ?></b></p>
|
||||
<?php
|
||||
$codes = "";
|
||||
if (!empty($obj['tfa_code'] ?? '')) {
|
||||
$codes = explode(',', $obj['tfa_code'] ?? '');
|
||||
foreach ($codes as $item) {
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $item . '</span>';
|
||||
}
|
||||
} else {
|
||||
$codes = array();
|
||||
for ($i = 1; $i <= 8; $i++) {
|
||||
$code = random_string('numeric', 6);
|
||||
$codes[] = $code;
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $code . '</span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="mt-2"><b><?= lang("App.profile_tfa_secret") ?></b><br><b
|
||||
class="text-primary"><?= $tfa_secret ?></b></p>
|
||||
<input type="hidden" id="tfa_secret" name="tfa_secret"
|
||||
value="<?= $tfa_secret ?>">
|
||||
<input type="hidden" id="tfa_code" name="tfa_code"
|
||||
value="<?= implode(',', $codes) ?>">
|
||||
<button type="button" class="btn btn-primary btn-block mt-2"
|
||||
onclick="download('<?= lang("App.profile_qrcode") ?>\n<?= implode(",", $codes) ?>\n<?= lang("App.profile_tfa_secret") ?>\n<?= $tfa_secret ?>','backup_codes.txt')">
|
||||
<i class="fas fa-download mr-1"></i> <?= lang("App.profile_tfa_download") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Required vendors -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/global/global.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/js/quixnav-init.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/js/custom.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/select2/js/select2.full.min.js") ?>">></script>
|
||||
<!-- Alert -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/toastr/js/toastr.min.js") ?>">></script>
|
||||
<!-- Date Range Picker -->
|
||||
<!-- momment js is must -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/moment/moment.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/bootstrap-daterangepicker/daterangepicker.js") ?>">></script>
|
||||
<!-- Material color picker -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js") ?>">></script>
|
||||
<!-- Form -->
|
||||
<script>
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
$('#first_name').focus();
|
||||
$("#country").select2();
|
||||
$("#language").select2();
|
||||
$('#date_birth').bootstrapMaterialDatePicker({
|
||||
format: '<?=momentDateJS()?>',
|
||||
time: false
|
||||
});
|
||||
});
|
||||
$('.file-upload').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#file').trigger('click');
|
||||
});
|
||||
|
||||
function download(text, filename) {
|
||||
let blob = new Blob([text], {type: "text/plain;charset=utf-8"});
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
}
|
||||
|
||||
function tfaView() {
|
||||
document.getElementById("sendFormTFA").submit();
|
||||
}
|
||||
</script>
|
||||
<?= sweetAlert() ?>
|
||||
@ -0,0 +1,291 @@
|
||||
<?php
|
||||
$session = session();
|
||||
$token = $session->get('token') ?? '';
|
||||
$tfa = $session->get('tfa') ?? false;
|
||||
$settings = $session->get('settings');
|
||||
|
||||
$picture = session()->get('picture');
|
||||
$pulse = session()->get('pulse');
|
||||
$notification = session()->get('notification');
|
||||
|
||||
if (!empty($token) && $tfa == false) {
|
||||
//echo "<script>window.location.href = '/'; </script>";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html
|
||||
lang="<?= $session->get('lang') ?>"
|
||||
class="h-100 light-style layout-navbar-fixed layout-menu-fixed"
|
||||
dir="ltr"
|
||||
data-theme="theme-default"
|
||||
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||
data-template="vertical-menu-template-no-customizer"
|
||||
>
|
||||
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
|
||||
/>
|
||||
|
||||
<title><?= lang("App.dashboard_title") ?> - <?= $settings['title'] ?? '' ?></title>
|
||||
|
||||
<meta name="description" content=""/>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="114x114"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="120x120"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="144x144"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="152x152"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="180x180"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="192x192"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="32x32"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="96x96"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="16x16"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
|
||||
<link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/demo.css') ?>"/>
|
||||
|
||||
|
||||
<!-- Vendors CSS -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
|
||||
|
||||
<!-- Page CSS -->
|
||||
<?= $this->renderSection('css') ?>
|
||||
|
||||
<!-- Helpers -->
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Layout wrapper -->
|
||||
<div class="layout-wrapper layout-content-navbar">
|
||||
<div class="layout-container">
|
||||
|
||||
<?php include "menu.php" ?>
|
||||
|
||||
<!-- Layout container -->
|
||||
<div class="layout-page">
|
||||
|
||||
<!-- Navbar -->
|
||||
<nav
|
||||
class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
|
||||
id="layout-navbar"
|
||||
>
|
||||
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
|
||||
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
|
||||
<i class="ti ti-menu-2 ti-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
|
||||
<div class="navbar-nav align-items-center">
|
||||
<a class="nav-link style-switcher-toggle hide-arrow" href="javascript:void(0);">
|
||||
<i class="ti ti-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="navbar-nav flex-row align-items-center ms-auto">
|
||||
|
||||
<!-- Notification -->
|
||||
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link dropdown-toggle hide-arrow"
|
||||
href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown"
|
||||
data-bs-auto-close="outside"
|
||||
aria-expanded="false"
|
||||
>
|
||||
<i class="ti ti-bell ti-md"></i>
|
||||
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ Notification -->
|
||||
|
||||
<!-- Language -->
|
||||
<li class="nav-item dropdown-language dropdown me-2 me-xl-0">
|
||||
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown">
|
||||
<i class="fi <?= getCurrentLanguageFlag(); ?> fis rounded-circle me-1 fs-3"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a class="dropdown-item" href="<?= site_url('lang/es'); ?>" data-language="es">
|
||||
<i class="fi fi-es fis rounded-circle me-1 fs-3"></i>
|
||||
<span class="align-middle"><?= lang("App.lang_es") ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="<?= site_url('lang/en'); ?>" data-language="en">
|
||||
<i class="fi fi-gb fis rounded-circle me-1 fs-3"></i>
|
||||
<span class="align-middle"><?= lang("App.lang_en") ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!--/ Language -->
|
||||
|
||||
<!-- User -->
|
||||
<li class="nav-item navbar-dropdown dropdown-user dropdown">
|
||||
<a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);"
|
||||
data-bs-toggle="dropdown">
|
||||
<div class="avatar">
|
||||
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
|
||||
</div>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="d-flex">
|
||||
<div class="flex-shrink-0 me-3">
|
||||
<div class="avatar avatar">
|
||||
<img src="<?= $picture ?? '' ?>" alt class="h-auto rounded-circle"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<span class="fw-semibold d-block"><?= $session->get('first_name') . ' ' . $session->get('first_name') ?></span>
|
||||
<small class="text-muted">Admin</small>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<div class="dropdown-divider"></div>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="<?= site_url('profile'); ?>">
|
||||
<i class="ti ti-user-check me-2 ti-sm"></i>
|
||||
<span class="align-middle"><?= lang("App.menu_profile") ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li>-->
|
||||
<!-- <a class="dropdown-item" href="#">-->
|
||||
<!-- <i class="ti ti-settings me-2 ti-sm"></i>-->
|
||||
<!-- <span class="align-middle">Settings</span>-->
|
||||
<!-- </a>-->
|
||||
<!-- </li>-->
|
||||
|
||||
<li>
|
||||
<div class="dropdown-divider"></div>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item" href="<?= site_url("login/logout") ?>">
|
||||
<i class="ti ti-logout me-2 ti-sm"></i>
|
||||
<span class="align-middle"><?= lang("App.menu_logout") ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!--/ User -->
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- / Navbar -->
|
||||
|
||||
<!-- Content wrapper -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content -->
|
||||
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Account Settings /</span> Account</h4>
|
||||
|
||||
<?= $this->renderSection('content') ?>
|
||||
|
||||
</div>
|
||||
<!-- / Content -->
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="content-footer footer bg-footer-theme">
|
||||
<div class="container-xxl">
|
||||
<div class="footer-container d-flex align-items-center justify-content-between py-2 flex-md-row flex-column">
|
||||
<div>
|
||||
<a href="#" target="_blank" class="fw-semibold">Safekat</a> © <?= date('Y'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- / Footer -->
|
||||
|
||||
<div class="content-backdrop fade"></div>
|
||||
</div>
|
||||
<!-- Content wrapper -->
|
||||
</div>
|
||||
<!-- / Layout page -->
|
||||
</div>
|
||||
|
||||
<!-- Overlay -->
|
||||
<div class="layout-overlay layout-menu-toggle"></div>
|
||||
|
||||
<!-- Drag Target Area To SlideIn Menu On Small Screens -->
|
||||
<div class="drag-target"></div>
|
||||
</div>
|
||||
<!-- / Layout wrapper -->
|
||||
|
||||
<?= $this->renderSection('footerAdditions') ?>
|
||||
|
||||
<!-- Core JS -->
|
||||
<!-- build:js assets/vendor/js/core.js -->
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- Vendors JS -->
|
||||
<?= $this->renderSection('additionalExternalJs') ?>
|
||||
|
||||
<!-- Main JS -->
|
||||
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>
|
||||
|
||||
<!-- Page JS -->
|
||||
<?= sweetAlert() ?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
<?= $this->renderSection('additionalInlineJs') ?>
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -10,7 +10,7 @@ $pulse = session()->get('pulse');
|
||||
$notification = session()->get('notification');
|
||||
|
||||
if (!empty($token) && $tfa == false) {
|
||||
echo "<script>window.location.href = '/'; </script>";
|
||||
//echo "<script>window.location.href = '/'; </script>";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user