158 lines
7.0 KiB
PHP
158 lines
7.0 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
|
<title>@yield('page-title')</title>
|
|
|
|
<!-- Custom fonts for this template-->
|
|
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
|
|
|
|
<!-- Custom styles for this template-->
|
|
<!-- <link rel="stylesheet" href="../assets/css/bootstrap.css"> -->
|
|
<link rel="stylesheet" href="{{ url('public/assets/libs/bootstrap/css/bootstrap5.3.2.css') }}">
|
|
<link rel="stylesheet" href="{{ url('public/assets/libs/ol/ol.css') }}" type="text/css">
|
|
<link rel="stylesheet" href="{{ url('public/assets/libs/ol/ol-ext.css') }}" />
|
|
<link rel="stylesheet" href="{{ url('public/assets/css/l4l.css') }}" rel="stylesheet">
|
|
<link rel="stylesheet" href="{{ url('public/assets/css/styles.css') }}" rel="stylesheet">
|
|
<link rel="stylesheet" href="{{ url('public/assets/libs/fontawesome-free-7.1.0-web/css/all.min.css') }}" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css">
|
|
<link rel="stylesheet" href="{{ url('public/assets/libs/jquery-confirm/jquery-confirm.min.css') }}" type="text/css">
|
|
|
|
@yield('page-css')
|
|
<script type="text/javascript">
|
|
var base_url = "{!! url('/') !!}";
|
|
</script>
|
|
</head>
|
|
@include('admin.partials.profile')
|
|
|
|
<!-- <body class="bg-gradient-primary"> -->
|
|
<body class="bg-light">
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-primary shadow-sm">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="/landing">LUPMIS4LUSPA</a>
|
|
<div class="ms-auto">
|
|
<div class="dropdown">
|
|
<button class="btn btn-light dropdown-toggle" type="button" id="userDropdown" data-bs-toggle="dropdown">
|
|
<span class="me-2"><?php echo ucfirst(session('current_user.username')); ?></span>
|
|
<!-- <small class="text-muted">Municipality</small> -->
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
<li><a class="dropdown-item profileLink" >Profile</a></li>
|
|
<li><a class="dropdown-item" href="/landing">Landing Page</a></li>
|
|
<li><a class="dropdown-item" href="#">Settings</a></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a class="dropdown-item" href="/user-logout">Logout</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
@yield('page-content')
|
|
<script src="{{ url('public/assets/libs/jquery-3.2.1.min.js') }}" type="text/javascript"></script>
|
|
<script src="{{ url('public/assets/libs/bootstrap/js/bootstrap5.3.2.js') }}"></script>
|
|
<script src="{{ url('public/assets/libs/ol/ol.js') }}" type="text/javascript" ></script> <!-- ol6.15.1 -->
|
|
<script src="{{ url('public/assets/libs/ol/ol-ext.js') }}" type="text/javascript" ></script>
|
|
<script src="{{ url('public/assets/libs/fontawesome-free-7.1.0-web/js/all.min.js') }}"></script>
|
|
<script src="{{ url('public/assets/libs/jquery-confirm/jquery-confirm.min.js') }}"></script>
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
$('.profileLink').click(function(evt){
|
|
evt.preventDefault();
|
|
$.ajax({
|
|
type: "GET",
|
|
url: base_url + '/users/getprofile',
|
|
processData: false,
|
|
contentType: false,
|
|
async: false,
|
|
success: function (data){
|
|
console.log(data);
|
|
if (data.code === 1) {
|
|
console.log(data['user_details']);
|
|
|
|
$('.userId').val(data['user_details']['user_id']);
|
|
$('.userName').val(data['user_details']['username']);
|
|
$('.userFullName').val(data['user_details']['full_name']);
|
|
$('.userEmail').val(data['user_details']['email']);
|
|
$('.userPhone').val(data['user_details']['phone']);
|
|
$('.userDesignation').val(data['user_details']['ua_position']);
|
|
$('.userDateAdded').val(data['user_details']['created_date']);
|
|
// $('.userEmail').val(data['user_details']['email']);
|
|
$('#profileModal').modal('show');
|
|
|
|
|
|
}
|
|
else if (data.code > 1) {
|
|
$.alert({
|
|
title: 'Alert!',
|
|
content: data.msg,
|
|
});
|
|
}
|
|
else {
|
|
$.alert({
|
|
title: 'Alert!',
|
|
content: 'Your request could not be handled. Try again !',
|
|
});
|
|
|
|
}
|
|
}
|
|
});
|
|
|
|
});
|
|
$('#profileModalSubmitBtnQQ').click(function(evt){
|
|
evt.preventDefault(evt);
|
|
|
|
$('#successArea').addClass('d-none');
|
|
$('#errorsArea').removeClass('d-none');
|
|
var formData = new FormData($('#userProfileForm')[0]);
|
|
$.ajax({
|
|
url: base_url + '/profileupdate',
|
|
type: 'POST',
|
|
data: formData,
|
|
processData: false,
|
|
contentType: false,
|
|
beforeSend: function() {
|
|
$('#successArea').text("");
|
|
$('#successArea').text("Please wait ... profile update in progress!");
|
|
},
|
|
success: function(data) {
|
|
if (data['success'] == true) {
|
|
$('#successArea').removeClass('d-none');
|
|
$('#errorsArea').addClass('d-none');
|
|
|
|
$('#successArea').text("");
|
|
$('#successArea').text("Profile successfully updated!");
|
|
// location.reload();
|
|
setTimeout(function() {
|
|
//location.reload(); // Reloads the current page
|
|
}, 1500);
|
|
}
|
|
else{
|
|
$('#successArea').addClass('d-none');
|
|
$('#errorArea').removeClass('d-none');
|
|
$('#errorArea').text("");
|
|
$('#errorArea').text("Profile could not be update!");
|
|
}
|
|
},
|
|
error: function(xhr, status, error) {
|
|
console.error('Error:', error);
|
|
$('#successArea').text(error);
|
|
$('#successArea').text(error);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
@yield('page-js')
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|