Jump to content

spearchilduser

Members
  • Posts

    132
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

spearchilduser's Achievements

Member

Member (2/5)

0

Reputation

  1. <?php @require_once("includes/dbconfig.inc"); $day=$_GET["myday"]; //to get the day from the previous page $month=$_GET["mymonth"];//to get the month from the previous page $year=$_GET["myyear"]; //to get the year from the previous page $insertdate=date("Y-m-d",mktime(0,0,0,$month,$day,$year)); //to convert from d-m-y to m-d-y for SQL table $practiceid=$_GET["mypractice"]; //to get the year from the previous page // Starting of top line showing name of the day's slots echo"<table align=center width='100' border='1'>"; echo "<tr><td><b>Slots</b></td><tr>"; // Starting of the slots for($i=0;$i<=31;$i++){ // this shows 32 x 15 minute slots from 9:00am - 17:00pm $shr=9+floor($i/4); //calculates the start hour of a slot $smin=($i%4)*15; //calculates the start hour of a slot $displayTime=$shr.":".$smin; // this displays the full start time of the 15 minute slot echo "<tr><td valign=top>"; $dbslottimes = mysql_query("SELECT Appointment_Time FROM appointment WHERE Appointment_Date='2012-12-29'"); // query to select all the times in the appointment table where the appoouintment date is 29/12/2012 $dbslottimes1 = mysql_num_rows($dbslottimes); while($row = mysql_fetch_array($dbslottimes)){ // while loop to check the values that the query collected $app1 = $row["Appointment_Time"]; // storing the database field from the query into a variable to be used in the while loop //echo $app1; // this will print the values of those queries } if ($dbslottimes == "") // if statement to vheck the values in the database match the slots // this will then be used to only display the ones that do not match { echo $displayTime."<br>"; // if there is a match it willl just display the slot as a time } else { echo "<a href=dateinsert.php?day=$day&month=$month&year=$year&hour=$shr&min=$smin&practice=$practiceid>"; echo $displayTime."<br>"; //show the clickable link for the slot if there is not a match with the if statement. } echo "</td></tr>"; } echo "</table>"; ?> this code is to show a number of "slots" from 9 o clock and one every 15 minutes untill somethign liek 5 o clock. What i need to do is check the database if there is a time already in the database then to show that slot as a non link and show the others as links. i need help with the if statement that is not complete atm . cheers
  2. $sqlquery was just my way of saying the sql query its not actually called $sqlquery its called $sql and $sql1
  3. so i have $sql = mysql_query("SELECT * FROM quotes WHERE User_ID='$userid' AND accept_Decline= 5"); $sql1 = mysql_num_rows($sql); if ($sql1==0) { header( 'students.comp.glam.ac.uk/08023190/taxi/userentry.php' ) ; } else { all the other code } but it seems to just show nothing if the first condition is met
  4. $sql = mysql_query("SELECT * FROM quotes WHERE User_ID='$userid' AND accept_Decline= 5"); $sql1 = mysql_num_rows($sql);
  5. its the query that ive written which in this case its checking if there is a row with a number 5 in a certain column
  6. ok i thought i had fixed the problem but i havent i dnt get what the problem is i just want sql query ... if ($sqlquery ==0) { header(webpage.php); } else { } and it just displays the else statement all the time
  7. hmm thanz for the reply ill look into it thank you
  8. aww dont wory i have the statement the wrong way around ive fixed it thank you
  9. haha yer i know is not designed well but its telling me that Parse error: parse error, unexpected T_ELSE in E:\students\08023190\taxi\user.php on line 161 which is the line of the else word
  10. hi i need a little help with a if statement please: my current query $sql = mysql_query("SELECT * FROM quotes WHERE User_ID='$userid' AND accept_Decline= 5"); $sql1 = mysql_num_rows($sql); while($row = mysql_fetch_array($sql)){ $customer_Location = $row["Customer_Location"]; $customer_Longitude = $row["User_Longitude"]; $customer_Latitude = $row["User_Latitude"]; $customer_Destination = $row["Customer_Destination"]; $how_Many = $row["How_Many"]; $wait_Time = $row["Wait_Time"]; $pric = $row['Price']; $qid = $row ['Quote_ID']; } then i wan a if statement so if ( $sql1==1) then display: <table class = tablestyle width = 40% height = 3% align=left> <tr align = center> <th width = 10%> Customer Location</th> <td> </tr> <tr><th width = 10% > Customer Destination</th> <td width = 10%><input readonly type= "text" name="Customer_Destination" value="<?php echo "$customer_Destination"; ?>"></td> </tr> <tr><th width = 10%>Wait Time (minutes)</th> <td width = 10%><input readonly type= "text" name="mins" maxlength="2" value="<?php echo "$wait_Time"; ?>"></td> </tr> <tr><th width = 10%>How Many(people)</th> <td width = 10%><input readonly type= "text" name="numb" value="<?php echo "$how_Many"; ?>"></td> </tr> <tr><th width = 10%>Price</th> <td width = 10%><input readonly type= "text" name="price" value=£<?php echo "$pric"; ?>> </td> </tr> <tr> </table> </br></br></br></br></br></br></br></br></br></br></br></br></br> <?php $sql = mysql_query("SELECT * FROM quotes WHERE User_ID='$userid'"); while($row = mysql_fetch_array($sql)){ $customer_Location = $row["Customer_Location"]; $customer_Longitude = $row["User_Longitude"]; $customer_Latitude = $row["User_Latitude"]; $customer_Destination = $row["Customer_Destination"]; $how_Many = $row["How_Many"]; $wait_Time = $row["Wait_Time"]; $pric = $row['Price']; $qid = $row ['Quote_ID']; } $sql = mysql_query("SELECT * FROM bids WHERE Quote_ID='$qid' AND DeclienedByCustomer=0 "); $sql1 = mysql_query("SELECT * FROM bids WHERE Quote_ID='$qid' AND DeclienedByCustomer=2 "); $sql2 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=5 "); $sql3 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=2 "); $sql4 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=3 "); $sql5 = mysql_query("SELECT * FROM quotes WHERE Quote_ID='$qid' AND accept_Decline=4 "); while($row = mysql_fetch_array($sql)){ $bidId = $row['Bid_ID']; $firmId = $row['Firm_ID']; $sql6 = mysql_query("SELECT Firm_Name FROM taxi_firms WHERE Firm_ID='$firmId' "); while($row1 = mysql_fetch_array($sql6)){ $username = $row1['Firm_Name']; } echo ' Company Name: '; echo $username.' <a href = "acceptapp.php?Quote_ID='.$qid.'&Firm_ID='.$firmId.'" > Accept </a> | <a href = "declinedapp.php?Quote_ID='.$qid.'&Firm_ID='.$firmId.'" > Decline</a><br />'; } echo'</br>'; echo'</br>'; while($row = mysql_fetch_array($sql1)){ echo' you declined this job'; echo'</br>'; echo'</br>'; } While($row = mysql_fetch_array($sql2)){ echo' Job is being assessed'; echo'</br>'; echo'</br>'; } While($row = mysql_fetch_array($sql3)){ echo' you declined this job'; echo'</br>'; echo'</br>'; } While($row = mysql_fetch_array($sql4)){ echo' Company Have Declined This Job'; echo'</br>'; echo'</br>'; echo '<a href="userentryapp.php">Book another taxi</a>'; } While($row = mysql_fetch_array($sql5)){ echo' Company Have Accepted This Job Please Respond'; echo'</br>'; echo'</br>'; else header("usertentry.php"); } ANY HELP ?
  11. i need to open up a new page whilst sending across a variable without saving it ina session so the code ive used is : a href="TaxiEntry1.php?Quote_ID='.$qid.'">go</a> however i just wan this to be a new window a smaller window than the full screen one however any ideas?
  12. thats gunna be a little difficult becuase the information is gathered on the login page which then goes to another page whcih checks the login details and where it stores the details into sessions then redirects you to another page so at no point can i check but now ive added that line in it does like the page syas theres a problem
  13. aww sorry i dnt know what var_dump($_GET); is or how it woudl be used
  14. Yes im using the original gets to enter the information into the session variables then on the same page usign the session variables to enter the data into a table to check they were working
  15. $MyLon = $_SESSION['Lon']; $MyLat = $_SESSION['Lat']; echo $MyLon; echo $MyLat; as this is not showing me the results i expect im not tryign to use the data just yet
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.