Hey coders...I'm a novice at web development and I have my project to complete by tuesday, so all the help I can get will be much appreciated!!
The code below is of fetched data from a servicepost table, the post 'bid' is meant to enable the user to bid for the servicepost, store the bid in bid table and also notify the user who posted it that there is a bid (notification in the second code) and then the user shouldn't be able to bid for the same servicepost again...
<pre lang="PHP">
<form id="postbid" action="" method="post" data-inline="true" style="padding-right:2%">
<b><ul class="ui-bar-d"><em>Username:</em> <u></u></ul><br>
<ul><em>I want a freelancer to complete:</em> <u></u></ul>
<ul><em>To be completed by:</em> <u></u><br></ul>
<ul><em>At a fee of Ksh.</em> <u></u><em></em></ul>
</b>
<ul align="right">
<input type="submit" name="bid" id="bid" value="Make a Bid" data-mini="true" data-inline="true" onClick="POST"/>
</ul></form><hr><br>
= mysqli_real_escape_string($link,$_POST[= date(= "INSERT INTO bids VALUES (NULL, '"= $linkquery($sql) or die (mysqli_error($link));
// if successfully insert data into database, display message "Successful".
if($result){
echo "<script>alert('Bid Posted!');</script>";
}
else {
echo "<script type='text/javascript'>alert('bid failed!')</script>";
}
//$link->close();
}
}
?>
</pre>
--Here is the notification dialog box...the client should also be able to accept a bid...notifying the bidder through a #viewbids div that their bid was accepted...
<pre lang="PHP">
<div data-role="dialog" id="notifications" data-theme="c">
<div data-role="header"><h1>Notifications</h1></div>
<div data-role="content" data-theme="b">
<div class="ui-body-c" id="counter" style="border-spacing:3%"><strong><span class="ui-li-count"></span>New Bids</strong></div>
= "SELECT username, service, service_details, duedate FROM servicepost "= mysqli_query($link, 0) {
$i=0;
// output data of each row
while($row = mysqli_fetch_assoc($result))
{
$username= $row['username'];
$service= $row['service'];
$service_details= $row['service_details'];
$duedate= date('d-M-Y', strtotime($row['duedate']));
}
} else {
echo "0 results";
}
?>
<div class="ui-field-contain" id="bid_details">
<p><em>Bid made by</em> <strong><a href="info.php#bidderinfo" data-ajax="false" data-rel="dialog"></a> </strong><em>at</em><strong></strong><br>
<em>For your</em> <strong><a href="info.php#requestinfo" data-ajax="false" data-rel="dialog"> </a></strong><em>request.</em><br>
<em>Which is due on</em> <strong></strong>
</p>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#Bidaccept").click(function() {
$("#viewbids").html("Bid Accepted!");
});
});
</script>
<input type="submit" id="Bidaccept" data-inline="true" data-mini="true" data-theme="c" value="Accept Bid"/>
</pre>
It's alot to ask...I know, but desperate times you know, I still have to be able to incorporate comments and ratings to the completed serviceposts...plus print filterable data in pdf...so please bear with me, and go easy on me, im stressed =(!