@@ -1,5 +1,9 @@
|
||||
.mgr-5px{margin-right:5px;}
|
||||
#productsBox .col-sm-3{margin-bottom:5px;}
|
||||
#productsBox .input-group {table-layout: fixed; width: 100%;}
|
||||
#productsBox .has-branch .chosen-container {width: 70%!important}
|
||||
#productsBox .has-branch select {width: 100%; display: table-cell; border-radius: 0 2px 2px 0; border-left: none;}
|
||||
#productsBox .has-branch select:focus {box-shadow: inset 1px 0 #4d90fe}
|
||||
|
||||
.table-children > td:first-child{border-left:2px solid #ccc;}
|
||||
.table-children > td:last-child{border-right:2px solid #ccc;}
|
||||
|
||||
@@ -147,14 +147,14 @@ function loadBranches(product)
|
||||
}
|
||||
|
||||
var $inputgroup = $(product).closest('.input-group');
|
||||
if($inputgroup.find('select').size() >= 2) $inputgroup.find('select:last').remove();
|
||||
if($inputgroup.find('select').size() >= 2) $inputgroup.removeClass('has-branch').find('select:last').remove();
|
||||
var index = $inputgroup.find('select:first').attr('id').replace('products' , '');
|
||||
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val()), function(data)
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
$inputgroup.append(data);
|
||||
$inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).css('width', '80px').attr('onchange', "loadPlans('#products" + index + "', this.value)");
|
||||
$inputgroup.addClass('has-branch').append(data);
|
||||
$inputgroup.find('select:last').attr('name', 'branch[' + index + ']').attr('id', 'branch' + index).attr('onchange', "loadPlans('#products" + index + "', this.value)");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($products as $product):?>
|
||||
<div class='col-sm-3'>
|
||||
<div class='input-group'>
|
||||
<?php $hasBranch = $product->type != 'normal' and isset($branchGroups[$product->id]);?>
|
||||
<div class="input-group<?php if($hasBranch) echo ' has-branch';?>">
|
||||
<?php echo html::select("products[$i]", $allProducts, $product->id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "'");?>
|
||||
<span class='input-group-addon fix-border' style='padding:0'></span>
|
||||
<?php if($product->type != 'normal') echo html::select("branch[$i]", $branchGroups[$product->id], $product->branch, "class='form-control' style='width:80px'")?>
|
||||
<?php if($hasBranch) echo html::select("branch[$i]", $branchGroups[$product->id], $product->branch, "class='form-control' onchange=\"loadPlans('#products{$i}', this.value)\"");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $i++;?>
|
||||
|
||||
@@ -114,10 +114,10 @@
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($linkedProducts as $product):?>
|
||||
<div class='col-sm-3'>
|
||||
<div class='input-group'>
|
||||
<?php $hasBranch = $product->type != 'normal' and isset($branchGroups[$product->id]);?>
|
||||
<div class="input-group<?php if($hasBranch) echo ' has-branch';?>">
|
||||
<?php echo html::select("products[$i]", $allProducts, $product->id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "'");?>
|
||||
<span class='input-group-addon fix-border' style='padding:0px'></span>
|
||||
<?php if($product->type != 'normal' and isset($branchGroups[$product->id])) echo html::select("branch[$i]", $branchGroups[$product->id], $product->branch, "class='form-control' style='width:80px' onchange=\"loadPlans('#products{$i}', this.value)\"")?>
|
||||
<?php if($hasBranch) echo html::select("branch[$i]", $branchGroups[$product->id], $product->branch, "class='form-control' onchange=\"loadPlans('#products{$i}', this.value)\"");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $i++;?>
|
||||
@@ -125,7 +125,6 @@
|
||||
<div class='col-sm-3'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select("products[$i]", $allProducts, '', "class='form-control chosen' onchange='loadBranches(this)'");?>
|
||||
<span class='input-group-addon fix-border' style='padding:0px'></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user