Skip to content

Commit

Permalink
new php adds
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKacmaz committed Jan 3, 2021
1 parent b1973e9 commit 3c7b396
Show file tree
Hide file tree
Showing 10 changed files with 438 additions and 104 deletions.
106 changes: 78 additions & 28 deletions Projects/project1_main/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<nav class="nav">
<span>MANAGEMENT SYSTEM</span>
<ul class="nav-ul">
<li class="nav-ul-li"><a href="main.php">MAIN</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>
Expand All @@ -34,9 +34,6 @@
</nav>





<main class="main-content">
<div class="main-item">
<h2>Account Transactions</h2>
Expand All @@ -46,54 +43,107 @@

<main class="main-content">
<div class="main-item-3">
<h2>Your Information is ;</h2>
<p class="input-3">User name</p>
<p class="input-3">Name</p>
<p class="input-3">Surname</p>
<p class="input-3">Phone</p>
<p class="input-3">Email</p>
<h2>Your Information is ;</h2><br>
<p class="input-3">User name: <?php echo $_SESSION['userUsername'] ?></p><br>
<p class="input-3">Name: <?php echo $_SESSION['userName'] ?></p><br>
<p class="input-3">Surname: <?php echo $_SESSION['userSurname'] ?></p><br>
<p class="input-3">Phone: <?php echo $_SESSION['userGSM'] ?></p><br>
<p class="input-3">Email: <?php echo $_SESSION['userEmail'] ?></p><br>
<p class="input-3">Flat: <?php echo $_SESSION['userFlatno'] ?></p><br>
</div>
</main>


<main class="main-content">
<div class="main-item-2">
<form action="#">
<form action="account.php" method="POST">
<label for="username">User name</label>
<input type="text" name="username" id="username" class="input" required><br><br>
<input type="text" name="userUsername" id="username" class="input" placeholder="<?php echo $_SESSION['userUsername']?>" required><br><br>
<label for="name">Name</label>
<input type="text" name="name" id="name" class="input" required><br><br>
<input type="text" name="userName" id="name" class="input" required placeholder="<?php echo $_SESSION['userName']?>"><br><br>
<label for="surname">Surname</label>
<input type="text" name="surname" id="surname" class="input" required><br><br>
<input type="text" name="userSurname" id="surname" class="input" required placeholder="<?php echo $_SESSION['userSurname']?>"><br><br>
<label for="phone">Phone Number</label>
<input type="tel" name="phone" id="phone" class="input" placeholder="555-555-55-55" pattern="[0-9]{3}-[0-9]{3}-[0-9]{2}-[0-9]{2}" required><br><br>
<input type="tel" name="userGSM" id="phone" class="input" placeholder="<?php echo $_SESSION['userGSM']?>" required><br><br>
<label for="mail">E-mail</label>
<input type="email" name="mail" id="mail" class="input" placeholder="[email protected]" required><br><br>
<input type="email" name="userEmail" id="mail" class="input" placeholder="<?php echo $_SESSION['userEmail']?>" required><br><br>
<label for="password">Old Password</label>
<input type="password" name="password" id="password" class="input" required><br><br>
<input type="password" name="userPassword" id="passwordOld" class="input" required><br><br>
<label for="password">New Password</label>
<input type="password" name="password" id="password" class="input" required><br><br>
<input type="password" name="userPasswordNEW" id="passwordNew" class="input" required><br><br>
<label for="userFlatno">Flat</label>
<input type="int" name="userFlatno" id="userFlatno" class="input" placeholder="<?php echo $_SESSION['userFlatno']?>" required><br><br>

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

if(isset($_GET['update'])){
if($_GET['update'] == "ok"){
echo "güncelleme başırılı";
}
elseif($_GET['update'] == "no"){
echo"güncelleme başarısız";
}
}
?>
</div>
<?php
if (isset($_POST['submit'])) {

$bilgilerim_id = $_SESSION['userID'];

$kaydet = $db->prepare("UPDATE usersinfo set
userUsername=:userUsername,
userName=:userName,
userSurname=:userSurname,
userEmail=:userEmail,
userUsername=:userUsername,
userFlatno=:userFlatno,
userPassword=:userPassword,
userGSM=:userGSM
where userID={$_SESSION['userID']}
");

$insert = $kaydet->execute(array(

'userName' => $_POST['userName'],
'userSurname' => $_POST['userSurname'],
'userEmail' => $_POST['userEmail'],
'userUsername' => $_POST['userUsername'],
'userFlatno' => $_POST['userFlatno'],
'userPassword' => $_POST['userPasswordNEW'],
'userGSM' => $_POST['userGSM']
));



if ($insert) {
//echo "kayıt başarılı";
Header("Location:account.php?update=ok&bilgilerim_id=$bilgilerim_id");
exit;
} else {
//echo "kayıt başarısız";
Header("Location:account.php?update=no&bilgilerim_id=$bilgilerim_id");
exit;
}
}



?>
</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>
<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>

Expand Down
1 change: 1 addition & 0 deletions Projects/project1_main/admin/adminAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<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="adminBills.php">BILLS</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>
Expand Down
115 changes: 115 additions & 0 deletions Projects/project1_main/admin/adminBills.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>Document</title>
<link rel="stylesheet" href="../css/admin/adminTODO.css">

</head>

<body>

<!--welcome header bar-->
<header class="header">
<div class="welcome">
<p id="welcome">to-do 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="adminBills.php">BILLS</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="section">
<table id="payment">

<tr>
<th class="text-table">Bill ID</th>
<th class="text-table">Bill Date</th>
<th class="text-table">is ok</th>
<th class="text-table">Rent</th>
<th class="text-table">Corridor Electric Bill</th>
<th class="text-table">Maintenance Bill</th>
<th class="text-table">Corridor Cleaning Bill</th>
<th class="text-table">Fuel Bill</th>
<th class="text-table">SUM</th>
<th class="text-table">UPDATE</th>

</tr>
<?php
$checkUserInDB = $db->prepare("SELECT * FROM bills");
$checkUserInDB->execute();
while ($pullinfo = $checkUserInDB->fetch(PDO::FETCH_ASSOC)) {
?>

<?php
$sum = $pullinfo['rent'] + ($pullinfo['corridorLight'] / 10) + ($pullinfo['corridorWater'] / 10) + ($pullinfo['corridorCleaning'] / 10) + ($pullinfo['fuel'] / 10);
?>
<tr>
<td><?php echo $pullinfo['billID'] ?></td>
<td><?php echo $pullinfo['billDate'] ?></td>
<td><?php echo $pullinfo['isOK'] ?></td>
<td><?php echo $pullinfo['rent'] ?></td>
<td><?php echo $pullinfo['corridorLight'] ?></td>
<td><?php echo $pullinfo['corridorWater'] ?></td>
<td><?php echo $pullinfo['corridorCleaning'] ?></td>
<td><?php echo $pullinfo['fuel'] ?></td>
<td><?php echo $sum ?></td>
<td><a href="../index/payBill.php?billID=<?php echo $pullinfo['billID'] ?>"><button>UPDATE</button></a></td>
</tr>
<?php
}
?>
</table><br><br>

<!--UPDATE VEYA ADD İŞLEMİNİN SONUCUNU YAZDIRIR-->
<?php
if (isset($_GET['addNewBill'])) {
if ($_GET['addNewBill'] == "ok") {
echo "kayıt başarılı";
} elseif ($_GET['addNewBill'] == "no") {
echo "kayıt başarısız";
}
}

if (isset($_GET['update'])) {
if ($_GET['update'] == "ok") {
echo $_GET['billID'] . " nolu güncelleme başarılı";
} elseif ($_GET['update'] == "no") {
echo $_GET['billID'] . " nolu güncelleme başarısız";
}
}
?>
<br><br><a href="../index/payBill.php?addNewBill=1"><button>ADD NEW BILL</button></a>
</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>
79 changes: 40 additions & 39 deletions Projects/project1_main/admin/adminComplaint.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<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="adminBills.php">BILLS</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>
Expand All @@ -36,48 +37,48 @@


<main class="main">
<table style="width: 60%" border="1">
<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>
<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>
<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
$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";
}
<?php } ?>
</table>
<?php
if (isset($_GET['delete'])) {
if ($_GET['delete'] == "ok") {
echo "Successfully deleted";
} elseif ($_GET['delete'] == "no") {
echo "Failed deleted";
}

?>
}

?>
</main>


Expand Down
1 change: 1 addition & 0 deletions Projects/project1_main/admin/adminInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<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="adminBills.php">BILLS</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>
Expand Down
1 change: 1 addition & 0 deletions Projects/project1_main/admin/adminPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<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="adminBills.php">BILLS</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>
Expand Down
Loading

0 comments on commit 3c7b396

Please sign in to comment.