Dynamic php modal - php

I'm trying create modal that is dynamic and pre fills with the details of the item that is clicked on. Here is my code:
HTML:
{foreach from=$flowers3 item=row}
{foreach from=$row item=item}
<div class="item col-lg-4 col-md-4 col-sm-4 col-xs-12">
<div class="product">
<div class="image">
<div class="quickview">
<a alt="Quick View" class="btn btn-xs btn-quickview" data-target="#modal" data-toggle="modal"> View </a>
</div>
<a href="#">
<img class="item_thumb img-responsive" src="img/{$item.im}" alt="img">
</a>
</div>
<div class="description">
<h4 class="item_name">{$item.title}</h4>
<p class="item_price">
small
<input type="Radio" name="product" value="{$item.id}s" style="border:0;cursor:pointer;" />
<span style="font-weight: bold">${$item.ps|money:0}</span> | med
<input type="Radio" name="product" value="{$item.id}m" style="border:0;cursor:pointer;" />
<span style="font-weight: bold">${$item.pm|money:0}</span> | lg
<input type="Radio" name="product" value="{$item.id}l" style="border:0;cursor:pointer;" />
<span style="font-weight: bold">${$item.pl|money:0}</span>
</p>
</div>
<div class="action-control">
<a href="javascript:;" onClick="mySubmit()">
<span class="button-fill grey">
<i class="glyphicon glyphicon-shopping-cart">
</i> Add to cart </span>
</a>
</div>
</div>
</div>
{/foreach}
{/foreach}
Here's the PHP:
<?php
$GLOBALS['flowers']=getFlowers();
function &getFlowers(){
static $flowers;
if(!isset($flowers)){
$flowers=array(
'1'=>array('im'=>'store-a1.jpg','title'=>'CocoChanel','description'=>' Fashion fades.'),
'2'=>array('im'=>'store-a2.jpg','title'=>'The Royal Jewels','description'=>'Fit for any Queen.'),);}
$i=1;
foreach($flowers as $k=>&$v){
$v['id']=$k;
$v['num']=$i++;}
return $flowers;}
?>
And here's the modal:
<!--modal -->
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button"> ×</button>
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<!-- product Image -->
<div class="main-image col-lg-12 no-padding style3 modal-image">
<a class="product-largeimg-link" href="#">
<img src="img/{$item.imb}" class="img-responsive product-largeimg" alt="img">
</a>
</div>
<!--/image-->
</div>
</div>
<!--/ product Image-->
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12 modal-details no-padding">
<div class="modal-details-inner">
<h1 class="product-title">{$item.title}</h1>
<div class="details-description">
<p>{$item.description}</p>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!--/modal -->
When I add the modal within the {foreach} tags, it only fills with the information for one particular item (depending on where I place it. ex: it might be the first item, or if I place it between the {foreach from=$flowers3 item=row} it will be the last of the first row) but I can't get it to update every item on the particular "Quick View" that is clicked.
Thanks in advance for any help!!

Store the properties of the items in data-attributes of the item 's in your html:
<div class="item ..." ... data-title="Nice flower" data-price="€1,20" > ... </div>
Now use some javascript to update the modal. jQuery example:
$('.item').click(function(){
var el = $(this);
$('.modal .product-title').text(el.attr('data-title'));
// and the rest of the properties, then open the modal
});

Related

how do i apply condition through the table values?

I am making a carousel which should display the info dynamically in it. And here i am trying to apply condition through which the result can be filtered but it doesn't seems to be working. Below is the code for it.(what i really want to achieve through this is to appear the results in a carousel). Any kind of help would be immensely appreciated
<div class="container">
<div class="row" style="padding: 75px">
#if($tours->continent_id == 5)
<div class="row">
<div class="col-md-9">
<h3>Featured {{$tours->continent->name}}</h3>
</div>
<div class="col-md-3">
<!-- Controls -->
<div class="controls pull-right hidden-xs">
<a class="left fa fa-chevron-left btn btn-success"
href="#carousel-example"
data-slide="prev"></a><a class="right fa fa-
chevron-
right btn btn-success" href="#carousel-example"
data-slide="next"></a>
</div>
</div>
</div>
<div id="carousel-example" class="carousel slide hidden-xs" data-
ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
#foreach($tours as $tour)
<div class="col-sm-3">
<div class="col-item">
<div class="photo">
<img src="{{$tour->photo->file ?
asset($tour->photo->file): asset('images/404.png')}}"
class="img-responsive" alt="a" />
</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>{{$tour->location}}</h5>
<h5 class="price-text-
color">
{{$tour->service}}</h5>
</div>
<div class="rating hidden-sm
col-md-
6">
<i class="price-text-color
fa
fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color
fa
fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add"> <i class="fa fa-shopping-cart"></i>Add to cart
</p>
<p class="btn-details"> <i class="fa fa-list"></i>More details
</p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>
#endforeach
</div>
</div>
#endif
</div>
</div>
Here is the controller part of the code. which is including all the fillable values in the form view. which later can be used to apply conditions on the form or return it's table values in the form
public function index()
{$tours = Tour::all();
return view('admin/tour/slider',compact('tours'));}
Error page error message
What you want is to filter the tours and only interact with the ones that contain continent_id equals to 5?
In that case, you should improve the query on database
$tours = Tour::where('continent_id', 5)->get();
Or filter the collection
$tours->filter(function ($tour) {
return $tour->continent_id == 5;
}
In both cases, you won't be able to do {{ $tours->continent->name }} since you're working with a Collection of Tour, not with a Tour instance.
In order to print the title of the first tour you should do
$tours->first()->continent->name
All i had to do was to put if condition after the foreach statement for its values to be available for the loop at before that foreach loop i had to check for the existence of the values in the table like #if($tours). and it all worked nicely :)

Creating a custom Woocommerce product modal on click

I have created a basic HTML/jQuery structure for a modal that will pop up when clicked on. I'm in the process of integrating Woocommerce into my site and am unsure as to how I can do the following:
Have modal load respective product info
Integrate into a Woocommerce loop
Here is my HTML for the skeleton of what I'm trying to achieve:
<div class="col-md-4"><img src="<?php bloginfo('stylesheet_directory'); ?>/media/temp_product_images/Alto-183x300.jpg" alt="Product Img" class="product-img" data-toggle="modal" data-target="#myModal">
<p class="product-img-title text-center">Alto</p>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title text-center" id="myModalLabel">Alto</h4> </div>
<div class="modal-body" id="modal-body-one">
<div class="row">
<div class="col-sm-4"> <img src="<?php bloginfo('stylesheet_directory'); ?>/media/temp_product_images/Alto-183x300.jpg" alt="Modal Product Img" id="product-img"> </div>
<div class="col-sm-7">
<h5>Colours</h5>
<div class="scroll-container">
<div class="row">
<div class="col-xs-4">
<div class="selected-product-color"><img src="<?php bloginfo('stylesheet_directory'); ?>/media/temp_product_images/MACASSA.jpg" alt="Product Colour">
<p>Macassa</p>
</div>
</div>
</div>
<!-- End of Test Case -->
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn flip"><i class="fa fa-arrow-right" aria-hidden="true"></i></button>
</div>
</div>
</div>
<!-- Prices -->
<div class="modal-body" id="modal-body-two">
<div class="row">
<div class="col-sm-11">
<div class="row">
<h5 id="modal-prices">Download Price List</h5></div>
<div class="row">
<?php $my_query = new WP_Query('p=47');
while($my_query->have_posts()){
$my_query->the_post();
the_content();
} ?>
</div>
</div>
<div class="col-sm-1">
<button type="button" class="btn flip"><i class="fa fa-arrow-right" aria-hidden="true"></i></button>
</div>
</div>
</div>
<div class="modal-footer"> Get Quote </div>
</div>
</div>
</div>
<!-- End of Modal -->
</div>
And here is my jQuery:
//Modal Change Content
$('#modal-body-two').hide();
$('.flip').on('click', function () {
$('#modal-body-one, #modal-body-two').toggle()
});
Is there a way that I can display the product info on click within a modal using Woocommerce? Thanks

Database lightbox with jquery only showing first entry of the database

I'm trying to make a page that gets entries from a database and displays them in a <div> called "gallery-item". However the lightbox works, it only shows the first entry of the database. I hope someone can make sense of this code and may be able to help me with my problem.
My html/php/sql
<?php if (isset($_POST["Website"])) {
$query=$db->prepare("SELECT * FROM `portfoliodb`.`website`");
$query->execute();
while ( $row = $query->fetch()){
$website_id = $row['website_id'];
$website_name = $row ['website_name'];
$website_desc_en = $row ['website_desc_en'];
$website_tags = $row ['website_tags'];
$website_image = $row ['website_image'];
$website_type = $row['website_type'];
echo'
<div class="background hidden" id="background"></div>
<a>
<div class="lightbox hidden" id="lightbox">
<div class="box-title hidden" id="box-title">
<h4 class="hidden" id="box-title-h">' . htmlspecialchars($website_name) . '</h4>
<h4 class="close hidden" id="close">X</h4>
</div>
<div class="box-img hidden" id="box-img">
</div>
<div class="box-foot hidden" id="box-foot">
<div class="box-space hidden" id="box-space"></div>
<div class="box-desc hidden" id="box-desc">
<p class="desc-text hidden" id="box-text">'. htmlspecialchars($website_desc_en) .' </p>
</div>
<div class="tag-space-box hidden" id="box-tags-space"></div>
<div class="tag-box hidden" id="box-tags">
<small id="box-small" class="hidden">'. htmlspecialchars($website_tags) .'</small>
</div>
</div>
</div>
</a>
<a>
<div class="gallery-item-web button" id="button">
<p class="gallary-item-text">';
echo htmlspecialchars($website_name);
echo'</p>';
echo '<i class="fa fa-desktop fa-3x position-icon"></i>
</div></a>
';
}}
The gallery shows all entries in the database so that works fine, the only problem is that the lightbox shows the first entry, so if I were to have a database with the entries "Apples, Pears, Oranges", the gallery would display "Apples, Pears, Oranges". But the lightbox would display "Apples" on every single entry.
My Jquery
$(document).ready(function(){
$(".button").click(function(){
$("#background").toggleClass("hidden");
$("#lightbox").toggleClass("hidden");
$("#box-title").toggleClass("hidden");
$("#box-title-h").toggleClass("hidden");
$(".close").toggleClass("hidden");
$("#box-img").toggleClass("hidden");
$("#box-foot").toggleClass("hidden");
$("#box-space").toggleClass("hidden");
$("#box-desc").toggleClass("hidden");
$("#box-text").toggleClass("hidden");
$("#box-tags-space").toggleClass("hidden");
$("#box-tags").toggleClass("hidden");
$("#box-small").toggleClass("hidden");
});
$(".close").click(function(){
$("#background").toggleClass("hidden");
$("#lightbox").toggleClass("hidden");
$("#box-title").toggleClass("hidden");
$("#box-title-h").toggleClass("hidden");
$(".close").toggleClass("hidden");
$("#box-img").toggleClass("hidden");
$("#box-foot").toggleClass("hidden");
$("#box-space").toggleClass("hidden");
$("#box-desc").toggleClass("hidden");
$("#box-text").toggleClass("hidden");
$("#box-tags-space").toggleClass("hidden");
$("#box-tags").toggleClass("hidden");
$("#box-small").toggleClass("hidden");
});
$(".background").click(function(){
$("#background").toggleClass("hidden");
$("#lightbox").toggleClass("hidden");
$("#box-title").toggleClass("hidden");
$("#box-title-h").toggleClass("hidden");
$(".close").toggleClass("hidden");
$("#box-img").toggleClass("hidden");
$("#box-foot").toggleClass("hidden");
$("#box-space").toggleClass("hidden");
$("#box-desc").toggleClass("hidden");
$("#box-text").toggleClass("hidden");
$("#box-tags-space").toggleClass("hidden");
$("#box-tags").toggleClass("hidden");
$("#box-small").toggleClass("hidden");
});
});
(It's pretty bad I know, this is my first time using Jquery)
This is the Jquery for the lightbox, it toggles the class on every item of the lightbox to "hidden". Whih basically makes every item with that class invisible, great for a lightbox.
First off, you don't need to add class of "hidden" to every element. You can just add it to the container element and then all tags inside would also be hidden.
Your main mistake was to have the same ids and classes for all images, you will need to ensure that each image has an unique identifier.
Try my solution: https://jsfiddle.net/3vhv90ce/2/
HTML:
<div class="container1">
<div class="background" id="background"></div>
<a>
<div class="lightbox" id="lightbox">
<div class="box-title" id="box-title">
<h4 class="" id="box-title-h">name</h4>
<h4 class="close" id="close">X</h4>
</div>
<div class="box-img" id="box-img">
</div>
<div class="box-foot" id="box-foot">
<div class="box-space" id="box-space"></div>
<div class="box-desc" id="box-desc">
<p class="desc-text" id="box-text">description</p>
</div>
<div class="tag-space-box" id="box-tags-space"></div>
<div class="tag-box" id="box-tags">
<small id="box-small" class="">tags</small>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="gallery-item-web button" data-id="1">
<p class="gallary-item-text">Click me</p>
<i class="fa fa-desktop fa-3x position-icon"></i>
</div>
<div class="container2">
<div class="background" id="background"></div>
<a>
<div class="lightbox" id="lightbox">
<div class="box-title" id="box-title">
<h4 class="" id="box-title-h">name</h4>
<h4 class="close" id="close">X</h4>
</div>
<div class="box-img" id="box-img">
</div>
<div class="box-foot" id="box-foot">
<div class="box-space" id="box-space"></div>
<div class="box-desc" id="box-desc">
<p class="desc-text" id="box-text">description</p>
</div>
<div class="tag-space-box" id="box-tags-space"></div>
<div class="tag-box" id="box-tags">
<small id="box-small" class="">tags</small>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="gallery-item-web button" data-id="2">
<p class="gallary-item-text">Click me</p>
<i class="fa fa-desktop fa-3x position-icon"></i>
</div>
JS:
$(document).ready(function(){
$(".button").click(function(){
$('.container'+$(this).data('id')).toggleClass("hidden");
});
});
CSS:
.hidden {
display: none;
}
.gallery-item-web {
cursor: pointer;
}
I suppose your problem came from those lines:
<div class="background hidden" id="background"></div>
<div class="gallery-item-web button" id="button">
you have many controls with the same id, And this is ambiguous for jQuery.

Bootstrap 3 IE Grid Compatibillity

I have created a bootstrap 3 website and it looks great except in some versions of Internet Explorer the grids overlap each other. The url is awseattle.com the html code looks like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="AW Seattle provides luxury transportation services in the Greater Seattle-Tacoma & Airport area. We operate a full fleet of vehicles 24 hours a day, 7 days a week. (206) 412-9353">
<meta name="author" content="awseattle.com">
<meta name="keywords" content="seattle limo, limousine service, airport limo, cruise transfers, limo service" />
<META NAME="ROBOTS" CONTENT="INDEX, NOFOLLOW">
<title>AW Seattle</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/grayscale.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<script src="js/DateTimePicker.js" type="text/javascript"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
<!-- Respond.js proxy on external server -->
<link href="http://externalcdn.com/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
</head>
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand page-scroll" href="#page-top">
<span class="light">AW</span> Seattle
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right navbar-main-collapse">
<ul class="nav navbar-nav">
<!-- Hidden li included to remove active class from about link when scrolled up past about section -->
<li class="hidden">
</li>
<li>
<a class="page-scroll" href="#fleet">Fleet</a>
</li>
<li>
<a class="page-scroll" href="#services">Services</a>
</li>
<li>
<a class="page-scroll" href="#rates">Rates</a>
</li>
<li>
<a class="page-scroll" href="#reservations">Reservations</a>
</li>
<li>
<a class="page-scroll" href="#testimonials">Testimonials</a>
</li>
<li>
<a class="page-scroll" href="#contact">Contact Us</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Intro Header -->
<header class="intro">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div>
<br><br><br><br>
</div>
<div class="col-md-8">
<!---- Carosel --->
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img width='500' height='250' src="img/towncar.jpg" alt="AW Seattle Town Car">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img width='500' height='250' src="img/seattle.jpg" alt="AW Seattle">
<div class="carousel-caption">
</div>
</div>
<div class="item">
<img width='500' height='250' src="img/chauffeur.jpg" alt="chauffeur">
<div class="carousel-caption">
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!---- End Carosel --->
<br>
<div class="panel panel-default">
<div class="panel-body">
<font color='gray'> We take pride in making every trip a memorable experience. We have been rated one of the best towncar and limousine companies in the Greater Puget Sound area. We have been based in the Seattle Metropolitan area since 2000 and have built our business one customer at a time.
<Br><br>
Our service and prices set us apart from other companies, which makes our company highly competitive. Our experienced drivers are knowledgeable about city streets and locations statewide, are courteous, personable, and confident. Our town cars are meticulously clean and well-maintained. You can relax in luxury as you are safely taken to your desired destination.</font>
</div>
</div>
</div>
<div class="col-md-4">
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Account Log In</h3>
</div>
<div class="panel-body">
<form method="post" action="index.php">
<div class="input-group">
<input name="user" type="text" class="form-control" placeholder="User Name">
</div><Br>
<div class="input-group">
<input name="pass" type="text" class="form-control" placeholder="Password">
</div>
<Br>
<input type="submit" name="login" value="Log in">
</form>
</div>
</div>
<br>
<div class="panel panel-default">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Proud Transporter of</h3>
</div>
<div class="panel-body">
<img src="img/microsoft.png" alt="microsoft" style="width:150px;height:40px"><Br>
<img src="img/amazon.jpg" alt="amazon" style="width:150px;height:40px"><Br>
<img src="img/boeing.jpg" alt="boeing" style="width:150px;height:40px"><Br>
<img src="img/passportunlimited.jpg" alt="passport unlimited" style="width:150px;height:40px"><Br>
<img src="img/facebook.png" alt="facebook" style="width:150px;height:40px"><Br>
<img src="img/eddiebauer.jpg" alt="eddie bauer" style="width:150px;height:40px">
</div>
</div>
<div class="panel-body">
<a href='http://www.heathmanhotel.com/'>Hotel Reservations</a><br>
<a href='http://www.weather.com/weather/today/Seattle+WA+USWA0395?from=search_city'>Weather</a><br>
<a href='http://www.citysearch.com/guide/seattle-wa-metro'>Around Seattle</a><br>
</div>
</div>
</div>
<div class="col-md-8 col-md-offset-2">
<br><br><br><br>
</div>
</div>
</div>
</div>
</div>
</header>
<section id="fleet" class="container content-section text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>OUR FLEET</h2>
<div class="row">
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_TownCar.jpg" width="450" height="150" class="img-responsive" alt="Town Car">
Luxury Signature and L model Town Cars up to 4 passengers
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_WhiteLimo.jpg" width="450" height="150" class="img-responsive" alt="White Limo">
Seats 8-10 passengers, Tinted windows, Privacy divider
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_Suv.jpg" width="450" height="150" class="img-responsive" alt="SUV">
Seats up to 7 passengers, Climate controlled, Ample luggage room
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_Van.jpg" width="450" height="150" class="img-responsive" alt="Van">
Seats up to 14 passengers, Ample leg room, Privacy dividers
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_SuvLimo.jpg" width="450" height="150" class="img-responsive" alt="SUV Limo">
Seats up to 14 people, Rear luggage space, Sound system
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_mkt.jpg" width="450" height="150" class="img-responsive" alt="MKT">
Seats 7 comfortably with lots of leg room and style in a Lincon MKT.
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_partybus.jpg" width="450" height="150" class="img-responsive" alt="Party Bus">
<br>Seats up to 16 people
</a>
</div>
<div class="col-md-6">
<a class="thumbnail">
<img src="img/Fleet_Bus.jpg" width="450" height="150" class="img-responsive" alt="Bus">
Luxury Buses, Seats 39-54 people, Ample luggage room, TV/DVD
</a>
</div>
</div>
</div>
</div>
</section>
<section id="services" class="content-section text-center">
<div class="download-section">
<div class="container">
<div class="col-lg-8 col-lg-offset-2">
<h2>Services</h2>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">WEDDINGS, PROMS AND SPECIAL OCCASIONS</h3>
</div>
<div class="panel-body">
<div class="col-md-4">
<img src="img/wedding.jpg" alt="wedding" height="100%" width="100%">
</div>
<div class="col-md-8">
<font size="2" color="gray">On your special day everything must be perfect! Planning for a special occasion is very stressful, so let us take some of your stress away. Arrive and leave in style in one of our beautiful limousines. We guarantee that you will make it to all of your planned destinations on time and worry free. Let us help you make your special day the one to remember for years to come.</font>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">CITY TOURS</h3>
</div>
<div class="panel-body">
<div class="col-md-4">
<img src="img/city.jpg" alt="city" height="100%" width="100%">
</div>
<div class="col-md-8">
<font size="2" color="gray">Whether you are new to the Seattle area or have lived here your entire life and need to be reacquainted with our fair city, allow AW Seattle Towncar Service show you the splendor of the Pacific Northwest. Our drivers are well familiar with the area and will be able to provide a memorable experience for you and your family.</font>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">CORPORATE</h3>
</div>
<div class="panel-body">
<div class="col-md-4">
<img src="img/corprate.jpg" alt="corprate" height="100%" width="100%">
</div>
<div class="col-md-8">
<font size="2" color="gray">Take the worry out of your busy work day! Allow reliable and dependable drivers of AW Seattle Towncar Service take you to and from your business meetings in style and luxury. You will enjoy a smooth relaxing ride and arrive at your business meeting in a timely matter.</font>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">GROUND TRANSPORTATION SERVICE</h3>
</div>
<div class="panel-body">
<div class="col-md-4">
<img src="img/ground.jpg" alt="ground" height="100%" width="100%">
</div>
<div class="col-md-8">
<font size="2" color="gray">We began our business with ground transportation service and to this day continue to offer luxury and comfortable rides to and from the SeaTac Airport. Let go of all of your worries about traffic on the roads, rental cars or finding reliable parking for your vehicle. Allow our drivers to take you to the airport or home in style and on time.</font>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Service Agreement</h3>
</div>
<div class="panel-body" align="left">
<div class="col-md-12">
<font size="2" color="gray">
<ul>
<li>All round-trip reservations to be booked with return itinerary at the time of the initial booking </li>
<li>Reservations should include cell phone contact information ONLY; Home and office telephone numbers are irrelevant for coordinating pickups </li>
<li>When exiting baggage claim client to call dispatch # 206 412-9353 to inform from which exit door they can be met </li>
<li>Car seats for children are not provided but can be accommodated for drop-off at Sea-Tac and return will have the seats available for return to home at "one time charge" of $10.00 per seat </li>
<li>Trips between Midnight and 4:00 AM will result in a $10.00 surcharge </li>
<li>Stops en-route will result in an additional $10.00 service fee </li>
<li>Credit card information is kept on file ONLY if requested by the customer, otherwise client needs to present the card for payment to the driver each time </li>
<li>$10 charge to have a driver meet inside with sign at baggage claim </li>
<li>Reservations must be cancelled within 2 hours of pickup to avoid penalties </li>
<li>No-show reservations will result in full charge for the trip </li>
<li>Smoking is NOT permitted </li>
<li>Drinking alcohol is permitted; driver discretionary limits </li>
</ul>
</font>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="rates" class="container content-section text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Rates</h2>
<br><br>
<table width='100%' align='center'>
<tr>
<td align='right'><font size='5'>Calculate your rate:</font></td>
<td width="5%"></td>
<td align='left'><div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
Event Type
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" onclick='$("#toFromModal").modal({keyboard: false})'>Transportation to or from Sea Tac Airport</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" onclick='$("#cityTourModal").modal({keyboard: false})'>City Tour</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" onclick='$("#specialEventsModal").modal({keyboard: false})'>Special Occasion</a></li>
</ul>
</div></td>
</table>
<div class="modal fade" id="cityTourModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel"><font color='black'>City Tours</font></h4>
</div>
<div class="modal-body"><font color='gray'>
Your Rate is estimated at: $65 / hour for town cars<br><br>
Rates vary based on events, vehicles, and people. Rates are subject to change.
</font></div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="modal fade" id="specialEventsModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel"><font color='black'>Special Events</font></h4>
</div>
<div class="modal-body">
<font color='gray'>
Your Rate is estimated at: $65 / hour for town cars<br><br>
Rates vary based on events, vehicles, and people. Rates are subject to change.
</font>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="modal fade" id="toFromModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel"><font color='black'>To or From Sea Tac Airport</font></h4>
</div>
<div class="modal-body">
<select id='zip' name='zip' onchange="document.getElementById('ratediv').firstChild.nodeValue = this.options[this.selectedIndex].value">
<option value=''>Select A Pick Up / Drop Off Area</option>
<?php
// Create connection
$conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM ziprates GROUP BY city";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<option value='$".$row['ratelow']." - $". $row['ratehigh']."'>". $row['city']."</option>";
}
} else {
echo "0 results";
}
$conn->close();
?>
</select>
<br><br>
<font color='gray'>
Your Rate is estimated at:<br>
<div id='ratediv'>
</div><br><br>
Rates are for one way travel. Round trip is double.<br>
Lowest price is based on closest location to Sea Tac Airport<br>
Rates vary based on events, vehicles, and people. Rates are subject to change.
</font>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<br><br><br><br><br><br><br><br>There is $65.00 per hour charge for city tours and any other occasion. <br>Downtown Seattle to/from Sea-Tac Airport flat rate of $55.00. <br><br><br><br>All rates may be subject to change.
</div>
</div>
</section>
<section id="reservations" class="content-section text-center">
<div class="download-section">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Reservations</h2>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Select a event type to make a reservation:</h3>
</div>
<div class="panel-body" align="center">
<a class="btn btn-default btn-lg" style='width: 310px;' onclick='$("#tofromModal").modal({keyboard: false})'><span class="network-name">TO / From Sea TAc Airport</span></a>
<br>
Custom Route</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<div class="modal fade" id="tofromModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" align="center">
<div class="modal-body">
To Sea Tac Airport</span><br>
From Sea Tac Airport</span><br>
Round Trip (Travel To Seattle)</span><br>
Round Trip (Travel From Seattle)</span><br>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<section id="testimonials" class="container content-section text-center">
<div class="row">
<h2>Testimonials</h2>
<div class="table-responsive">
<table width='200%'>
<tr>
<?php
// Create connection
$conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM testimonials";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<td valign='top'>
<blockquote>
<p class='clients-words'>".$row['testimonial']."</p>
<span class='clients-name text-primary'>— ".$row['name']."</span>
</blockquote>
</td>";
}
} else {
echo "0 results";
}
$conn->close();
?>
</tr>
</table>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact" class="container content-section text-center">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Contact Us</h2>
<p>Call Us: (206) 412-9353 </p>
<p>Email Us: info#awseattle.com
</p>
<ul class="list-inline banner-social-buttons">
<li>
<i class="fa fa-twitter fa-fw"></i> <span class="network-name">Twitter</span>
</li>
<li>
<i class="fa fa-facebook fa-fw"></i> <span class="network-name">Facebook</span>
</li>
<li>
<i class="fa fa-google-plus fa-fw"></i> <span class="network-name">Google+</span>
</li>
</ul>
</div>
</div>
</section>
<!-- Footer -->
<footer>
<div class="container text-center">
<p>Copyright © AW Seattle 2014</p>
</div>
</footer>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="js/jquery.easing.min.js"></script>
<!-- Google Maps API Key - Use your own API key to enable the map feature. More information on the Google Maps API can be found at https://developers.google.com/maps/ -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCRngKslUGJTlibkQ3FkfTxj3Xss1UlZDA&sensor=false"></script>
<!-- Custom Theme JavaScript -->
<script src="js/grayscale.js"></script>
</body>
</html>
Any advice is appreciated. Not sure what to do ) :

Grabbing Values Outside a Form with PHP

I'm using the following code on my site. You'll notice that there is a checkbox outside the form (Towards the bottom). I need the value of the checkbox called to send_mail.php without creating a second form, and without placing it inside the form element. Is this even possible with PHP? `
<h2>Search for your dream home<br />
and save now!</h2>
<legend>Which Areas are you interested in?</legend>
<div class="areas row-fluid" style="text-align:left !important;">
<div class='span5' style='margin-left:0px !important;'>
<label>
<input type="checkbox" name="arrayValue[]" id="area[0]" value="test" style='margin-top:-5px !important;'> test</label>
</div>
</div>
<input type="button" onclick="jQuery('#myModal').modal('show')" value="CONTINUE" />
</div>
</div>
</div>
<!--banner area end-->
<!--content area 1 start-->
<div id="content1">
<div class="content1_in"> <span>
<h2 style="line-height:40px;font-size:40px;padding-bottom:10px">SOME CONTENT
</span>
<div class="img">
<img src="http://f14.co/realtor/assets/images/phone.png" alt="" />
</div>
</div>
</div>
<!--content area 1 end-->
<!--content area 1 start-->
<div id="content2">
<div class="content2_in"> <span> SOME CONTENT
</span>
<div class="img">
<img src="http://f14.co/realtor/assets/images/ipad-img.png" alt="" />
<div class="key"></div>
</div>
</div>
</div>
<!--content area 1 end-->
<!--content area 3 start-->
<div id="content3">
<div class="content3_in"> <span>
SOME CONTENT
</span>
<div class="img">
<img src="http://f14.co/realtor/assets/images/desktop-img.png" alt="" />
</div>
<div class="free"></div>
</div>
</div>
<!--content area 3 end-->
<div id="footer">
<div class="footer_in">
This Website Is Brought To You By: Test</div>
</div>
<!-- Modal -->
<div id="myModal" class="modal hide fade modal-survey" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel" class="survey_title">What type of home are you looking for?</h3>
</div>
<form method="post" class="form-horizontal" id="final_form" action="send_mail.php">
<input type="hidden" name="template" id="template" value="Buyers" />
<div class="modal-body" >
<div id="lead_info_1">
<div class="input select">
<div class=""></div>...
I would add a hidden input in your form.
Then, just before your post, assign the of the hidden textbox with the value of the checkbox.
(using jQuery)

Categories