parent
f03862b523
commit
1a43060996
42 changed files with 1160 additions and 83 deletions
|
|
@ -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 = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue