Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?php
//This page displays a list of all registered members
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>List of all the users</title>
</head>
<body>
<div align="center">
<div class="header" style="width: 100%; margin: auto;margin-top: 10px">
<a href="<?php echo $url_home; ?>"><img width="80%" src="<?php echo $design; ?>/images/logo.png" alt="Espace Membre" /></a>
</div></div>
<div class="contentusers">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysqli_fetch_array(mysqli_query($var,'select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">WCSF Index</a> &gt; Daily Usage
</div>
<div class="box_right">
<a href="list_pm.php">Your messages(<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Logout</a>)
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">WCSF Index</a> &gt; Daily Usage
</div>
<div class="box_right">
<a href="signup.php">Sign Up</a> - <a href="login.php">Login</a>
</div>
<div class="clean"></div>
</div>
<?php
}
?>
Today's Usage:
<table>
<!-- <tr>
<th>Username</th>
<th>Email</th>
<th>Address</th>
</tr> -->
<?php
//$req = mysqli_query($var,"select daily_consumption from users where username = '{$_SESSION['username']}'");
$req = mysqli_query($var,"SELECT water_flow from valve INNER JOIN users ON id = v_id");
while($dnn = mysqli_fetch_array($req))
{
?>
<tr height="250px">
<!-- <td><?php echo $dnn['id']; ?></td>
<td><a href="profile.php?id=<?php echo $dnn['id']; ?>"></a> -->
<td><font size="10"> <b><?php echo htmlentities($dnn['water_flow'], ENT_QUOTES, 'UTF-8'); ?> Litre </b></font></td>
<!-- <td><?php echo htmlentities($dnn['email'], ENT_QUOTES, 'UTF-8'); ?></td>
<td><?php echo htmlentities($dnn['user_address'], ENT_QUOTES, 'UTF-8'); ?></td> -->
<!-- <?php $qty = $dnn['water_flow']; ?> -->
</tr>
<?php
}
// $data = mysqli_query($var,"SELECT users.id, users.username,users.daily_consumption,users.monthly_consumption,users.weekly_consumption, valve.water_flow FROM users INNER JOIN valve ON users.id = valve.v_id");
// $user = $_SESSION['username'];
// while($dn1 = mysqli_fetch_assoc($data))
// {
// if($user === $dn1['username']){
// // $username = $dn1['username'];
// $weekly_consumption = $dn1['weekly_consumption'];
// $daily_consumption = $dn1['daily_consumption'];
// $consumption = $dn1['monthly_consumption'];
// // $dailyUsage = $dn1['water_flow'];
// $daily_consumption +=$qty;
// $weekly_consumption = $weekly_consumption + $qty;
// $monthly_consumption = $consumption + $qty;
// $updateData = mysqli_query($var,"UPDATE users SET monthly_consumption='$monthly_consumption',daily_consumption='$daily_consumption', weekly_consumption='$weekly_consumption' WHERE username ='$user'");
// }}
// date_default_timezone_set('Asia/karachi');
// $current_time = date('h:i:s');
// echo $current_time;
?>
</table>
</div>
<!-- <div class="foot">
<p><b>Water Control System and Discussion Portal for Farmers</b></p>
</div> -->
</body>
</html>