Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. I dont think any one actually saw the comment so here it is this is my problem, the vars need to be retireved from the db , do i need to reset the pointer if so how? corresponds to this line $sql = "SELECT *, (TO_DAYS(".$rows['started_on'].") - TO_DAYS(`".$rows['completed_on']."`)) as `difference` FROM sites WHERE id = '$site_id' AND member_id = '$id'";
  2. bit of a prob this is my code $sql = "SELECT *, (TO_DAYS(".$rows['started_on'].") - TO_DAYS(`".$rows['completed_on']."`)) as `difference` FROM sites WHERE id = '$site_id' AND member_id = '$id'";// this is my problem, the vars need to be retireved from the db , do i need to reset the pointer if so how? $query = mysql_query($sql); $number = mysql_num_rows($query); ?> <p align="center" style="text-align:left; margin-left:5px;"> <?php if($number == 0) { echo "Either the site is not registered , or the site is not registered to this username. Please check and try again."; } else { while($rows = mysql_fetch_assoc($query)) { echo $rows['difference']; } ?>
  3. would that be $sql = "SELECT * FROM news SELECT TO_DAYS(".$new_time.") - TO_DAYS(".$old_time.") as `difference`;"
  4. Bluesky, i didnt write the code i found it (google) so i dont know, any help would be good. And AndyB that may help, but doing it using that would be the long way i beleive?
  5. I have this code for the difference in days , but i think i am doing something wrong as it is not returning the correct result. <?php $today1 = $rows['started_on']; $today1 = date("d.m.Y",strtotime($today1)); $f_date1 = $rows['completed_on']; $f_date1 = date("d.m.Y",strtotime($f_date1 )); $difference = intval(($f_date1 - $today1)/86400+1); echo $difference; ?> The $rows are stored in this format (2008-08-07 21:43:10), any ideas. Note: i will need it to work out the amount of days from when i started to when i finished, that may go into another month.
  6. I have made a multiple select box, but when i echo the post , its value is always the last selected option, how can i get all the options? This is some of the code <?php if(isset($_POST['request_choices'])) { echo $_POST['request_choices']; } ?> <form action="?site=<?php echo $_GET['site'];?>" method="post"> Request a report regarding '<?php echo $site; ?>' <span style="font-size:smaller"><a href="Javascript:void();">Change Site</a></span><br> <br> <span style="font-size:small">If you do not wish to recieve a general overview please select the areas you wish to be in the report,otherwise leave blank.</span><br><span style="font-size:smaller;">To select multiple options , hold down the ctrl key.</span><br> <select name="request_choices" multiple="multiple" style=" width:170px;height:70px;"> <option value="price">Price</option> <option value="completion">Completion Time</option> <option value="progress">Progress</option> <option value="features">Feature List</option> </select> <br><br> If you have any other querys or questions enter them into the text area below.<br> <textarea rows="5" cols="50" name="extra_comment"></textarea><br> <input type="submit" style="height:20px;" name="report" size="10" value="Request Report"> </form>
  7. No difference, although all i changed was the bits you echoed out, my current code is: <?php if(isset($_POST['submit2'])) { $price = $_POST["grandtotal"]; if(isset($_SESSION["email"])) { $frmemail = $_SESSION["email"]; } else { echo "<script>alert('Error. Please login again.');</script>"; header("Location:home-pub.php?logout"); } $now = date("d/m/Y"); $next = date('d/m/y', strtotime("+1 year")); if($price == 0 || strlen($price) == 0) { echo "Invalid price"; } else { $county = array(); $m = 0; for($i=0;$i<120;$i++) { if(isset($_POST['countybox' . $i])) { $checkbx = $_POST['countybox' . $i]; } if (isset($checkbx) && $checkbx != '') { $county[$m] = $checkbx; $m++; } } print_r ($county); $now = date("d/m/Y"); $next = date('d/m/Y', strtotime("+1 year")); foreach($county as $count) { $query = "SELECT * FROM Payments WHERE Region='".$count."' AND location='WEBSITE'"; $mysql = mysql_query($query); echo $count."<br>"; /*$type = $rows['service_type']; $area = $rows['county']; $name = $rows['companyname']; $sql_pay = "INSERT INTO Payments (company_type,email,location,Price,Region,companyname,created) VALUES ('$type','$frmemail','WEBSITE','$price','$area','$name',NOW())"; mysql_query($sql_pay) or die(mysql_error()); header("Location:https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=grant.deller%40allabout-weddings%2ecom&item_name=1%20year%20listing%20on%20All%20About%20Weddings%20(".$m."%20counties)&amount=".$price. "%2e00&no_shipping=0&no_note=1&currency_code=GBP&bn=PP%2dBuyNowBF&charset=UTF%2d8"); */ /*while($rw = mysql_fetch_assoc($mysql)) { $startdate = date("d/m/Y",strtotime($rw['periodstart'])); echo $startdate; $enddate = date("d/m/Y",strtotime($rw['periodend'])); if($startdate =< $now) { ?> <script>alert("Error, conflicting bookings please check the booking slots and try again");</script> <?php header("Location:webbook.php"); } else { } }*/ } } } ?> And this still produces the same problem.
  8. database is fine , and that javascript function just works out the price i beleive function countyCount(obj) { if (obj.checked) { supercount+=1 } if (obj.checked == false) { supercount-=1 } supercountChecker() } function supercountChecker(obj) { if (supercount==1) { valueholder=0 } if (supercount==2) { valueholder=30 } if (supercount==3) { valueholder=60 } if (supercount==4) { valueholder=90 } if (supercount==5) { valueholder=120 } if (supercount==6) { valueholder=150 } if (supercount==7) { valueholder=180 } if (supercount== { valueholder=210 } if (supercount==9) { valueholder=240 } if (supercount==10) { valueholder=270 } if (supercount==11) { valueholder=300 } if (supercount==12) { valueholder=330 } if (supercount==13) { valueholder=360 } if (supercount==14) { valueholder=390 } if (supercount==15) { valueholder=410 } if (supercount==16) { valueholder=440 } if (supercount==17) { valueholder=470 } if (supercount==18) { valueholder=500 } if (supercount==19) { valueholder=530 } if (supercount==20) { valueholder=560 } if (supercount==21) { valueholder=590 } if (supercount==22) { valueholder=620 } if (supercount==23) { valueholder=650 } if (supercount==24) { valueholder=680 } if (supercount==25) { valueholder=710 } if (supercount==26) { valueholder=740 } if (supercount==27) { valueholder=770 } if (supercount==28) { valueholder=800 } if (supercount==29) { valueholder=830 } if (supercount==30) { valueholder=860 } if (supercount==31) { valueholder=890 } if (supercount==32) { valueholder=920 } if (supercount==33) { valueholder=950 } if (supercount==34) { valueholder=980 } if (supercount==35) { valueholder=1010 } if (supercount==36) { valueholder=1040 } if (supercount==37) { valueholder=1070 } if (supercount==38) { valueholder=1100 } if (supercount==39) { valueholder=1130 } if (supercount==40) { valueholder=1160 } if (supercount==41) { valueholder=1190 } if (supercount==42) { valueholder=1220 } if (supercount==43) { valueholder=1250 } if (supercount==44) { valueholder=1280 } if (supercount==45) { valueholder=1310 } if (supercount==46) { valueholder=1340 } if (supercount==47) { valueholder=1370 } if (supercount==48) { valueholder=1400 } if (supercount==49) { valueholder=1430 } if (supercount==50) { valueholder=1460 } if (supercount==51) { valueholder=1490 } if (supercount==52) { valueholder=1520 } if (supercount==53) { valueholder=1550 } if (supercount==54) { valueholder=1580 } if (supercount==55) { valueholder=1620 } if (supercount==56) { valueholder=1650 } if (supercount==57) { valueholder=1680 } if (supercount==58) { valueholder=1710 } if (supercount==59) { valueholder=1740 } if (supercount==60) { valueholder=1770 } if (supercount==61) { valueholder=1800 } if (supercount==62) { valueholder=1830 } if (supercount==63) { valueholder=1850 } if (supercount==64) { valueholder=1880 } if (supercount==65) { valueholder=1910 } if (supercount==66) { valueholder=1940 } if (supercount==67) { valueholder=1970 } if (supercount==68) { valueholder=2000 } if (supercount==69) { valueholder=2030 } if (supercount==70) { valueholder=2060 } if (supercount==71) { valueholder=2090 } if (supercount==72) { valueholder=2120 } if (supercount==73) { valueholder=2150 } if (supercount==74) { valueholder=2180 } if (supercount==75) { valueholder=2210 } if (supercount==76) { valueholder=2240 } if (supercount==77) { valueholder=2270 } if (supercount==78) { valueholder=2300 } if (supercount==79) { valueholder=2330 } if (supercount==80) { valueholder=2360 } if (supercount==81) { valueholder=2390 } if (supercount==82) { valueholder=2420 } if (supercount==83) { valueholder=2450 } if (supercount==84) { valueholder=2480 } if (supercount==85) { valueholder=2510 } if (supercount==86) { valueholder=2540 } if (supercount==87) { valueholder=2570 } if (supercount==88) { valueholder=2600 } if (supercount==89) { valueholder=2630 } if (supercount==90) { valueholder=2660 } if (supercount==91) { valueholder=2690 } if (supercount==92) { valueholder=2720 } if (supercount==93) { valueholder=2750 } if (supercount==94) { valueholder=2780 } if (supercount==95) { valueholder=2810 } if (supercount==96) { valueholder=2840 } if (supercount==97) { valueholder=2870 } if (supercount==98) { valueholder=2900 } if (supercount==99) { valueholder=2930 } if (supercount==100) { valueholder=2960 } if (supercount==101) { valueholder=2990 } if (supercount==102) { valueholder=3020 } if (supercount==103) { valueholder=3050 } if (supercount==104) { valueholder=3080 } if (supercount==105) { valueholder=3110 } if (supercount==106) { valueholder=3140 } if (supercount==107) { valueholder=3170 } if (supercount==108) { valueholder=3200 } if (supercount==109) { valueholder=3230 } if (supercount==110) { valueholder=3260 } if (supercount==111) { valueholder=3290 } if (supercount==112) { valueholder=3320 } if (supercount==113) { valueholder=3350 } if (supercount==114) { valueholder=3380 } if (supercount==115) { valueholder=3410 } if (supercount==116) { valueholder=3440 } if (supercount==117) { valueholder=3470 } if (supercount==118) { valueholder=3500 } if (supercount==119) { valueholder=3530 } // NON working condensed checker to replace the above code // var moretimeCounter // for (moretimeCounter=4; moretimeCounter==119; moretimeCounter++) // { // if (supercount==moretimeCounter) { valueholder=(moretimeCounter * 35) } // } // FOLLOWING TWO LINES GIVE OR TAKE 100 QUID DISCOUNT FOR MULTICOUNTY if (obj=='nowMinus100') { valueholder-=100 } if (obj=='nowAdd100') { +valueholder + 100 } document.timereg.grandtotal.value=valueholder trueprice=valueholder/(supercount-1) if (isNaN(trueprice)) { trueprice=0; } // if (isUndefined(trueprice)) { trueprice=0; } trueprice=trueprice.toFixed(2) document.timereg.truepricebox.value='(£'+trueprice }
  9. there is no countyCount() , nor is it referenced.
  10. I have still have the problem can anyone help
  11. Lolz, dunno if that will happen. And press solved if it is ,it stops people wasting time reading through it to find out its been solved.
  12. show the code for that bit, that is probably where the problem is
  13. how do you know the session isnt created?? Have u put session_start(); at the top of everypage?
  14. Thats not what i nead though ,lozl , what the problem is , first of all the problem i just posted below , then the checking of the checkboxes against the database , to see if the person has booked that timeslot already.
  15. Isset doesnt check if it has a value , it checks if the $var (in this case session) is present try <?php session_start(); if(isset($_SESSION["myusername"])){ echo "session is set" } else { echo "session is set" } ?> There is no reason why this or the previous one wont work.
  16. my code should of worked , so was there any errors or anything from it?
  17. On these pages the session they are checking for , or the value is it the same as the session you have been set?
  18. soz for posting another kinda bump , but the code looks wrong in the previous post, so here it is <?php $county = array(); $county = array(150); $m = 0; for($i=0;$i<120;$i++) { if(isset($_POST['countybox' . $i])) { $checkbx = $_POST['countybox' . $i]; } if (isset($checkbx) && $checkbx != '') { $county[$m] = $checkbx; $m++; } } print_r ($county); $now = date("d/m/Y"); $next = date('d/m/Y', strtotime("+1 year")); foreach($county as $count) { $query = "SELECT * FROM Payments WHERE Region='".$count."' AND location='WEBSITE'"; $mysql = mysql_query($query); echo $count."<br>"; /*$type = $rows['service_type']; $area = $rows['county']; $name = $rows['companyname']; $sql_pay = "INSERT INTO Payments (company_type,email,location,Price,Region,companyname,created) VALUES ('$type','$frmemail','WEBSITE','$price','$area','$name',NOW())"; mysql_query($sql_pay) or die(mysql_error()); header("Location:https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=grant.deller%40allabout-weddings%2ecom&item_name=1%20year%20listing%20on%20All%20About%20Weddings%20(".$m."%20counties)&amount=".$price. "%2e00&no_shipping=0&no_note=1&currency_code=GBP&bn=PP%2dBuyNowBF&charset=UTF%2d8"); */ /*while($rw = mysql_fetch_assoc($mysql)) { $startdate = date("d/m/Y",strtotime($rw['periodstart'])); echo $startdate; $enddate = date("d/m/Y",strtotime($rw['periodend'])); if($startdate =< $now) { ?> <script>alert("Error, conflicting bookings please check the booking slots and try again");</script> <?php header("Location:webbook.php"); } else { } }*/ } } ?>
  19. Thanks for the try , but thats not where the problem is i beleive, the problem is getting the value from the checkbox in the code i think. Here is the updated code, php only bits , this now does work kindoff, <?php $county = array(); $county = array(150); $m = 0; for($i=0;$i<120;$i++) { if(isset($_POST['countybox' . $i])) { $checkbx = $_POST['countybox' . $i]; } if (isset($checkbx) && $checkbx != '') { $county[$m] = $checkbx; $m++; } } print_r ($county); $now = date("d/m/Y"); $next = date('d/m/Y', strtotime("+1 year")); foreach($county as $count) { $query = "SELECT * FROM Payments WHERE Region='".$count."' AND location='WEBSITE'"; $mysql = mysql_query($query); echo $count."<br>"; /*$type = $rows['service_type']; $area = $rows['county']; $name = $rows['companyname']; $sql_pay = "INSERT INTO Payments (company_type,email,location,Price,Region,companyname,created) VALUES ('$type','$frmemail','WEBSITE','$price','$area','$name',NOW())"; mysql_query($sql_pay) or die(mysql_error()); header("Location:https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=grant.deller%40allabout-weddings%2ecom&item_name=1%20year%20listing%20on%20All%20About%20Weddings%20(".$m."%20counties)&amount=".$price. "%2e00&no_shipping=0&no_note=1&currency_code=GBP&bn=PP%2dBuyNowBF&charset=UTF%2d8"); */ /*while($rw = mysql_fetch_assoc($mysql)) { $startdate = date("d/m/Y",strtotime($rw['periodstart'])); echo $startdate; $enddate = date("d/m/Y",strtotime($rw['periodend'])); if($startdate =< $now) { ?> <script>alert("Error, conflicting bookings please check the booking slots and try again");</script> <?php header("Location:webbook.php"); } else { } }*/ } } ?> My problem is this As you can see it does this on the last result , any one see what im doing wrong?
×
×
  • 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.