Compare commits

...

5 Commits

Author SHA1 Message Date
d0f1607632 commit jun 24 2024-06-24 09:42:54 +02:00
6e1ecbc485 jun 24 2024-06-24 07:52:54 +02:00
4cf0c7bcb9 jun 20 2024-06-20 08:55:52 +02:00
f076d20a62 jun 19 2024-06-19 12:29:37 +02:00
5af38630ff jun 19 2024-06-19 10:58:42 +02:00
147 changed files with 1658 additions and 303 deletions

25
about.php Normal file → Executable file
View File

@@ -116,19 +116,36 @@
</ul>
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
@@ -579,7 +596,9 @@
// Get the button
let mybutton = document.getElementById("scrollToTopBtn");
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {

316
add_user.php Normal file
View File

@@ -0,0 +1,316 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.rtl.min.css" integrity="sha384-gXt9imSW0VcJVHezoNQsP+TNrjYXoGcrqBZJpry9zJt8PCQjobwmhMGaDHTASo9N" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://kit.fontawesome.com/4bb6479073.js" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<title>Globaly - Full Cycle Business Management & Consulting Responsive WordPress Theme</title>
<style>
#generate-password {
top: 40%;
right: 50px;
position: absolute;
cursor: pointer;
}
.fa-solid {
position: absolute;
right: 3%;
top: 41%;
cursor: pointer;
}
#pswd_info {
position: absolute;
bottom: 25%;
bottom: -115px\9;
/* IE Specific */
right: 1%;
width: 400px;
padding: 15px;
background: #fefefe;
font-size: .875em;
border-radius: 5px;
box-shadow: 0 1px 3px #ccc;
border: 1px solid #ddd;
}
#pswd_info {
display: none;
}
#pswd_info h4 {
margin: 0 0 10px 0;
padding: 0;
font-weight: normal;
}
#pswd_info::before {
content: "\25B2";
position: absolute;
top: -12px;
left: 45%;
font-size: 14px;
line-height: 14px;
color: #ddd;
text-shadow: none;
display: block;
}
.invalid {
padding-left: 22px;
line-height: 24px;
color: #ec3f41;
}
.valid {
padding-left: 22px;
line-height: 24px;
color: #3a7d34;
}
@media screen and (min-width: 768px) {
.fa-solid {
top: 41%;
}
#pswd_info {
bottom: 35%;
right: 30%;
}
}
@media screen and (min-width: 992px) {
.fa-solid {
top: 40%;
}
#pswd_info {
bottom: 15%;
right: 38%;
}
}
.date-container {
width: 100%;
display: flex;
span {
margin-right: 20px;
}
}
</style>
</head>
<body>
<div class="form d-flex flex-column align-items-center justify-content-center my-md-5 mb-5 mb-lg-0">
<div class="headline-card d-flex flex-column align-items-center justify-content-center mt-4">
<h2>Add new user</h2>
<img class="line-img" src="assets/images/line.png" alt="">
</div>
<form action="php/add_user_register.php" method="post">
<div class="form-container-bot d-flex flex-column align-items-start justify-content-center">
<input class="input-text" type="text" placeholder="User's Name" name="name">
<input class="input-text" type="text" placeholder="User's Surname" name="surname">
<input class="input-text" type="text" placeholder="User's Email" name="email">
<input class="input-text" type="password" id="password" placeholder="Password" name="password">
<i id="togglePassword" class="fa-solid fa-eye"></i>
<p id="generate-password">generete</p>
<input class="input-text" type="password" id="confirm-password" placeholder="Confirm Password" name="password_again">
<input class="input-text" type="text" placeholder="User's City" name="city">
<h6>Date of birth:</h6>
<div class="date-container">
<span>
<select name="birth_day">
<?php
$start_date = 1;
$end_date = 31;
for ($j = $start_date; $j <= $end_date; $j++) {
echo '<option value=' . $j . '>' . $j . '</option>';
}
?>
</select>
</span>
<span>
<select name="birth_month">
<?php for ($m = 1; $m <= 12; ++$m) {
$month_label = date('F', mktime(0, 0, 0, $m, 1));
?>
<option value="<?php echo $month_label; ?>"><?php echo $month_label; ?></option>
<?php } ?>
</select>
</span>
<span>
<select name="birth_year">
<?php
$year = date('Y');
$min = $year - 100;
$max = $year;
for ($i = $max; $i >= $min; $i--) {
echo '<option value=' . $i . '>' . $i . '</option>';
}
?>
</select>
</span>
<div class="checkbox-container">
Administrator:
<input type="checkbox" id="exampleCheckbox" name="admin">
<input type="hidden" id="exampleCheckboxValue" name="admin" value="0">
</div>
</div>
<input class="view-more" type="submit" value="Add user">
</div>
</form>
<div id="pswd_info">
<h4>Password must meet the following requirements:</h4>
<ul>
<li id="letter" class="invalid">At least <strong>one letter</strong></li>
<li id="capital" class="invalid">At least <strong>one capital letter</strong></li>
<li id="number" class="invalid">At least <strong>one number</strong></li>
<li id="character" class="invalid">At least <strong>one special character</strong></li>
<li id="length" class="invalid">Be at least <strong>8 characters</strong></li>
</ul>
</div>
<a href="admin_panel.php"><input class="view-more" type="submit" value="Back"></a>
<script>
$(document).ready(function() {
// Function to validate password
function validatePassword() {
var pswd = $('#password').val();
// Validate the length
if (pswd.length < 8) {
$('#length').removeClass('valid').addClass('invalid');
} else {
$('#length').removeClass('invalid').addClass('valid');
}
// Validate letter
if (pswd.match(/[A-Za-z]/)) {
$('#letter').removeClass('invalid').addClass('valid');
} else {
$('#letter').removeClass('valid').addClass('invalid');
}
// Calidate Capital letter
if (pswd.match(/[A-Z]/)) {
$('#capital').removeClass('invalid').addClass('valid');
} else {
$('#capital').removeClass('valid').addClass('invalid');
}
// Validate Number
if (pswd.match(/[0-9]/)) {
$('#number').removeClass('invalid').addClass('valid');
} else {
$('#number').removeClass('valid').addClass('invalid');
}
// Validate special character
if (pswd.match(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/)) {
$('#character').removeClass('invalid').addClass('valid');
} else {
$('#character').removeClass('valid').addClass('invalid');
}
}
// Bind events
$('#password').on('keyup focus blur', function() {
$('#pswd_info').show();
validatePassword();
});
$('#password').blur(function() {
$('#pswd_info').hide();
});
// Toggle Password show
$("#togglePassword").removeClass("fa-solid fa-eye").addClass("fa-solid fa-eye-slash");
$("#togglePassword").click(function() {
const passwordInput = $("#password");
const type = passwordInput.attr("type");
if (type === "password") {
passwordInput.attr("type", "text");
$("#togglePassword").removeClass("fa-solid fa-eye-slash").addClass("fa-solid fa-eye");
} else {
passwordInput.attr("type", "password");
$("#togglePassword").removeClass("fa-solid fa-eye").addClass("fa-solid fa-eye-slash");
}
});
$('#generate-password').click(function() {
const password = generatePassword(8);
$('#password').val(password);
$('#confirm-password').val(password);
});
function generatePassword(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+[]{}|;:,.<>?';
let password = '';
do {
password = '';
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
password += characters[randomIndex];
}
} while (!isPasswordValid(password));
return password;
}
function isPasswordValid(password) {
if (password.length < 8) {
return false;
}
if (!/[a-z]/.test(password)) {
return false;
}
if (!/[A-Z]/.test(password)) {
return false;
}
if (!/\d/.test(password)) {
return false;
}
if (!/[!@#$%^&*()_+[\]{}|;:,.<>?]/.test(password)) {
return false;
}
return true;
}
function updateCheckboxValue() {
const isChecked = $('#exampleCheckbox').is(':checked');
$('#exampleCheckboxValue').val(isChecked ? '1' : '0');
}
$('#exampleCheckbox').change(function() {
updateCheckboxValue();
});
updateCheckboxValue();
});
</script>
</body>
</html>

179
admin_panel.php Normal file
View File

@@ -0,0 +1,179 @@
<?php
require 'php/connect.inc.php';
$con = mysqli_connect($mysql_host, $mysql_user, $mysql_pass);
if (mysqli_select_db($con, $mysql_db)) {
// Check if delete request is made
if (isset($_POST['delete_email'])) {
$delete_email = $_POST['delete_email'];
$delete_query = "DELETE FROM `globaly_accounts` WHERE `email` = '".mysqli_real_escape_string($con, $delete_email)."'";
mysqli_query($con, $delete_query);
}
$query = "SELECT `name`, `surname`, `email`, `birth_day`, `birth_month`, `birth_year`, `city` FROM `globaly_accounts`";
$query_run = mysqli_query($con, $query);
if (mysqli_num_rows($query_run) > 0) {
echo '<table border="1">
<tr>
<th>Name</th>
<th>Surname</th>
<th>Email</th>
<th>Birth Date</th>
<th>City</th>
<th>Edit</th>
</tr>';
while ($query_row = mysqli_fetch_assoc($query_run)) {
$name = $query_row['name'];
$surname = $query_row['surname'];
$email = $query_row['email'];
$birth_date = $query_row['birth_day'] . '.' . $query_row['birth_month'] . '.' . $query_row['birth_year'] . '.';
$city = $query_row['city'];
echo '<tr>
<td>' . htmlspecialchars($name) . '</td>
<td>' . htmlspecialchars($surname) . '</td>
<td>' . htmlspecialchars($email) . '</td>
<td>' . htmlspecialchars($birth_date) . '</td>
<td>' . htmlspecialchars($city) . '</td>
<td id="edit-td">
<form id="delete-form" method="POST" action="">
<input type="hidden" name="delete_email" value="' . htmlspecialchars($email) . '">
<button id="delete-btn" type="submit"><i class="fa-regular fa-circle-xmark"></i></button>
</form>
<a id="edit-user" href="edit-user.php?name=' . urlencode($name) . '&surname=' . urlencode($surname) . '&email=' . urlencode($email) . '&birth_day=' . urlencode($query_row['birth_day']) . '&birth_month=' . urlencode($query_row['birth_month']) . '&birth_year=' . urlencode($query_row['birth_year']) . '&city=' . urlencode($query_row['city']) . '"><i class="fa-solid fa-user-pen"></i></a>
</td>
</tr>';
}
echo '</table>';
} else {
echo 'No results found.';
}
} else {
echo 'Database selection failed.';
}
mysqli_close($con);
?>
<style>
body{
display: flex;
flex-direction: column;
align-items: center;
justify-content: start;
background-image: url('assets/images/image10.jpg');
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#edit-td{
display: flex;
}
#delete-btn{
background: transparent;
border: none;
font-size: 25px;
}
#delete-form{
margin-bottom: 0px;
}
#edit-user{
color: black;
}
.fa-regular{
cursor: pointer;
}
.fa-regular:hover{
color: red;
transition: 0.2s;
}
.fa-solid{
cursor: pointer;
}
.fa-solid:hover{
color: green;
transition: 0.2s;
}
h2{
color: #15c1cb;
font-size: 15px;
}
table {
font-size: 8px;
width: fit-content;
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
background-color: #f2f2f2;
}
th, td {
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
color: #15c1cb;
}
#btn-back{
margin-top:30px;
}
@media screen and (min-width:768px) {
body{
justify-content: center;
}
table{
font-size: 17px;
}
h2{
font-size: 40px;
}
}
@media screen and (min-width:992px) {
body{
justify-content: center;
}
table{
font-size: 25px;
}
h2{
font-size: 40px;
}
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search people</title>
<link rel="stylesheet" href="style/style.css">
<script src="https://kit.fontawesome.com/4bb6479073.js" crossorigin="anonymous"></script>
</head>
<body>
<div id="btn-back">
<a href="index.php"><input class="view-more" type="submit" value="Back"></a>
<a href="add_user.php"><input class="view-more" type="submit" value="Add user"></a>
</div>
</body>
</html>

0
assets/fonts/Lato-Bold.ttf Normal file → Executable file
View File

0
assets/fonts/Lato-Regular.ttf Normal file → Executable file
View File

0
assets/fonts/Merriweather-Regular.ttf Normal file → Executable file
View File

0
assets/fonts/MerriweatherSans-Regular.ttf Normal file → Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 MiB

0
assets/images/fakeimg.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
assets/images/footer-logo.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 884 B

0
assets/images/icon1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 574 B

0
assets/images/icon2.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 698 B

After

Width:  |  Height:  |  Size: 698 B

0
assets/images/icon3.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 610 B

After

Width:  |  Height:  |  Size: 610 B

0
assets/images/icon4.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 940 B

0
assets/images/image1.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

0
assets/images/image10.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

0
assets/images/image2-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

0
assets/images/image30.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 345 KiB

After

Width:  |  Height:  |  Size: 345 KiB

0
assets/images/image32.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB

0
assets/images/image33.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

0
assets/images/image37.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

0
assets/images/image38.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

0
assets/images/image39.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

0
assets/images/image40.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
assets/images/image41-130x136.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

0
assets/images/image41-560x350.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
assets/images/image41-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

0
assets/images/image41.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 258 KiB

0
assets/images/image42-560x350.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
assets/images/image42-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

0
assets/images/image42.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 191 KiB

0
assets/images/image43-560x350.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
assets/images/image43-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
assets/images/image43.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

0
assets/images/image44.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

0
assets/images/image5-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

0
assets/images/image5.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

0
assets/images/image6-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

0
assets/images/image7-640x506.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

0
assets/images/line.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 81 B

After

Width:  |  Height:  |  Size: 81 B

0
assets/images/line2_03.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 38 B

After

Width:  |  Height:  |  Size: 38 B

0
assets/images/logo.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

0
assets/images/logo01-1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 598 B

After

Width:  |  Height:  |  Size: 598 B

0
assets/images/logo02-1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
assets/images/logo03-1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

0
assets/images/logo04-1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
assets/images/logo05-1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
assets/images/logo06-1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

0
assets/images/num1.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 460 B

0
assets/images/num2.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 978 B

0
assets/images/num3.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
assets/images/team1.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
assets/images/team10.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

0
assets/images/team11.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

0
assets/images/team12.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

0
assets/images/team2.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

0
assets/images/team3.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

0
assets/images/team4.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
assets/images/team5.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

0
assets/images/team6.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

0
assets/images/team7.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
assets/images/team8.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

0
assets/images/team9.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

0
assets/images/test1_03.webp Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
assets/images/test2_03.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

26
cases.php Normal file → Executable file
View File

@@ -94,20 +94,36 @@
</ul>
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
@@ -355,7 +371,9 @@
// Get the button
let mybutton = document.getElementById("scrollToTopBtn");
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {

26
contacts.php Normal file → Executable file
View File

@@ -94,20 +94,36 @@
</ul>
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
@@ -254,7 +270,9 @@
// Get the button
let mybutton = document.getElementById("scrollToTopBtn");
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {

335
edit-user.php Normal file
View File

@@ -0,0 +1,335 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.rtl.min.css" integrity="sha384-gXt9imSW0VcJVHezoNQsP+TNrjYXoGcrqBZJpry9zJt8PCQjobwmhMGaDHTASo9N" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://kit.fontawesome.com/4bb6479073.js" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<title>Globaly - Full Cycle Business Management & Consulting Responsive WordPress Theme</title>
<style>
#generate-password {
top: 40%;
right: 50px;
position: absolute;
cursor: pointer;
}
.fa-solid {
position: absolute;
right: 3%;
top: 41%;
cursor: pointer;
}
#pswd_info {
position: absolute;
bottom: 25%;
bottom: -115px\9;
/* IE Specific */
right: 1%;
width: 400px;
padding: 15px;
background: #fefefe;
font-size: .875em;
border-radius: 5px;
box-shadow: 0 1px 3px #ccc;
border: 1px solid #ddd;
}
#pswd_info {
display: none;
}
#pswd_info h4 {
margin: 0 0 10px 0;
padding: 0;
font-weight: normal;
}
#pswd_info::before {
content: "\25B2";
position: absolute;
top: -12px;
left: 45%;
font-size: 14px;
line-height: 14px;
color: #ddd;
text-shadow: none;
display: block;
}
.invalid {
padding-left: 22px;
line-height: 24px;
color: #ec3f41;
}
.valid {
padding-left: 22px;
line-height: 24px;
color: #3a7d34;
}
@media screen and (min-width: 768px) {
.fa-solid {
top: 41%;
}
#pswd_info {
bottom: 35%;
right: 30%;
}
}
@media screen and (min-width: 992px) {
.fa-solid {
top: 40%;
}
#pswd_info {
bottom: 15%;
right: 38%;
}
}
.date-container {
width: 100%;
display: flex;
span {
margin-right: 20px;
}
}
</style>
</head>
<?php
require 'php/connect.inc.php';
$name = htmlspecialchars($_GET['name']);
$surname = htmlspecialchars($_GET['surname']);
$email = htmlspecialchars($_GET['email']);
$birth_day = htmlspecialchars($_GET['birth_day']);
$birth_month = htmlspecialchars($_GET['birth_month']);
$birth_year = htmlspecialchars($_GET['birth_year']);
$city = htmlspecialchars($_GET['city']);
?>
<body>
<div class="form d-flex flex-column align-items-center justify-content-center my-md-5 mb-5 mb-lg-0">
<div class="headline-card d-flex flex-column align-items-center justify-content-center mt-4">
<h2>Edit user</h2>
<img class="line-img" src="assets/images/line.png" alt="">
</div>
<form action="php/update-user.php" method="post">
<div class="form-container-bot d-flex flex-column align-items-start justify-content-center">
<input class="input-text" type="text" name="name" value="<?php echo $name; ?>">
<input class="input-text" type="text" name="surname" value="<?php echo $surname; ?>">
<input class="input-text" type="text" name="email" value="<?php echo $email; ?>">
<input class="input-text" type="password" id="password" placeholder="Password" name="password">
<i id="togglePassword" class="fa-solid fa-eye"></i>
<p id="generate-password">generate</p>
<input class="input-text" type="password" id="confirm-password" placeholder="Confirm Password" name="password_again">
<input class="input-text" type="text" name="city" value="<?php echo $city; ?>">
<h6>Date of birth:</h6>
<div class="date-container">
<span>
<select name="birth_day">
<?php
$start_date = 1;
$end_date = 31;
for ($j = $start_date; $j <= $end_date; $j++) {
$selected = ($j == $birth_day) ? 'selected' : '';
echo '<option value="' . $j . '" ' . $selected . '>' . $j . '</option>';
}
?>
</select>
</span>
<span>
<select name="birth_month">
<?php
for ($m = 1; $m <= 12; ++$m) {
$month_label = date('F', mktime(0, 0, 0, $m, 1));
$selected = ($month_label == $birth_month) ? 'selected' : '';
echo '<option value="' . $month_label . '" ' . $selected . '>' . $month_label . '</option>';
}
?>
</select>
</span>
<span>
<select name="birth_year">
<?php
$year = date('Y');
$min = $year - 100;
$max = $year;
for ($i = $max; $i >= $min; $i--) {
$selected = ($i == $birth_year) ? 'selected' : '';
echo '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>';
}
?>
</select>
</span>
<div class="checkbox-container">
Administrator:
<input type="checkbox" id="exampleCheckbox" name="admin">
<input type="hidden" id="exampleCheckboxValue" name="admin" value="0">
</div>
</div>
<input class="view-more" type="submit" value="Edit user">
</div>
</form>
<div id="pswd_info">
<h4>Password must meet the following requirements:</h4>
<ul>
<li id="letter" class="invalid">At least <strong>one letter</strong></li>
<li id="capital" class="invalid">At least <strong>one capital letter</strong></li>
<li id="number" class="invalid">At least <strong>one number</strong></li>
<li id="character" class="invalid">At least <strong>one special character</strong></li>
<li id="length" class="invalid">Be at least <strong>8 characters</strong></li>
</ul>
</div>
<a href="admin_panel.php"><input class="view-more" type="submit" value="Back"></a>
<script>
$(document).ready(function() {
// Function to validate password
function validatePassword() {
var pswd = $('#password').val();
// Validate the length
if (pswd.length < 8) {
$('#length').removeClass('valid').addClass('invalid');
} else {
$('#length').removeClass('invalid').addClass('valid');
}
// Validate letter
if (pswd.match(/[A-Za-z]/)) {
$('#letter').removeClass('invalid').addClass('valid');
} else {
$('#letter').removeClass('valid').addClass('invalid');
}
// Calidate Capital letter
if (pswd.match(/[A-Z]/)) {
$('#capital').removeClass('invalid').addClass('valid');
} else {
$('#capital').removeClass('valid').addClass('invalid');
}
// Validate Number
if (pswd.match(/[0-9]/)) {
$('#number').removeClass('invalid').addClass('valid');
} else {
$('#number').removeClass('valid').addClass('invalid');
}
// Validate special character
if (pswd.match(/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/)) {
$('#character').removeClass('invalid').addClass('valid');
} else {
$('#character').removeClass('valid').addClass('invalid');
}
}
// Bind events
$('#password').on('keyup focus blur', function() {
$('#pswd_info').show();
validatePassword();
});
$('#password').blur(function() {
$('#pswd_info').hide();
});
// Toggle Password show
$("#togglePassword").removeClass("fa-solid fa-eye").addClass("fa-solid fa-eye-slash");
$("#togglePassword").click(function() {
const passwordInput = $("#password");
const type = passwordInput.attr("type");
if (type === "password") {
passwordInput.attr("type", "text");
$("#togglePassword").removeClass("fa-solid fa-eye-slash").addClass("fa-solid fa-eye");
} else {
passwordInput.attr("type", "password");
$("#togglePassword").removeClass("fa-solid fa-eye").addClass("fa-solid fa-eye-slash");
}
});
$('#generate-password').click(function() {
const password = generatePassword(8);
$('#password').val(password);
$('#confirm-password').val(password);
});
function generatePassword(length) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+[]{}|;:,.<>?';
let password = '';
do {
password = '';
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * characters.length);
password += characters[randomIndex];
}
} while (!isPasswordValid(password));
return password;
}
function isPasswordValid(password) {
if (password.length < 8) {
return false;
}
if (!/[a-z]/.test(password)) {
return false;
}
if (!/[A-Z]/.test(password)) {
return false;
}
if (!/\d/.test(password)) {
return false;
}
if (!/[!@#$%^&*()_+[\]{}|;:,.<>?]/.test(password)) {
return false;
}
return true;
}
function updateCheckboxValue() {
const isChecked = $('#exampleCheckbox').is(':checked');
$('#exampleCheckboxValue').val(isChecked ? '1' : '0');
}
$('#exampleCheckbox').change(function() {
updateCheckboxValue();
});
updateCheckboxValue();
});
</script>
</body>
</html>

59
index.php Normal file → Executable file
View File

@@ -21,7 +21,6 @@
</head>
<style>
.slick-carousel .first-part {
min-height: 65vh;
background-size: cover;
@@ -64,6 +63,7 @@
min-height: 78vh;
}
.textbox {
margin-top: 120px;
}
@@ -196,19 +196,38 @@
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
<nav class="menu d-flex d-md-none justify-content-center align-items-center w-100 " style="background-color: white; height: 68px;">
@@ -290,40 +309,6 @@
<section>
<!-- first part -->
<!-- <div class="slick-carousel" id="first-part-home" >
<div>
<div class="textbox mx-md-3 mx-lg-3 mx-0 d-flex flex-column justify-content-start align-items-center">
<h2 class="h2-first">Full Cycle Business Management</h2>
<p style="text-align: center; padding: 0 30px;">
Whether your company looks for a financial consulting, investment risks assessments or an interim, HR
management, were ready to provide that for you.We have a proven expertise in any process, that a modern day
business lives and works through.
</p>
<input class="read-more" type="submit" value="read more">
</div>
</div>
<div>
<div class="textbox mx-md-3 mx-lg-3 mx-0 d-flex flex-column justify-content-start align-items-center">
<h2 class="h2-first">Financial Consulting Services</h2>
<p style="text-align: center; padding: 0 30px;">
Our team provides expert financial consulting to help your business make informed decisions and achieve its goals.
</p>
<input class="read-more" type="submit" value="read more">
</div>
</div>
<div>
<div class="textbox mx-md-3 mx-lg-3 mx-0 d-flex flex-column justify-content-start align-items-center">
<h2 class="h2-first">Investment Risk Assessment</h2>
<p style="text-align: center; padding: 0 30px;">
We assess investment risks thoroughly to ensure your investments are safe and profitable.
</p>
<input class="read-more" type="submit" value="read more">
</div>
</div>
</div> -->
<div class="slick-carousel d-flex justify-content-start align-items-center">
<div class="first-part">
<div class="textbox mx-md-3 mx-lg-3 mx-0 d-flex flex-column justify-content-start align-items-center">

0
login.html Normal file → Executable file
View File

26
news.php Normal file → Executable file
View File

@@ -95,20 +95,36 @@
</ul>
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
@@ -584,7 +600,9 @@
// Get the button
let mybutton = document.getElementById("scrollToTopBtn");
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {

63
people.php Normal file → Executable file
View File

@@ -104,17 +104,17 @@
if (!empty($search_text)) {
$con = mysqli_connect($mysql_host, $mysql_user, $mysql_pass);
if (mysqli_select_db($con, $mysql_db)) {
$query = "SELECT `name`, `surname` FROM `globaly_accounts` WHERE `name` LIKE '" . mysqli_real_escape_string($con, $search_text) . "%'";
$query_run = mysqli_query($con, $query);
while ($query_row = mysqli_fetch_assoc($query_run)) {
$name = $query_row['name'];
echo $name . ' ' .$query_row['surname'] . '<br>' ;
$surname = $query_row['surname'];
echo '<a href="search_people.php?name=' . urlencode($name) . '&surname=' . urlencode($surname) . '">' . $name . ' ' . $surname . '</a><br>';
}
}
}
?>
<body>
@@ -149,7 +149,7 @@
</a>
</li>
</ul>
<div class="form-container">
<!-- <div class="form-container">
<form class="form-search d-flex align-items-center d-sm-flex justify-content-sm-between mb-0" role="search">
<input id="src-input" class="form-control rounded-0 border-0" type="search" placeholder="Search ..." name="search_text" onkeyup="findmatch();">
<button class="btn" type="submit" style="padding-bottom: 0px;padding-top: 0px;">
@@ -158,7 +158,16 @@
</span>
</button>
</form>
</div> -->
<div class="form-container">
<form id="searchForm" class="form-search d-flex align-items-center d-sm-flex justify-content-sm-between mb-0" role="search" onsubmit="return redirectToSearchPeople();">
<input id="src-input" class="form-control rounded-0 border-0" type="search" placeholder="Search ..." name="search_text">
<button class="btn" type="submit" style="padding-bottom: 0px; padding-top: 0px;">
<span class="material-icons pt-1">search</span>
</button>
</form>
</div>
</nav>
<!-- header -->
@@ -216,20 +225,36 @@
</ul>
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
@@ -359,8 +384,8 @@
<div class="card4 d-flex align-items-center justify-content-center flex-column mb-4">
<img class="img-fourth-au" src="assets/images/team3.jpg" alt="">
<div class="card-text4 d-flex align-items-center justify-content-start flex-column">
<h4 class="h4-fourth"><?php echo $data[3]['name'] . ' ' . $data[3]['surname']; ?></h4>
<p class="p-fourth"><?php echo $data[3]['email'] . '<br>' . $data[3]['birth_day'] . '.' . $data[3]['birth_month'] . '.' . $data[3]['birth_year'] . '.'; ?></p>
<h4 class="h4-fourth"><?php echo $data[11]['name'] . ' ' . $data[11]['surname']; ?></h4>
<p class="p-fourth"><?php echo $data[11]['email'] . '<br>' . $data[11]['birth_day'] . '.' . $data[11]['birth_month'] . '.' . $data[11]['birth_year'] . '.'; ?></p>
</div>
</div>
</div>
@@ -386,8 +411,8 @@
<div class="card4 d-flex align-items-center justify-content-center flex-column mb-4">
<img class="img-fourth-au" src="assets/images/team6.jpg" alt="">
<div class="card-text4 d-flex align-items-center justify-content-start flex-column">
<h4 class="h4-fourth"><?php echo $data[6]['name'] . ' ' . $data[6]['surname']; ?></h4>
<p class="p-fourth"><?php echo $data[6]['email'] . '<br>' . $data[6]['birth_day'] . '.' . $data[6]['birth_month'] . '.' . $data[6]['birth_year'] . '.'; ?></p>
<h4 class="h4-fourth"><?php echo $data[15]['name'] . ' ' . $data[15]['surname']; ?></h4>
<p class="p-fourth"><?php echo $data[15]['email'] . '<br>' . $data[15]['birth_day'] . '.' . $data[15]['birth_month'] . '.' . $data[15]['birth_year'] . '.'; ?></p>
</div>
</div>
</div>
@@ -408,10 +433,11 @@
</thead>
<tbody>
<?php
for ($id = 7; $id <= max(array_keys($data)); $id++) {
$maxId = max(array_keys($data));
for ($id = 7; $id <= $maxId; $id++) {
if (isset($data[$id])) {
echo "<tr>";
// Combine key and value for birth date into a formatted string
$birthDate = "{$data[$id]['birth_day']}.{$data[$id]['birth_month']}.{$data[$id]['birth_year']}.";
echo "<td class='td-others'>{$data[$id]['name']}</td>";
@@ -419,13 +445,12 @@
echo "<td class='td-others'>{$data[$id]['email']}</td>";
echo "<td class='td-others'>$birthDate</td>";
echo "</tr>";
} else {
echo "<tr><td colspan='4'>No data found for ID $id</td></tr>";
}
}
?>
</tbody>
</table>
</div>
</div>
@@ -482,6 +507,14 @@
xmlhttp.send();
}
function redirectToSearchPeople() {
const searchText = document.getElementById('src-input').value;
if (searchText.trim() !== "") {
window.location.href = 'search_people.php?search_text=' + encodeURIComponent(searchText);
}
return false; // Prevent the form from submitting the traditional way
}
</script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>

67
php/add_user_register.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
require 'connect.inc.php';
require 'core.inc.php';
if (
isset($_POST['name']) && isset($_POST['surname']) && isset($_POST['email'])
&& isset($_POST['password']) && isset($_POST['password_again']) && isset($_POST['birth_day'])
&& isset($_POST['birth_month']) && isset($_POST['birth_year']) && isset($_POST['city']) && isset($_POST['admin'])
) {
$admin = $_POST['admin'];
$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$password = $_POST['password'];
$password_again = $_POST['password_again'];
$password_hash = md5($password);
$birth_day = $_POST['birth_day'];
$birth_month = $_POST['birth_month'];
$birth_year = $_POST['birth_year'];
$city = $_POST['city'];
if (
!empty($name) && !empty($password) && !empty($password_again) && isset($admin)&&
!empty($email) && !empty($birth_day) && !empty($birth_month) && !empty($birth_year) && !empty($city)
) {
if (strlen($name) > 30) {
echo 'Please ahear to maxlength of fields';
} elseif (preg_match("/\d/", $name) || preg_match("/\W/", $name)) {
echo 'Your name must contains only letters!';
} else {
if ($password != $password_again) {
echo 'Passwords do not match';
} elseif (strlen($password) < 8) {
echo 'Password is weak!';
} elseif (!preg_match("/\d/", $password)) {
echo 'Password must have one number at least!';
} elseif (!preg_match("#[A-Z]+#", $password)) {
echo 'Password must have one capital letter at least!';
} elseif (!preg_match("#[a-z]+#", $password)) {
echo 'Password must have one letter at least!';
} elseif (!preg_match("/\W/", $password)) {
echo 'Password must have one special carachter at least!';
} else {
$query = "SELECT `email` FROM `globaly_accounts` WHERE `email` ='$email'";
$query_run = mysqli_query($con, $query);
if (mysqli_num_rows($query_run) == 1) {
echo 'The email ' . $email . 'already exists';
} else {
$query = "INSERT INTO `globaly_accounts` VALUES (NULL ,'" . mysqli_real_escape_string($con, $name) .
"','" . mysqli_real_escape_string($con, $surname) . "','" . mysqli_real_escape_string($con, $email) . "','" . mysqli_real_escape_string($con, $password_hash) . "','" . mysqli_real_escape_string($con, $city) . "','" .
mysqli_real_escape_string($con, $birth_day) . "','" . mysqli_real_escape_string($con, $birth_month) . "','" . mysqli_real_escape_string($con, $birth_year) . "','" . mysqli_real_escape_string($con, $admin) ."')";
if ($query_run = mysqli_query($con, $query)) {
echo '<script type="text/javascript">
alert("You have successfully added the user!");
window.location.href = "../add_user.php";
</script>';
} else {
echo 'We could not register you!';
}
}
}
}
} else {
echo 'All fields are required';
}
}

0
php/connect.inc.php Normal file → Executable file
View File

23
php/core.inc.php Normal file → Executable file
View File

@@ -1,4 +1,5 @@
<?php
ob_start();
session_start();
$current_file = $_SERVER['SCRIPT_FILENAME'];
@@ -15,6 +16,28 @@ function loggedin(){
}
}
function is_admin(){
include 'connect.inc.php';
if (isset($_SESSION['user_id'])) {
$user_id = $_SESSION['user_id'];
$query = "SELECT `admin` FROM `globaly_accounts` WHERE `id` = $user_id";
if ($query_run = mysqli_query($con, $query)) {
$row = mysqli_fetch_assoc($query_run);
$admin = $row['admin'];
if($admin == 1) {
return true;
} else{
return false;
}
} else {
echo 'query run problem';
}
} else {
echo 'no user loged in ';
}
}
function getuserfield($field){
global $con;
$query = "SELECT `$field` FROM `globaly_accounts` WHERE `id`= '" . $_SESSION['user_id']. "'";

0
php/index_loged.php Normal file → Executable file
View File

0
php/login.php Normal file → Executable file
View File

0
php/logout.php Normal file → Executable file
View File

9
php/register.php Normal file → Executable file
View File

@@ -6,7 +6,7 @@ if (!loggedin()) {
if (
isset($_POST['name']) && isset($_POST['surname']) && isset($_POST['email'])
&& isset($_POST['password']) && isset($_POST['password_again']) && isset($_POST['birth_day'])
&& isset($_POST['birth_month']) && isset($_POST['birth_year'])
&& isset($_POST['birth_month']) && isset($_POST['birth_year']) && isset($_POST['city'])
) {
$name = $_POST['name'];
$surname = $_POST['surname'];
@@ -17,10 +17,11 @@ if (!loggedin()) {
$birth_day = $_POST['birth_day'];
$birth_month = $_POST['birth_month'];
$birth_year = $_POST['birth_year'];
$city = $_POST['city'];
if (
!empty($name) && !empty($password) && !empty($password_again) &&
!empty($email) && !empty($birth_day) && !empty($birth_month) && !empty($birth_year)
!empty($email) && !empty($birth_day) && !empty($birth_month) && !empty($birth_year) && !empty($city)
) {
if (strlen($name) > 30) {
echo 'Please ahear to maxlength of fields';
@@ -46,11 +47,11 @@ if (!loggedin()) {
echo 'The email ' . $email . 'already exists';
} else {
$query = "INSERT INTO `globaly_accounts` VALUES (NULL ,'" . mysqli_real_escape_string($con, $name) .
"','" . mysqli_real_escape_string($con, $surname) ."','" . mysqli_real_escape_string($con, $email) . "','" . mysqli_real_escape_string($con, $password_hash) . "','" .
"','" . mysqli_real_escape_string($con, $surname) ."','" . mysqli_real_escape_string($con, $email) . "','" . mysqli_real_escape_string($con, $password_hash) . "','" . mysqli_real_escape_string($con, $city) ."','" .
mysqli_real_escape_string($con, $birth_day) . "','" . mysqli_real_escape_string($con, $birth_month) . "','" . mysqli_real_escape_string($con, $birth_year) . "')";
if ($query_run = mysqli_query($con, $query)) {
echo '<script>alert("You are registerd!")</script>';
header('Location: ../index.html');
header('Location: ../index.php');
} else {
echo 'We could not register you!';
}

0
php/send_email.php Normal file → Executable file
View File

46
php/update-user.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
require 'connect.inc.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Retrieve data from the form
$name = mysqli_real_escape_string($con, $_POST['name']);
$surname = mysqli_real_escape_string($con, $_POST['surname']);
$email = mysqli_real_escape_string($con, $_POST['email']);
$password = mysqli_real_escape_string($con, $_POST['password']);
$password_again = mysqli_real_escape_string($con, $_POST['password_again']);
$city = mysqli_real_escape_string($con, $_POST['city']);
$birth_day = mysqli_real_escape_string($con, $_POST['birth_day']);
$birth_month = mysqli_real_escape_string($con, $_POST['birth_month']);
$birth_year = mysqli_real_escape_string($con, $_POST['birth_year']);
$admin = mysqli_real_escape_string($con, $_POST['admin']);
// Hash the password if it was provided
if (!empty($password) && $password == $password_again) {
$password_hashed = md5($password);
$password_update = "password = '$password_hashed',";
} else {
$password_update = "";
}
$query = "UPDATE `globaly_accounts` SET
name = '$name',
surname = '$surname',
email = '$email',
$password_update
city = '$city',
birth_day = '$birth_day',
birth_month = '$birth_month',
birth_year = '$birth_year',
admin = '$admin'
WHERE email = '$email'";
if (mysqli_query($con, $query)) {
echo '<script type="text/javascript">
alert("You have successfully edit the user!");
window.location.href = "../admin_panel.php";
</script>';
} else {
echo "Error updating user information: " . mysqli_error($con);
}
}
?>

129
search_people.php Normal file → Executable file
View File

@@ -0,0 +1,129 @@
<?php
require 'php/connect.inc.php';
if (isset($_GET['search_text'])) {
$search_text = $_GET['search_text'];
echo '<h2>Search Results for: ' . htmlspecialchars($search_text) . '</h2>';
$con = mysqli_connect($mysql_host, $mysql_user, $mysql_pass);
if (mysqli_select_db($con, $mysql_db)) {
$query = "SELECT `name`, `surname`, `email`, `birth_day`, `birth_month`, `birth_year` FROM `globaly_accounts` WHERE `name` LIKE '" . mysqli_real_escape_string($con, $search_text) . "%'";
$query_run = mysqli_query($con, $query);
if (mysqli_num_rows($query_run) > 0) {
echo '<table border="1">
<tr>
<th>Name</th>
<th>Surname</th>
<th>Email</th>
<th>Birth Date</th>
</tr>';
while ($query_row = mysqli_fetch_assoc($query_run)) {
$name = $query_row['name'];
$surname = $query_row['surname'];
$email = $query_row['email'];
$birth_date = $query_row['birth_day'] . '.' . $query_row['birth_month'] . '.' . $query_row['birth_year'] . '.';
echo '<tr>
<td>' . htmlspecialchars($name) . '</td>
<td>' . htmlspecialchars($surname) . '</td>
<td>' . htmlspecialchars($email) . '</td>
<td>' . htmlspecialchars($birth_date) . '</td>
</tr>';
}
echo '</table>';
} else {
echo 'No results found.';
}
} else {
echo 'Database selection failed.';
}
mysqli_close($con);
} else {
echo 'No search text provided.';
}
?>
<style>
body{
display: flex;
flex-direction: column;
align-items: center;
justify-content: start;
background-image: url('assets/images/image10.jpg');
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
h2{
color: #15c1cb;
font-size: 20px;
}
table {
font-size: 10px;
width: fit-content;
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
background-color: #f2f2f2;
}
th, td {
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
color: #15c1cb;
}
#btn-back{
margin-top:30px;
}
@media screen and (min-width:768px) {
body{
justify-content: center;
}
table{
font-size: 20px;
}
h2{
font-size: 50px;
}
}
@media screen and (min-width:992px) {
body{
justify-content: center;
}
table{
font-size: 30px;
}
h2{
font-size: 50px;
}
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search people</title>
<link rel="stylesheet" href="style/style.css">
</head>
<body>
<div id="btn-back">
<a href="people.php"><input class="view-more" type="submit" value="Back"></a>
</div>
</body>
</html>

26
services.php Normal file → Executable file
View File

@@ -95,20 +95,36 @@
</ul>
</div>
<img src="assets/images/logo.webp" class="logo-img mt-3 mt-lg-0 mt-md-0" alt="">
<!-- Login -->
<div class="dropdown" id="dropdownid" style="position: absolute; width: fit-content;">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fa-solid fa-users"></i>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<?php if (loggedin()) {
<?php
if (loggedin()) {
echo '<li><a class="dropdown-item" href="php/logout.php">Log out</a></li>';
if (is_admin()) {
echo '<li><a class="dropdown-item" href="admin_panel.php">Admin panel</a></li>';
}
} else {
echo '<li><a class="dropdown-item" href="login.html">Log in</a></li>
<li><a class="dropdown-item" href="signup.php">Sign up</a></li>';
} ?>
}
?>
</ul>
</div>
<!-- Weather icon -->
<?php if (loggedin()) {
echo '<div class="weather-div" style="position: absolute; color: white; font-size: 25px; left:12%; top:15px;">
<a style="color:white" href="weather.php"><i class="fa-solid fa-cloud-sun"></i></a>
<div>';
} ?>
<!-- site navigation-->
@@ -405,7 +421,9 @@
// Get the button
let mybutton = document.getElementById("scrollToTopBtn");
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {

7
signup.php Normal file → Executable file
View File

@@ -19,7 +19,7 @@
.fa-solid {
position: absolute;
right: 3%;
top: 46%;
top: 41%;
cursor: pointer;
}
@@ -74,7 +74,7 @@
@media screen and (min-width: 768px) {
.fa-solid {
top: 46%;
top: 41%;
}
#pswd_info {
@@ -86,7 +86,7 @@
@media screen and (min-width: 992px) {
.fa-solid {
top: 45%;
top: 40%;
}
@@ -123,6 +123,7 @@
<input class="input-text" type="password" id="password" placeholder="Password" name="password">
<i id="togglePassword" class="fa-solid fa-eye"></i>
<input class="input-text" type="password" placeholder="Confirm Password" name="password_again">
<input class="input-text" type="text" placeholder="City" name="city">
<h6>Date of birth:</h6>
<div class="date-container">
<span>

0
slick-1.8.1/.gitignore vendored Normal file → Executable file
View File

0
slick-1.8.1/CONTRIBUTING.markdown Normal file → Executable file
View File

0
slick-1.8.1/ISSUE_TEMPLATE.md Normal file → Executable file
View File

0
slick-1.8.1/LICENSE Normal file → Executable file
View File

0
slick-1.8.1/Makefile Normal file → Executable file
View File

0
slick-1.8.1/README.markdown Normal file → Executable file
View File

0
slick-1.8.1/bower.json Normal file → Executable file
View File

0
slick-1.8.1/component.json Normal file → Executable file
View File

0
slick-1.8.1/index.html Normal file → Executable file
View File

0
slick-1.8.1/package.json Normal file → Executable file
View File

0
slick-1.8.1/slick.jquery.json Normal file → Executable file
View File

0
slick-1.8.1/slick/ajax-loader.gif Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

0
slick-1.8.1/slick/config.rb Normal file → Executable file
View File

0
slick-1.8.1/slick/fonts/slick.eot Normal file → Executable file
View File

0
slick-1.8.1/slick/fonts/slick.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Some files were not shown because too many files have changed in this diff Show More