Jump to content

deansaddigh

Members
  • Posts

    440
  • Joined

  • Last visited

    Never

Everything posted by deansaddigh

  1. basically nothing is brought back, which it should be. if($_SERVER['REQUEST_METHOD'] == "POST") { /*get the posted data*/ $country = $_POST["country"]; $region = $_POST["region"]; $town = $_POST["town"]; $weeks = $_POST["weeks"]; } /*************** * Check to see if variables are empty **************/ if (isset($country,$region,$town,$weeks)) { $query = "SELECT * FROM school WHERE town= '.$town.'"; $result = mysql_query($query, $conn) or die ("Unable to perform query"); } /*************** * get values from sql query **************/ while($row= mysql_fetch_array($result)) { echo $name = $row['name']; echo $address = $row['address']; echo $school_fact = $row["school_facts"]; echo $general_info = $row["general_info"]; echo $country =$row["country"]; } if i get rid of the where clause it works.
  2. if($country !==' ' || $region !==' ' || $town !==' ' || $weeks !==' ' ){}; I dont want to do anything at this stage i basically just want to see if the variables are empty
  3. I have a php script that i want to display 52 weeks in a select <option> tag code here <?php $i = 0; while ($i <= 52) { '<option value="'.$i.'"> '.$i.' </option>'; $i++; } ?> Doesnt seem to populate the option box with anything any help? thanks in advance
  4. Just wanted to know if this site has a course type and course table do you think. http://www.ukstudy.com/Show_Front.php?DesignKind=1 I guessed this from there search form
  5. Thanks man, i appreciate the help all is good now.
  6. Thank you so much. i have done it this way. they are already looping through and displaying images, with this code. so i added an extra $imagecount <? $imagecount =1; $k =1; foreach ($imagesResults as $imagesResults2){ ?> <div class='thumbPhoto' style='margin-left:-3px;margin-right:8px;'> <a href="javascript:image_click(<?=$k?>, '<?=$imagesResults2{'large'}?>', '<?=$imagesResults2{'main'}?>')" border="0"><img src='admin/images/properties/<?=$imagesResults2{'thumb'}?>' width='53px' height='45px' id="pimage<?=$k?>" name="pimage<?=$k?>" border='0'></a> </div> <? $k++; $imagecount++; } ?> Then here i want to display a different image based on how many images it brings back but i am getting an error. <?php if ($imagecount <= 6); { ?> <div class='mainImageBox' style='float:right; background-image:url(/images/mainImageBox.jpg);'> <?php } else { ?><div class='mainImageBox' style='float:right; background-image:url(/images/bigmainImageBox.jpg);'> <?php } ?> its an Parse error: syntax error, unexpected T_ELSE in D:\Inetpub\wwwroot\dhcottages.co.uk\testsite\details.php on line 233 error and it seems to be this line else { ?><div class='mainImageBox' style='float:right; background-image:url(/images/bigmainImageBox.jpg);'> <?php } ?>
  7. i have this code. $k =1; foreach ($imagesResults as $imagesResults2){ ?> <div class='thumbPhoto' style='margin-left:-3px;margin-right:8px;'> <a href="javascript:image_click(<?=$k?>, '<?=$imagesResults2{'large'}?>', '<?=$imagesResults2{'main'}?>')" border="0"><img src='admin/images/properties/<?=$imagesResults2{'thumb'}?>' width='53px' height='45px' id="pimage<?=$k?>" name="pimage<?=$k?>" border='0'></a> </div> <? $k++; } ?> and i want to find out how many rows there are, because i then need to do an if statement to see if there are more than 5 rows do this etc
  8. Hi guys, i have a searchBar.php script which populates counties it works on this page http://www.dhcottages.co.uk/testsite/details.php?id=75 But not any other page e.g http://www.dhcottages.co.uk/testsite/index.php heres the code for the searchBar.php <? $countySQL='SELECT DISTINCT p.county_id, c.county FROM properties p JOIN county c ON p.county_id = c.id WHERE status = \'online\' order by county ASC'; $locationcounty = $db->query($countySQL); if(!isset($arrivalDate))$arrivalDate =''; if(!isset($departure))$departure =''; if(!isset($location))$location =''; if(!isset($sleeps))$sleeps =''; if(!isset($pets))$pets =''; if(!isset($shortBreaks))$shortBreaks =''; ?> <div id="searchNav"> <div style="clear:both;">Search</div> <form method='POST' name='search' id='search' action='list.php'> <input type='text' name='arrival' class='date-pick' id="arrival" style='font-size:11px;'<? if (!empty($arrivalDate)){?>value="<?=$arrivalDate?>"<? }else{?>value="Arrival"<? }?> /> <input name='departure' id="departure" class="date-pick" type="text" style='font-size:11px;'<? if (!empty($departureDate)){?>value="<?=$departureDate?>"<? }else{?>value="Departure"<? }?> /> <select name='location' class='searchDropDown' style='margin-top:5px;'> <option value='' <? if ( $location == '' ){echo 'selected';}?>>County</option> <? foreach($locationcounty as $locationcounty2) { ?> <option value='<?=$locationcounty2{'county_id'}?>' ><?=$locationcounty2{'county'}?></option> <? } ?> </select> <select name='sleeps' class='searchDropDown'> <option value='' <? if ($sleeps == ''){echo 'selected';}?>>Sleeps</option> <option value='1'<? if ($sleeps == '1'){echo 'selected';}?>>1</option> <option value='2'<? if ($sleeps == '2'){echo 'selected';}?>>2</option> <option value='3'<? if ($sleeps == '3'){echo 'selected';}?>>3</option> <option value='4'<? if ($sleeps == '4'){echo 'selected';}?>>4</option> <option value='5'<? if ($sleeps == '5'){echo 'selected';}?>>5</option> <option value='6'<? if ($sleeps == '6'){echo 'selected';}?>>6</option> <option value='7<? if ($sleeps == '7'){echo 'selected';}?>'>7</option> <option value='8'<? if ($sleeps == '8'){echo 'selected';}?>>8</option> <option value='9'<? if ($sleeps == '9'){echo 'selected';}?>>9</option> <option value='10'<? if ($sleeps == '10'){echo 'selected';}?>>10</option> </select> <select name='pets' class='searchDropDown'> <option value=''>Pets</option> <option value='yes' <? if ( $pets == 'yes' ){echo 'selected';}?>>Yes</option> <option value='no' <? if ( $pets == 'no' ){echo 'selected';}?>>No</option> </select> <table border='0'> <tr> <td>Short Breaks</td><td><input type="checkbox" name="short" value='checked'<?=$shortBreaks?>></td> </tr> <tr> <td><a href="javascript:document.getElementById('search').submit()"><img src='images/searchSquare.gif' border='0' style='margin-left:25px; margin-top:-3px;'></a></td> </tr> </table> </form> </div> <script type='text/javascript'> $(function() { $('.date-pick').datePicker({clickInput:true}) $('#arrival').bind( 'dpClosed', function(e, selectedDates) { var d = selectedDates[0]; if (d) { d = new Date(d); $('#departure').dpSetStartDate(d.addDays(1).asString()); } } ); $('#departure').bind( 'dpClosed', function(e, selectedDates) { var d = selectedDates[0]; if (d) { d = new Date(d); $('#arrival').dpSetEndDate(d.addDays(-1).asString()); } } ); }); </script> And heres the code for the index.php so you can see maybe there is some confliciotn <?php $page_id = 'home'; $title = 'Home'; include('lib/includes/header.php'); ?> <!-- START OF MAIN CONTENT --> <? include('lib/includes/searchBar.php'); ?> <div class="topItem"><a href="list.php"><img src='images/take_a_look.jpg' border='0'></a></div> <div class="topItem"><a href="map.php"><img src='images/dorsetMap.jpg' border='0'></a></div> <div class="bottomItem"><a href="list.php?short=checked"><img src='images/short_term.jpg' border='0'></a></div> <div class="bottomItem"><a href="brochureRequest.php"><img src='images/brochure.jpg' border='0'></a></div> <BR clear='all'><BR clear='all'> </NOFRAMES> <!-- END OF MAIN CONTENT --> <?php include('lib/includes/footer.php'); ?>
  9. As above really i have this code and i need the images to float to the left of each other. <div class='icons'><img src='images/noSmoking.jpg' alt='No smoking'></div> <? if ($cottageResults[0]{'pets'} == 'checked') { ?> <div class='icons'><img src='images/Pets.jpg' alt='Pets allowed'></div> <? } else { ?> <div class='icons'><img src='images/noPets.jpg' alt='No pets'></div> <? } if ($cottageResults[0]{'linen'} == 'linen' || $cottageResults[0]{'linen'} == 'both') { ?> <div class='icons'><img src='images/linen.jpg' alt='Linen provided'></div> <? } ?> <? if ($cottageResults[0]{'linen'} == 'towels' || $cottageResults[0]{'linen'} == 'both') { ?> <div class='icons'><img src='images/towels.jpg' alt='Towels provided'></div> <? } ?> <? if ($cottageResults[0]{'changeOver'} == 'Friday') { ?> <div class='icons'><img src='images/friday.jpg' alt='Friday changeover'></div> <? } if ($cottageResults[0]{'changeOver'} == 'Saturday') { ?> <div class='icons'><img src='images/saturday.jpg' alt='Saturday chnageover'></div> <? } if ($cottageResults[0]{'parking'} != 0) { ?> <div class='icons'><img src='images/parking.jpg' alt='Parking available'></div> <? } ?>
  10. Hi i have got it working thanks. this if ($cottage[0]{'changeOver'} == 'Friday') should have been if ($cottage ['changeOver'] == 'Friday')
  11. Hi and thank you, i have changed them all accordingly , but its still not working. if you can go here http://www.dhcottages.co.uk/testsite/list.php?page=1&limit=5&order=RAND%280.1242%29&garden=&openFire=&coastal=&shortBreaks=&pets=&sleeps=&location=&departureDate=&arrivalDate= you can see that every listing has the dog crossed out, it if you click more details, it takes you to the page with the icons that should be visible
  12. I have this code, which should display images based on wether fields are checked or not. //This is where code should go! ?> <? if ($cottage[0]{'pets'} == 'checked') { ?> <div class='icons'><img src='images/Pets.jpg' alt='Pets allowed'></div> <? } else { ?> <div class='icons'><img src='images/noPets.jpg' alt='No pets'></div> <? } if($cottage[0]{'linen'} == 'linen' || $cottage[0]{'linen'} == 'both') { ?> <div class='icons'><img src='images/linen.jpg' alt='Linen provided'></div> <? } ?> <? if ($cottage[0]{'linen'} == 'towels' || $cottage[0]{'linen'} == 'both') { ?> <div class='icons'><img src='images/towels.jpg' alt='Towels provided'></div> <? } ?> <? if ($cottage[0]{'changeOver'} == 'Friday') { ?> <div class='icons'><img src='images/friday.jpg' alt='Friday changeover'></div> <? } And heres the code for the entire page. <?php require_once('admin/lib/scripts/php/functions.php'); dbConnect(); session_start(); /*top drop down search*/ $locationsQuery = dbExec("SELECT DISTINCT p.county_id, c.county FROM properties p JOIN county c ON p.county_id = c.id WHERE status = 'online' ORDER BY county ASC"); //set up defaults $arrivalDate = ''; $departureDate = ''; $location = ''; $sleeps =''; $pets =''; $shortBreaks =''; $coastal =''; $openFire =''; $garden =''; if(isset($_SESSION['rand'])){ $rand = $_SESSION['rand']; }else{ $rand = ''; } if (empty($rand)) { srand((float)microtime()*1000000); $rand = "0.".rand(); $_SESSION['rand'] = $rand; } $order = 'RAND('.$rand.')'; $limit = 5; $page = 1; if(isset($_GET['short'])){ $shortBreaks = 'checked'; } if(isset($_GET['location'])){ $location = $_GET['location']; } //Check for post variables if(isset($_POST['arrival'])){ $arrivalDate = $_POST['arrival']; $departureDate = $_POST['departure']; $location = $_POST['location']; $sleeps = $_POST['sleeps']; $pets = $_POST['pets']; if(isset($_POST['short'])){ $shortBreaks = ($_POST['short'] == 'checked')? 'checked': ''; } if(isset($_POST['coastal'])) $coastal = 'checked'; if(isset($_POST['openFire'])) $openFire = 'checked'; if(isset($_POST['garden'])) $garden = 'checked'; if(isset($_POST['order'])) $order = $_POST['order']; if(isset($_POST['limit'])) $limit = $_POST['limit']; } //Check for paging variables if(isset($_GET['page'])){ $arrivalDate = $_GET['arrivalDate']; $departureDate = $_GET['departureDate']; $location = $_GET['location']; $sleeps =$_GET['sleeps']; $pets =$_GET['pets']; $shortBreaks =$_GET['shortBreaks']; $coastal =$_GET['coastal']; $openFire =$_GET['openFire']; $garden =$_GET['garden']; $order = $_GET['order']; $limit = $_GET['limit']; $page = $_GET['page']; } //location filter if($location <> ''){ $locationSQL = ' AND county_id = \''.$location.'\''; }else{ $locationSQL = ''; } //sleeps filter if($sleeps <> ''){ $sleepsSQL = ' AND maxGuests = '.$sleeps.''; }else{ $sleepsSQL = ''; } //pets filter if($pets == 'yes'){ $petsSQL = ' AND pets = \'checked\''; }else if($pets == 'no'){ $petsSQL = ' AND pets != \'checked\''; }else{ $petsSQL = ''; } //coastal filter if($coastal <> ''){ $coastalSQL = ' AND costal = \'checked\''; }else{ $coastalSQL = ''; } //open fire filter if($openFire <> ''){ $openFireSQL = ' AND openFire = \'checked\''; }else{ $openFireSQL = ''; } //garden filter if($garden <> ''){ $gardenSQL = ' AND garden = \'checked\''; }else{ $gardenSQL = ''; } //short breaks filter if($shortBreaks <> ''){ $shortBreaksSQL = ' AND shortBreaks = \'checked\''; }else{ $shortBreaksSQL = ''; } //calculate arrival and departure dates $dateSQL = ''; if(($arrivalDate <> '' && $arrivalDate <> 'Arrival') || ($departureDate <> '' && $departureDate <> 'Departure')){ if($arrivalDate == '' || $arrivalDate == 'Arrival'){ //only departure date entered $departure_date = explode("/", $departureDate); $departure_date = $departure_date[2].$departure_date[1].$departure_date[0]; $dateSQL = " AND p.id NOT IN (SELECT property_id FROM bookings WHERE (('$departure_date' < departure_date AND '$departure_date' > arrival_date) OR (departure_date = '$departure_date')))"; }else if($departureDate == '' || $departureDate == 'Departure'){ //only arrival date entered $arrival_date = explode("/", $arrivalDate); $arrival_date = $arrival_date[2].$arrival_date[1].$arrival_date[0]; $dateSQL = " AND p.id NOT IN (SELECT property_id FROM bookings WHERE (('$arrival_date' > arrival_date AND '$arrival_date' < departure_date) OR (arrival_date = '$arrival_date')))"; }else{ //both dates entered $departure_date = explode("/", $departureDate); $departure_date = $departure_date[2].$departure_date[1].$departure_date[0]; $arrival_date = explode("/", $arrivalDate); $arrival_date = $arrival_date[2].$arrival_date[1].$arrival_date[0]; $dateSQL = " AND p.id NOT IN (SELECT property_id FROM bookings WHERE (('$arrival_date' < arrival_date AND '$departure_date' > arrival_date) OR ('$arrival_date' < departure_date AND '$departure_date' > departure_date ) OR ('$arrival_date' >= arrival_date AND '$departure_date' <= departure_date )))"; } } //get properties $cottageQueryAll = dbExec("SELECT p.*, (SELECT thumb FROM images WHERE product_id = p.id LIMIT 1) AS thumb FROM properties p WHERE p.status = 'online' $dateSQL $locationSQL $sleepsSQL $petsSQL $coastalSQL $openFireSQL $gardenSQL $shortBreaksSQL"); //calculate pages $totalCottages = mysql_num_rows($cottageQueryAll); if($limit > ''){ $pages = ceil($totalCottages / $limit); }else{ $pages = 0; } //calculate order by $orderBy = ($order <> '')? 'ORDER BY '.$order : ''; if($limit <> ''){ if($page == 1){ $pageStart = 0; }else{ $pageStart = ($page-1) * $limit; } $limitBy = 'LIMIT '.$pageStart.','.$limit; }else{ $limitBy = ''; } $cottageQuery = dbExec("SELECT p.*, (SELECT thumb FROM images WHERE product_id = p.id LIMIT 1) AS thumb FROM properties p WHERE p.status = 'online' $dateSQL $locationSQL $sleepsSQL $petsSQL $coastalSQL $openFireSQL $gardenSQL $shortBreaksSQL $orderBy $limitBy"); $page_id = 'home'; $title = 'Home'; include('lib/includes/header.php'); //$arrivalSQL = "SELECT * FROM bookings WHERE (('$arrival_date' < arrival_date AND '$departure_date' > arrival_date) OR ('$arrival_date' < departure_date AND '$departure_date' > departure_date ) OR ('$arrival_date' >= arrival_date AND '$departure_date' <= departure_date ))"; ?> <!-- START OF MAIN CONTENT --> <? include('lib/includes/searchBar.php'); ?> <div id='listContents'> <form method='POST' name='filter' id='filter' action='list.php' style="padding:0; margin:0;"> <div class="thinTitle">Filter cottages</div> <div class="filterBox"> <input name="departure" value="<?=$departureDate?>" type="hidden" /> <input name="arrival" value="<?=$arrivalDate?>" type="hidden" /> <input name="short" value="<?=$shortBreaks?>" type="hidden" /> <table border='0'> <tr> <td> <select name='pets' class='searchDropDown'> <option value=''>Pets</option> <option value='yes' <? if ( $pets == 'yes' ){echo 'selected';}?>>Yes</option> <option value='no' <? if ( $pets == 'no' ){echo 'selected';}?>>No</option> </select> </td> <td> <select name='location' class='searchDropDown'> <option value=''>Location</option> <? while($locationResults = mysql_fetch_array($locationsQuery)){ ?> <option value='<?=$locationResults['county_id']?>' <? if($location == $locationResults['county_id']){echo 'selected';}?>><?=$locationResults['county']?></option> <? } ?> </select> </td> <td width='200'> <select name='sleeps' class='searchDropDown'> <option value='' <? if ( $sleeps == "" ){echo 'selected';}?>>Sleeps</option> <option value='1' <? if ( $sleeps == '1' ){echo 'selected';}?>>1</option> <option value='2' <? if ( $sleeps == '2' ){echo 'selected';}?>>2</option> <option value='3' <? if ( $sleeps == '3' ){echo 'selected';}?>>3</option> <option value='4' <? if ( $sleeps == '4' ){echo 'selected';}?>>4</option> <option value='5' <? if ( $sleeps == '5' ){echo 'selected';}?>>5</option> <option value='6' <? if ( $sleeps == '6' ){echo 'selected';}?>>6</option> <option value='7' <? if ( $sleeps == '7' ){echo 'selected';}?>>7</option> <option value='8' <? if ( $sleeps == '8' ){echo 'selected';}?>>8</option> <option value='9' <? if ( $sleeps == '9' ){echo 'selected';}?>>9</option> <option value='10' <? if ( $sleeps == '10' ){echo 'selected';}?>>10</option> </select> </td> <td> <div class='button'><a href="javascript:document.getElementById('filter').submit()">Refresh</a></div> </td> </tr> </table> <table class='blueText'> <tr> <td>Coastal</td> <td width='110'><input type="checkbox" name="coastal" value='checked' <?=$coastal?>></td> <td>Open Fire</td> <td width='100'><input type="checkbox" name="openFire" value='checked' <?=$openFire?>></td> <td>Garden</td> <td><input type="checkbox" name="garden" value='checked' <?=$garden?>></td> </tr> </table> </div> <div class='yellowLine' style="margin:10px 0 10px 0;"></div> <table border='0' bgcolor='#252645' width="100%"> <tr> <td width='200px' valign='middle' style="padding-left:10px;">Cottage results (<?=$totalCottages?>):</td> <td width='150px' valign='middle'></td> <td valign='middle' width="100px">Show: <select name='limit' class='searchDropDownNew' onchange='document.filter.submit()'> <option value='5' <? if ( $limit == '5' ){echo 'selected';}?>>5</option> <option value='10'<? if ( $limit == '10' ){echo 'selected';}?>>10</option> <option value='20'<? if ( $limit == '20' ){echo 'selected';}?>>20</option> <option value='30'<? if ( $limit == '30' ){echo 'selected';}?>>30</option> <option value='40'<? if ( $limit == '40' ){echo 'selected';}?>>40</option> <option value='50'<? if ( $limit == '50' ){echo 'selected';}?>>50</option> <option value=''<? if ( $limit == '' ){echo 'selected';}?>>All</option> </select> </td> <td valign='middle'>Order by: <select name='order' class='searchDropDownNew' onchange='document.filter.submit()'> <option value=''>Please select</option> <option value='location ASC'<? if ( $order == 'location ASC' ){echo 'selected';}?>>Location A-Z</option> <option value='location DESC'<? if ( $order == 'location DESC' ){echo 'selected';}?>>Location Z-A</option> <option value='propertyName ASC'<? if ( $order == 'propertyName ASC' ){echo 'selected';}?>>Name A-Z</option> <option value='propertyName DESC'<? if ( $order == 'propertyName DESC' ){echo 'selected';}?>>Name Z-A</option> <option value='maxGuests ASC'<? if ( $order == 'maxGuests ASC' ){echo 'selected';}?>>Sleeps Low-High</option> <option value='maxGuests DESC'<? if ( $order == 'maxGuests DESC' ){echo 'selected';}?>>Sleeps High-Low</option> </select> </td> </tr> </table> </form> <br /> <div id='searchResultsContainer'> <? if(mysql_num_rows($cottageQuery)){ while($cottage = mysql_fetch_array($cottageQuery)){ if($cottage['thumb']<>''){ $img = "<a href='details.php?id=".$cottage['id']."'><img src='admin/images/properties/".$cottage['thumb']."' class='imageBorder'></a>"; }else{ $img = " "; } $thisSat = date("Ymd", strtotime("saturday")); $thisSun = date("Ymd", strtotime("sunday")); $weekendCheckQuery = dbExec("SELECT property_id FROM bookings WHERE (('$thisSat' < arrival_date AND '$thisSun' > arrival_date) OR ('$thisSat' < departure_date AND '$thisSun' > departure_date ) OR ('$thisSat' >= arrival_date AND '$thisSun' <= departure_date )) AND property_id = ".$cottage['id'].""); if(mysql_num_rows($weekendCheckQuery)){ $thisWeekend = '<span style="padding: 0px 0 0px 3px; clear:both; display:block;"> </span>'; }else{ $thisWeekend = '<span style="padding: 5px 0 5px 3px; clear:both; display:block;">Available this weekend</span>'; } ?> <div class='orangeBorderTop'> </div> <div class='orangeBorderMiddle'> <table border='0' class='blueText2' style='margin:0px'> <tr> <td width='100'><?=$img?></td> <td valign='top' width='370'> <a href='details.php?id=<?=$cottage['id']?>'><span class='blueTextBold'><?=$cottage['propertyName']?> - <?=$cottage['location']?></span></a><br /> <a href='details.php?id=<?=$cottage['id']?>'class='blueText2'><?=$cottage['list_description']?>...[more]</a> </td> <td width='20'></td> <td valign="top"> <img src="images/beds/<?=$cottage['bedrooms']?>.png" /><img src="images/sleeps/<?=$cottage['maxGuests']?>.png" /><br /> <?=$thisWeekend?> <a href='details.php?id=<?=$cottage['id']?>'><img src='images/take.gif' border='0'></a> <? //This is where code should go! ?> <? if ($cottage[0]{'pets'} == 'checked') { ?> <div class='icons'><img src='images/Pets.jpg' alt='Pets allowed'></div> <? } else { ?> <div class='icons'><img src='images/noPets.jpg' alt='No pets'></div> <? } if($cottage[0]{'linen'} == 'linen' || $cottage[0]{'linen'} == 'both') { ?> <div class='icons'><img src='images/linen.jpg' alt='Linen provided'></div> <? } ?> <? if ($cottage[0]{'linen'} == 'towels' || $cottage[0]{'linen'} == 'both') { ?> <div class='icons'><img src='images/towels.jpg' alt='Towels provided'></div> <? } ?> <? if ($cottage[0]{'changeOver'} == 'Friday') { ?> <div class='icons'><img src='images/friday.jpg' alt='Friday changeover'></div> <? } //end code ?> </td> </tr> </table> </div> <div class='orangeBorderBottom'> </div> <? } }else{ ?> <div class='blueText'><p class='font1'>No results found.</p></div> <? } ?> <div class='paginationBar'> <? $queryString = '&limit='.$limit.'&order='.$order.'&garden='.$garden.'&openFire='.$openFire.'&coastal='.$coastal.'&shortBreaks='.$shortBreaks.'&pets='.$pets.'&sleeps='.$sleeps.'&location='.$location.'&departureDate='.$departureDate.'&arrivalDate='.$arrivalDate; for($i=1; $i<=$pages; $i++){ if($i < ($pages)){ if($i == $page){ echo '<strong>'.$i.'</strong> | '; }else{ echo '<a href="list.php?page='.$i.$queryString.'">'.$i.'</a> | '; } }else{ if($i == $page){ echo '<strong>'.$i.'</strong>'; }else{ echo '<a href="list.php?page='.$i.$queryString.'">'.$i.'</a>'; } } } ?> </div> </div> </div> <!-- END OF MAIN CONTENT --> <? include('lib/includes/brochureBar.php'); ?> <BR clear='all'> <?php include('lib/includes/footer.php'); ?> Any help would be brilliant thanks in advance guys
  13. i have this code for displaying pictures big and small. Now i have added a the first link in here <div class='mainPhoto'><a href = "admin/images/properties/<?=$imagesResults[0]{'large'}?>" rel="lightbox" ><img src='admin/images/properties/<?=$imagesResults[0]{'main'}?>' width='299px' height='189px' name="large"></a></div> the image when you click on any of there others just shows the same image. I think i need to change some java script. <script language="JavaScript"><!-- //thumbnail script $(document).ready(function(){ <? $y = 1; foreach ($imagesResults as $imageData) { ?> image<?=$y?> =new Image(); <? $y++; } ?> // This defines the source of the display image <? $i = 1; foreach ($imagesResults as $imageData1) { ?> image<?=$i?>.src ="admin/images/properties/<?=$imageData1{'large'}?>" <? $i++; } ?> // This defines the source of the preview image <? $r = 1; foreach ($imagesResults as $imageData2) { ?> document.images['pimage<?=$r?>'].src=image<?=$r?>.src; <? $r++; } ?> }) // This defines what to do when an image is clicked on function image_click(clicks) { <? $x = 1; foreach ($imagesResults as $imageData3) { ?> if(clicks==<?=$x?>){document.images['large'].src=image<?=$x?>.src;} <? $x++; } ?> } // --></script> Can anyone point me in the right direction if you go here and click on any of the smaller images then click on the main image no matter what smaller image you have selected the bigger one is always the same. http://www.dhcottages.co.uk/testsite/details.php?id=75
  14. Can someone tell me how i add a light box effect to this code please <img src='admin/images/properties/<?=$imagesResults[0]{'large'}?>
  15. Hi guys, i have it working now. Cheers
  16. OK i have managed to get them to join using this $locationSQL='SELECT p.county_id, c.county FROM properties p JOIN county c ON p.county_id = c.county WHERE status = \'online\' order by location ASC'; $locationResults = $db->query($locationSQL); Now i should be able to access county on the county table. But the option boxes arnt getting filled with the county. <select name='location' class='searchDropDown' style='margin-top:5px;'> <option value='' <? if ( $location == '' ){echo 'selected';}?>>County</option> <? foreach($locationResults as $locationResults2) { ?> <option value='<?=$locationResults2{'county_id'}?>' <? if ( $location == $locationResults2{'county_id'} ){echo 'selected';}?>><?=$locationResults2{'county'}?></option> <? } ?> </select> Please someone help, im on a deadline
  17. How can i join my tables i have this sql $locationSQL='SELECT county_id FROM properties WHERE status = \'online\' order by location ASC'; $locationResults = $db->query($locationSQL); but i have a county table with fields id and county i need to be able to access county so i can fill a option box with the county
  18. Basically all i have done is just modified some code and added an area section. The form is allready submitting other things like location price etc. And i have simply added a field in db called area and changes to the page, everything else submits appart from the area. Add properties.php (this has form which gets processed on addimages2.php addProperties.php <?php include('../lib/scripts/php/functions.php'); $page_title='Add Properties'; $page_id_top = 'properties'; $page_id = 'add'; if(isset($_GET['error_code'])) { $error_id = 'Highlighted fields are required'; $highlight = true; } include('../lib/includes/header.php'); $ownerSQL = 'SELECT * FROM owners'; $ownerResults = $db->query($ownerSQL); $property_id =''; $costal =''; $garden =''; $openFire =''; $pets =''; $disabled =''; $groundFloor =''; $shortBreaks =''; $baby =''; $data =''; if (empty($_GET['get_owner'])) { $_GET['get_owner'] = ''; } if (empty($_GET['get_grading'])) { $_GET['get_grading'] = ''; } if (empty($_GET['get_maxGuests'])) { $_GET['get_maxGuests'] = ''; } if (empty($_GET['get_bedrooms'])) { $_GET['get_bedrooms'] = ''; } if (empty($_GET['get_parking'])) { $_GET['get_parking'] = ''; } if (empty($_GET['get_petsAmount'])) { $_GET['get_petsAmount'] = ''; } if (empty($_GET['get_status'])) { $_GET['get_status'] = ''; } if (empty($_GET['get_changeOver'])) { $_GET['get_changeOver'] = ''; } if (empty($_GET['get_linen'])) { $_GET['get_linen'] = ''; } if (empty($_GET['get_special1'])) { $_GET['get_special1'] = ''; } if (empty($_GET['get_special2'])) { $_GET['get_special2'] = ''; } if (empty($_GET['get_access'])) { $_GET['get_access'] = ''; } if (empty($_GET['get_area'])) { $_GET['get_area'] = ''; } if(isset($_GET['id'])) { $property_id = $_GET['id']; $propertiesSQL = "SELECT * FROM properties WHERE id = '$property_id'"; $data = $db->query($propertiesSQL); $_GET['get_owner'] = $data[0]['owner']; $_GET['get_grading'] = $data[0]['grading']; $_GET['get_maxGuests'] = $data[0]['maxGuests']; $_GET['get_bedrooms'] = $data[0]['bedrooms']; $_GET['get_parking'] = $data[0]['parking']; $_GET['get_petsAmount'] = $data[0]['petsAmount']; $_GET['get_status'] = $data[0]['status']; $_GET['get_changeOver'] = $data[0]['changeOver']; $_GET['get_linen'] = $data[0]['linen']; $_GET['get_special1'] = $data[0]['special1']; $_GET['get_special2'] = $data[0]['special2']; $_GET['get_access'] = $data[0]['access']; /*New area*/ $_GET['get_area'] = $data[0]['area']; } if (empty($data)) { if (!empty($_GET['get_owner'])) { $data[0]['owner'] = $_GET['get_owner']; } else { $data[0]['owner'] = ''; } if (!empty($_GET['get_propertyName'])) { $data[0]['propertyName'] = $_GET['get_propertyName']; } else { $data[0]['propertyName'] = ''; } if (!empty($_GET['get_changeOver'])) { $data[0]['changeOver'] = $_GET['get_changeOver']; } else { $data[0]['changeOver'] = ''; } if (!empty($_GET['get_linen'])) { $data[0]['linen'] = $_GET['get_linen']; } else { $data[0]['linen'] = ''; } if (!empty($_GET['get_special1'])) { $data[0]['special1'] = $_GET['get_special1']; } else { $data[0]['special1'] = ''; } if (!empty($_GET['get_special2'])) { $data[0]['special2'] = $_GET['get_special2']; } else { $data[0]['special2'] = ''; } if (!empty($_GET['get_access'])) { $data[0]['access'] = $_GET['get_access']; } else { $data[0]['access'] = ''; } if (!empty($_GET['get_location'])) { $data[0]['location'] = $_GET['get_location']; } else { $data[0]['location'] = ''; } /**********************New**************************/ /*Building in functionality for area search*/ /***************************************************/ if (!empty($_GET['area'])) { $data[0]['area'] = $_GET['get_area']; } else { $data[0]['area'] = ''; } /***********************************************/ if (!empty($_GET['get_grading'])) { $data[0]['grading'] = $_GET['get_grading']; } else { $data[0]['grading'] = ''; } if (!empty($_GET['get_description'])) { $data[0]['description'] = $_GET['get_description']; } else { $data[0]['description'] = ''; } if (!empty($_GET['get_list_description'])) { $data[0]['list_description'] = $_GET['get_list_description']; } else { $data[0]['list_description'] = ''; } if (!empty($_GET['get_maxGuests'])) { $data[0]['maxGuests'] = $_GET['get_maxGuests']; } else { $data[0]['maxGuests'] = ''; } if (!empty($_GET['get_bedrooms'])) { $data[0]['bedrooms'] = $_GET['get_bedrooms']; } else { $data[0]['bedrooms'] = ''; } if (!empty($_GET['get_parking'])) { $data[0]['parking'] = $_GET['get_parking']; } else { $data[0]['parking'] = ''; } if (!empty($_GET['get_petsAmount'])) { $data[0]['petsAmount'] = $_GET['get_petsAmount']; } else { $data[0]['petsAmount'] = ''; } if (!empty($_GET['postcode'])) { $data[0]['postcode'] = $_GET['postcode']; } else { $data[0]['postcode'] = ''; } if (!empty($_GET['get_baby'])) { $data[0]['baby'] = 'checked'; } else { $data[0]['baby'] = ''; } if (!empty($_GET['get_costal'])) { $data[0]['costal'] = 'checked'; } else { $data[0]['costal'] = ''; } if (!empty($_GET['get_garden'])) { $data[0]['garden'] = 'checked'; } else { $data[0]['garden'] = ''; } if (!empty($_GET['get_openFire'])) { $data[0]['openFire'] = 'checked'; } else { $data[0]['openFire'] = ''; } if (!empty($_GET['get_pets'])) { $data[0]['pets'] = 'checked';; } else { $data[0]['pets'] = ''; } if (!empty($_GET['get_disabled'])) { $data[0]['disabled'] = 'checked'; } else { $data[0]['disabled'] = ''; } if (!empty($_GET['get_groundFloor'])) { $data[0]['groundFloor'] = 'checked'; } else { $data[0]['groundFloor'] = ''; } if (!empty($_GET['get_shortBreaks'])) { $data[0]['shortBreaks'] = 'checked'; } else { $data[0]['shortBreaks'] = ''; } if (!empty($_GET['get_status'])) { $data[0]['status'] = 'checked'; } else { $data[0]['status'] = ''; } if (!empty($_GET['get_offline'])) { $data[0]['offline'] = $_GET['offline']; } else { $data[0]['offline'] = ''; } if (!empty($_GET['get_security_fee'])) { $data[0]['security_fee'] = $_GET['get_security_fee']; } else { $data[0]['security_fee'] = ''; } if (!empty($_GET['get_booking_fee'])) { $data[0]['booking_fee'] = $_GET['get_booking_fee']; } else { $data[0]['booking_fee'] = ''; } } ?> <div id="sub_nav"> <? include('subnav2.php');?> </div> <div id="content"> <div id="content_tab"> <!--START OF PAGE TABS--> <? include('add_tabs.php');?> <!--END OF PAGE TABS--> </div> <div id="content_contents"> <!--START OF PAGE CONTENT--> <div class="contentForm"> <form name="addProperties" id="addProperties" method="post" action="properties/addImages.php?id=<?=$property_id?>"> <table border='0' width='700'> <tr> <td width='15%'><? if (!empty($_GET['owner'])){?><font color='red'>Owner:</font><?}else{?>Owner:<?}?></td> <td width='40%'> <select class="list" name="owner" style='width:155px'> <option value ="999" <? if ( $_GET['get_owner'] == '999' ){echo 'selected';}?> >Please Select</option> <? foreach($ownerResults as $ownerResults2) { ?> <option value ="<?=$ownerResults2{'id'}?>" <? if ( $_GET['get_owner'] == $ownerResults2{'id'} ){echo 'selected';}?> ><?=$ownerResults2{'title'}.' '.$ownerResults2{'name'}.' '.$ownerResults2{'surname'}?></option> <? } ?> </select> </td> <td>Status</td> <td> <select name="status" style='width:150px'> <option value ="offline" class="reviewOffline"<? if ( $_GET['get_status'] == 'offline' ){echo 'selected';}?> >Offline</option> <option value ="online" class="reviewOnline"<? if ( $_GET['get_status'] == 'online' ){echo 'selected';}?> >Online</option> </select> </td> </tr> <tr> <td><? if (!empty($_GET['propertyName'])){?><font color='red'>Property Name:</font><?}else{?>Property Name:<?}?></td> <td><input class="inputBox" name="propertyName" type="text" value="<?=$data[0]['propertyName']?>" /></td> <td><? if (!empty($_GET['changeOver'])){?><font color='red'>Change over day:</font><?}else{?>Change over day:<?}?></td> <td> <select class="list" name="changeOver" style='width:150px'> <option value ="" <? if ( $_GET['get_changeOver'] == "" ){echo 'selected';}?> >Please select</option> <option value ="Friday" <? if ( $_GET['get_changeOver'] == "Friday" ){echo 'selected';}?> >Friday</option> <option value ="Saturday" <? if ( $_GET['get_changeOver'] == "Saturday" ){echo 'selected';}?> >Saturday</option> </select> </td> </tr> <tr> <td><? if (!empty($_GET['postcode'])){?><font color='red'>Postcode:</font><?}else{?>Postcode:<?}?></td> <td><input class="inputBox" name="postcode" type="text" value="<?=$data[0]['postcode']?>" /></td> <td></td> <td></td> </tr> <tr> <td><? if (!empty($_GET['location'])){?><font color='red'>Location:</font><?}else{?>Location:<?}?></td> <td><input class="inputBox" name="location" type="text" value="<?=$data[0]['location']?>"/></td> <?php //*********************************// // Drop down box with location values //*********************************//?> <tr> <td><? if (!empty($_GET['area'])){?><font color='red'>Area:</font><?}else{?>Area:<?}?></td> <td> <select class="list" name="area" style='width:150px'> <option value ="South West">South West</option> <option value ="South East" >South East</option> <option value ="London" >London</option> <option value ="East Anglia" >East Anglia</option> <option value ="West Midlands" >West Midlands</option> <option value ="North West" >North West</option> <option value ="Yorkshire and Humberside" >Yorkshire and Humberside</option> <option value ="North East">North East</option> </select> </td> </tr> <? //*************************************************************************************************************************/?> <td><? if (!empty($_GET['grading'])){?><font color='red'>Grading:</font><?}else{?>Grading:<?}?></td> <td> <select class="list" name="grading" style='width:150px'> <option value ="6" <? if ( $_GET['get_grading'] == "6" ){echo 'selected';}?> >No grade</option> <option value ="1" <? if ( $_GET['get_grading'] == '1' ){echo 'selected';}?> >1 stars</option> <option value ="2" <? if ( $_GET['get_grading'] == '2' ){echo 'selected';}?> >2 stars</option> <option value ="3" <? if ( $_GET['get_grading'] == '3' ){echo 'selected';}?> >3 stars</option> <option value ="4" <? if ( $_GET['get_grading'] == '4' ){echo 'selected';}?> >4 stars</option> <option value ="5" <? if ( $_GET['get_grading'] == '5' ){echo 'selected';}?> >5 stars</option> </select> </td> </tr> <tr> <td valign='top'><? if (!empty($_GET['description'])){?><font color='red'>Description:</font><?}else{?>Description:<?}?></td> <td colspan='3'><textarea name='description' cols='63' rows='5'><?=$data[0]['description']?></textarea></td> </tr> <tr> <td valign='top'><? if (!empty($_GET['list_description'])){?><font color='red'>Short Description:</font><?}else{?>Short Description:<?}?></td> <td colspan='3'> <textarea name=list_description wrap=physical cols=63 rows=3 onKeyDown="textCounter(this.form.list_description,this.form.remLen,300);" onKeyUp="textCounter(this.form.list_description,this.form.remLen,150);"><?=$data[0]['list_description']?></textarea> </td> </tr> </table> <BR> <table> <tr> <td width=''><? if (!empty($_GET['maxGuests'])){?><font color='red'>Max guests:</font><?}else{?>Max guests:<?}?></td> <td width='60'> <select class="list" name="maxGuests"> <option value ="" <? if ( $_GET['get_maxGuests'] == '' ){echo 'selected';}?> ></option> <option value ="1" <? if ( $_GET['get_maxGuests'] == '1' ){echo 'selected';}?> >1</option> <option value ="2" <? if ( $_GET['get_maxGuests'] == '2' ){echo 'selected';}?> >2</option> <option value ="3" <? if ( $_GET['get_maxGuests'] == '3' ){echo 'selected';}?> >3</option> <option value ="4" <? if ( $_GET['get_maxGuests'] == '4' ){echo 'selected';}?> >4</option> <option value ="5" <? if ( $_GET['get_maxGuests'] == '5' ){echo 'selected';}?> >5</option> <option value ="6" <? if ( $_GET['get_maxGuests'] == '6' ){echo 'selected';}?> >6</option> <option value ="7" <? if ( $_GET['get_maxGuests'] == '7' ){echo 'selected';}?> >7</option> <option value ="8" <? if ( $_GET['get_maxGuests'] == '8' ){echo 'selected';}?> >8</option> <option value ="9" <? if ( $_GET['get_maxGuests'] == '9' ){echo 'selected';}?> >9</option> <option value ="10" <? if ( $_GET['get_maxGuests'] == '10' ){echo 'selected';}?> >10</option> </select> </td> <td width=''><? if (!empty($_GET['bedrooms'])){?><font color='red'>Bedrooms:</font><?}else{?>Bedrooms:<?}?></td> <td width='60'> <select class="list" name="bedrooms"> <option value ="" <? if ( $_GET['get_bedrooms'] == '' ){echo 'selected';}?> ></option> <option value ="1" <? if ( $_GET['get_bedrooms'] == '1' ){echo 'selected';}?> >1</option> <option value ="2" <? if ( $_GET['get_bedrooms'] == '2' ){echo 'selected';}?> >2</option> <option value ="3" <? if ( $_GET['get_bedrooms'] == '3' ){echo 'selected';}?> >3</option> <option value ="4" <? if ( $_GET['get_bedrooms'] == '4' ){echo 'selected';}?> >4</option> <option value ="5" <? if ( $_GET['get_bedrooms'] == '5' ){echo 'selected';}?> >5</option> <option value ="6" <? if ( $_GET['get_bedrooms'] == '6' ){echo 'selected';}?> >6</option> <option value ="7" <? if ( $_GET['get_bedrooms'] == '7' ){echo 'selected';}?> >7</option> <option value ="8" <? if ( $_GET['get_bedrooms'] == '8' ){echo 'selected';}?> >8</option> <option value ="9" <? if ( $_GET['get_bedrooms'] == '9' ){echo 'selected';}?> >9</option> <option value ="10" <? if ( $_GET['get_bedrooms'] == '10' ){echo 'selected';}?> >10</option> </select> </td> <td>Parking spaces:</td> <td width='100'> <select class="list" name="parking"> <option value ="" <? if ( $_GET['get_parking'] == '' ){echo 'selected';}?> >None</option> <option value ="6" <? if ( $_GET['get_parking'] == '6' ){echo 'selected';}?> >On road</option> <option value ="1" <? if ( $_GET['get_parking'] == '1' ){echo 'selected';}?> >1</option> <option value ="2" <? if ( $_GET['get_parking'] == '2' ){echo 'selected';}?> >2</option> <option value ="3" <? if ( $_GET['get_parking'] == '3' ){echo 'selected';}?> >3</option> <option value ="4" <? if ( $_GET['get_parking'] == '4' ){echo 'selected';}?> >4</option> <option value ="5" <? if ( $_GET['get_parking'] == '5+' ){echo 'selected';}?> >5+</option> </select> </td> <td>Amount of pets:</td> <td> <select class="list" name="petsAmount"> <option value ="0" <? if ( $_GET['get_petsAmount'] == '0' ){echo 'selected';}?> >None</option> <option value ="1" <? if ( $_GET['get_petsAmount'] == '1' ){echo 'selected';}?> >1</option> <option value ="2" <? if ( $_GET['get_petsAmount'] == '2' ){echo 'selected';}?> >2</option> <option value ="3" <? if ( $_GET['get_petsAmount'] == '3' ){echo 'selected';}?> >3</option> <option value ="4" <? if ( $_GET['get_petsAmount'] == '4' ){echo 'selected';}?> >4</option> <option value ="5" <? if ( $_GET['get_petsAmount'] == '5' ){echo 'selected';}?> >5+</option> </select> </td> </tr> </table> <BR><BR> <table> <tr> <td width='80'>Coastal:</td> <td width='50'><input type='checkbox' name='costal' <?=$data[0]['costal']?>></td> <td width='120'>Garden:</td> <td width='50'><input type='checkbox' name='garden'<?=$data[0]['garden']?>></td> <td width='100'>Open fire:</td> <td width='50'><input type='checkbox' name='openFire'<?=$data[0]['openFire']?>></td> <td width='100'>Sleeps baby:</td> <td width='50'><input type='checkbox' name='baby'<?=$data[0]['baby']?>></td> </tr> <tr> <td>Pets:</td> <td><input type='checkbox' name='pets' <?=$data[0]['pets']?>></td> <td>Disabled Access:</td> <td><input type='checkbox' name='disabled' <?=$data[0]['disabled']?>></td> <td>Ground floor access:</td> <td><input type='checkbox' name='groundFloor' <?=$data[0]['groundFloor']?>></td> <td>Short breaks:</td> <td><input type='checkbox' name='shortBreaks' <?=$data[0]['shortBreaks']?>></td> </tr> </table> <BR><BR> <table> <tr> <td>Security fee</td> <td>£<input class="inputBox" size='8' name="security_fee" type="text" value="<?=$data[0]['security_fee']?>" /></td> </tr> <tr> <td>Booking fee</td> <td>£<input class="inputBox" size='8' name="booking_fee" type="text" value="<?=$data[0]['booking_fee']?>" /></td> </tr> <tr> <td width='100'>Linen provision</td> <td> <select class="list" name="linen"> <option value ="none">None</option> <option value ="linen" <? if ( $_GET['get_linen'] == 'linen' ){echo 'selected';}?> >Linen free of charge</option> <option value ="towels" <? if ( $_GET['get_linen'] == 'towels' ){echo 'selected';}?> >Towels free of charge</option> <option value ="both" <? if ( $_GET['get_linen'] == 'both' ){echo 'selected';}?> >Linen and towels free of charge</option> </select> </td> </tr> <tr> <td>Special feature 1</td> <td><input class="inputBox" size='29' name="special1" type="text" value="<?=$data[0]['special1']?>" /></td> </tr> <tr> <td>Special feature 2</td> <td><input class="inputBox" size='29' name="special2" type="text" value="<?=$data[0]['special2']?>" /></td> </tr> <tr> <td valign='top'>Access Statement:</td> <td colspan='3'><textarea name='access' cols='63' rows='5'><?=$data[0]['access']?></textarea></td> </tr> </table> </form> <BR><BR> </div> <img src='images/greyLine.jpg' style='margin-bottom:10px;margin-top:50px;'> <div class="buttonLeft" style='margin-left:680px;'><a href="javascript:document.getElementById('addProperties').submit()">Next</a></div> <!--END OF PAGE CONTENTS--> </div> </div> <?php include('../lib/includes/footer.php'); ?> Addimages2.php <?php include('../lib/scripts/php/functions.php'); $page_title='Add Images'; $page_id_top = 'properties'; $page_id = 'images'; $gm = true; $property_id = $_GET['id']; include('../lib/includes/header.php'); $errors =''; if(!empty($_POST)) { $owner =''; $propertyName =''; $changeOver =''; $location =''; $grading =''; $description =''; $maxGuests =''; $bedrooms =''; $parking =''; $petsAmount =''; $postcode=''; /*area*/ $area= ''; $linen =''; $special1 =''; $special2 =''; $access =''; $costal ='0'; $garden ='0'; $openFire ='0'; $baby ='0'; $pets ='0'; $disabled ='0'; $groundFloor ='0'; $shortBreaks ='0'; $status =''; $owner = $_POST['owner']; $propertyName = $_POST['propertyName']; $changeOver = $_POST['changeOver']; $location = $_POST['location']; /*area*/ $area = $_POST['area']; $grading = $_POST['grading']; $description = $_POST['description']; $description = addslashes($description); $postcode = $_POST['postcode']; $list_description = $_POST['list_description']; $list_description = addslashes($list_description); $maxGuests = $_POST['maxGuests']; $parking = $_POST['parking']; $petsAmount = $_POST['petsAmount']; $linen = $_POST['linen']; $special1 = $_POST['special1']; $special2 = $_POST['special2']; $access = $_POST['access']; $status = $_POST['status']; $bedrooms = $_POST['bedrooms']; if (isset($_POST['costal'])) { $costal = 'checked'; } if (isset($_POST['garden'])) { $garden = 'checked'; } if (isset($_POST['openFire'])) { $openFire = 'checked'; } if (isset($_POST['baby'])) { $baby = 'checked'; } if (isset($_POST['pets'])) { $pets = 'checked'; } if (isset($_POST['disabled'])) { $disabled = 'checked'; } if (isset($_POST['groundFloor'])) { $groundFloor = 'checked'; } if (isset($_POST['shortBreaks'])) { $shortBreaks = 'checked'; } if (empty($owner)) { $errors.= '&owner=1'; } if (empty($propertyName)) { $errors.= '&propertyName=1'; } if (empty($changeOver)) { $errors.= '&changeOver=1'; } if (empty($location)) { $errors.= '&location=1'; } /*area*/ if (empty($area)) { $errors.= '&area=1'; } if (empty($postcode)) { $errors.= '&postcode=1'; } if (empty($grading)) { $errors.= '&grading=1'; } if (empty($description)) { $errors.= '&description=1'; } if (empty($list_description)) { $errors.= '&list_description=1'; } if (empty($maxGuests)) { $errors.= '&maxGuests=1'; } if (empty($bedrooms)) { $errors.= '&bedrooms=1'; } if (!empty($errors)) { $owner = urlencode($owner); $propertyName = urlencode($propertyName); $changeOver = urlencode($changeOver); $location = urlencode($location); $location = urlencode($area); $grading = urlencode($grading); $description = urlencode($description); $maxGuests = urlencode($maxGuests); $bedrooms = urlencode($bedrooms); $parking = urlencode($parking); $petsAmount = urlencode($petsAmount); $linen = urlencode($linen); $special1 = urlencode($special1); $special2 = urlencode($special2); $access = urlencode($access); $postcode = urlencode($postcode); $costal = urlencode($costal); $garden = urlencode($garden); $openFire = urlencode($openFire); $baby = urlencode($baby); $pets = urlencode($pets); $disabled = urlencode($disabled); $groundFloor = urlencode($groundFloor); $shortBreaks = urlencode($shortBreaks); $status = urlencode($status); header('location: addProperties.php?error_code='.$errors.'&get_owner='.$owner.'&postcode='.$postcode.'&get_propertyName='.$propertyName.'&get_changeOver='.$changeOver.'&get_location='.$location.'&get_grading='.$grading.'&get_description='.$description.'&get_list_description='.$list_description.'&get_maxGuests='.$maxGuests.'&get_bedrooms='.$bedrooms.'&get_parking='.$parking.'&get_petsAmount='.$petsAmount.'&get_linen='.$linen.'&get_special1='.$special1.'&get_special2='.$special2.'&get_access='.$access.'&get_costal='.$costal.'&get_garden='.$garden.'&get_openFire='.$openFire.'&get_baby='.$baby.'&get_pets='.$pets.'&get_disabled='.$disabled.'&get_groundFloor='.$groundFloor.'&get_shortBreaks='.$shortBreaks.'&get_status='.$status.'get_area='.$area); die(); } else { if(!empty($_GET['id'])) { //----------------------------------- //UPATE RECORD //----------------------------------- $property_id = $_GET['id']; $updatePropertySQL = "UPDATE properties SET owner = '$owner', propertyName = '$propertyName', changeOver = '$changeOver', location = '$location', grading = '$grading', description = '$description',list_description = '$list_description', maxGuests = '$maxGuests', bedrooms = '$bedrooms', parking='$parking',petsAmount='$petsAmount', costal = '$costal', garden ='$garden',openFire ='$openFire',pets ='$pets',baby ='$baby',disabled ='$disabled',groundFloor ='$groundFloor',shortBreaks ='$shortBreaks',`status` ='$status',linen ='$linen',special1 ='$special1',special2 ='$special2',access='$access', postcode='$postcode', area='$area', WHERE id = $property_id"; $db->execute($updatePropertySQL); echo mysql_error(); $content = " <html> <head> <title>Dorset Cottage Holidays</title> <style type=\"text/css\"> body {font: 11px verdana;} </style> </head> <body> <p>Hi,</p> <p>Someone has updateded the details of $propertyName.</p> <p>Please click the link and double check the details.</p> <p><a href='http://dhcottages.co.uk/details.php?id=$property_id'>Check property</a></p> </body> </html>"; $subject = "Property update on the Dorset Cottage Holiday website"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: enquires@dhcottages.co.uk"; $email = "enquires@dhcottages.co.uk"; //mail($email,$subject,$content,$headers); } else { //----------------------------------- //ADD RECORD //----------------------------------- $addPropertySQL = "INSERT INTO properties(owner,propertyName,changeOver,location,grading,description,list_description,maxGuests,bedrooms,parking,petsAmount,costal,garden,openFire,pets,baby,disabled,groundFloor,shortBreaks,`status`,linen,special1,special2,access, postcode, area) VALUES ('$owner','$propertyName','$changeOver','$location','$grading','$description','$list_description','$maxGuests','$bedrooms','$parking','$petsAmount','$costal','$garden','$openFire','$pets','$baby','$disabled','$groundFloor','$shortBreaks','$status','$linen','$special1','$special2','$access', '$postcode' ,'$area')"; $db->execute($addPropertySQL); echo mysql_error(); $property_id = mysql_insert_id(); $content = " <html> <head> <title>Dorset Cottage Holidays</title> <style type=\"text/css\"> body {font: 11px verdana;} </style> </head> <body> <p>Hi,</p> <p>A new property has been added to the Dorset Cottage Holidays website. ($propertyName)</p> <p>Please click the link and double check the details.</p> <p><a href='http://www.dhcottages.co.uk/details.php?id=$property_id'>Check property</a></p> echo $area; </body> </html>"; $subject = "Property added to the Dorset Cottage Holiday website"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: enquires@dhcottages.co.uk"; $email = "enquires@dhcottages.co.uk"; //mail($email,$subject,$content,$headers); } ?> <!-- generate google map --> <!-- google maps key --> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAArpssmGkHIk4Pzow_SQH4CxRSTus_UUzkkTlTocJKPLVw2BrG4xR188-et2o7pUA14NwQRxSLXNtQrA" type="text/javascript"></script> <!-- ajax key --> <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAArpssmGkHIk4Pzow_SQH4CxRSTus_UUzkkTlTocJKPLVw2BrG4xR188-et2o7pUA14NwQRxSLXNtQrA" type="text/javascript"></script> <script type="text/javascript"> var map; var localSearch = new GlocalSearch(); function usePointFromPostcode(postcode, callbackFunction) { localSearch.setSearchCompleteCallback(null, function() { if (localSearch.results[0]) { var resultLat = localSearch.results[0].lat; var resultLng = localSearch.results[0].lng; var point = new GLatLng(resultLat,resultLng); $.post('lib/scripts/php/addLongLat.php',{long:resultLng, lat:resultLat, id:<?=$property_id?>}); }else{ alert("Postcode not found!"); } }); localSearch.execute(postcode + ", UK"); } usePointFromPostcode('<?=$postcode?>',''); </script> <? } } ?> <script type="text/javascript"> function ajaxFileUpload() { var nextImage = $("#nextImage").val(); var productId = $("#productId").val(); $("#loading") .ajaxStart(function(){ $(this).show(); }) .ajaxComplete(function(){ $(this).hide(); }); $("#image_"+nextImage).fadeIn(500, function(){ $.ajaxFileUpload ( { url:'lib/scripts/php/upload.php?id='+productId, secureuri:false, fileElementId:'prod_image', dataType: 'json', success: function (data, status) { if(typeof(data.error) != 'undefined') { if(data.error != '') { $("#image_"+nextImage).fadeOut(); }else { $("#image_src_"+nextImage).fadeOut(100,function(){ $("#image_src_"+nextImage).html(unescape(data.msg)); $("#del_"+nextImage).html(unescape(data.del)); $("#label_"+nextImage).html(unescape(data.lbl)); $("#select_"+nextImage).html(unescape(data.type)); $("#image_src_"+nextImage).fadeIn(100); $("#nextImage").val(parseInt(nextImage)+1); }); } } }, error: function (data, status, e) { alert(e); } } ) return false; }); return false; } function removeImage(img_id, prod_id) { $("#images").fadeOut(100, function(){ $("#images").load("lib/scripts/php/imageDiv.php?id="+prod_id+"&img_id="+img_id+"&del", {}, function(){ $("#images").fadeIn(); }); }); return false; } function updatePrimary(img_id,id,val) { $.post("lib/scripts/php/primary.php?id="+img_id+"&prod_id="+id+"&val="+val,{}); } function labelImage(img,id) { var txt = 'Label: <input type="text" id="alertName" name="myname" value="" />'; function mycallbackform(v,m){ if(v == true) { var label = escape(m.children('#alertName').val()); $("#images").fadeOut(100, function(){ $("#images").load("lib/scripts/php/imageDiv.php?id="+id+"&img_id="+img+"&label="+label, {}, function(){ $("#images").fadeIn(); }); }); } } $.prompt(txt,{ callback: mycallbackform, buttons: { Save: true, Cancel: false } }); } </script> <div id="sub_nav"> <? include('subnav2.php');?> </div> <div id="content"> <div id="content_tab"> <!--START OF PAGE TABS--> <? include('add_tabs.php');?> <!--END OF PAGE TABS--> </div> <div id="content_contents"> <!--START OF PAGE CONTENT--> <div id="form_content"> <form name="prodImages" action="<?=$_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data"> <table border="0" width='500'> <tr> <td class="title">Upload new image:</td> <td class="fileElement"> <input type="file" name="prod_image" id="prod_image" /> <input type="hidden" name="productId" id="productId" value="<?=$property_id?>" /> </td> <td> <div class="button" style="float:right"><a href="#" onclick="return ajaxFileUpload();">Upload</a></div> </td> </tr> </table> </form> <div class="divider"></div> Current images: <br /> <div id="images"> <? include('../lib/scripts/php/imageDiv.php'); ?> </div> </div> <!--END OF PAGE CONTENTS--> </div> <img src='images/greyLine.jpg' style='margin-bottom:5px;margin-top:-60px;margin-left:10px;'> <div class="buttonLeft" style='margin-left:690px;margin-top:-50px;'><a href="properties/addPricing.php?id=<?=$property_id?>">Next</a></div> </div> <?php include('../lib/includes/footer.php'); ?> Any help would be amazing as its been puzzling me for ages.
  19. my appolagise, when i keep the echo '<p> view Archived by year</p>'; echo '<form action="archivedBookings.php" method="get">'; echo '<select name="year" class="dropdown" onChange="this.form.submit()" >'; // Loop through the entries and print out a dropdown for ( $counter = 0; $counter <= $totalyears; $counter ++) { $year = $oldestdateyear + $counter; ?> <option value="<?=$year?>" <? if($_GET{'year'}){echo 'selected';}?>><?=$year?></option> <? } echo '</select>'; echo '</form>';
  20. When i keep that in though i get a No input file specified. error?
  21. Thats wicked i did have this for the form value as well echo '<form action="archivedBookings.php" method="get">'; which obviously just needed to be <form> am i right
  22. Ok im confusing myself aswell. In lamens terms all i want is the user can select a date and then records show up for that date. I found out what $this_page does $this_page ="http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
  23. IM trying to pass page number and year that was selected back to the same page. i have this code echo '<form action="archivedBookings.php" method="get">'; echo '<select name="year" class="dropdown" onChange="this.form.submit()" >'; Which submits the form when the user selects a year from the drop down box and <option value="<?=$this_page.'&$year'?>" <? if($_GET{'year'}){echo 'selected';}?>><?=$year?></option> the code above, should send through the page variable and the year variable that was selected. The selected part i dont know what that does and when the page submits i get a crazy url that looks like this http://www.dhcottages.co.uk/testsite/admin/archivedBookings.php?year=http%3A%2F%2Fwww.dhcottages.co.uk%2Ftestsite%2Fadmin%2Fbookings%2FarchivedBookings.php%26%24year Can anyone point me in the right direction a tall?
×
×
  • 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.