Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
zume2020 committed Oct 15, 2018
1 parent 609d260 commit 21a2c09
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# CManager
Helps in managing xerox copy distribution
Helps in managing xerox copy distribution
4 changes: 2 additions & 2 deletions checklogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

header("Location: index.php");
} else{
echo mysqli_error($link);
echo mysqli_error($link);
}
}

Expand All @@ -79,6 +79,6 @@
}

//incorrect credentials
//header("Location: index");
header("Location: login.php?error");
echo $sql ." <br>count " .$count ."<br> userId>> ". $row['userId'] ."<br>usrepass>>".$row['psw'] ;
?>
6 changes: 2 additions & 4 deletions process.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@



if (!empty($cstat)) {
//Insert query

if (isset($cstat AND !empty($cstat))) {
if (isset($cstat)) {

if ($cstat=='ON') {
$sql = "UPDATE `task_reg` SET `payment`='1' WHERE (`top_id`='".$topid."' AND `use_id`='".$usrid."') ";
Expand All @@ -30,7 +28,7 @@
echo $sql." ". mysqli_error($link);
}

}

}

// clossing connection
Expand Down
27 changes: 19 additions & 8 deletions task.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
<body>

<a href="logout.php?logout">Sign Out</a></li>
<a href="users.php">Users</a></li>



<div id="wrapper">
Expand Down Expand Up @@ -86,16 +88,25 @@

<?php

$sql = "SELECT "
. " users.id, users.name, task_reg.payment"
. " FROM "
. " task_reg "
. " JOIN users ON users.id = task_reg.use_id "
. " JOIN topics ON topics.id = task_reg.top_id "
. " WHERE "
. " topics.id=". $id;
// $sql = "SELECT "
// . " users.id, users.name, task_reg.payment"
// . " FROM "
// . " task_reg "
// . " JOIN users ON users.id = task_reg.use_id "
// . " JOIN topics ON topics.id = task_reg.top_id "
// . " WHERE "
// . " topics.id=". $id;


$sql = "SELECT users.id, users.name, IFNULL(task_reg.payment, 0) AS payment "
. "FROM users "
. "LEFT JOIN task_reg ON users.id = task_reg.use_id "
. "LEFT JOIN topics ON topics.id = task_reg.top_id AND topics.id =". $id ." "
. "ORDER BY `users`.`name` ASC ";


echo($sql);

$result = mysqli_query($link, $sql);
$num_rows = mysqli_num_rows($result);

Expand Down

0 comments on commit 21a2c09

Please sign in to comment.