This commit is contained in:
Kevin Adametz 2020-01-02 19:22:30 +01:00
parent f03862b523
commit 1a43060996
42 changed files with 1160 additions and 83 deletions

View file

@ -6,6 +6,7 @@ use App\Models\Category;
use App\Models\Country;
use App\Models\Product;
use App\Models\ShippingCountry;
use App\Models\UserLevel;
class HTMLHelper
{
@ -156,6 +157,19 @@ class HTMLHelper
return $ret;
}
public static function getUserLevelOptions($id = false, $all = true){
$values = UserLevel::where('active', 1)->get();
$ret = "";
if($all){
$ret .= '<option value="">'.__('no').'</option>\n';
}
foreach ($values as $value){
$attr = ($value->id == $id) ? 'selected="selected"' : '';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.'</option>\n';
}
return $ret;
}
public static function getCompanyOptions($company){
$options = array(1 => __('business'), 0 => __('private'), );
@ -258,6 +272,18 @@ class HTMLHelper
return (!empty($values[$id]) ? $values[$id] : '');
}
public static function getTaxSaleOptions($id){
$values = array('1' => __('taxable_sales_1'), '2' => __('taxable_sales_2'));
$ret = "";
$ret .= '<option value="">'.__('please select').'</option>\n';
foreach ($values as $key => $value){
$attr = ($key == $id) ? 'selected="selected"' : '';
$ret .= '<option value="'.$key.'" '.$attr.'>'.$value.'</option>\n';
}
return $ret;
}
/*public static function getIndustrySectorsWithoutParents($id = false, $sameId = false, $all = true){
$values = IndustrySector::where('parent_id', null)->get();
$ret = "";