</div> <p> <button type="submit" class="btn waves-effect waves-light" name="SignUp" >Post<i class="mdi-content-send right"></i></button> </p> </form> </div> <div class="row"> <ul class="collection"> <?php $query_feed = "SELECT * FROM discussions ORDER BY status_time DESC"; if ($query_run = mysqli_query($con, $query_feed)) { while ($query_row = mysqli_fetch_assoc($query_run)) { $user = $query_row['status_user_id']; $stat = $query_row['status_content']; $tim = $query_row['status_time']; $namely = searchOwner($user); echo '<li class="collection-item"><span class="title"> ' . $stat . '- </span><p id="postby" class="small light right-align"><i>' . $namely . '<br>' . $tim . '</i></p></li>'; } } ?> </ul> </div> </div> <<footer class="page-footer teal"> <div class="container"> <div class="row"> <div class="col l6 s12"> <img src="iitroparlogo.png" class="small responsive-img"> <h5 class="white-text">IIT Ropar Presents</h5>
<html> <head> <title>Permissions</title> </head> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/> <title>View Profile</title> <!-- CSS --> <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/> <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/> </head> <body> <h3>Request <?php echo searchOwner($toWhomId); ?> to buy</h3> <form method="post" action=""> <button class="waves-effect waves-light btn-large" name="confirm">Yes</button> <button class="waves-effect waves-light btn-large" name="cancel">No</button> </form> </body> </html> <?php if (isset($_POST['confirm'])) { $query = "SELECT * FROM messages WHERE (m_tag='01' OR m_tag='11') AND message_sender_id='{$askerId}' AND message_subject='__WANTTOBUY__' AND message_recipient_id='{$toWhomId}' AND message_content='{$bookTitle}'"; $query_run = mysqli_query($con, $query); $check_query = mysqli_num_rows($query_run); if ($check_query != 0) { echo 'You already have requested him/her';
<?php require 'includes/connection.php'; //session continue //session_start(); //session check if (!isset($_SESSION["user_email"])) { echo "you're not logged in<br>Click <a href=\"index.php\">here</a> to log in."; exit; } $user_email = $_SESSION['user_email']; $user_id = searchOwnerId($user_email); $recipient_id = $_GET['id']; $user_name = searchOwner($user_id); //function to return $ownerId function searchOwnerId($user_email) { global $con; $userQuery = "SELECT user_id FROM user_login_details WHERE user_email='{$user_email}'"; if (!($userQuery_run = mysqli_query($con, $userQuery))) { die("Could load book owners data"); } return mysqli_fetch_assoc($userQuery_run)['user_id']; } //to search the owner of if owner id is mentioned function searchOwner($ownerId) { global $con; $userQuery = "SELECT user_id,user_name FROM user_login_details"; if (!($userQuery_run = mysqli_query($con, $userQuery))) { die("Could load book owners data");
</div> </div> </form> <?php } } } } } else { if ($query_run = mysqli_query($con, $query)) { while ($query_row = mysqli_fetch_assoc($query_run)) { $bookTitle = $query_row['bookTitle']; if ($getbookTitle === $bookTitle) { $ownerId = $query_row['ownerId']; $bId = $query_row['bId']; echo '<a href = "profile.php?id=' . $ownerId . '">' . searchOwner($query_row['ownerId']) . '</a> has the book<br> <strong>Status : </strong>' . b_status($bId, $ownerId) . '<br>'; echo '<a href="index.php">Login</a><br>'; } } } } ?> </div> </div> </div> <!-- Sumthing Was Here====Alot --> <footer class="page-footer teal"> <div class="container"> <div class="row"> <div class="col l6 s12">
?> <thead> <tr> <th>Reciever</th> <th>Subject</th> <th>Message</th> <th>Time</th> </tr> </thead> <tbody> <?php foreach ($notify_array as $n) { ?> <tr> <td><?php echo searchOwner($n['message_recipient_id']); ?> </td> <td><?php echo $n['message_subject']; ?> </td> <td><?php echo $n['message_content']; ?> </td> <td><?php echo $n['message_time']; ?> </td> </tr>
<?php include 'includes/connection.php'; //include('home.php'); if (isset($_POST['sub'])) { $email = mysqli_real_escape_string($con, $_POST['email']); $pass = md5(mysqli_real_escape_string($con, $_POST['pass'])); $get_user = "******"; $run_user = mysqli_query($con, $get_user); $_SESSION['user_id'] = mysqli_fetch_assoc(mysqli_query($con, "select user_id from user_login_details where user_email='{$email}'"))['user_id']; $check = mysqli_num_rows($run_user); if ($check == 1) { $_SESSION["user_email"] = $email; $_SESSION["user_name"] = searchOwner($_SESSION["user_id"]); echo "<script>window.location='homecss.php'</script>"; } else { echo "<script>alert('Email or Password incorrect!Try agin')</script>"; } } //to search the owner of if owner id is mentioned function searchOwner($ownerId) { global $con; $userQuery = "SELECT user_id,user_name FROM user_login_details"; if (!($userQuery_run = mysqli_query($con, $userQuery))) { die("Could load book owners data"); } while ($userQuery_row = mysqli_fetch_assoc($userQuery_run)) { $id = $userQuery_row['user_id']; $username = $userQuery_row['user_name']; if ($id == $ownerId) {