Dynamic filtration in PHP - php

I have code for filtration. But the data which filtered was static data. Now I want that data comes from database. Here I shown code snippet for that.
here is the script:
<script>
$('document').ready(function(){
$('#demo').jplist({
itemsBox: '.list'
,itemPath: '.list-item'
,panelPath: '.jplist-panel'
});
});
</script>
and this is the html design:
<div
class="jplist-group"
data-control-type="checkbox-group-filter"
data-control-action="filter"
data-control-name="themes">
<input
data-path=".architecture"
id="architecture"
type="checkbox"
/>
<label for="architecture">Architecture</label>
<input
data-path=".christmas"
id="christmas"
type="checkbox"
/>
<label for="christmas">Christmas</label>
</div>
<!-- item 1 -->
<div class="list-item box">
<!-- img -->
<div class="img left">
<img src="img/thumbs/arch-2.jpg" alt="" title=""/>
</div>
<!-- data -->
<div class="block right">
<p class="date">03/18/2012</p>
<p class="title">Architecture</p>
<p class="desc">Architecture is both the process and product of planning, designing and construction. Architectural works, in the material form of buildings, are often perceived as cultural symbols and as works of art. Historical civilizations are often identified with their surviving architectural achievements.</p>
<p class="like">25 Likes</p>
<p class="theme">
<span class="architecture">Architecture</span>,
<span class="brown">Brown</span>
</p>
</div>
</div>
Thanks in advance.

Related

php get function not working in wordpress

Here i am trying to convert my html and css template in wordpress theme and i have four php files (1) index.php, (2) header.php, (3) feature.php and (4) footer.php.
In index.php files i am getting the other three files using function <?php get_header(); ?>, <?php get_feature (); ?>,<?php get_footer (); ?>.
Now on using function <?php get_header(); ?>,<?php get_footer (); ?> in index.php it shows the header and footer section but on including <?php get_feature (); ?> between header and footer it shows error indicating <?php get_feature (); ?>line saying "Fatal error: Call to undefined function get_feature() in C:\xampp\htdocs\Alvin Lemo\wordpress\wp-content\themes\alvinlimo\index.php on line 2" and does not show the feature section and footer section.
Below is what i have done
In index.php
<?php get_header (); ?>
<?php get_feature(); ?> <!--- Error Showing Line -->
<?php get_footer (); ?>
In header.php
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<!--- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>Alvin Lemo</title>
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet">
<!-- Script
================================================== -->
<script src="js/modernizr.js"></script>
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="favicon.png" >
<?php wp_head (); ?>
</head>
<body>
<div id="myNav" class="overlay">
×
<div class="overlay-content">
<div class="container">
<h2 style="color:white">Please Login To Resere Your Fleet With Us</h2><br />
<form>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter email"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="pwd" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter password"><br /><br />
</div>
<div class="checkbox">
</div>
<button type="submit" class="btn btn-default">Rserve</button>
</form>
</div>
</div>
</div>
<div id="myNavv" class="overlay">
×
<div class="overlay-content">
<div class="container">
<h2 style="color:white">Please Register To Reserve Your Fleet </h2><br />
<form>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter FullName"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter email"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="pwd" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter password"><br /><br />
</div>
<button type="submit" class="btn btn-default">Register</button>
</form>
</div>
</div>
</div>
<!-- Header
================================================== -->
<header>
<div class="logo">
<a class="smoothscroll" href="#hero"><!--<img alt="" src="images/logo.png">-->
<h2>A.L.S</h2>
</a>
</div>
<nav id="nav-wrap">
<a class="mobile-btn" href="#nav-wrap" title="Show navigation">Show Menu</a>
<a class="mobile-btn" href="#" title="Hide navigation">Hide Menu</a>
<ul id="nav" class="nav">
<li><a class="smoothscroll" href="#features">EVENT TRANSPORTATION</a></li>
<li><a class="smoothscroll" href="#pricing">Services</a></li>
<li><a class="smoothscroll" href="#screenshots">OUR FLEET</a></li>
<li><a class="smoothscroll" href="#testimonials">Testimonials</a></li>
<li><a class="smoothscroll" href="#subscribe">CONTACT</a></li>
</ul> <!-- end #nav -->
</nav> <!-- end #nav-wrap -->
<ul class="header-social">
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-google-plus"></i></li>
</ul>
</header>
<!-- Header End -->
<!-- Homepage Hero
================================================== -->
<section id="hero">
<div class="row">
<div class="twelve columns">
<div class="hero-text">
<br /><br /><br />
<h1 class="responsive-headline">Welcome To Alvin's Limo</h1>
<p>
Little about alivin's limo services.
</p>
</div>
<br />
<div class="buttons">
<a class="button trial" onclick="openNav()">Reserve Fleet</a>
<a class="button learn-more smoothscroll" onclick="openNavv()">Register</a>
</div>
<br /><br /><br /><br /><br /><br /><br />
</div>
</div>
</section>
<!-- Homepage Hero end -->
In feature.php
<!-- Features Section
================================================== -->
<section id='features'>
<div class="row section-head">
<h1>EVENT TRANSPORTATION</h1>
<p>
We Fell Happy To Be Part Of Your Special Ocassion
</p>
</div>
<div class="row feature design">
<div class="six columns right">
<h3> Wedding Transporation</h3>
<p>LMake your "most memorable day" of your life more special by Alvin Wedding Limo Service.
Your weddings transportation will be most beautiful latest model limousine imaginable,
with all the special amenities you desire. Our chauffeurs are always on time, courteous,
and dressed in black suit. Let us take you to the church and from the church to the reception and
from the reception to the airport or any special place in Texas for your honeymoon. You don't need
to worry about coordinating transportation from each destination, we can help arrange your weddings
party pick-ups and drop-offs and everything in between. We do service all the hills country wedding
venues. Feel free to check our wedding reviews - WEDDINGWIRE-THE KNOTT.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/fpt-112704-Wedding-Flowers.jpg" />
</div>
</div>
<div class="row feature responsive">
<div class="six columns left">
<h3>Wine Transportation.</h3>
<p>
Alvin Limousine Services share your passion for wine; that’s why we specialize in hills country
wine tours. We offer a diverse selection of vehicles ranging from sedans, stretch limousines to
transport you affordably in luxury, safety, and style! Leave the driving, directions, stress,
and traffic to us while our Chauffeur whisks you away to your perfect day!
Our impressive customer list is concrete evidence of our ability to outperform our competition,
consistently exceeding our customers’ expectations. We will make your tour the best tour you have
ever known. We have dedicated chauffeur that specialize in wine tours, Brewery and Vodka distillery.
</p>
</div>
<div class="six columns feature-media right">
<img src="images/wine-tours-preferrred-limo.jpg" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Concert</h3>
<p>
Whether you want to see a Show, Concert, Opera, Symphony or any other fun thing you can think of,
Alvin Limos will provide you personal and reliable chauffeured Limousine.
Reserve luxury town car Sedan or our luxurious stretch limousine for hassle free ride
from navigation, traffic, and struggling the multitude of cars for parking. Roll up with
style to the front door of any events location you desire.
Let the professional Chauffeurs of Alvin Limousine Service take you to your next Concert,
Movie premier, Opera, Symphony or any night out events with comfort and style.
We get you there on time in safely and in style ; Alvin Limo will ensure you have the time of
your life. We are the Leader in providing a full Service Limousine Transportation.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/thenextweb.jpg" />
<!--<img src="images/feature-image-3.png" alt="" />-->
</div>
</div>
<div class="row feature video">
<div class="six columns left">
<h3>ACL/SXSW/Austin 360</h3>
<p>
What you hear is true. With vibrant entertainment and culture, inspiring cuisine and stunning outdoor settings, Austin lets you create a soundtrack all your own. We're home to more than 250 music venues and a vibrant arts scene. So take a look around, and put Live Music Capital of the World® on your playlist. Whether you want to take ride thought Austin or plan a night out with friends and family we will do that in style. Alvin Limousine is a premier transportation when it comes to Austin Texas culture and events. Come one come all and let us drive though the ins and outs of this beautiful happening city.
Alvin Limousine staff are very discrete and confident with all our celebrities and movies stars that we have been transporting for years.
</p>
</div>
<div class="six columns feature-media right">
<img src="images/1ff7f709cd8ef280ec5f2b317f79ba14-2b32e6b5be7f48f4557299fc9db819c3.png" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Convention Center</h3>
<p>
The Austin Convention Center, a premier facility located in the heart of the capital city’s downtown business district, has emerged as a leader in the convention and meeting industry.
Alvin’s Limousine Services is proud to be part of your success by providing you or your guests with a premier chauffeured services . We can accommodate small or large groups .
- Airport Transportations
- Shuttling your groups through out your meetings
- Advertising your business on our Cars. (Wrap the cars with your Logo or new Product.**Extra Fees apply)
</p>
</div>
<div class="six columns feature-media left">
<img src="images/ARATA_ISOZAKI_RHWL_QNCC_DOHA_QATAR_PAN_060313_0009.jpg" />
</div>
</div>
<div class="row feature responsive">
<div class="six columns left">
<h3>Circuits of America - Formula 1</h3>
<p>
Circuit Of The Americas is a multi-purpose facility that will host the most prestigious racing events in the world, including the Formula 1 United States Grand Prix. It is the first purpose-built Grand Prix facility in the U.S Austin Texas
Circuit of The Americas (COTA) in Austin, Texas, is the home of world championships and a world-class destination for premium sports and entertainment.
Alvin’s Limousine Services is proud to be the leading transportations in Austin Texas, we can provide you or your Guests with many VIP Packages that can suits your needs , from Town car service , SUV’s or Stretch Limousine ,we are your one stop solutions to your transportations for World-Class destination . For International reservations , Please use our 24/7 reservations systems for quick quote and complete reservation confirmed within one hour or you can
Skpe us at : Austinlimo
</p>
</div>
<div class="six columns feature-media right">
<img src="images/bQwIzE.jpg" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Prom</h3>
<p>
Whether you want to see a Show, Concert, Opera, Symphony or any other fun thing you can think of, Alvin Limos will provide you personal and reliable chauffeured Limousine. Reserve luxury town car Sedan or our luxurious stretch limousine for hassle free ride from navigation, traffic, and struggling the multitude of cars for parking. Roll up with style to the front door of any events location you desire.
Let the professional Chauffeurs of Alvin Limousine Service take you to your next Concert, Movie premier, Opera, Symphony or any night out events with comfort and style.
We get you there on time in safely and in style ; Alvin Limo will ensure you have the time of your life. We are the Leader in providing a full Service Limousine Transportation.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/prom-header.jpg" />
</div>
</div>
</section>
<!-- Features Section end -->
In footer.php
<!-- Footer
================================================== -->
<footer>
<div class="row">
<div class="six columns right-cols">
<div class="row">
<div class="columns">
<h2 class="address">Come Visit</h2>
<p>
7901 Cameron Rd Bldg3 Suite 312, Austin tx 78754<br>
</p>
</div>
<div class="columns last">
<h2 class="contact">Contact Us</h2>
<ul>
<li>512 300 1379</li>
<li>someone#woosite.com</li>
</ul>
</div>
</div>
</div>
<p class="copyright">© 2014 Alvin's Limousine Services | Design by <a>cts-Design Team</a></p>
<div id="go-top">
<a class="smoothscroll" title="Back to Top" href="#hero"><i class="icon-up-open"></i></a>
</div>
</div> <!-- Row End -->
</footer>
<!-- Footer End-->
<?php wp_footer (); ?>
<!-- Java Script
================================================== -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2 /jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.10.2.min.js"><\/script>')</script>
<script type="text/javascript" src="js/jquery-migrate-1.2.1.min.js">
</script>
<script src="js/jquery.flexslider.js"></script>
<script src="js/waypoints.js"></script>
<script src="js/jquery.fittext.js"></script>
<script src="js/jquery.fitvids.js"></script>
<script src="js/imagelightbox.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js">
</script>
</body>
</html>
Functions like get_header() and get_footer() are predefined WordPress functions. To get custom part of template we use
<?php get_template_part( string $slug, string $name = null ) ?>
As stated in documentation, patterns it uses to find files are:
{slug}.php
{slug}-{name}.php
If the theme contains no specified file then no template will be included.
The template is included using require, not require_once, so you may include the same template part multiple times.
Finally, this one should load your feature template:
<?php get_template_part( 'feature' ) ?>
Source: https://developer.wordpress.org/reference/functions/get_template_part/
You try to use an undefined function, that is maybe coming from a third party plugin. get_feature() is not a native WordPress function.
If you want to display the featured image, you can use get_the_post_thumbnail() (more details
Hope it helps

How to save variables and use these in another page?

I'm making a website with a guest and admin side to it. In the admin side there are additional page's in which you can fill in form's which contain text and titles for certain div's in other page's.
I was wondering how can I make it so that when you fill in these forms and press save, the variables will be used in the other page where you can actually see the title and text as html. The text and title have to be visible for everyone that visits the page and have to stay there until there are changes made.
I have code yet, since i don't know how to start, I do have the interfaces, you can see the HTML down here.
Interface Input:
<div class="panel-box">
<div class="titles">
<h4>Voeg vacatures toe</h4>
</div>
<form class="form-theme">
<div class="row">
<div class="form-group">
<div class="col-md-12">
<label for="name">Titel vacature</label>
<input type="text" required="required" value="" maxlength="100" class="form-control" name="Name" id="name">
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-md-12">
<label for="description">Beschrijving</label>
<textarea rows="10" class="form-control" name="description" id="description" required="required" ></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input type="submit" value="Save" class="btn btn-lg btn-primary">
</div>
</div>
</form>
</div>
Output:
<!-- Content Central -->
<div class="container padding-top">
<div class="row">
<!-- content Column Left -->
<div class="col-md-12">
<!-- Experts -->
<div class="panel-box">
<div class="titles">
<h4> <!-- This is where the title should be --> </h4>
</div>
<div class="row">
<ul class="events-carousel events-no-carousel">
<!-- Item blog post -->
<li class="col-xs-6 col-sm-6 col-md-4">
<div class="info-post">
<h4>Vacature naam</h4>
<p><!-- This is where the text should be -->
<a class="btn btn-primary pull-right" href="{{ path('static_page', {template:'club/vacancy'}) }}">Bekijken</a></p>
</div>
</li>
<!-- End Item blog post -->
</ul>
<!-- End blog post-->
</div>
</div>
<!-- End Experts -->
</div>
</div>
</div>
<!-- End Testimonials -->
<!-- End Section Area - Content Central -->
Generally, you should store your form data in database, and then retrieve it from database to render on the other page.
So the PHP script on the page with form should save your form data, when other script on page where you want to show your data should take it from database.

Form text field in nested div not clickable

I did go through other similar topics and still was unable to solve my problem.
The following is my form code.
<div id="footer-left">
<div id="subscribe">
<form action="subscribe.php" method="post">
<input type="text" name="name" value="Enter Your Name"/>
<input type="text" name="email" value="Enter Your Email"/>
<input type="submit" value="Subscribe">
</form>
</div>
</div>
And the following my css code.
#subscribe {
z-index:5;
}
#footer-left {
position:relative;
float:left;
bottom:0px;
width:40%;
height:350px;
background:#f0f0f0;
padding-right:2%;
padding-left:5%;
padding-top:50px;
}
And-index-5 is highest among all classes and identifiers. Still my text area is not clickable.
I know I must be missing some small point but unable to know what it is.
And help would be highly appreciated.
Thanks.
Updated to reflect the solution. In the original Fiddle posted in the comments, the z-index of the footer pane was -2. This was affecting the child elements as well. The form is now clickable after changing the z-index here to 3 as shown in the CSS below. Full code is on the jsfiddle.
http://jsfiddle.net/cpTZT/2/
HTML
<body onload="scaleImage()">
<div id="map_header" class="expressWay">
<div id="header_tabs">
<div id="header_left">
<div id="logo_banner"></div>
<div id="logo"><img src="./images/logo-text.png" style="width:100%;height:100%;" />
</div>
<div id="tabs">
<ul class="nav">
<li id="city"><span>City</span>
<div class="dropDown">
<div class="column" style="margin-left:0px"> Bangalore
Chennai
Delhi
Mumbai
Hyderabad
Jaipur
</div>
</div>
</li>
</ul>
</div>
<div class="clear"></div>
</div>
<div id="header_right">
<div id="social_links">
</div> Sign In
<img class="dots" src="./images/dots.png" align="center" style="display:inline-block;float:right;margin-right:40px;margin-top:10px;" />
<li id="partner"><span>Partner With Us</span>
</li>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="content"></div>
<div id="footer">
<div id="footer-left">
<div id="subscribe">
<form action="subscribe.php" method="post">
<input type="text" name="name" placeholder="Enter Your Name" />
<input type="text" name="email" placeholder="Enter Your Email" />
<input type="submit" value="Subscribe">
</form>
</div>
</div>
<div id="footer-right-left">
<ul>
<li><b>COMPANY</b>
</li>
<li>About Us</li>
<li>Careers</li>
<li>Legal</li>
<li>Terms & Conditions</li>
<li>Press/Publications</li>
</ul>
</div>
<div id="footer-right-right">
<ul>
<li><b>CONTACT US</b>
</li>
<li>Street No XYX Locality City State,Pincode</li>
<li>query#ananas.in</li>
<li>+91-xxxxxxxxxx</li>
</ul>
</div>
</div>
CSS
#footer {
position:relative;
z-index:3;
font-size:0.8em;
}
The area was clickable when I put the original code on JS Fiddle, but when you typed, the text did not disappear.
EDIT: Fixed the information to properly address the question.

Function that checks the value of my roof that was selected and give me the output can be customized

i work on web application in php. The application will be the estimates of works on roof. the app is app.tettosano.com/php_test/ when the user select its roof, then draw the roof on google maps, useful for measure the roof's area, and then on the basis of the choice of the roof, the user can make customizations.
Now, the code not work, there is no passage of value, but the code of choice the roof is
<div class="container">
<!--<div class="carousel slide" id="myCarousel">-->
<div class="carousel-inner" style="margin-left:1px !important;">
<div class="item active">
<form action="rooftype1.php" method="get">
<?php
$sql=mysql_query("select * from add_building where btype = '" . $buiding_type ."'");
while($row=mysql_fetch_array($sql))
{
?>
<ul class="thumbnails">
<li>
<div class="thumbnail">
<h5><?php echo $row['bname'] ?></h5>
<img src='admin/upload/<?php echo $row['bimage'];?>'/>
<div class="caption">
<p>Far far away behind the world mountains, far from the countries.</p>
</div>
<div> <label class="checkbox">
<input type="checkbox" value="<?php echo $row['b_id']; ?>" name="check" > Seleziona il tetto
</label></div>
<div> Esiste la copertura in amianto ?</div>
<div>
<label class="radio"><input type="radio" /> Si</label>
<label class="radio"><input type="radio" /> No</label>
</div>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
I would need a function that checks the value of my roof that was selected and give me the output can be customized.
How can i to solve this issue?

Display news from other web page

I want to display news from anoter web page onto mine, and I cannot figure out the best method for this.
The news on the other web page are displayed within a div class like the following
<div class="news-container">
<div class="news-list"><img src="abcd.jpg" /><strong>abcd</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><img src="efgh.jpg" /><strong>efgh</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><img src="ijkl.jpg" /><strong>ijkl</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
<div class="news-list"><img src="mnop.jpg" /><strong>mnop</strong>
<p>What you see is what you get. <span class="morelink">Read more</span></p>
<div class="clear-both"></div>
</div>
I would like to be able to circle through the news and display them on my own page and rearranged according to our own site layout.
<div class="other-news">
<div class="news-list"><strong>abcd</strong>
<p>What you see is what you get. <img src="abcd.jpg" /></p>
</div>
<div class="news-list"><strong>efgh</strong>
<p>What you see is what you get. <img src="efgh.jpg" /> </p>
</div>
<div class="news-list"><strong>ijkl</strong>
<p>What you see is what you get. <img src="ijkl.jpg" /> </p>
</div>
<div class="news-list"><strong>mnop</strong>
<p>What you see is what you get. <img src="mnop.jpg" /> </p>
</div>
All suggestions are more than welcome.
// Nyborg
You need to look at PHP cURL or file_get_contents(security issues) or look at PHP HTML DOM Parser.
Also look at the legality of what your doing? (they normally provide an API if they want to let you have content)

Categories