CSS hover property on button not working after adding PHP code - php

I added a hover effect on a button. The code effect worked perfectly until I added some PHP code inside my page. Everything except the hover effect is working fine. It tried to understand the problem by using console but got no hint.
Here's my code:
CSS:
#secondary-content
{
position: relative;
top: 100vh;
}
#write-blog
{
position: relative;
top: -50%;
z-index: 3;
}
.ghost-button
{
display: inline-block;
width: 200px;
padding: 8px;
color: #fff;
border: 2px solid #fff;
text-align: center;
outline: none;
text-decoration: none;
}
.ghost-button:hover, .ghost-button:active
{
background-color: #fff;
color: #000;
transition: background-color 0.3s ease-in, color 0.3s ease-in;
}
Here's the code inside my body:
<div class="slider fullscreen" data-indicators="false">
<ul class="slides">
<li>
<img src="Includes/images/map2.jpg">
<div class="caption left-align">
<h3 class="light white-text">History doesn't repeats itself,<br>but it does rhyme.</h3>
</div>
</li>
<li>
<div class="caption right-align">
<h1 class="light white-text">First solve the problem.<br>Then, write the code.</h1>
</div>
<img src="Includes/images/sublime_text.jpeg"> <!-- random image -->
</li>
<li>
<div class="caption center-align">
<h4 class="light white-text">Art speaks where words are unable to explain.</h4>
</div>
<img src="Includes/images/art1.jpg">
</li>
<li>
<img src="Includes/images/music2.jpg">
<div class="caption right-align">
<h5 class="light grey-text text-lighten-3">Where words fail, Music speaks.</h5>
</div>
</li>
<li>
<div class="caption left-align">
<h4 class="light white-text">Science is the poetry of<br>reality.</h4>
</div>
<img src="Includes/images/science.jpg"> <!-- random image -->
</li>
</ul>
<div id="write-blog" class="center-align">
<a class="ghost-button" href="">WRITE A BLOG</a>
</div>
</div>
<div id="secondary-content">
<div class="container">
<?php
$blog = DB::getInstance()->get('blogs', array('deletion_status', '=', '0'));
if($blogs = $blog->fetchRecords(2))
{
foreach($blogs as $blog)
{
$date=strtotime($blog->created_on); // changing the format of timestamp fetched from the database, converting it to milliseconds
echo
"<div class='section'>
<div class='row'>
<div class='col s2'>
<blockquote>".
date('M', $date)."<br>".
date('Y d', $date).
"</blockquote>
</div>
<div class='col s8'>
<h5>".ucfirst($blog->title)."</h5>
<h6>".ucfirst($blog->description)."</h6><br>
<div class='row'>
<div class='col s1'>
<i class='material-icons' style='color:grey'>remove_red_eye</i>
</div>
<div class='col s1'>
{$blog->views}
</div>
<div class='col s1 offset-s2'>
<i class='material-icons' style='color:grey'>thumb_up</i>
</div>
<div class='col s1'>
{$blog->likes}
</div>
<div class='col s1 offset-s2'>
<i class='material-icons' style='color:grey'>thumb_down</i>
</div>
<div class='col s1'>
{$blog->dislikes}
</div>
</div>
<div class='divider'></div>
</div>
</div>
</div>";
}
}
?>
</div>
<script src="Includes/js/jquery.min.js"></script>
<script type="text/javascript" src="Includes/js/materialize.min.js"></script>
<script>
$(document).ready(function(){
$('.slider').slider();
});
</script>
The code below the div having id 'secondary-content' is also working fine. What wrong am I doing here?

Related

How can i set a height to div according to step by step div

When i am listing products i want them to have fixed height according to its step by step div's max height. For example below there is a screenshot from amazon that has what i want. All 4 elements' height are same.
and i'm using the code below to list products
<div class="shop-product-wrap">
<div class="row row-8">
<?php foreach ($products as $product): ?>
<div class="product-col col-lg-3 col-md-4 col-sm-6">
<!-- Single Product Start -->
<div class="single-product-wrap mt-10">
<div class="product-image">
<a href="<?= $product['url'] ?>"><img class="lazy"
src="<?= public_url('images/other/thumbnail.jpg') ?>"
data-src="<?= image_url($product['image_small']) ?>"
alt=""></a>
</div>
<div class="product-button">
<a onclick="wishlist.add(<?= $product['product_id'] ?>)"
class="add-to-wishlist">
<i class="icon-heart"></i></a>
</div>
<div class="product-content">
<h6 class="product-name"><?= $product['product_name'] ?>
</h6>
<div class="starts-icon-box">
<i class="stars-icon"></i>
</div>
<div class="price-box">
<div class="single-product-discount-and-price">
<?php if ($product['product_discount_price']): ?>
<span class="onsale"><?= (100 - (round(($product['product_price'] * 100) / $product['product_discount_price']))) . '%' ?></span>
<?php endif; ?>
<div class="old-and-new-price">
<span class="old-price"><?= $product['product_discount_price'] ?> TL</span>
<span class="new-price"><?= number_format($product['product_price'], 2) ?> TL</span>
</div>
</div>
</div>
<div class="product-button-action">
<a onclick="cart.add(<?= $product['product_id'] ?>,1)"
class="add-to-cart">Add to cart</a>
</div>
</div>
</div>
<!-- Single Product End -->
</div>
<?php endforeach; ?>
</div>
</div>
and when i listing products they all take the height they can according to their content such as its name and so that they don't have the same height. How can i make them have same height step-by-step.
Sorry for my bad english.
You have to use div tag with same class name for every product item and add a parent div like this...
<div class="parent">
<div class="child">Item 1</div>
<div class="child">Item 2</div>
<div class="child">Item 3</div>
<div class="child">Item 4</div>
</div>
Then use flex box for parent and child element...
.parent{
display: flex;
flex-wrap: wrap;
align-content: stretch;
height: 600px; /*or something*/
}
.child{
background-color: #f1f1f1;
width: 100px;
margin: 10px;
text-align: center;
line-height: 75px;
font-size: 30px;
}
Please visit those links for more information about flex box...
https://www.w3schools.com/css/css3_flexbox.asp
https://www.w3schools.com/css/tryit.asp?filename=trycss3_flexbox_align-content_stretch

How can I add a css rule to a dynamically created element in jquery

Is it possible to add css to a specific dynamically created div in jquery? I want to add an overlay to a specific div but trying to find a way to pass the id from the dynamically created div to the jquery function in order to only add the CSS rule to that specific div, is becoming a task for me. When I click on the div it adds the overlay to all of them.
Thanks for your time and here is my code.
foreach($selectedPhotoResult as $rowSelect){
if($counter % 3 === 1){
echo '</div><div class="row">';
}
echo'
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 text-center picContainer">
<a class="overlayPicHL" data-overlayPicID-id="'.$row['ad_id'].'"><div class="price" style="position:absolute;top:0px;;right:15px;z-index:98;height:50px;width:50px;border-radius: 0px 5px 0px 0px;background-image: linear-gradient(to bottom, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0) 100%);"><i class="fa fa-eye" style="font-size:25px;color:#ffffff;position:absolute;top:10px;right:10px;"></i></div></a>
<div class="well photoControlsMain pht-brd-cl">
<a class="mainImageProfile" style="display:block;" data-userMain-id="'.$row['ad_user'].'" data-pic-id="'.$row['ad_photo_thumb'].'">
<div class="imageOverlayStyle">
Something here
</div>
<figure>
<img src="'.$row['ad_photo_thumb'].'" class="img-responsive imageSizingGallery imageProfileStyleSmall" style="object-fit: contain;" width="100%" alt=""/>
<div class="photoControlsMainImage">
<p style="z-index:9999;">
<span class="text-prt-und-bl usernameIndexPos">'.ucwords($row['industryName']).'</span>
<span class="adRateIndexPos">$'.$row['ad_rate'].'/hr</span>
';
if($userfile->member_is_loggedin()){
echo'<a class="userMsgID" data-toggle="modal" data-target="#msgUserModal" data-userSenduserID-id="'.$rowSelect['user_id'].'" data-userSend-id="'.$rowSelect['industryName'].'" data-username-modal="'.ucwords($rowSelect['industryName']).'"><span class="commentIcoPos"><i class="fa fa-comment-o"></i></span></a>';
if($favList->rowCount() > 0){
foreach($favListResult as $rowFav){
if($rowFav['user_fav_id'] == $user_id){
echo'<span class="heartIcoPosRed adUnFav" data-unfav-id="'.$rowFav['fav_id'].'"><a><i class="fa fa-heart heartIcoRedColor"></i></a></span></a>';
}
}
}else{
echo'<span class="heartIcoPos adFav" data-userFav-id="'.$user_id.'" data-fav-id="'.$row['ad_id'].'"><a class="heartIcoWhite"><i class="fa fa-heart"></i></a></span></a>';
}
echo city($row['ad_city']);
}else{
echo'</a>
<a class="loginDisplayHeader" style="display:none;"><span class="commentIcoPos"><i class="fa fa-comment-o"></i></span></a>
<a class="loginDisplayHeaderFull" id="loginFormShowHeader"><span class="commentIcoPos"><i class="fa fa-comment-o"></i></span></a>
<a class="loginDisplayHeader" style="display:none;"><span class="heartIcoPos heartIcoWhite"><i class="fa fa-heart"></i></span></a>
<a class="loginDisplayHeaderFull" id="loginFormShowHeader"><span class="heartIcoPos heartIcoWhite"><i class="fa fa-heart"></i></span></a>
';
echo city($row['ad_city']);
}
$likes = $conn->prepare("SELECT count(likes) as likeCount
FROM
likes
WHERE
user_accept_id = :adUserId
");
$likes->bindParam(":adUserId", $adUserId);
$likes->execute();
$likesFetch = $likes->fetchAll();
if($likes->rowCount() > 0){
foreach($likesFetch as $rowLikes){
echo'<span class="userLikeBtnLG">'.thousandsCurrencyFormat($rowLikes['likeCount']).' Likes <i class="fa fa fa-thumbs-o-up thbsUPND"></i></span>';
}
}
echo'</p>
</div>
</figure>
</div>
</div>
';
}
Here is the jquery code so far
$(".overlayPicHL").on("click", function() {
const imageOverlayStyle =
$(this.nextElementSibling).find('.imageOverlayStyle');
$(imageOverlayStyle).css({
backgroundColor: 'yellow'
});
});
And this is the CSS for the overlay item
.imageOverlayStyle {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #008CBA;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
It's a simple overlay transition, I just need to figure out how to add this overlay to a specific div that is pulled from the database...dynamically created. I have searched for a solution for a while now with no such luck yet.
The .imageOverlayStyle you want to target is a child of the next sibling of the clicked .overlayPicHL, so use nextElementSibling and [0]:
$(".overlayPicHL").on("click", function() {
const imageOverlayStyle = $(this.nextElementSibling).find('.imageOverlayStyle');
$(imageOverlayStyle).css({
backgroundColor: 'yellow'
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 text-center picContainer">
<a class="overlayPicHL" data-overlayPicID-id="'.$row['ad_id'].'">overlayPicHL
<div class="price"><i class="fa fa-eye" style="font-size:25px;color:#ffffff;position:absolute;top:10px;right:10px;"></i></div>
</a>
<div class="well photoControlsMain pht-brd-cl">
<a class="mainImageProfile" style="display:block;" data-userMain-id="'.$row['ad_user'].'" data-pic-id="'.$row['ad_photo_thumb'].'">
<div class="imageOverlayStyle">
Something here
</div>
<figure>
<img src="'.$row['ad_photo_thumb'].'" class="img-responsive imageSizingGallery imageProfileStyleSmall" style="object-fit: contain;" width="100%" alt="" />
<div class="photoControlsMainImage">
<p style="z-index:9999;">
<span class="text-prt-und-bl usernameIndexPos">usernameIndexPos</span>
<span class="adRateIndexPos">adrate</span>
</p>
</div>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 text-center picContainer">
<a class="overlayPicHL" data-overlayPicID-id="'.$row['ad_id'].'">overlayPicHL
<div class="price"><i class="fa fa-eye" style="font-size:25px;color:#ffffff;position:absolute;top:10px;right:10px;"></i></div>
</a>
<div class="well photoControlsMain pht-brd-cl">
<a class="mainImageProfile" style="display:block;" data-userMain-id="'.$row['ad_user'].'" data-pic-id="'.$row['ad_photo_thumb'].'">
<div class="imageOverlayStyle">
Something here
</div>
<figure>
<img src="'.$row['ad_photo_thumb'].'" class="img-responsive imageSizingGallery imageProfileStyleSmall" style="object-fit: contain;" width="100%" alt="" />
<div class="photoControlsMainImage">
<p style="z-index:9999;">
<span class="text-prt-und-bl usernameIndexPos">usernameIndexPos</span>
<span class="adRateIndexPos">adrate</span>
</p>
</div>
</figure>
</a>
</div>
</div>
Add the rules to a stylesheet so that they are automatically applied to the newly created elements.
Chain the css() method when you create your elements: $('') . appendTo(document. ...
Create a new stylesheet dynamically: $("").
$('<img id="newImage" src="text.jpg"/>')
.appendTo(document.body)
.css(style);
Create a new stylesheet dynamically:
$("<style>").text("#myNewEl { width:40px; height:35px; }").appendTo("head");
You can find class in entire document and add css, you can use next() if you want it to add to only next() div
$(document).on("click", ".overlayPicHL", function(){
var id = $(this).attr("data-overlayPicID-id");
$(this).next(".imageOverlayStyle").css({"height":"100%"}); //<-this is the css I want to add to the specific div when the icon has been clicked
});
.imageOverlayStyle {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #008CBA;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a class="overlayPicHL" data-overlayPicID-id="'.$row['ad_id'].'">
<div class="price" style="position:absolute;top:0px;;right:15px;z-index:98;height:50px;width:50px;border-radius: 0px 5px 0px 0px;background-image: linear-gradient(to bottom, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0) 100%);"><i class="fa fa-eye" style="font-size:25px;color:#ffffff;position:absolute;top:10px;right:10px;"></i></div></a>
<div class="imageOverlayStyle" id="imgOvrlayID" data-imgOvly-id="'.$row['ad_id'].'">
Something here
</div>

Uploaded file does not come to the filebag of the request

I have a user profile screen which shows a user's information along with a profile picture. There I have a link called "Change Photo" which triggers a file input to upload a new image. Then I have a JS code to submit the form soon after the file input takes the image. But once the form is submitted, at my controller, when I dump my request, the filebag is empty.
This is my .twig file
{% extends('base.html.twig') %}
{% block title %}Welcome- Open Rpoad Tolling!{% endblock %}
{% block stylesheets %}
<style>
body{
background: -webkit-linear-gradient(left, #3931af, #00c6ff);
}
.emp-profile{
padding: 3%;
margin-top: 3%;
margin-bottom: 3%;
border-radius: 0.5rem;
background: #fff;
}
.profile-img{
text-align: center;
}
.profile-img img{
width: 70%;
height: 100%;
}
.profile-img .file {
position: relative;
overflow: hidden;
margin-top: -20%;
width: 70%;
border: none;
border-radius: 0;
font-size: 15px;
background: #212529b8;
}
.profile-img .file input {
position: absolute;
opacity: 0;
right: 0;
top: 0;
}
.profile-head h5{
color: #333;
}
.profile-head h6{
color: #0062cc;
}
.profile-edit-btn{
border: none;
border-radius: 1.5rem;
width: 70%;
padding: 2%;
font-weight: 600;
color: #6c757d;
cursor: pointer;
}
.profile-edit-btn:hover{
color: #FFF;
background: rgb(240, 173, 78, 0.75);
/*border: 2px solid rgba(240, 173, 78, 0.75);*/
}
.proile-rating{
font-size: 12px;
color: #818182;
margin-top: 5%;
}
.proile-rating span{
color: #495057;
font-size: 15px;
font-weight: 600;
}
.profile-head .nav-tabs{
margin-bottom:5%;
}
.profile-head .nav-tabs .nav-link{
font-weight:600;
border: none;
}
.profile-head .nav-tabs .nav-link.active{
border: none;
border-bottom:2px solid #0062cc;
}
.profile-work{
padding: 14%;
margin-top: -15%;
}
.profile-work p{
font-size: 12px;
color: #818182;
font-weight: 600;
margin-top: 10%;
}
.profile-work a{
text-decoration: none;
color: #495057;
font-weight: 600;
font-size: 14px;
}
.profile-work ul{
list-style: none;
}
.profile-tab label{
font-weight: 600;
}
.profile-tab p{
font-weight: 600;
color: #0062cc;
}
</style>
{% endblock %}
{% block body %}
<div class="container emp-profile">
<form action="{{ path('changeImage') }}" name="changeProfilePhoto" id="changeImageForm" method="post" enctype="multipart/form-data" >
<div class="row">
<div class="col-md-4">
<div class="profile-img">
<img src="{{ photoSrc }}" alt=""/>
<div class="file btn btn-lg btn-primary" id="fileUploadButton">
Change Photo
</div>
</div>
</div>
<div class="col-md-6">
<div class="profile-head">
<h5>
{{ user.firstName }} {{ user.lastName }}
</h5>
<h6>
Web Developer and Designer
</h6>
<p class="proile-rating">RANKINGS : <span>8/10</span></p>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">About</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Timeline</a>
</li>
</ul>
</div>
</div>
<div class="col-md-2">
<button type="button" onclick="window.location.href = '{{ editProfile }}';" class="profile-edit-btn" name="btnAddMore" >Edit Profile</button>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="profile-work">
<p>WORK LINK</p>
Website Link<br/>
Bootsnipp Profile<br/>
Bootply Profile
<p>SKILLS</p>
Web Designer<br/>
Web Developer<br/>
WordPress<br/>
WooCommerce<br/>
PHP, .Net<br/>
</div>
</div>
<div class="col-md-8">
<div class="tab-content profile-tab" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
<div class="row">
<div class="col-md-6">
<label>User Id</label>
</div>
<div class="col-md-6">
<p>Kshiti123</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Name</label>
</div>
<div class="col-md-6">
<p>Kshiti Ghelani</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Email</label>
</div>
<div class="col-md-6">
<p>kshitighelani#gmail.com</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Phone</label>
</div>
<div class="col-md-6">
<p>123 456 7890</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Profession</label>
</div>
<div class="col-md-6">
<p>Web Developer and Designer</p>
</div>
</div>
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<div class="row">
<div class="col-md-6">
<label>Experience</label>
</div>
<div class="col-md-6">
<p>Expert</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Hourly Rate</label>
</div>
<div class="col-md-6">
<p>10$/hr</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Total Projects</label>
</div>
<div class="col-md-6">
<p>230</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>English Level</label>
</div>
<div class="col-md-6">
<p>Expert</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Availability</label>
</div>
<div class="col-md-6">
<p>6 months</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Your Bio</label><br/>
<p>Your detail description</p>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="file" id="changeImageButton" name="file"/>
</form>
</div>
<script>
const changeImgButton = document.getElementById('changeImageButton');
const fileUploadButton = document.getElementById('fileUploadButton');
const formHome = document.getElementById('changeImageForm');
changeImgButton.addEventListener("change",function () {
formHome.submit();
});fileUploadButton.addEventListener("click",function () {
changeImgButton.click();
});
</script>
{% endblock %}
// This is my controller
/**
* #Route("/changeImage", name="changeImage")
* #param Request $request
*/
public function changeImage(Request $request){
$file = $request->files->get('file');
dump($request);die;
if($file){
$fileName = md5(uniqid()).'.'.$file->guessExtension();
$file->move(
$this->getParameter('uploads_dir'), $fileName
);
}
}

I want to switch to another page after clicking on the pic in codeigniter, how i can do it?

<div class="col-lg-4 col-sm-6">
<a href="#" class="portfolio-box">
<img src="img/portfolio/1.jpg" class="img-responsive" alt="">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
Category:-
</div>
<div class="project-name">
Mobile
</div>
</div>
</div>
</a>
</div>
//1.jpg image is appearing in the view i want to switch to another view after clicking on this image.
You can achieve this with css:
#my-div{
background-color: #000;
width: 200px;
height: 200px }
a.fill-div {
display: block;
height: 100%;
width: 100%;
text-decoration: none}
<div class="col-lg-4 col-sm-6" id="my-div">
the rest of it.
</div>

how to use multiple if statement in blade file in laravel5

In laravel5 instead of using foreach I can use the if statement to filter the data on the basis of SQL query. How can I view my page using ifelse statement in laravel5? I have three div class in these class how to fetch the data from the database? How to use in the blade.php file?
How can I filter the data from database using routes and controller?
<div class="container">
<div class="block-content block-content-small-padding">
<div class="block-content-inner">
<h2 class="center">Recent Properties</h2>
<ul class="properties-filter">
<li class="selected"><span>All</span></li>
<li><a href="#" class="featured" data-filter=".featured" ><span>Featured</span></a></li>
<li><a href="#" class="rent" data-filter=".rent" ><span>Rent</span></a></li>
<li><a href="#"class="sale" data-filter=".sale" ><span>Sale</span></a></li>
</ul>
<div class="properties-items isotope" style="position: relative; overflow: hidden; height: 810px;">
<div class="row ">
#if($val -> $value)
<div class="property-item col-sm-6 col-md-3 isotope-item my " style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px);">
<div class="property-box">
<div class="property-box-inner">
<h3 class="property-box-title">{{$value->city}}</h3>
<h4 class="property-box-subtitle">{{$value->state}}</h4>
<div class="property-box-picture">
<div class="property-box-price">{{$value->property_price}}</div>
<div class=""> <img src="images/test/{{$value->image}}" alt=""> </div>
</div>
</div>
</div>
</div>
#elseif($val -> $value)
<div class="property-item col-sm-6 col-md-3 isotope-item" style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px);">
<div class="property-box">
<div class="property-box-inner">
<h3 class="property-box-title">{{$value->city}}</h3>
<h4 class="property-box-subtitle">{{$value->state}}</h4>
<div class="property-box-picture">
<div class="property-box-price">{{$value->property_price}}</div>
<div class=""> <img src="images/test/{{$value->image}}" alt=""> </div>
</div>
</div>
</div>
</div>
#else($val -> $value)
<div class="property-item property-sale col-sm-6 col-md-3 isotope-item myButton my" style="position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px);">
<div class="property-box">
<div class="property-box-inner">
<h3 class="property-box-title">{{$value->city}}</h3>
<h4 class="property-box-subtitle">{{$value->state}}</h4>
<div class="property-box-picture">
<div class="property-box-price">{{$value->property_price}}</div>
<div class=""> <img src="images/test/{{$value->image}}" alt=""> </div>
</div>
</div>
</div>
</div>
#endif
Controller:
public function index()
{
$view=DB::table('property_details')
->get();
return View::make('index', array('val'=>$view));
}
public function rentshow()
{
$show=DB::table('property_details')
->where('sale_or_rent','=','rent')
->get();
return View::make('index', array('val'=>$show));
}
public function saleshow()
{
$show=DB::table('property_details')
->where('sale_or_rent','=','sale')
->get();
return View::make('index', array('val'=>$show));
}
You need to correct your if / else statements to:
#if ( $val == "something" )
// do something
#elseif ( $val == "something-else" )
// do something else
#else
// the default
#endif
You can't pass a condition to #else like you've done in your code.

Categories