This commit is contained in:
2024-06-24 07:52:54 +02:00
parent 4cf0c7bcb9
commit 6e1ecbc485
146 changed files with 964 additions and 59 deletions

0
about.php Normal file → Executable file
View File

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>

176
admin_panel.php Normal file
View File

@@ -0,0 +1,176 @@
<?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` 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>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'] . '.';
echo '<tr>
<td>' . htmlspecialchars($name) . '</td>
<td>' . htmlspecialchars($surname) . '</td>
<td>' . htmlspecialchars($email) . '</td>
<td>' . htmlspecialchars($birth_date) . '</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"><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

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

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

0
assets/images/blue-sky-with-clouds.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 8.6 MiB

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

0
cases.php Normal file → Executable file
View File

0
contacts.php Normal file → Executable file
View File

316
edit-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>Edit 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>

27
index.php Normal file → Executable file
View File

@@ -13,15 +13,14 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://kit.fontawesome.com/4bb6479073.js" crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="slick-1.8.1/slick/slick.css"/>
<link rel="stylesheet" type="text/css" href="slick-1.8.1/slick/slick-theme.css"/>
<link rel="stylesheet" type="text/css" href="slick-1.8.1/slick/slick.css" />
<link rel="stylesheet" type="text/css" href="slick-1.8.1/slick/slick-theme.css" />
<title>Globaly - Full Cycle Business Management & Consulting Responsive WordPress Theme</title>
</head>
<style>
.slick-carousel .first-part {
min-height: 65vh;
background-size: cover;
@@ -64,7 +63,8 @@
min-height: 78vh;
}
.textbox{
.textbox {
margin-top: 120px;
}
@@ -202,22 +202,29 @@
<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:10%; top:15px;">
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>';
}?>
} ?>
@@ -323,7 +330,7 @@
<input class="read-more" type="submit" value="read more">
</div>
</div>
<div class="first-part" >
<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">
<h2 id="first-part-h2" class="h2-first">
Why You Need an Advisor?</h2>
@@ -612,7 +619,7 @@
'url("assets/images/image38.jpg")'
];
$('.slick-carousel').on('beforeChange', function(event, slick, currentSlide, nextSlide){
$('.slick-carousel').on('beforeChange', function(event, slick, currentSlide, nextSlide) {
$('.first-part').css('background-image', backgrounds[nextSlide]);
});

0
login.html Normal file → Executable file
View File

0
news.php Normal file → Executable file
View File

0
people.php Normal file → Executable file
View File

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

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

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

0
search_people.php Normal file → Executable file
View File

0
services.php Normal file → Executable file
View File

0
signup.php Normal file → Executable file
View File

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

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

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