我有一個bootstrap購物車,我正在嘗試添加到我的網站,問題在於表單的第一行完美(四行到一行),但第二行分裂其結果,兩個一條線在另一條線上。Mysql結果沒有正確對齊
我可以得到的結果顯示兩行完美沒有任何錯誤。但我似乎無法得到正確的四列結果。
到該網站的鏈接可以在這裏找到http://www.deli-box.co.uk/deli6.php
HTML & PHP在Web頁面
<section class="products" data-image="">
<?php
//
// Show Product Grid
//
if (isset($_GET['category'])) {
$category = $_GET['category'];
} else {
$category = 1;
} // list category from table bsc_category
$shoppingcart_vertical = 0; // if the is vertical shoppingcart_vertical=1/is top or bottom are horitzontal -> shoppingcart_vertical=0
$_SESSION['LastProductPage'] = $_SERVER["REQUEST_URI"]; // take the name of this page for return
include "BootstrapShoppingCart/products_grid.php"; // list products
//
// Show Product Grid
//
?>
</section>
下面的代碼是形成的結果,是對內容的一部分的部分產品網格頁面。我已經離開sooe code,但這只是查詢,並不認爲它有任何影響。
<div class=".col-md-3" data-id="<?php echo $thisproduct[0] ['id_product']; ?>" data-type="<?php
if (count($thisproduct)>1) {
echo 'select'; // are selection/type?
}
?>" data-quantity="1">
<div class="thumbnail">
<img src="assets/<?php echo $thisproduct[0]['img']; ?>" alt="<?php echo $thisproduct[0]['name']; ?>" class="img-responsive">
<div class="caption">
<p>
<?php
echo $thisproduct[0]['name'] . "<br />"; // display name product
$price = new getprice($rs['id'], 0); // first its id->product second id->type
$price_array = $price->get(); // getting price [0] = no offer price [1]= offer price
if (count($thisproduct)==1) { // its only 1 product or ... have types ?
if ($thisproduct[0]['price'] > 0) { // have price ?
if ($thisproduct[0]['offer']) { // this a offer ?
echo '<span class="price_overline">' . moneyformat($thisproduct[0]['price']) . '</span>';
echo '<span class="offer"> ' . moneyformat($thisproduct[0]['price_offer']) . '</span>';
} else {
echo '<span class="price">' . moneyformat($thisproduct[0]['price']) . '</span>';
}
} else {
echo '<span class="price"> </span>'; // are price 0 then
}
} else {
echo '<span class="offer"> </span>';
}
?>
</p>
<?php
if (count($thisproduct)>1) {
?>
<select class="form-control combobox_type" style="margin-bottom: 6px;">
<option value="select" selected>Select ...</option>
<?php foreach ($thisproduct as $type) {
if ($type['id_type']>0) {
?>
<option value="<?php echo $type['id_type']; ?>"><?php
echo $type['name_type']. ' ';
// its type w price ?
// display price type ... like iphone 16gb/32gb/64/gb
if ($type['offer']) { // this a offer ?
echo '<span class="price_overline">' . moneyformat($type['price']) . '</span>';
echo '<span class="offer"> ' . moneyformat($type['price_offer']) . '</span>';
} else {
echo '<span class="price">' . moneyformat($type['price']) . '</span>';
}
?></option>
<?php } // foreach types
} // its a type? ?>
</select>
<?php
} else { // options
echo '<div style="height: 40px;"></div>'; // i make a offset
}
?>
<p align="center">
<?php if ($shoppingcart_vertical) { ?>
<a href="#" class="btn btn-success addproduct"><i class="icon-shopping-cart"></i>Add</a>
<?php } else { ?>
<a href="#" class="btn btn-success addproduct-horizontal"><i class="icon-shopping-cart"></i>Add</a>
<?php } ?>
</p>
</div>
</div>
</div>
謝謝,我試過了,我也以前試過,只是想什麼是我能想到的。 –