wrong size of bootstrap dropdown. not responsive how to fix? - html

I wonder how I can change the size of bootstrap select tag. It is not responsive as well. Please see attachment, in first picture there is small resolution in second one is bigger.
<div class="col-md-9">
<?php $this->load->view('FlashMessagesView'); ?>
<div class="col-md-12 form-group">
<?php if ($searchTerm)
{ ?>
<h3>Vysledky hladania:
<a href="<?php echo base_url('Product/index/') . $subCategoryId; ?>" style="cursor: pointer; color: red"
class="glyphicon glyphicon-remove" aria-hidden="true"></a>
</h3>
<?php } ?>
<div class="col-md-3" style="float: right">
<?php echo form_open('Product/index/' . $subCategoryId,
['id' => 'form_search', 'class' => 'form-horizontal', 'role' => 'form']); ?>
<div class="input-group">
<input type="hidden" name="subcategory_id"
value="<?php echo $subCategoryId ?>"/>
<input type="text" class="form-control" name="product_description"
placeholder="Hladat velkost RAM, CPU...">
<span class="input-group-btn"><button class="btn btn-default" type="submit"><span
class="glyphicon glyphicon-search"></span></button></span>
<?php echo form_close(); ?>
</div>
</div>
Cena: <span class="glyphicon glyphicon-arrow-down" style="cursor: pointer"
onclick="sortProductByLowestPrice()"></span><span class="glyphicon glyphicon-arrow-up"
style="cursor: pointer"
onclick="sortProductByHighestPrice()"></span><br>
Len skladom <input type="checkbox" id="stock_sort" name="stock_only" onclick="sortProductByStock()">
</div>
<?php
$con = mysqli_connect('localhost', 'root', '');
mysqli_select_db($con, 'test');
$sql = "SELECT * FROM products WHERE subcategory_id = " . $subCategoryId;
$result = mysqli_query($con, $sql);
$numberOfProducts = mysqli_num_rows($result);
$numberOfPages = ceil($numberOfProducts / $resultPerPage);
if ( ! isset($_GET['page']))
{
$page = 1;
} else
{
$page = $_GET['page'];
}
$pageFirstResult = ($page - 1) * $resultPerPage;
if ($searchTerm)
{
$like = implode(' OR ', $searchTerm);
$sql = "SELECT * FROM products WHERE subcategory_id = " . $subCategoryId . " AND " . $like . " LIMIT " . $pageFirstResult . ", " . $resultPerPage;
} else
{
$sql = "SELECT * FROM products WHERE subcategory_id = " . $subCategoryId . " LIMIT " . $pageFirstResult . ", " . $resultPerPage;
}
$result = mysqli_query($con, $sql);
if (mysqli_num_rows($result) != 0)
{
$productCount = 0;
?>
<div class="col-md-12" style="padding-left: 0">
<ul class="list-unstyled" id="products" data-role="list">
<?php
while ($product = mysqli_fetch_array($result))
{
?>
<li data-sort="<?php echo $product['product_price'] ?>" class="col-md-3">
<div class="thumbnail">
<a href="product_details.html"><img
src="<?php echo base_url('assets/img/') . $product['product_image']; ?>"/></a>
<div class="caption" style="height: 300px; overflow: hidden">
<h5><?php echo $product['product_name']; ?></h5>
<p><?php echo $product['product_description']; ?></p>
</div>
<div class="product_footer caption">
<?php if ($product['product_quantity'] == 0)
{ ?>
<p style="text-align: center"><span
style="color:orange"><b>Na objednavku.</b></span>
</p>
<?php } else
{ ?>
<p style="text-align: center">
<span style="color:green">
<b>Na sklade <?php echo $product['product_quantity'] ?> ks.</b>
</span>
</p>
<?php } ?>
<h3><a type="button" id="<?php echo $product['id'] ?>"
class="btn btn-success buy_button">Kupit</a>
<?php if ($this->encryption->decrypt($this->session->role) == 'Admin')
{ ?>
<button href="" type="button" id="<?php echo $product['id'] ?>"
class="btn btn-warning"
data-toggle="modal" data-target="#modal_<?php echo $productCount; ?>">
Upravit
</button>
<?php } ?>
<span class="pull-right"><?php echo $product['product_price']; ?> €</span></h3>
<div class="modal fade" id="modal_<?php echo $productCount ?>" data-backdrop="static"
data-keyboard="false">
<div class="modal-dialog">
<div class="modal-body"><?php $this->load->view('AdminProductUpdateView', array('product' => $product, 'productCount' => $productCount,
'id' => $product['id'])) ?>
</div>
</div>
</div>
<p style="text-align: center">Cena bez
DPH <?php echo $product['product_price'] - $product['product_price_dph']; ?> €</p>
</div>
</div>
</li>
<?php $productCount++; ?>
<?php
}
?>
</ul>
</div>
<div class="col-md-1">
<select class="form-control" style="min-width: 2cm" onchange="productPerPage(<?php echo $subCategoryId; ?>, this.value)">
<option selected="selected" hidden><?php echo $resultPerPage; ?></option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>10</option>
<option>20</option>
<option>50</option>
</select>
</div>
Produkty na stranku
<div class="products_pagination">
<a id="previous_page">&slarr;</a>
<?php
for ($i = 1; $i <= $numberOfPages; $i++)
{
?>
<a id="<?php echo $i; ?>"
href="<?php echo base_url('Product/index/') . $subCategoryId . '/' . $resultPerPage . '?page=' . $i; ?>"><?php echo $i . ' '; ?></a>
<?php
}
?>
<a id="next_page">→</a>
</div>
<?php } else
{ ?>
<h3 class="col-md-12">Nenasli sa ziadne produkty.</h3>
<?php } ?>
</div>
<script>
productsPaggination(<?php echo $numberOfPages; ?>);
getSubcategoryForAdminUpdate(<?php echo $isAdmin ? 1 : 0; ?>, <?php echo $numberOfProducts; ?>);
</script>
small resolution
bigger resolution

This works for me to reduce select tag's width;
<select id ="Select1" class="input-sm">
You can use any one of these classes;
class="input-sm"
class="input-md"
class="input-lg"

Since youre using col-md-1, you are giving it 1/12 of your containers space, which is very little.
I would suggest to simply give it more space, eg. col-sm-2

Try specifying the width:
select.form-control {
width:100%;
}
I am not sure if you also realise that the dropdown is in the col-md-1 container. It will appear small on small screens.

Related

How to remove vertical bar from print preview

I am trying to print a bootstrap modal in chrome but I see always I press the print button and preview the print, the preview shows this vertical bar.
How can I remove this vertical bar in print preview. I don't know why this is showing. There is no vertical bar in the actual bootstrap modal which I am printing.
Any help is appreciated. Thanks
Here is the html coding:
<style>
.str td{
padding-top:1px !important;
padding-bottom:1px !important;
}
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{padding: 5px;}
</style>
<div class="modal-dialog modal-lg no-modal-header">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<i class="fa fa-2x">×</i>
</button>
<button type="button" class="btn btn-xs btn-default no-print pull-right" style="margin-right:15px;" onclick="window.print();">
<i class="fa fa-print"></i> <?= lang('print'); ?></button>
<?php if ($logo) {
?>
<div class="text-cente no-print" style="margin-bottom:20px;">
<img src="<?= base_url() . 'assets/uploads/logos/' . $biller->logo; ?>"
alt="<?= $biller->company && $biller->company != '-' ? $biller->company : $biller->name; ?>">
</div>
<?php
} ?>
<div class="well well-sm no-print">
<div class="row bold">
<div class="col-xs-5">
<p class="bold">
<?= lang('date'); ?>: <?= $this->sma->hrld($inv->date); ?><br>
<?= lang('ref'); ?>: <?= $inv->reference_no; ?><br>
<?php if (!empty($inv->return_sale_ref)) {
echo lang('return_ref') . ': ' . $inv->return_sale_ref;
if ($inv->return_id) {
echo ' <a data-target="#myModal2" data-toggle="modal" href="' . admin_url('sales/modal_view/' . $inv->return_id) . '"><i class="fa fa-external-link no-print"></i></a><br>';
} else {
echo '<br>';
}
} ?>
<?= lang('sale_status'); ?>: <?= lang($inv->sale_status); ?><br>
<?= lang('payment_status'); ?>: <?= lang($inv->payment_status); ?><br>
<?= $inv->payment_method ? lang('payment_method') . ': ' . lang($inv->payment_method) : ''; ?>
<?php
if ($inv->payment_method == 'cod' || $inv->payment_method == 'bank' && $inv->attachment) {
?>
<a href="<?= admin_url('welcome/download/' . $inv->attachment) ?>"
title="<?= lang('attachment') ?>" class="tip">
<i class="fa fa-chain"></i>
</a>
<?php
}
?>
<?php if ($inv->payment_status != 'paid' && $inv->due_date) {
echo '<br>' . lang('due_date') . ': ' . $this->sma->hrsd($inv->due_date);
} ?>
</p>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
<div class="row" style="margin-bottom:15px;">
<?php if ($Settings->invoice_view == 1) {
?>
<div class="col-xs-12 text-center">
<h1><?= lang('tax_invoice'); ?></h1>
</div>
<?php
} ?>
</div>
<?php
$col = $Settings->indian_gst ? 5 : 4;
if ($Settings->product_discount && $inv->product_discount != 0) {
$col++;
}
if ($Settings->tax1 && $inv->product_tax > 0) {
$col++;
}
if ($Settings->product_discount && $inv->product_discount != 0 && $Settings->tax1 && $inv->product_tax > 0) {
$tcol = $col - 2;
} elseif ($Settings->product_discount && $inv->product_discount != 0) {
$tcol = $col - 1;
} elseif ($Settings->tax1 && $inv->product_tax > 0) {
$tcol = $col - 1;
} else {
$tcol = $col;
}
?>
<div class="row" style="margin-bottom:10px;">
<?php if ($Settings->invoice_view == 1) {
?>
<div class="col-xs-12 text-center">
<h1><?= lang('tax_invoice'); ?></h1>
</div>
<?php
} ?>
<div class="col-xs-4">
<div class="row">
<div class="col-xs-2" style="padding-right: 0px;">
<?php echo $this->lang->line('to'); ?>:
</div>
<div class="col-xs-10 pull-left" style="padding-left: 10px;">
<strong>
<p><small><?= $customer->company && $customer->company != '-' ? $customer->company : $customer->name; ?></small></p>
<?= $customer->company && $customer->company != '-' ? '' : 'Attn: ' . $customer->name ?></strong></p>
</strong>
</div>
<div class="col-xs-10" style="padding-right: 0px;">
<small>
<?php if ($customer->vat_no != '-' && $customer->vat_no != '') {
echo '<br>' . lang('vat_no') . ': ' . $customer->vat_no;
}
if ($customer->gst_no != '-' && $customer->gst_no != '') {
echo '<br>' . lang('gst_no') . ': ' . $customer->gst_no;
}
if ($customer->cf1 != '-' && $customer->cf1 != '') {
echo lang('ccf1') . ': ' . $customer->cf1;
}
if ($customer->cf2 != '-' && $customer->cf2 != '') {
echo '<br>' . lang('ccf2') . ': ' . $customer->cf2;
}
if ($customer->cf3 != '-' && $customer->cf3 != '') {
echo '<br>' . lang('ccf3') . ': ' . $customer->cf3;
}
if ($customer->cf4 != '-' && $customer->cf4 != '') {
echo '<br>' . lang('ccf4') . ': ' . $customer->cf4;
}
if ($customer->cf5 != '-' && $customer->cf5 != '') {
echo '<br>' . lang('ccf5') . ': ' . $customer->cf5;
}
if ($customer->cf6 != '-' && $customer->cf6 != '') {
echo '<br>' . lang('ccf6') . ': ' . $customer->cf6;
}
?>
</small>
</div>
</div>
</div>
<div class="col-xs-4">
<?php
echo '<small>'.$customer->address . '<br>' . $customer->city . ' ' . $customer->postal_code . ' ' . $customer->state . '<br>' . $customer->country;
?>
</div>
<div class="col-xs-4">
<small><?php echo lang('tel') . ': ' . $customer->phone . '<br>' . lang('email') . ': ' . $customer->email;
?></small>
</div>
</div>
<div class="table-responsive">
<table class="table table-bordered table-hover table-striped print-table order-table" style="page-break-inside:auto">
<tbody>
<tr>
<th colspan="2"><small>SALES PERSON</small></th>
<th colspan="2"><small>REFERENCE NO</small></th>
<th colspan="2"><small>INVOICE DATE</small></th>
<th colspan="2"><small>PAID BY</small></th>
</tr>
<tr>
<td colspan="2"><small><?=$created_by->first_name?></small></td>
<td colspan="2"><small><?=$inv->reference_no?></small></td>
<td colspan="2"><small><?=$this->sma->hrld($inv->date)?></small></td>
<td colspan="2"><small><?=$payments?></small></td>
</tr>
<tr>
<th><small>NO</small></th>
<th><small>DESCRIPTION</small></th>
<th><small>QTY</small></th>
<th><small>UNIT</small></th>
<th><small>SUB TOTAL</small></th>
<th><small>%</small></th>
<th class="text-right"><small>TOTAL</small></th>
</tr>
<?php $r = 1;
if($rows){
foreach ($rows as $row):
?>
<tr class="str" style="<?php if($r == 9){ echo 'page-break-inside:avoid; page-break-after:auto;'; } ?>" >
<td class="std"><small><?=$r?></small></td>
<td class="std"><small><?=$row->product_name?></small></td>
<td class="std"><small><?=$this->sma->formatQuantity($row->unit_quantity)?></small></td>
<td class="std"><small><?=number_format((float)$row->unit_price + $row->item_discount, 2, '.', '')?></small>
</td>
<td class="std"><small><?=number_format((float)($row->unit_price)*($row->unit_quantity), 2, '.', '')?></small>
</td>
<td class="std"><small><?=number_format((float)$row->item_discount, 2, '.', '')?></small></td>
<td class="text-right"><small><?=$this->sma->formatMoney($row->subtotal)?></small></td>
</tr>
<?php
$r++;
endforeach;
}
if ($return_rows) {
echo '<tr class="warning"><td colspan="100%" class="no-border"><strong>' . lang('returned_items') . '</strong></td></tr>';
foreach ($return_rows as $row):
?>
<tr>
<td><small><?=$r?></small></td>
<td><small><?=$row->product_name?></small></td>
<td><small><?=$this->sma->formatQuantity($row->unit_quantity)?></small></td>
<td><small><?=number_format((float)$row->unit_price + $row->item_discount, 2, '.', '')?></small>
</td>
<td><small><?=number_format((float)($row->unit_price)*($row->unit_quantity), 2, '.', '')?></small>
</td>
<td><small><?=number_format((float)$row->item_discount, 2, '.', '')?></small></td>
<td class="text-right"><small><?=$this->sma->formatMoney($row->subtotal)?></small></td>
</tr>
<?php
$r++;
endforeach;
}
?>
</tbody>
<tfoot>
<tr>
<th colspan="6" class="text-right"><small><?=lang('total');?></small></th>
<th colspan="2" class="text-right">
<small><?=$this->sma->formatMoney($return_sale ? (($inv->total + $inv->product_tax) + ($return_sale->total + $return_sale->product_tax)) : ($inv->total + $inv->product_tax));?></small>
</th>
</tr>
<?php
if ($inv->order_tax != 0) {
echo '<tr><th colspan="6><small>' . lang('tax') . '</th><th class="text-right"colspan="2"><small>' . $this->sma->formatMoney($return_sale ? ($inv->order_tax + $return_sale->order_tax) : $inv->order_tax) . '</small></th></tr>';
}
if ($inv->order_discount != 0) {
echo '<tr><th colspan="6" class="text-right"><small>' . lang('order_discount') . '</small></th><th class="text-right" colspan="2"><small>' . $this->sma->formatMoney($return_sale ? ($inv->order_discount + $return_sale->order_discount) : $inv->order_discount) . '</small></th></tr>';
}
if ($inv->shipping != 0) {
echo '<tr><th colspan="6" class="text-right"><small>' . lang('shipping') . '</th><th class="text-right" colspan="2"><small>' . $this->sma->formatMoney($inv->shipping) . '</small></th></tr>';
}
if ($return_sale) {
if ($return_sale->surcharge != 0) {
echo '<tr><th colspan="6" class="text-right"><small>' . lang('return_surcharge') . '</small></th><th class="text-right" colspan="2"><small>' . $this->sma->formatMoney($return_sale->surcharge) . '</small></th></tr>';
}
}
if ($Settings->indian_gst) {
if ($inv->cgst > 0) {
$cgst = $return_sale ? $inv->cgst + $return_sale->cgst : $inv->cgst;
echo '<tr><td colspan="6"><small>' . lang('cgst') . '</small></td><td class="text-right" colspan="2"><small>' . ($Settings->format_gst ? $this->sma->formatMoney($cgst) : $cgst) . '</small></td></tr>';
}
if ($inv->sgst > 0) {
$sgst = $return_sale ? $inv->sgst + $return_sale->sgst : $inv->sgst;
echo '<tr><td colspan="6"><small>' . lang('sgst') . '</small></td><td class="text-right" colspan="2"><small>' . ($Settings->format_gst ? $this->sma->formatMoney($sgst) : $sgst) . '</small></td></tr>';
}
if ($inv->igst > 0) {
$igst = $return_sale ? $inv->igst + $return_sale->igst : $inv->igst;
echo '<tr><td colspan="6"><small>' . lang('igst') . '</small></td><td class="text-right" colspan="6"><small>' . ($Settings->format_gst ? $this->sma->formatMoney($igst) : $igst) . '</small></td></tr>';
}
}
if ($pos_settings->rounding || $inv->rounding != 0) {
?>
<tr>
<th colspan="6" class="text-right"><small><?=lang('rounding'); ?></small></th>
<th colspan="2" class="text-right">
<small><?= $this->sma->formatMoney($inv->rounding); ?></small></th>
</tr>
<tr>
<th colspan="6" class="text-right"><small><?=lang('grand_total'); ?></small></th>
<th colspan="2" class="text-right">
<small><?=$this->sma->formatMoney($return_sale ? (($inv->grand_total + $inv->rounding) + $return_sale->grand_total) : ($inv->grand_total + $inv->rounding)); ?></small>
</th>
</tr>
<?php
} else {
?>
<tr>
<th colspan="6" class="text-right"><small><?=lang('grand_total'); ?></small></th>
<th colspan="2" class="text-right">
<small><?=$this->sma->formatMoney($return_sale ? ($inv->grand_total + $return_sale->grand_total) : $inv->grand_total); ?></small>
</th>
</tr>
<?php
}
if ($inv->paid < ($inv->grand_total + $inv->rounding)) {
?>
<tr>
<th colspan="6" class="text-right"><small><?=lang('paid_amount'); ?></small></th>
<th colspan="2" class="text-right">
<small><?=$this->sma->formatMoney($return_sale ? ($inv->paid + $return_sale->paid) : $inv->paid); ?></small>
</th>
</tr>
<tr>
<th colspan="6" class="text-right"><small>Due Amount</small></th>
<th colspan="2" class="text-right">
<small><?=$this->sma->formatMoney(($return_sale ? (($inv->grand_total + $inv->rounding) + $return_sale->grand_total) : ($inv->grand_total + $inv->rounding)) - ($return_sale ? ($inv->paid + $return_sale->paid) : $inv->paid)); ?></small>
</th>
</tr>
<?php
} ?>
<td colspan='8'>
<strong><small>Please Note : Any deposit balances are due prior to the above Confirmed
Product Delivery Date</small></strong>
<br>
<small>All goods remain the property of Arcadia Traders untill paid in full.</small>
<br>
<small>- Please use invoice number as reference for all payments.</small>
</td>
</tr>
</tfoot>
</table>
</div>
<?= $Settings->invoice_view > 0 ? $this->gst->summary($rows, $return_rows, ($return_sale ? $inv->product_tax + $return_sale->product_tax : $inv->product_tax)) : ''; ?>
<div class="row">
<div class="col-xs-12">
<?php
if ($inv->note || $inv->note != '') {
?>
<div class="well well-sm">
<p class="bold"><?= lang('note'); ?>:</p>
<div><?= $this->sma->decode_html($inv->note); ?></div>
</div>
<?php
}
if ($inv->staff_note || $inv->staff_note != '') {
?>
<div class="well well-sm staff_note">
<p class="bold"><?= lang('staff_note'); ?>:</p>
<div><?= $this->sma->decode_html($inv->staff_note); ?></div>
</div>
<?php
} ?>
</div>
<?php if ($customer->award_points != 0 && $Settings->each_spent > 0) {
?>
<div class="col-xs-5 pull-left">
<div class="well well-sm">
<?=
'<p>' . lang('this_sale') . ': ' . floor(($inv->grand_total / $Settings->each_spent) * $Settings->ca_point)
. '<br>' .
lang('total') . ' ' . lang('award_points') . ': ' . $customer->award_points . '</p>'; ?>
</div>
</div>
<?php
} ?>
<div class="order_barcodes no-print">
<table class="table">
<tbody>
<tr>
<td>
<div style="max-width:200px; padding-top:7px;">
<img src="<?= admin_url('misc/barcode/' . $this->sma->base64url_encode($inv->reference_no) . '/code128/74/0/1'); ?>"
alt="<?= $inv->reference_no; ?>" class="bcimg">
</div>
</td>
<td class="text-right">
<div style="max-width:70px">
<?= $this->sma->qrcode('link', urlencode(admin_url('sales/view/' . $inv->id)), 2); ?>
</div>
</td>
</tr>
</tbody>
</table>
<br>
</div>
<div class="col-xs-5 pull-right no-print">
<div class="well well-sm">
<p>
<?= lang('created_by'); ?>:
<?= $inv->created_by ? $created_by->first_name . ' ' . $created_by->last_name : $customer->name; ?>
<br>
<?= lang('date'); ?>: <?= $this->sma->hrld($inv->date); ?>
</p>
<?php if ($inv->updated_by) {
?>
<p>
<?= lang('updated_by'); ?>:
<?= $updated_by->first_name . ' ' . $updated_by->last_name; ?><br>
<?= lang('update_at'); ?>: <?= $this->sma->hrld($inv->updated_at); ?>
</p>
<?php
} ?>
</div>
</div>
</div>
<?php if (!$Supplier || !$Customer) {
?>
<div class="buttons">
<div class="btn-group btn-group-justified">
<div class="btn-group">
<a href="<?= admin_url('sales/add_payment/' . $inv->id) ?>" class="tip btn btn-primary"
title="<?= lang('add_payment') ?>" data-toggle="modal" data-target="#myModal2">
<i class="fa fa-dollar"></i>
<span class="hidden-sm hidden-xs"><?= lang('payment') ?></span>
</a>
</div>
<div class="btn-group">
<a href="<?= admin_url('sales/add_delivery/' . $inv->id) ?>" class="tip btn btn-primary"
title="<?= lang('add_delivery') ?>" data-toggle="modal" data-target="#myModal2">
<i class="fa fa-truck"></i>
<span class="hidden-sm hidden-xs"><?= lang('delivery') ?></span>
</a>
</div>
<?php if ($inv->attachment) {
?>
<div class="btn-group">
<a href="<?= admin_url('welcome/download/' . $inv->attachment) ?>" class="tip btn btn-primary"
title="<?= lang('attachment') ?>">
<i class="fa fa-chain"></i>
<span class="hidden-sm hidden-xs"><?= lang('attachment') ?></span>
</a>
</div>
<?php
} ?>
<div class="btn-group">
<a href="<?= admin_url('sales/email/' . $inv->id) ?>" data-toggle="modal"
data-target="#myModal2" class="tip btn btn-primary" title="<?= lang('email') ?>">
<i class="fa fa-envelope-o"></i>
<span class="hidden-sm hidden-xs"><?= lang('email') ?></span>
</a>
</div>
<div class="btn-group">
<a href="<?= admin_url('sales/pdf/' . $inv->id) ?>" class="tip btn btn-primary"
title="<?= lang('download_pdf') ?>">
<i class="fa fa-download"></i>
<span class="hidden-sm hidden-xs"><?= lang('pdf') ?></span>
</a>
</div>
<?php if (!$inv->sale_id) {
?>
<div class="btn-group">
<a href="<?= admin_url('sales/edit/' . $inv->id) ?>" class="tip btn btn-warning sledit"
title="<?= lang('edit') ?>">
<i class="fa fa-edit"></i>
<span class="hidden-sm hidden-xs"><?= lang('edit') ?></span>
</a>
</div>
<div class="btn-group">
<a href="#" class="tip btn btn-danger bpo"
title="<b><?= $this->lang->line('delete_sale') ?></b>"
data-content="<div style='width:150px;'><p><?= lang('r_u_sure') ?></p><a class='btn btn-danger' href='<?= admin_url('sales/delete/' . $inv->id) ?>'><?= lang('i_m_sure') ?></a> <button class='btn bpo-close'><?= lang('no') ?></button></div>"
data-html="true" data-placement="top">
<i class="fa fa-trash-o"></i>
<span class="hidden-sm hidden-xs"><?= lang('delete') ?></span>
</a>
</div>
<?php
} ?>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('.tip').tooltip();
});
</script>
I'm no sure of what exactly your problem is, but you can try adding style="overflow: hidden;" at the beginning (at str) and maybe that solves the problem.
You can simply hide this scroll bar by adding this css property in your style tag only if your website do not have scrolling behaviour
html { overflow: hidden; }
But if you website does have scrolling behaviour and you just want to remove this scroll bar from printing document then you can use add these css proeprties in your style tag
::-webkit-scrollbar {
width: 0px;
background: transparent;
/* make scrollbar transparent */
actual answer
Try using window.print() and hide everything except the modal. The scroll bars won’t be there using this method.

MySQL Update Batch Process Remove Some Records

I have a program to store some financial values using batch process. Main tables are finance_budget & finance_budget_issue. finance_budget.budget_id = finance_budget_issue.budget_id (1 to many join)
I tried to edit some records using following code
Controller
public function editIssues($id)
{
$this->checkPermissions('edit', 'allocationIssues');
$bc = array(array('link' => 'budget/regIssues', 'page' => 'Allocation Issues'), array('link' => '#', 'page' => 'Edit'));
$meta = array('page_title' => 'Allocation Issues', 'bc' => $bc);
$this->form_validation->set_rules('vote_id', 'Vote', 'required');
$this->form_validation->set_rules('budget_date', 'Budget Date', 'required');
if ($this->form_validation->run() == true) {
$ustock = array(
'vote_id' => $this->input->post('vote_id'),
'budget_date' => $this->input->post('budget_date'),
'ref_no' => $this->input->post('ref_no'),
'usr' => $this->session->userdata('id_user'),
'added_time' => date('Y-m-d h:i:s'),
'budget_status' => 'issues',
'transfer_status' => 'Pending'
);
$count = count($this->input->post('office'));
$offices = $this->input->post('office');
$amount = $this->input->post('amount');
$notes = $this->input->post('notes');
for ($x = 0; $x < $count; $x++) {
$details[$x]['budget_id'] = $id;
$details[$x]['office'] = $offices[$x];
$details[$x]['amount'] = $amount[$x];
$details[$x]['notes'] = $notes[$x];
}
}
if ($this->form_validation->run() == true && $this->Budget_model->editIssuedAllocations($ustock, $details, $id)) {
$this->session->set_flashdata('message', 'Successfully Updated ..!!');
redirect('budget/regIssues');
} else {
$this->data['vote'] = $this->Budget_model->getVote(array('office_id'=>$this->session->userdata('office_id')));
$this->data['office'] = $this->Budget_model->getOffice();
$this->data['issues'] = $this->Budget_model->budgetById($id);
$this->render('budget/editIssues', $meta, $this->data);
}
}
Model
function editIssuedAllocations($ustock,$details,$id)
{
if(!empty($id)){
$this->db->trans_start();
$this->db->update('finance_budget',$ustock,array('budget_id'=>$id));
if($id!=1){
$this->db->where('budget_id', $id);
$this->db->delete('finance_budget_issue');
$this->db->insert_batch('finance_budget_issue', $details);
}
$this->db->trans_complete();
return $this->db->trans_status();
}
return false;
}
View
<?php
if (!empty($purchase)) {
$details = $purchase;
$purchase = $purchase[0];
}
?>
<script type="text/javascript">
$(document).ready(function () {
var i = $('#last').val();
$(".add-new").click(function () {
i++;
// $('.tab_logic').append();
$('#addr' + i).html("<td><a href='javascript:void(0);' id='add-post' class='external add-new'><i style='color: #00C853 !important;' class='fa fa-2x fa-plus-circle'></i></a></td>" +
"<td><select name='office[]' id='office" + i + "' class='select2 form-control' required>" +
"<option value=''></option>" +
<?php
if (!empty($office)) {
foreach ($office as $row) {
?>
"<option value='<?= $row->office_id ?>'><?= addslashes($row->office_name) ?></option>" +
<?php
}
}
?>
"</select></td>" +
"<td><input name='amount[]' type='number' step='any' placeholder='Amount' class='form-control input-md' required></td>" +
"<td><input name='notes[]' type='text' placeholder='Notes' class='form-control input-md'></td>" +
"<td><a href='javascript:void(0);' class='external remove'><i style='color: #dd4b39 !important;' class='fa fa-2x fa-minus-circle' id='addIcon'></i></a></td>");
$('#tab_logic').append('<tr id="addr' + (i + 1) + '"></tr>');
$('#i').val(i);
// alert($('#i').val());
$('#item' + i).select2();
});
$(document).on("click", ".remove", function () {
var count = $('#tab_logic>tbody').children().length;
if (count > 0) {
$(this).closest('tr').remove();
}
});
});
</script>
<div class="box box-info">
<div class="box box-info collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">Edit Issued Allocations</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" style="font-size: 16px;" data-widget="collapse"><i
class="fa fa-plus"></i>
</button>
</div>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<div class="box-body" style="display: block">
<form action="<?= site_url('budget/editPurchase/' . $purchase->budget_id) ?>" method="post">
<div class="row">
<div class="col-md-2">
<div class="form-group"><label>Budget ID</label>
<input type="text" name="budget_id" id="budget_id" class="form-control" disabled
value="<?= $purchase->budget_id ?> ">
</div>
</div>
<div class="col-md-4">
<div class="form-group"><label>වැය ශීර්ෂය</label>
<select name="vote_id" id="vote_id" class="form-control select2" required>
<option value="<?= $purchase->vote_id ?>"><?= $purchase->vote ?></option>
<?php
if (!empty($vote)) {
foreach ($vote as $row) {
?>
<option value="<?= $row->vote_id ?>"><?= $row->vote ?></option>
<?php
}
}
?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group"><label>යොමු / ගොණු අංකය</label>
<input type="text" name="ref_no" id="ref_no" class="form-control"
value="<?= $purchase->ref_no ?>">
</div>
</div>
<div class="col-md-2">
<div class="form-group"><label>දිනය</label>
<input type="date" name="budget_date" id="budget_date" class="form-control"
value="<?= $purchase->budget_date ?>">
</div>
</div>
</div>
<div class="col-md-12 column">
<table class="table table-bordered table-hover" id="tab_logic">
<thead>
<tr>
<th class="text-center">
</th>
<th class="text-center">
Office
</th>
<th class="text-center">
Amount
</th>
<th class="text-center">
Notes
</th>
<th class="text-center">
</th>
</tr>
</thead>
<tbody>
<?php
//dd($details);
$x = 0;
foreach ($details as $i => $values) {
// foreach ($values as $key => $value) {
$x = $i;
?>
<tr id='addr0'>
<td>
<a href="javascript:void(0);" id="add-post" class="external add-new"><i
style="color: #00C853 !important;"
class="fa fa-2x fa-plus-circle"></i></a>
</td>
<td style="width: 50%">
<input type="hidden" name="i" id="i" value="<?= $i ?>">
<select name="office[]" id="<?= "office" . $i ?>" class="form-control select2" required>
<option value="<?= $details[$i]->office_id ?>"><?= $details[$i]->office_name ?></option>
<?php
if (!empty($office)) {
foreach ($office as $row) {
?>
<option value="<?= $row->office_id ?>"><?= $row->office_name ?></option>
<?php
}
}
?>
</select>
</td>
<td>
<input type="number" name='amount[]' placeholder='Amount' class="form-control"
value="<?= (-1) * $details[$i]->amount ?>" required/>
</td>
<td>
<input type="text" name="notes[]" placeholder='Notes'
value="<?= $details[$i]->notes ?>" class="form-control"/>
<input type="hidden" name="table_id"
value="<?= $details[$i]->notes ?>">
</td>
<td><a href='javascript:void(0)' class='external remove'><i
style='color: #dd4b39 !important;'
class='fa fa-2x fa-minus-circle ' id='addIcon'></i></a>
</td>
</tr>
<tr id='addr1'></tr>
<?php
//print " $key => $value\n";
// }
//print "}\n";
}
?>
</tbody>
</table>
</div>
<!--table-->
<div class="row">
<div class="col-md-8"></div>
<div class="col-md-4">
<input type="hidden" value="<?= $x ?>" name="last" id="last">
<input type="submit" value="Update" class="btn btn-primary btn-block">
</div>
</div>
</form>
<!--end of table-->
</div>
</div>
</div>
Desired Output
Should be edit some values in the finance_budget & finance_budget_issue tables that related with same budget_id (Eg:- budget_id =2995)
Error
After editing some values in my view that is working & save properly. When I press the save button in my view without editing any value, the record in finance_budget_issue table that is related to finance_budget table by budget_id is deleted.
I can not understand what I am going wrong ? Can anyone help me ?
You could modify the model to check whether $details are empty or not to leave the finance_budget_issue table intact :
function editIssuedAllocations($ustock,$details,$id)
{
if(!empty($id)){
$this->db->trans_start();
$this->db->update('finance_budget',$ustock,array('budget_id'=>$id));
if($id!=1 && !empty($details[0])){
$this->db->where('budget_id', $id);
$this->db->delete('finance_budget_issue');
$this->db->insert_batch('finance_budget_issue', $details);
}
$this->db->trans_complete();
return $this->db->trans_status();
}
return false;
}
I have modified the for loop as follows in the controller.
$count = count($this->input->post('office'));
$offices = $this->input->post('office');
$votes = $this->input->post('vote_id');
$amount = $this->input->post('amount');
$notes = $this->input->post('notes');
$bdate = $this->input->post('budget_date');
for ($x = 0; $x < $count; $x++) {
$details[$x]['budget_id'] = $id;
$details[$x]['office'] = $offices[$x];
$details[$x]['vote_id'] = $votes[$x];
$details[$x]['amount'] = (-1)*$amount[$x];
$details[$x]['notes'] = $notes[$x];
$details[$x]['budget_date'] = $bdate[$x];
$details[$x]['status'] = 1;
}
Now the issue was fixed partially. But the saving vote_id of finance_budget_issue table is incorrect without editing.

Moving Details box renders Add to Cart Button inoperable - Magento

My site offers products that have multiple options. Some with as many as 5-8 options. So, the "details box" ends up way beneath all of the options. Also, the details are to long to place into the "short description" box at the top. So, I moved the details box above the options box. When doing this it causes the "add to cart" button to no longer work. I have tried moving code all over the page & no matter which portion of code I move the "add to cart button" won't work. (I have tried moving the options code & the details box code) I am using a custom theme called BuyShop. Here is a link to one of the products so you can see what I am talking about & trying to do: http://www.dvineinspiration.com/featured-products/mime-basic-plus.html. I have also included the code from the product/view.phtml file below.
<!--PRODUCT BOX-->
<?php
$widthSmall=62;
$heightSmall=62;
$widthMedium=460;
$heightMedium=440;
$_video = $this->getProduct()->getVideobox();
$_customtab = $this->getProduct()->getCustomtab();
$_customtabtitle = $this->getProduct()->getCustomtabtitle();
$image_size=Mage::getStoreConfig('buyshoplayout/product_info/product_info_image_size');
$main_image_popup='';
$popup_video='';
if(Mage::helper('lightboxes')->isActive())
{
/*popups*/
$helper = Mage::helper('lightboxes');
$rel = $helper->getLightboxRel($helper->getConfig('lightbox_type'));
$class = $helper->getLightboxClass($helper->getConfig('lightbox_type'));
$main_image_popup='class="'.$class.'" rel="'.$rel.'"';
$popup_video='class="video '.$class.'" rel="'.$rel.'"';
}
switch($image_size)
{
case 'small':
if(Mage::helper('buyshopconfig')->getMediaCount($_product) or !empty($_video))
{
$span0=4;
$span1=1;
$span2=3;
$span3=8;
}
else
{
$span0=3;
$span1=1;
$span2=3;
$span3=9;
}
$height_thumbs=206;
break;
case 'medium':
if(Mage::helper('buyshopconfig')->getMediaCount($_product) or !empty($_video))
{
$span0=5;
$span1=1;
$span2=4;
$span3=7;
}
else
{
$span0=4;
$span1=1;
$span2=4;
$span3=8;
}
$height_thumbs=350;
break;
case 'big':
if(Mage::helper('buyshopconfig')->getMediaCount($_product) or !empty($_video))
{
$span0=6;
$span1=1;
$span2=5;
$span3=6;
}else
{
$span0=5;
$span1=1;
$span2=5;
$span3=7;
}
$height_thumbs=422;
break;
}
?>
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
<div class="product-box">
<div class="no-display">
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
<input type="hidden" name="related_product" id="related-products-field" value="" />
</div>
<div class="row">
<div class="span<?php echo $span0?>">
<div class="product-img-box">
<div class="row">
<?php if(Mage::helper('buyshopconfig')->getMediaCount($_product) or !empty($_video)):?>
<div class="span<?php echo $span1?>">
<div class="more-views flexslider">
<ul class="slides">
<?php echo $this->getChildHtml('media') ?>
<?php if(!empty($_video)):?>
<li><a class="video" href="<?php echo Mage::helper('catalog/output')->productAttribute($this->getProduct(), $_video, 'video') ?>"><i class=" icon-link"></i></a></li>
<?php endif;?>
</ul>
</div>
</div>
<?php endif;?>
<div class="span<?php echo $span2?>">
<div class="product-image">
<a <?php echo $main_image_popup;?> title="<?php echo $this->htmlEscape($_product->getImageLabel())?>" <?php if(!Mage::helper('lightboxes')->isActive()):?>class="cloud-zoom"<?php endif;?> href="<?php echo Mage::helper('catalog/image')->init($_product, 'image', $_product->getFile())?>" <?php if(!Mage::helper('lightboxes')->isActive()):?>id='zoom1' data-rel="position: 'right', adjustX: 10, adjustY: 0"<?php endif;?>>
<img class="product-retina" data-image2x="<?php echo Mage::helper('catalog/image')->init($_product, 'image', $_product->getFile())->resize($widthMedium*2, $heightMedium*2)?>" src="<?php echo Mage::helper('catalog/image')->init($_product, 'image', $_product->getFile())->resize($widthMedium, $heightMedium)?>" alt="" />
</a>
</div>
<div class="pull-right hidden"><i class="icon-zoom-in"></i></div>
</div>
</div>
</div>
</div>
<div class="span<?php echo $span3?>">
<div class="product-shop">
<?php echo $this->getChildHtml('custom_related_block') ?>
<div class="product_info_left">
<div class="product-name">
<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>
</div>
<?php if(Mage::getStoreConfig('buyshoplayout/product_info/sku')):?>
<p><?php echo $this->__('SKU') ?>: <b><?php echo nl2br($_product->getSku()) ?></b></p>
<?php endif; ?>
<?php if(!Mage::getStoreConfig('buyshopconfig/options/catalog_mode')):?>
<div class="product_type_data_price"><?php echo $this->getChildHtml('product_type_data') ?></div>
<?php endif; ?>
<div class="share-buttons share-buttons-panel" data-style="medium" data-counter="true" data-oauth="true" data-hover="true" data-promo-callout="left" data-buttons="twitter,facebook,pinterest"></div></p>
<div class="add-to-links">
<ul>
<?php echo Mage::helper('buyshopconfig')->addWishCompLink($_product,$this,true); ?>
<?php if ($this->canEmailToFriend()): ?>
<li><i class="icon-at"></i><?php echo $this->__('Email to a friend') ?></li>
<?php endif; ?>
</ul>
</div>
<?php echo $this->getReviewsSummaryHtml($_product, false, true)?>
<?php if(!Mage::getStoreConfig('buyshopconfig/options/catalog_mode')):?>
<?php echo $this->getPriceHtml($_product) ?>
<?php endif; ?>
<div class="socialsplugins_wrapper">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('buyshop_social_like_buttons')->toHtml() ?>
</div>
<?php if ($_product->getShortDescription()):?>
<div class="short-description"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
<?php endif;?>
<?php echo Mage::helper('buyshopconfig')->countdownSpecialPrice($_product,'defaultCountdown',$this);?>
<?php if(!Mage::getStoreConfig('buyshopconfig/options/catalog_mode')):?>
<?php echo $this->getChildHtml('alert_urls') ?>
<?php echo $this->getTierPriceHtml() ?>
<?php echo $this->getChildHtml('extrahint') ?>
<?php if (!$this->hasOptions()):?>
<?php if($_product->isSaleable()): ?>
<?php echo $this->getChildHtml('addtocart') ?>
<?php endif; ?>
<?php echo $this->getChildHtml('extra_buttons') ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->getChildHtml('other');?>
<?php if(Mage::getStoreConfig('buyshoplayout/product_info/qr')):?>
<div class="clearfix hidden-phone" style="margin: 20px 0 0 0">
<img src="http://api.qrserver.com/v1/create-qr-code/?size=100x100&data=<?php echo Mage::helper("core/url")->getCurrentUrl() ?>" alt="QR: <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>"/>
</div>
<?php endif;?>
</div>
</div>
</div>
<?php $modules_enable=Mage::getStoreConfig('advanced/modules_disable_output');?>
<div class="row">
<div class="span12">
<ul class="nav-tabs" id="myTab">
<li class="active"><?php echo $this->__('Description') ?></li>
<?php if(!$modules_enable['Mage_Review']):?><li><?php echo $this->__('Reviews') ?></li><?php endif;?>
<?php if(!$modules_enable['Mage_Tag']):?><li><?php echo $this->__('Tags') ?></li><?php endif;?>
<?php if ($_customtab && Mage::getStoreConfig('buyshoplayout/product_info/custom_tab')): ?>
<li><?php if(!empty($_customtabtitle)) echo html_entity_decode($this->helper('catalog/output')->productAttribute($this->getProduct(), $_customtabtitle, 'customtabtitle'));else echo 'Custom tab title' ?></li>
<?php endif;?>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
<div class="box-collateral <?php echo "box-{$alias}"?>">
<?php if ($title = $this->getChildData($alias, 'title')):?>
<h2><?php echo $this->escapeHtml($title); ?></h2>
<?php endif;?>
<?php echo $html; ?>
</div>
<?php endforeach;?>
</div>
<div class="tab-pane" id="tab2">
<?php echo $this->getChildHtml('reviews') ?>
</div>
<div class="tab-pane" id="tab3">
<?php echo $this->getChildHtml('product_additional_data') ?>
</div>
<?php if ($_customtab): ?>
<div class="tab-pane" id="tab4">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_customtab, 'customtab') ?>
</div>
<?php endif; ?>
</div></div></div>
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>
</div>
</div>
<!--PRODUCT BOX EOF-->
</form>
</div>
</div>
</div>
<?php echo $this->getChildHtml('upsell_products') ?>
<script type="text/javascript">
<?php
?>
jQuery(function(){
var PreviewSliderHeight = function() {
var big_image_height= <?php echo $height_thumbs?>;
var preview_image_height= jQuery('div.more-views ul.slides li:first-child').height();
var slider_height = Math.round (big_image_height/preview_image_height) * preview_image_height - 10;
jQuery(".flexslider.more-views .flex-viewport").css({
"min-height": slider_height + "px"
});
if((slider_height-(jQuery('div.more-views ul.slides li:first-child').height()*jQuery('div.more-views ul.slides li').length))>=-10)
{
jQuery('.more-views .flex-next').remove()
jQuery('.more-views .flex-prev').remove()
}
};
jQuery('.flexslider.more-views').flexslider({
animation: "slide",
autoplay: false,
minItems: 3,
animationLoop: false,
direction: "vertical",
controlNav: false,
slideshow: false,
prevText: "<i class='icon-down'></i>",
nextText: "<i class='icon-up'></i>",
start: PreviewSliderHeight
});
})
</script>
<script type="text/javascript">
//<![CDATA[
var productAddToCartForm = new VarienForm('product_addtocart_form');
<?php if(Mage::getStoreConfig('buyshopconfig/options/ajax_add_to_cart')){?>
productAddToCartForm.submit = function(button, url) {
if (this.validator.validate()) {
var form = this.form;
var oldUrl = form.action;
if (url) {
form.action = url;
}
var e = null;
// Start of our new ajax code
if (!url) {
url = jQuery('#product_addtocart_form').attr('action');
}
url = url.replace("checkout/cart","ajax/index"); // New Code
var data = jQuery('#product_addtocart_form').serialize();
data += '&isAjax=1';
jQuery('#preloader .loader').fadeIn(300);
try {
jQuery.ajax( {
url : url,
dataType : 'json',
type : 'post',
data &colon; data,
success : function(data) {
jQuery('#ajax_loader').hide();
if(data.status == 'ERROR'){
jQuery('#preloader .loader').hide();
jQuery('#preloader .inside').html(data.message);
jQuery('#preloader .message').fadeIn(300);
setTimeout(function(){
jQuery('#preloader .message').fadeOut();
},1500);
}else{
jQuery('#preloader .loader').hide();
if(jQuery('.ul_wrapper.toplinks')){
jQuery('.shoppingcart').replaceWith(data.sidebar);
}
jQuery(".shoppingcart .fadelink").bind({
mouseenter: function(e) {
jQuery(this).find(".shopping_cart_mini").stop(true, true).fadeIn(300, "linear");
},
mouseleave: function(e) {
jQuery(this).find(".shopping_cart_mini").stop(true, true).fadeOut(300, "linear");
}
});
if(jQuery('#topline .links')){
jQuery('#topline .links').replaceWith(data.toplink);
}
jQuery('#preloader .inside').html(data.message);
jQuery('#preloader .message').fadeIn(300);
setTimeout(function(){
jQuery('#preloader .message').fadeOut();
},1500)
}
}
});
} catch (e) {
}
// End of our new ajax code
this.form.action = oldUrl;
if (e) {
throw e;
}
}
}.bind(productAddToCartForm);
<?php }else { ?>
productAddToCartForm.submit = function(button, url) {
if (this.validator.validate()) {
var form = this.form;
var oldUrl = form.action;
if (url) {
form.action = url;
}
var e = null;
try {
this.form.submit();
} catch (e) {
}
this.form.action = oldUrl;
if (e) {
throw e;
}
if (button && button != 'undefined') {
button.disabled = true;
}
}
}.bind(productAddToCartForm);
<?php } ?>
productAddToCartForm.submitLight = function(button, url){
if(this.validator) {
var nv = Validation.methods;
delete Validation.methods['required-entry'];
delete Validation.methods['validate-one-required'];
delete Validation.methods['validate-one-required-by-name'];
// Remove custom datetime validators
for (var methodName in Validation.methods) {
if (methodName.match(/^validate-datetime-.*/i)) {
delete Validation.methods[methodName];
}
}
if (this.validator.validate()) {
if (url) {
this.form.action = url;
}
this.form.submit();
}
Object.extend(Validation.methods, nv);
}
}.bind(productAddToCartForm);
<?php if(!Mage::helper('lightboxes')->isActive()):?>
jQuery("a.video").click(function() {
jQuery.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'title' : this.title,
'width' : 680,
'height' : 495,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
});
return false;
});
<?php endif;?>
//]]>
When you have products with multiple options the details box ends up way beneath them so that the customer many not even see them. So, just in case anyone else has this issue & wants/needs assistance doing this. In order to move the "Details/Description" box above the add to cart button & keep the add to cart button functioning......
1. Details/Description Box - move the following code to above the last two </div> right before <!--PRODUCT BOX EOF-->:
<?php $modules_enable=Mage::getStoreConfig('advanced/modules_disable_output');?>
<div class="row">
<div class="span12">
<ul class="nav-tabs" id="myTab">
<li class="active"><?php echo $this->__('Description') ?></li>
<?php if(!$modules_enable['Mage_Review']):?><li><?php echo $this->__('Reviews') ?></li><?php endif;?>
<?php if(!$modules_enable['Mage_Tag']):?><li><?php echo $this->__('Tags') ?></li><?php endif;?>
<?php if ($_customtab && Mage::getStoreConfig('buyshoplayout/product_info/custom_tab')): ?>
<li><?php if(!empty($_cu`enter code here`stomtabtitle)) echo html_entity_decode($this->helper('catalog/output')->productAttribute($this->getProduct(), $_customtabtitle, 'customtabtitle'));else echo 'Custom tab title' ?></li>
<?php endif;?>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
<div class="box-collateral <?php echo "box-{$alias}"?>">
<?php if ($title = $this->getChildData($alias, 'title')):?>
<h2><?php echo $this->escapeHtml($title); ?></h2>
<?php endif;?>
<?php echo $html; ?>
</div>
<?php endforeach;?>
</div>
<div class="tab-pane" id="tab2">
<?php echo $this->getChildHtml('reviews') ?>
</div>
<div class="tab-pane" id="tab3">
<?php echo $this->getChildHtml('product_additional_data') ?>
</div>
<?php if ($_customtab): ?>
<div class="tab-pane" id="tab4">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_customtab, 'customtab') ?>
</div>
<?php endif; ?>
2. Add to cart button - move the following code beneath <!--PRODUCT BOX EOF--> (Each piece of code is located in a separate part of the product box so just look for them & put them together)
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
And
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
<?php endif;?>
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>
And
</form>

How can I use a Wordpress Widget to fill in blanks in HTML

Building my first WP widget. (below) Need to provide the client access to input Thumbnail Link, Youtube Link, Project Title and Description. The Widget is storing and retrieving data but I'm stumped on how to send that data to the HTML fields.
<?php
/*
Plugin Name: Red Viking Video
Plugin URI: http://digital-persona.com
Description: Bla Bla Bla
Version: 1.0
Author: Dan
Author URI: Bio Page
Licence: none
*/
class WP_red_viking_video extends WP_Widget {
function __construct() {
parent::__construct(false, $name = __('Red Viking Video'));
}
function form($instance) {
$thumbnail = esc_textarea( $instance['thumbnail'] );
$you_tube_link = esc_textarea( $instance['you_tube_link'] );
$project_title = esc_textarea( $instance['project_title'] );
$project_details = esc_textarea( $instance['project_details'] );
?>
<p>
<label for="<?php echo $this->get_field_id('thumbnail'); ?>"><?php _e('Thumbnail' ); ?></label>
<textarea class="widefat" rows="3" cols="30" id="<?php echo $this->get_field_id('thumbnail'); ?>" name="<?php echo $this->get_field_name('thumbnail'); ?>"><?php if (!empty($thumbnail)) echo $thumbnail; ?></textarea>
<p>
<label for="<?php echo $this->get_field_id('you_tube_link'); ?>">
<?php _e('You Tube Link', 'wp_widget_plugin'); ?>
</label>
<textarea class="widefat" rows="3" cols="30" id="<?php echo $this->get_field_id('you_tube_link'); ?>" name="<?php echo $this->get_field_name('you_tube_link'); ?>"><?php if (!empty($you_tube_link)) echo $you_tube_link; ?></textarea>
</p>
<p>
<label for="<?php echo $this->get_field_id('project_title'); ?>">
<?php _e('Project Title', 'wp_widget_plugin'); ?>
</label>
<textarea class="widefat" rows="3" cols="30" id="<?php echo $this->get_field_id('project_title'); ?>" name="<?php echo $this->get_field_name('project_title'); ?>"><?php if (!empty($project_title)) echo $project_title; ?></textarea>
</p>
<p>
<label for="<?php echo $this->get_field_id('project_details'); ?>">
<?php _e('Project Details', 'wp_widget_plugin'); ?>
</label>
<textarea class="widefat" rows="10" cols="30" id="<?php echo $this->get_field_id('project_details'); ?>" name="<?php echo $this->get_field_name('project_details'); ?>"><?php if (!empty($project_details)) echo $project_details; ?></textarea>
</p>
<?php
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
// Fields
$instance['thumbnail'] = esc_textarea($new_instance['thumbnail']);
$instance['you_tube_link'] = strip_tags($new_instance['you_tube_link']);
$instance['project_title'] = strip_tags($new_instance['project_title']);
$instance['project_details'] = strip_tags($new_instance['project_details']);
return $instance;
}
function widget($args, $instance) {
?>
<div class="widget featured-video one-third column project">
<!-- ====================== YOU TUBE LINK ======================= -->
<a class="youtube" href="<?php echo $you_tube_link; ?>" title="Orchestra London Promo">
<!-- ==================== END YOU TUBE LINK ===================== -->
<div class="thumbnail slide">
<!-- ===================== THUMBNAIL LINK ======================= -->
<img class="thumbnail" src="http://<?php echo $thumbnail; ?>" />
<!-- =================== END THUMBNAIL LINK ===================== -->
<div class="project snipit">
<!-- ==================== OVERLAY CONTENT ======================= -->
<h4><?php echo $project_title; ?></h4>
<!-- PROJECT TITLE -->
<p><?php echo $project_details; ?></p>
<!-- PROJECT DESCRIPTION -->
<!-- ================= END OVERLAY CONTENT ===================== -->
</div>
</div>
</a> </div>
<?php
}
}
add_action('widgets_init', function() {
register_widget('WP_red_viking_video');
})
?>
They are stored in the $instance variable, similarly to what you have in your update() function. Just add the following on top of your widget() function:
$thumbnail = $instance['thumbnail'];
$you_tube_link = $instance['you_tube_link'];
$project_title = $instance['project_title'];
$project_details = $instance['project_details'];

I want to make the background image of joomla login be full width

I have custimized the css of my joomla login page, everything is perfect, but I would like the image that I have inserted in the background through css to scale to whole width. Right now it is of a certain width size, despite the fact that in my css I have added width:100%.
Here is the login code:
<?php
/**
* #package Joomla.Site
* #subpackage com_users
* #copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* #license GNU General Public License version 2 or later; see LICENSE.txt
* #since 1.5
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<div class="login<?php echo $this->pageclass_sfx?>">
<?php //if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1 class="title">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php //endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<?php endif ; ?>
<?php if (($this->params->get('login_image')!='')) :?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JTEXT::_('COM_USER_LOGIN_IMAGE_ALT')?>"/>
<?php endif; ?>
<?php if($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif ; ?>
<form class="form-horizontal" action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">
<fieldset class="well">
<?php foreach ($this->form->getFieldset('credentials') as $field): ?>
<?php if (!$field->hidden): ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="control-group">
<label id="remember-lbl" class="control-label" for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME') ?></label>
<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes" alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME') ?>" />
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn-send"><?php echo JText::_('JLOGIN'); ?></button>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</fieldset>
</form>
</div>
<div class="other-link">
<ul class="yt-list type-square">
<li class="pull-left">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<?php
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) : ?>
<li class="pull-right">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
Don't modify core Joomla files, learn about overrides (1, 2 & 3) and use them, that way when a security update is released you can apply it safely and not have to worry about your changes being overwritten.
Did you mean backgroud-size: 100% rather than width: 100%? That would make more sense for background images. In that case, I would recommend reading this primer on "Scaling background images"
To help further we will need to see your existing CSS that you've created and either a link showing the problem or a good screen shot of the issue.