I have a problem with WebDriver's XPath that, even though it's right, is returning an error expression.
The expression is:
(*//div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]//(span[#class='myb-SettledBetParticipant_ParticipantSpan ' or #class='myb-OpenBetParticipant_ParticipantSpan']|div[#class='myb-SettledBetItem_SubHeaderText']))
The html is:
<div class="myb-BetItemsContainer_BetItemsContainer ">
<div class="myb-SettledBetItem ">
<div class="myb-SettledBetItemHeader ">
<div class="myb-SettledBetItemHeader_HeaderTextContainer ">
<div class="myb-SettledBetItemHeader_Title ">
<div class="myb-SettledBetItemHeader_Text ">R$0,50 Simples</div>
</div>
<div class="myb-SettledBetItem_SubHeaderText "></div>
</div>
<div class="myb-SettledBetItem_BetStateContainer ">
<div class="myb-SettledBetItem_BetStateLabel ">Retorno Obtido</div>
<div class="myb-SettledBetItem_BetReturnLabel ">R$1,19</div>
</div>
</div>
<div>
<div>
<div class="myb-SettledBetParticipant-FirstOfType myb-SettledBetParticipant myb-SettledBetParticipant_Won ">
<div class="myb-SettledBetParticipant_Header ">
<div class="myb-SettledBetParticipant_HeaderTitle ">
<div class="myb-SettledBetParticipant_HeaderText "><span class="myb-SettledBetParticipant_ParticipantSpan ">Hollyoak Hector (v Courts Ad Darcey) </span>
<div class="myb-HalfAndHalfPill myb-HalfAndHalfPill_Status-1 ">
<div class="myb-HalfAndHalfPill_TextStatus myb-HalfAndHalfPill_TextStatus-1 ">
<div class="myb-HalfAndHalfPill_TextStatusLHS myb-HalfAndHalfPill_TextStatusLHS-1 "></div>
<div class="myb-HalfAndHalfPill_TextStatusRHS myb-HalfAndHalfPill_TextStatusRHS-1 "></div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetParticipant_HeaderOdds ">2.37</div>
</div>
<div class="myb-SettledBetParticipant_MarketDescription ">Aposta Comparativa</div>
<div class="myb-SettledBetParticipant_FixtureDescription ">8.27 Central Park EVE (Corrida 8)</div>
</div>
</div>
<div class="myb-SettledBetItemFooter ">
<div class="myb-SettledBetItemFooter_BetInformation ">
<div class="myb-SettledBetItemFooter_StakeInformation ">
<div class="myb-SettledBetItemFooter_StakeLabel ">Aposta</div>
<div class="myb-SettledBetItemFooter_StakeTextWrapper "><span class="myb-SettledBetItemFooter_StakeTextCurrency myb-SettledBetItemFooter_StakeTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_StakeText ">0,50</span></div>
</div>
<div class="myb-SettledBetItemFooter_ReturnInformation ">
<div class="myb-SettledBetItemFooter_ReturnLabel ">Retorno Total</div>
<div class="myb-SettledBetItemFooter_ReturnTextWrapper "><span class="myb-SettledBetItemFooter_ReturnTextCurrency myb-SettledBetItemFooter_ReturnTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_ReturnText ">1,19</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetItem ">
<div class="myb-SettledBetItemHeader ">
<div class="myb-SettledBetItemHeader_HeaderTextContainer ">
<div class="myb-SettledBetItemHeader_Title ">
<div class="myb-SettledBetItemHeader_Text ">R$0,50 Simples</div>
</div>
<div class="myb-SettledBetItem_SubHeaderText "></div>
</div>
<div class="myb-SettledBetItem_BetStateContainer ">
<div class="myb-SettledBetItem_BetStateLabel ">Retorno Obtido</div>
<div class="myb-SettledBetItem_BetReturnLabel ">R$0,77</div>
</div>
</div>
<div>
<div>
<div class="myb-SettledBetParticipant-FirstOfType myb-SettledBetParticipant myb-SettledBetParticipant_Won ">
<div class="myb-SettledBetParticipant_Header ">
<div class="myb-SettledBetParticipant_HeaderTitle ">
<div class="myb-SettledBetParticipant_HeaderText "><span class="myb-SettledBetParticipant_ParticipantSpan ">Trap 8 </span>
<div class="myb-HalfAndHalfPill myb-HalfAndHalfPill_Status-1 ">
<div class="myb-HalfAndHalfPill_TextStatus myb-HalfAndHalfPill_TextStatus-1 ">
<div class="myb-HalfAndHalfPill_TextStatusLHS myb-HalfAndHalfPill_TextStatusLHS-1 "></div>
<div class="myb-HalfAndHalfPill_TextStatusRHS myb-HalfAndHalfPill_TextStatusRHS-1 "></div>
</div>
</div>
</div>
</div>
<div class="myb-SettledBetParticipant_HeaderOdds ">1.53</div>
</div>
<div class="myb-SettledBetParticipant_MarketDescription ">Vencedor e V/C Ao-Vivo</div>
<div class="myb-SettledBetParticipant_FixtureDescription ">Race 15 Palm Beach</div>
</div>
</div>
<div class="myb-SettledBetItemFooter ">
<div class="myb-SettledBetItemFooter_BetInformation ">
<div class="myb-SettledBetItemFooter_StakeInformation ">
<div class="myb-SettledBetItemFooter_StakeLabel ">Aposta</div>
<div class="myb-SettledBetItemFooter_StakeTextWrapper "><span class="myb-SettledBetItemFooter_StakeTextCurrency myb-SettledBetItemFooter_StakeTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_StakeText ">0,50</span></div>
</div>
<div class="myb-SettledBetItemFooter_ReturnInformation ">
<div class="myb-SettledBetItemFooter_ReturnLabel ">Retorno Total</div>
<div class="myb-SettledBetItemFooter_ReturnTextWrapper "><span class="myb-SettledBetItemFooter_ReturnTextCurrency myb-SettledBetItemFooter_ReturnTextCurrency-formatted ">R$</span><span class="myb-SettledBetItemFooter_ReturnText ">0,77</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
Expected outcome:
Hollyoak Hector (v Courts Ad Darcey)
Trap 8
And was tested on the site: http://xpather.com/
The error returned is:
Fatal error: Uncaught Facebook\WebDriver\Exception\InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression THIS_EXPRESSION because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string THIS_EXPRESSION is not a valid XPath expression. .... in DIR/vendor/facebook/webdriver/lib/Exception/WebDriverException.php on line 152
What is happening? Why doesn't it work in WebDriver's Xpath and it works on this site?
Is this the best way to handle this data?
Your XPath expression only works in XPath-2.0 or above.
To make it work in XPath-1.0, you have to split what you have tried to do with the brackets:
//div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]//span[#class='myb-SettledBetParticipant_ParticipantSpan ' or #class='myb-OpenBetParticipant_ParticipantSpan'] | //div[contains(#class, 'myb-SettledBetItem ') or contains(#class, 'myb-OpenBetItem_Collapsed') or contains(#class, 'myb-OpenBetItem ')]/div[#class='myb-SettledBetItem_SubHeaderText']
So duplicate the first part of the expression and apply the union afterwards on both expressions.
Related
I want to get the .text() of the sibling customerID from the class"db_record_left" when class="db_record_left" gets clicked.
The whole class="db_record" is dynamical generated. But the console.log(CustID); still prints it for every class="db_record" and not only for the clicked one.
echo'
<div class="db_record" id="potentialCustomer-'.$countPotentialCustomers.'">
<div class="db_record_left">
<div class="db_record_describer">'.$cus_Fname.' '.$cus_Lname.'</div>
<div class="db_record_info_wrapper">
<div class="db_record_info_describer">Adresse:</div>
<div class="db_record_info">'.$cus_Adress.'</div>
<div class="db_record_info">
<span>'.$cus_ZipCode.' </span>
<span>'.$cus_Locality.'</span>
</div>
</div>
<div class="db_record_info_wrapper">
<div class="db_record_info_describer">Fahrzeuge:</div>
'.matchVehicles($cus_Vehicles).'
</div>
</div>
<div class="db_record_right">
<div class="material-icons md-large md-ghost-white-enabeld w-embed">
<span class="material-icons-outlined">navigate_next</span>
</div>
</div>
</div>
<span class="customerID" style="display: none">'.$cus_ID.'</span>
';
This would be the jQuery-code
function checkCustomerInformation(){
$(".db_records_wrapper").on('click', 'div.db_record', function (){
const CustID = $(this).siblings(".customerID").text();
console.log(CustID);
});
}
siblings() gets every matching sibling element. To get only the only following the .db_record which was clicked, use next():
$(this).next(".customerID").text();
Here's a working example:
function checkCustomerInformation() {
$(".db_records_wrapper").on('click', 'div.db_record', function() {
const custID = $(this).next(".customerID").text();
console.log(custID );
});
}
checkCustomerInformation();
.db_record {
margin: 10px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<div class="db_records_wrapper">
<div class="db_record" id="potentialCustomer-'.$countPotentialCustomers.'">
<div class="db_record_left">
<div class="db_record_describer">$cus_Fname1 $cus_Lname1</div>
<div class="db_record_info_wrapper">
<div class="db_record_info_describer">Adresse:</div>
<div class="db_record_info">$cus_Adress1</div>
<div class="db_record_info">
<span>$cus_ZipCode1</span>
<span>$cus_Locality1</span>
</div>
</div>
<div class="db_record_info_wrapper">
<div class="db_record_info_describer">Fahrzeuge:</div>
matchVehicles($cus_Vehicles1)
</div>
</div>
<div class="db_record_right">
<div class="material-icons md-large md-ghost-white-enabeld w-embed">
<span class="material-icons-outlined">navigate_next</span>
</div>
</div>
</div>
<span class="customerID" style="display: none">$cus_ID1</span>
<div class="db_record" id="potentialCustomer-'.$countPotentialCustomers.'">
<div class="db_record_left">
<div class="db_record_describer">$cus_Fname2 $cus_Lname2</div>
<div class="db_record_info_wrapper">
<div class="db_record_info_describer">Adresse:</div>
<div class="db_record_info">$cus_Adress2</div>
<div class="db_record_info">
<span>$cus_ZipCode2</span>
<span>$cus_Locality2</span>
</div>
</div>
<div class="db_record_info_wrapper">
<div class="db_record_info_describer">Fahrzeuge:</div>
matchVehicles($cus_Vehicles2)
</div>
</div>
<div class="db_record_right">
<div class="material-icons md-large md-ghost-white-enabeld w-embed">
<span class="material-icons-outlined">navigate_next</span>
</div>
</div>
</div>
<span class="customerID" style="display: none">$cus_ID2</span>
</div>
I am using simple_html_dome and I want to grab experience, education, and title.
By my code, I am getting (Call to a member function find() on null in ) error message but title is showing error is ($notrmjobs = $item->find('div[class=norm-jobs-wrapper]',0);) here.
What is the core rules to catch HTML tag by find method?
<div class="boxed">
<div class="row">
<div class="col-md-12">
<div class="norm-jobs-wrapper" onclick="DivOpen('id=734675&fcatId=1&ln=1');">
<div class="row">
<div class="col-sm-3 col-sm-push-3">
<!--<div class="row">
<div class="col-sm-12">
<div class="comp_logo"><img src="images/38951.jpg" alt=""></div>
</div>
</div>-->
</div>
<div class="col-sm-9 col-sm-pull-9">
<div class="row">
<div class="col-sm-12">
<div class="comp-name-text">GBA Techno Pvt. Ltd.</div>
</div>
<div class="col-sm-12">
<div class="job-title-text">
<a onclick="clickJObTitle()" target="_blank" href="jobdetails.asp?id=734675&fcatId=1&ln=1">
Sr. Executive, Accounts
</a>
</div>
</div>
<div class="col-sm-12">
<div class="edu-text">
<div class="row">
<div class="col-sm-2">
<div class="edu-text-s">
Education:
</div>
</div>
<div class="col-sm-10">
<div class="edu-text-d">
Masters/ MBA in Accounts or Finance from any reputed university
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="row">
<div class="col-sm-9">
<div class="exp-text">
<div class="row">
<div class="col-sm-2">
<div class="exp-text-s">Experience:</div>
</div>
<div class="col-sm-10">
<div class="exp-text-d">
At least 3 year(s)
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="dead-text">
<div class="dead-text-s">Deadline: </div>
<div class="dead-text-d">
<strong>Dec 13, </strong>2017
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include 'simple_html_dom.php';
$html = file_get_html('http://jobs.bdjobs.com/jobsearch.asp?fcatId=1&icatId=');
$boxed = $html->find('div[class=boxed]',0);
$raw = $boxed->find('div[class=row]');
foreach($raw as $key => $loop){
$item = $loop->find('div[class=col-md-12]',0);
$notrmjobs = $item->find('div[class=norm-jobs-wrapper]',0);
$raw = $notrmjobs->find('div[class=row]',0);
$sdivice = $raw->find('div[class=col-sm-9 col-sm-pull-9]',0);
$sraw = $sdivice->find('div[class=row]',0);
$asraw = $sraw->find('div[class=col-sm-12]',0);
$title = $asraw->find('div[class=comp-name-text]',0)->plaintext;
echo $title;
}
?>
I using php to display result to my page and I did a bit of styling using bootstrap
<div class="alert alert-success" role="alert">
<?php
if(isset($_POST['submit'])){ //check if form was submitted
include "assets/backend/newsletter.php";
}
?>
</div>
Even the php code is not executed I can see the blank panel.
How can I get rid of that?
[Image for reference.][1]I think on ur case this makes way much more sens then what are u doing up there:
<?php
if(isset($_POST['submit'])){ ?>
<div class="alert alert-success" role="alert">
<?php include "assets/backend/newsletter.php"; ?>
</div>
<?php}?>
This way if the form was submitted the panel will appear if not submitted the panel will not be visible.
footer.php
<div class="container">
<div class="row">
<?php
if(isset($_POST['submit'])){
echo '<div class="alert alert-success" role="alert"> ';
include 'assets/backend/newsletter.php';
echo '</div>';
}
?>
</div>
<div class="container-fluid" style="background-color:#222222">
<div class="row">
<div class="container" style="margin-top:15px;
margin-bottom:15px">
<div class="col-lg-4" style="color:#f3f6f9">
<img src="images/pc%20logo.png" width="80px" height="80px">
<h4 >
PLACEMENT
<cell style="font-weight:bold">CELL</cell>
</h4>
<p>Nehru Nagar, Ring Road <br>New Delhi <br>
Ph :(+91) 964 328 0581<br>
Email : placements.pgdav#gmail.com
</p>
<a href="https://www.facebook.com/pgdavplacements"> <img src="images/f.png" height="30px" width="30px" >
</a>
<img src="images/i.png" height="30px" width="30px">
<img src="images/linkedin.png" height="30px" width="30px">
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:30px">
<h4>Subscribe to Our Newsletter</h4>
<form action=" " method="post">
<div class="form-group">
<input class="form-control" type="text"
id="inputemail" name="email_newsletter" placeholder="Your Email ID">
</div>
<input type="submit" name="submit" class="btn btn-default" value="subscribe">
</form>
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:29px">
<h4>Links</h4>
<ol class="breadcrumb">
<li>Home</li>
<li>About Cell</li>
<li>Registration</li>
<li>Contact Us</li>
</ol>
</div>
</div>
<div class="container-fluid" style="background-color:#f3f6f9">
<div class="row">
<div class="container" style="padding-top:7px">
<div class="col-lg-6 col-sm-12 col-xs-12">© All the Rights Reserved with Placement Cell</div>
<div class="col-lg-6 col-sm-12 col-xs-12" style="text-align:right">Developed By Bhanu Singh</div>
</div>
</div>
</div>
</div>
</div></div>
or this:
<div class="container">
<div class="row">
<?php
if(isset($_POST['submit'])){ ?>
<div class="alert alert-success" role="alert">
<?php
include 'assets/backend/newsletter.php';
?>
</div>
<?php
}
?>
</div>
<div class="container-fluid" style="background-color:#222222">
<div class="row">
<div class="container" style="margin-top:15px;
margin-bottom:15px">
<div class="col-lg-4" style="color:#f3f6f9">
<img src="images/pc%20logo.png" width="80px" height="80px">
<h4 >
PLACEMENT
<cell style="font-weight:bold">CELL</cell>
</h4>
<p>Nehru Nagar, Ring Road <br>New Delhi <br>
Ph :(+91) 964 328 0581<br>
Email : placements.pgdav#gmail.com
</p>
<a href="https://www.facebook.com/pgdavplacements"> <img src="images/f.png" height="30px" width="30px" >
</a>
<img src="images/i.png" height="30px" width="30px">
<img src="images/linkedin.png" height="30px" width="30px">
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:30px">
<h4>Subscribe to Our Newsletter</h4>
<form action=" " method="post">
<div class="form-group">
<input class="form-control" type="text"
id="inputemail" name="email_newsletter" placeholder="Your Email ID">
</div>
<input type="submit" name="submit" class="btn btn-default" value="subscribe">
</form>
</div>
<div class="col-lg-4" style="color:#f3f6f9;
padding-top:29px">
<h4>Links</h4>
<ol class="breadcrumb">
<li>Home</li>
<li>About Cell</li>
<li>Registration</li>
<li>Contact Us</li>
</ol>
</div>
</div>
<div class="container-fluid" style="background-color:#f3f6f9">
<div class="row">
<div class="container" style="padding-top:7px">
<div class="col-lg-6 col-sm-12 col-xs-12">© All the Rights Reserved with Placement Cell</div>
<div class="col-lg-6 col-sm-12 col-xs-12" style="text-align:right">Developed By Bhanu Singh</div>
</div>
</div>
</div>
</div>
</div></div>
tested both options are workin;
Hello I want to disable an <img> tag inside a certain <div> when there's no image inputted by the user.
if(is_array($init) || is_object($init)){
foreach ($init as $data) {
echo '
<div id="profile-page-wall-post" class="card">
<div class="card-profile-title">
<div class="row">
<div class="col s1">
<img src="'.base_url('assets/images/'.$data->accounts_picture.'').'"
alt="" class="circle responsive-img valign profile-post-uer-image">
</div>
<div class="col s10">
<p class="grey-text text-darken-4 margin">'.$data->accounts_fname."\t".$data->accounts_lname.'</p>
<span class="grey-text text-darken-1 ultra-small">Shared publicly '.$data->post_date.'</span>
</div>
</div>
<div class="row center-align">
<div class="col s12">
<img class="Boxing image_attached" src="'.base_url('assets/files/'.$data->post_picture.'').'">
</div>
</div>
<div class="row">
<div class="col s12">
<p>'.$data->post_content.'</p>
</div>
</div>
<div class="row">
<div class="col s12">
<a href="'.base_url('assets/files/'.$data->post_file.'').'" download>'.$data->post_filename.'</a>
</div>
</div>
</div>
<div class="card-action row">
<div class="input-field col s8 margin">
<input id="profile-comments" type="text"
class="validate margin">
<label for="profile-comments" class="">
Comments
</label>
</div>
</div>
<div id="CommentSection" class="z-depth-1 col s12">
<div class="col s12">
<div class="card-panel grey lighten-5 z-depth-1">
<div class="row valign-wrapper">
<div class="col s2">
<img src="assets/images/def.jpg"
alt="" class="circle responsive-img">
</div>
<div class="col s10">
<p>Comment content</p>
</div>
</div>
</div>
</div>
</div>
</div>
';
}
}
I wanted to disable the <div> with the <img> inside, if $data->post_picture is null. How can I do this?
Not sure why this is tagged with jQuery and Javascript, since all you seem to be using is PHP, so why don't you just:
// ... (end your echo)
';
if(!empty($data->post_picture)){
echo '
<div class="row center-align">
<div class="col s12">
<img class="Boxing image_attached" src="'.base_url('assets/files/'.$data->post_picture.'').'">
</div>
</div>
';
}
echo ' // (continue your echo)
// ...
Please also not that you may have a syntax error at "'.base_url('assets/files/'.$data->post_picture.'').'" (you're closing and opening '' but this actually closes your echo '. You're using single quotes (') around what you're echoing, then double quotes around the img src="", and then single quotes around the base_url again, which I think (I'm not sure, since the code is so messy and I get confused by all the quotes) results in a syntax error over here: '').'.
Ok, may be its really simple. but, I can't figure it out how to do it. What I want is to query one table and show results in two divs on the page. What I mean is that I have some html like this:
<div class="row">
<div class="small">
//
</div>
<div class="large">
//
</div>
<div class="small">
//
</div>
<div class="small">
//
</div>
<div class="small">
//
</div>
<div class="large">
//
</div>
</div>
and the query like this
$stmt = $pdo->prepare("SELECT * FROM cars WHERE cars_cat = ? ORDER BY car_id DESC");
$stmt->execute(array($cat_id));
$data = $stmt->fetchAll();
foreach($data as $row) {
}
The database table is simple table with id, name, image, cars_cat.
UPDATE:
This is the structure of the gallery
<div class="col-sm-4 col-md-4 col-lg-4 nopadding"> <!-- First Column -->
<div class="small">
</div>
<div class="large">
</div>
<div class="small">
</div>
<div class="small">
</div>
</div> <!-- End First Column -->
<div class="col-sm-4 col-md-4 col-lg-4 nopadding"> <!-- Second Column -->
<div class="small">
</div>
<div class="small">
</div>
<div class="large">
</div>
<div class="small">
</div>
</div> <!-- End Second Column -->
<div class="col-sm-4 col-md-4 col-lg-4 nopadding"> <!-- Third Column -->
<div class="large">
</div>
<div class="small">
</div>
<div class="large">
//
</div>
</div> <!-- End Third Column -->
Try this way
<style>
.row {
-webkit-column-width:400px;
-moz-column-width:400px;
column-width:400px;
-webkit-column-gap:5px;
-moz-column-gap:5px;
column-gap:5px;
}
.small-box{
display:inline-block;
margin:0 0 5px 0;
padding:10px;
color:white;
}
.img-responsive{
width:100%;
height:auto;
}
</style>
<div class="row">
<div class="small-box">
<img src="http://aneemals.com/wp-content/uploads/2013/04/photos-of-animals-that-know-what-love-is-3.jpg" alt="img" class="img-responsive">
</div>
<div class="small-box">
<img src="http://www.softstuffcreations.com/refresh/data/zoom_image/1772-PandaBear_resized.jpg" alt="img" class="img-responsive">
</div>
<div class="small-box">
<img src="http://images6.fanpop.com/image/photos/35600000/wild-animals-animals-of-the-world-35665506-800-533.jpg" alt="img" class="img-responsive">
</div>
<div class="small-box">
<img src="http://nice-animals.com/wp-content/uploads/2013/10/facts-of-love-between-animals-08.jpg" alt="img" class="img-responsive">
</div>
<div class="small-box">
<img src="http://www.kenya.com/wp-content/uploads/2013/03/Mt-Kenya-Animals.jpg" alt="img" class="img-responsive">
</div>
<div class="small-box">
<img src="http://www.softstuffcreations.com/refresh/data/zoom_image/1772-PandaBear_resized.jpg" alt="img" class="img-responsive">
</div>
<div class="small-box">
<img src="http://fc09.deviantart.net/fs71/i/2012/364/4/3/animals___lion_9_by_moonsongstock-d5pr9za.jpg" alt="img" class="img-responsive">
</div>
</div>
Means basically what you need to update is to update code this way
<div class="row">
<?php
foreach($data as $row) {
echo '<div class="small-box"> your image </div>';
}
?>
</div>
<div class="row">
<?php
foreach($data as $row) {
if($row->div_type == 0){
echo '<div class="small"> your data </div>';
}else{
echo '<div class="large"> your data </div>';
}
}
?>
</div>