if (isset($_GET['nerror'])) { echo "<div class=\"alert alert-error\">\nPlease enter all the details asked before you can continue!\n</div>"; } } ?> <?php include 'menu.php'; ?> <div class="row-fluid" id="main-content"> <div class="span1"></div> <div class="span10"> <?php require_once 'functions.php'; connectdb(); $userId = getUserid(); //$userId ="1"; $query = 'SELECT * from notifications WHERE receiver="' . $userId . '" ORDER BY timestamp DESC;'; $result = mysql_query($query) or die("error!!!"); ?> <table class="table table-hover"> <thead><tr> <th>Time</th> <th>Car Pool Details</th> <th>Notification Type</th> <th>Action</th> </tr> </thead> <tbody> <?php while ($row = mysql_fetch_array($result)) {
} } } $i++; } echo "<p>Name: <strong>" . $name . " </strong></p>"; echo "<p>Email Id: <strong>" . $email . "</strong></p>"; echo "<p>Gender: <strong>" . $sex . " </strong></p>"; echo "<p>Contact: <strong>" . $contact . "</strong></p>"; echo "<p>Description: <strong>" . $desc . "</strong></p>"; echo "<p>Carbon Credits: <strong>" . $credits . " </strong></p>"; echo "<p>Badge:<span class='label label-success'> " . $badge . "</span></p>"; } else { $email = $_SESSION['username']; $query = "SELECT * from users where email='" . $email . "'"; $uid = getUserid(); $res = mysql_query($query); $fetch = mysql_fetch_array($res); $name = $fetch['name']; $email = $fetch['email']; $gender = $fetch['gender']; $contact = $fetch['contactno']; $desc = $fetch['description']; $credits = $fetch['credits']; $badge = "Newbie in town"; $rank = "SELECT * from users ORDER BY credits DESC"; $resul = mysql_query($rank); $num = mysql_num_rows($resul); $top = $num / 3; $middle = $top * 2; $i = 1;
?> <br/> Brief Description of the car pool: <?php echo $desc; ?> <br/> <br/> <?php $time = date("Y-m-d H:i:s"); if ($uptime > $time) { ?> <h2> <small>Request for this car</small></h2> <input type="hidden" id="formfrom" name="from" /> <input type="hidden" id="formto" name="to" /> <input type="hidden" name="uid" value=<?php echo getUserid(); ?> /> <input type="hidden" name="cid" value=<?php echo $cid; ?> /> <div class="btn-group"> <button id="from" class="btn dropdown-toggle" data-toggle="dropdown">From <span class="caret"></span></button> <ul class="dropdown-menu from"> <?php $q = "SELECT place from route WHERE cid=" . $cid; $re = mysql_query($q) or dir(mysql_error()); while ($row = mysql_fetch_array($re)) { echo "<li><a href='#'>" . $row['place'] . "</a></li>"; }
function userid() { echo getUserid(); }