Skip to content

Commit

Permalink
added new functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKacmaz committed Jan 2, 2021
1 parent c6fcb61 commit b1973e9
Show file tree
Hide file tree
Showing 29 changed files with 2,129 additions and 120 deletions.
16 changes: 10 additions & 6 deletions Projects/project1_main/account.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<?php
include 'database/logDB.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">

Expand All @@ -20,12 +24,12 @@
<nav class="nav">
<span>MANAGEMENT SYSTEM</span>
<ul class="nav-ul">
<li class="nav-ul-li"><a href="main.html">MAIN</a></li>
<li class="nav-ul-li"><a href="information.html">INFORMATION</a></li>
<li class="nav-ul-li"><a href="to-do.html">TO/DO</a></li>
<li class="nav-ul-li"><a href="complaint.html">COMPLAINT</a></li>
<li class="nav-ul-li"><a href="account.html">ACCOUNT</a></li>
<li class="nav-ul-li"><a href="log.html">LOG-OUT</a></li>
<li class="nav-ul-li"><a href="main.php">MAIN</a></li>
<li class="nav-ul-li"><a href="information.php">INFORMATION</a></li>
<li class="nav-ul-li"><a href="to-do.php">TO/DO</a></li>
<li class="nav-ul-li"><a href="complaint.php">COMPLAINT</a></li>
<li class="nav-ul-li"><a href="account.php">ACCOUNT</a></li>
<li class="nav-ul-li"><a href="logout.php">LOG-OUT</a></li>
</ul>
</nav>

Expand Down
144 changes: 144 additions & 0 deletions Projects/project1_main/admin/adminAccount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?php
include '../database/adminDB.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Account</title>
<link rel="stylesheet" href="../css/admin/adminAccount.css">
</head>

<body>
<header class="header">
<div class="welcome">
<p id="welcome"> Account Page</p>
</div>
</header>



<nav class="nav">
<span>MANAGEMENT SYSTEM</span>
<ul class="nav-ul">
<li class="nav-ul-li"><a href="adminPanel.php">MAIN</a></li>
<li class="nav-ul-li"><a href="adminInfo.php">USERS</a></li>
<li class="nav-ul-li"><a href="adminTODO.php">TO/DO</a></li>
<li class="nav-ul-li"><a href="adminComplaint.php">COMPLAINTS</a></li>
<li class="nav-ul-li"><a href="adminAccount.php">USER ADD</a></li>
<li class="nav-ul-li"><a href="adminLogOut.php">LOG-OUT</a></li>
</ul>
</nav>


<main class="main-content">
<div class="main-item">
<h2>Account Transactions</h2>
<p>You can add new user and new admin here</p>
</div>
</main>


<section class="main-content">
<div class="main-item">
<form action="../index/new_user_sign.php" method="POST">

<label for="userName">User Name</label>
<input type="text" name="userName" id="userName" class="input" required><br><br>

<label for="userSurname">User Surname</label>
<input type="text" name="userSurname" id="userSurname" class="input" required><br><br>

<label for="userUsername">User Username</label>
<input type="text" name="userUsername" id="userUsername" class="input" required><br><br>

<label for="userFlatno">User userFlatno</label>
<input type="number" name="userFlatno" id="userFlatno" class="input" required><br><br>

<label for="userGSM">User Phone Number</label>
<input type="tel" name="userGSM" id="userGSM" class="input" placeholder="555-555-55-55" required><br><br>

<label for="userEmail">User E-mail</label>
<input type="email" name="userEmail" id="userEmail" class="input" placeholder="[email protected]" required><br><br>

<label for="userPassword">User Password</label>
<input type="password" name="userPassword" id="userPassword" class="input" required><br><br>

<label for="submit"></label>
<input type="submit" name="adminSignUser-btn" id="submit" class="btn" required>
<label for="reset"></label>
<input type="reset" name="reset" id="reset" class="btn" required>
</form>

<?php
if (isset($_GET['adminUserSign'])) {
if ($_GET['adminUserSign'] == "success") {
echo "kayıt başarılı";
} elseif ($_GET['adminUserSign'] == "failed") {
echo "kayıt başarısız";
}
}
?>
</div>

<div class="main-item">
<form action="../index/new_user_sign.php" method="POST">

<label for="adminUSERNAME">Admin Username</label>
<input type="text" name="adminUSERNAME" id="adminUSERNAME" class="input" required><br><br>

<label for="adminNAME">Admin Name</label>
<input type="text" name="adminNAME" id="adminNAME" class="input" required><br><br>

<label for="adminSURNAME">Admin Surname</label>
<input type="text" name="adminSURNAME" id="adminSURNAME" class="input" required><br><br>

<label for="adminGSM">Admin Phone Number</label>
<input type="tel" name="adminGSM" id="adminGSM" class="input" placeholder="555-555-55-55" required><br><br>

<label for="adminGSM_2">Admin Phone Number 2</label>
<input type="tel" name="adminGSM_2" id="adminGSM_2" class="input" placeholder="555-555-55-55" required><br><br>

<label for="adminPASSWORD">Admin Password</label>
<input type="password" name="adminPASSWORD" id="adminPASSWORD" class="input" required><br><br>

<label for="adminEMAIL">Admin E-mail</label>
<input type="email" name="adminEMAIL" id="adminEMAIL" class="input" placeholder="[email protected]" required><br><br>


<label for="submit"></label>
<input type="submit" name="adminSignAdmin-btn" id="submit-2" class="btn" required>
<label for="reset"></label>
<input type="reset" name="reset2" id="reset2" class="btn" required>
</form>

<?php
if (isset($_GET['adminNewAdmin'])) {
if ($_GET['adminNewAdmin'] == "success") {
echo "kayıt başarılı";
} elseif ($_GET['adminNewAdmin'] == "failed") {
echo "kayıt başarısız";
}
}
?>

</div>
</section>


<footer class="footer">
<div class="links">
<ul>
<li class="link"><a href="https://www.linkedin.com/in/alperen-ka%C3%A7maz-2202/" title="LinkedIn" target="_blanced"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTMdFqfhP3dTNKjtRennSsHXGUmiF9yJ2AfVQ&usqp=CAU" height="50" width="50" alt="LinkedIn"></a></li>
<li class="link"><a href="https://www.instagram.com/mr.kacmaz" title="Instagram" target="_blanced"><img src="https://pazarlamasyon.com/wp-content/uploads/2018/01/new-instagram-logo-clipart-16.jpg" height="50" width="50" alt="Instagram"></a></li>
<li class="link"><a href="https://github.com/MrKacmaz" title="GitHub" target="_blanced"> <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSUP7RN0hZaqZpljtz9c0nz5eSc2DFY-XSRQA&usqp=CAU" width="50" height="50" alt="GitHub"> </a></li>
</ul>
</div>
</footer>

</body>

</html>
96 changes: 96 additions & 0 deletions Projects/project1_main/admin/adminComplaint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
include '../database/adminDB.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Complaint</title>
<link rel="stylesheet" href="../css/admin/adminComplain.css">
</head>

<body>
<!--welcome header bar-->
<header class="header">
<div class="welcome">
<p id="welcome">complaint page</p>
</div>
</header>


<!--MENU BAR-->
<nav class="nav">
<span>MANAGEMENT SYSTEM</span>
<ul class="nav-ul">
<li class="nav-ul-li"><a href="adminPanel.php">MAIN</a></li>
<li class="nav-ul-li"><a href="adminInfo.php">USERS</a></li>
<li class="nav-ul-li"><a href="adminTODO.php">TO/DO</a></li>
<li class="nav-ul-li"><a href="adminComplaint.php">COMPLAINTS</a></li>
<li class="nav-ul-li"><a href="adminAccount.php">USER ADD</a></li>
<li class="nav-ul-li"><a href="adminLogOut.php">LOG-OUT</a></li>
</ul>
</nav>


<main class="main">
<table style="width: 60%" border="1">
<tr>
<th>S.NO</th>
<th>Complain ID</th>
<th>Name</th>
<th>Surname</th>
<th>User Name</th>
<th>Flat No</th>
<th>About</th>
<th>Complain</th>
<th>Delete</th>
</tr>
<?php
$checkUserInDB = $db->prepare("SELECT * FROM complains");
$checkUserInDB->execute();
$say = 0;
while ($pullinfo = $checkUserInDB->fetch(PDO::FETCH_ASSOC)) {
$say++
?>
<tr>
<td><?php echo $say; ?></td>
<td><?php echo $pullinfo['complainID']; ?></td>
<td><?php echo $pullinfo['userName']; ?></td>
<td><?php echo $pullinfo['userSurname']; ?></td>
<td><?php echo $pullinfo['userUsername']; ?></td>
<td><?php echo $pullinfo['userFlatno']; ?></td>
<td><?php echo $pullinfo['about']; ?></td>
<td><?php echo $pullinfo['userComplain']; ?></td>
<td align="center"><a href="../index/delete.php?complainID=<?php echo $pullinfo['complainID'] ?>&userComplaintdelete=delete"><button>Delete</button></td></a>
</tr>
<?php } ?>
</table>
<?php
if(isset($_GET['delete'])){
if($_GET['delete'] == "ok"){
echo"Successfully deleted";
}elseif($_GET['delete'] == "no"){
echo"Failed deleted";
}
}

?>
</main>


<footer class="footer">
<div class="links">
<ul>
<li class="link"><a href="https://www.linkedin.com/in/alperen-ka%C3%A7maz-2202/" title="LinkedIn" target="_blanced"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTMdFqfhP3dTNKjtRennSsHXGUmiF9yJ2AfVQ&usqp=CAU" height="50" width="50" alt="LinkedIn"></a></li>
<li class="link"><a href="https://www.instagram.com/mr.kacmaz" title="Instagram" target="_blanced"><img src="https://pazarlamasyon.com/wp-content/uploads/2018/01/new-instagram-logo-clipart-16.jpg" height="50" width="50" alt="Instagram"></a></li>
<li class="link"><a href="https://github.com/MrKacmaz" title="GitHub" target="_blanced"> <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSUP7RN0hZaqZpljtz9c0nz5eSc2DFY-XSRQA&usqp=CAU" width="50" height="50" alt="GitHub"> </a></li>
</ul>
</div>

</footer>
</body>

</html>
115 changes: 115 additions & 0 deletions Projects/project1_main/admin/adminInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php
include '../database/adminDB.php';
session_start();
?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Information</title>
<link rel="stylesheet" href="../css/admin/adminInfo.css">
</head>

<body>

<header class="header">
<div class="welcome">
<p id="welcome">information page</p>
</div>
</header>


<nav class="nav">
<span>MANAGEMENT SYSTEM</span>
<ul class="nav-ul">
<li class="nav-ul-li"><a href="adminPanel.php">MAIN</a></li>
<li class="nav-ul-li"><a href="adminInfo.php">USERS</a></li>
<li class="nav-ul-li"><a href="adminTODO.php">TO/DO</a></li>
<li class="nav-ul-li"><a href="adminComplaint.php">COMPLAINTS</a></li>
<li class="nav-ul-li"><a href="adminAccount.php">USER ADD</a></li>
<li class="nav-ul-li"><a href="adminLogOut.php">LOG-OUT</a></li>
</ul>
</nav>


<main class="main-content">
<div class="main-item">
<h2>List of All Tenant </h2>
<div>
<table style="width: 60%" border="1">
<tr>
<th>S.NO</th>
<th>ID</th>
<th>Name</th>
<th>Surname</th>
<th>User Name</th>
<th>Flat No</th>
<th>E-Mail</th>
<th>GSM</th>
<th>Register Time</th>
<th>Update</th>
<th>Delete</th>
</tr>
<?php
$checkUserInDB = $db->prepare("SELECT * FROM usersinfo");
$checkUserInDB->execute();
$say = 0;
while ($pullinfo = $checkUserInDB->fetch(PDO::FETCH_ASSOC)) {
$say++
?>
<tr>
<td><?php echo $say; ?></td>
<td><?php echo $pullinfo['userID']; ?></td>
<td><?php echo $pullinfo['userName']; ?></td>
<td><?php echo $pullinfo['userSurname']; ?></td>
<td><?php echo $pullinfo['userUsername']; ?></td>
<td><?php echo $pullinfo['userFlatno']; ?></td>
<td><?php echo $pullinfo['userEmail']; ?></td>
<td><?php echo $pullinfo['userGSM']; ?></td>
<td><?php echo $pullinfo['registerTime']; ?></td>
<td align="center"><a href="../index/update.php?userID=<?php echo $pullinfo['userID'] ?>&userIDupdate=ok"><button>Update</button></td></a>
<td align="center"><a href="../index/delete.php?userID=<?php echo $pullinfo['userID'] ?>&userIDdelete=delete"><button>Delete</button></td></a>
</tr>
<?php } ?>
</table>
<?php
if (isset($_GET['durum']))
if ($_GET['durum'] == "ok") {
echo "Update Successful";
} elseif ($_GET['durum'] == "no") {
echo "Update Failed";
}
if (isset($_GET['delete'])) {
if ($_GET['delete'] == "ok") {
echo "Deleted Successful";
} else {
echo "Deleted Failed";
}
}

?>
<p><B>ALERT EKLE DELETE YAPARKEN</B></p>
</div>

</main>






<footer class="footer">
<div class="links">
<ul>
<li class="link"><a href="https://www.linkedin.com/in/alperen-ka%C3%A7maz-2202/" title="LinkedIn" target="_blanced"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTMdFqfhP3dTNKjtRennSsHXGUmiF9yJ2AfVQ&usqp=CAU" height="50" width="50" alt="LinkedIn"></a></li>
<li class="link"><a href="https://www.instagram.com/mr.kacmaz" title="Instagram" target="_blanced"><img src="https://pazarlamasyon.com/wp-content/uploads/2018/01/new-instagram-logo-clipart-16.jpg" height="50" width="50" alt="Instagram"></a></li>
<li class="link"><a href="https://github.com/MrKacmaz" title="GitHub" target="_blanced"> <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSUP7RN0hZaqZpljtz9c0nz5eSc2DFY-XSRQA&usqp=CAU" width="50" height="50" alt="GitHub"> </a></li>
</ul>
</div>

</footer>
</body>

</html>
4 changes: 4 additions & 0 deletions Projects/project1_main/admin/adminLogOut.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
session_start();
session_destroy();
header("Location:../log.php");
Loading

0 comments on commit b1973e9

Please sign in to comment.