Jump to content

Search the Community

Showing results for tags 'booking system'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. HI I'm creating a booking system in PHP that allows estate agents to book viewings for houses. I am having a slight issue. The concept is simple, a user searches for the property using postal code, the database then returns the property results. The user then ticks a checkbox next to the property they want to add the viewing for. This is where the issue is occurring. Each property has an ID. The ID is assigned to the name="" element in the HTML. I'm now not sure where to go from here. What I want is this, once the user selects the property, the property ID for the selected row needs to be stored so that I can use it later on in the booking. Here is the part of the Code I have. $newrecord = "Here are the results"; if (isset($_POST['submitted'])) { $PostCode = $_POST['PostCode']; $error; $checkpostcode = "SELECT * from PropertyTable WHERE PostCode = '$PostCode'"; $resultpostcode = mysql_query($checkpostcode); $count = mysql_num_rows($resultpostcode); if ($count == 0) { $_POST["PostCode"] = $PostCode; echo 'Sorry no properties were found with this Post Code. Please check it is entered correctly, then try again.'; } else { //show options $selectproperty ="SELECT * from PropertyTable WHERE PostCode = '$PostCode'"; $propertyresults = mysql_query($selectproperty); echo"<div class='page-restrict-output'>"; echo "<form method='post' action='add-viewing'>"; echo "<input id='addviewingbutton' type='Submit' name='addviewingbtn' value='Select Property' /><br><br /></td></tr>"; echo"<table id='selectviewingtable' border='1'>"; echo "<tr><th>Property Name</th><th>Post Code</th><th>Property ID</th><th>Add Viewing</th></tr>"; while($row = mysql_fetch_array($propertyresults)) { echo "<tr><td>"; echo $row['PropertyName']; echo "</td><td>"; echo $row['PostCode']; echo "</td><td>"; echo $row['ProductID']; echo "</td><td>"; echo $row['SelectViewing']; echo "<input id='selectviewingbutton' type='checkbox' name='$row[ProductID]' value='True' /></td></tr>"; echo" </form>"; echo "</div>"; } } } if (isset($_POST['addviewingbtn'])) { foreach ($_POST as $key => $value){ if ($value="True"){ $ProductId = $key; } } $choseproperty = "SELECT ProductID from PropertyTable WHERE '$row[ProductID]' = True"; $chosenpropertyresults = mysql_query($choseproperty); while($row = mysql_fetch_array($chosenpropertyresults)) { } print_r($_POST); echo "$chosenproperty"; } else { } Using print_r I get Array ( [addviewingbtn] => Select Property [4] => True ). The [4] is the property ID, this changes on which item you select. I'm just a bit lost here. I'm still getting to grips with PHP and any help would be much appreciated.
×
×
  • 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.