23.11 Upload to live

This commit is contained in:
Kevin Adametz 2019-11-23 15:02:41 +01:00
parent 8cae2f92a4
commit 8ebdacec98
80 changed files with 7320 additions and 3937 deletions

View file

@ -4,6 +4,7 @@ namespace App\Services;
use App\Models\Attribute;
use App\Models\Category;
use App\Models\Country;
use App\Models\Product;
use App\Models\ShippingCountry;
class HTMLHelper
@ -30,6 +31,7 @@ class HTMLHelper
0 => 'Kunde',
1 => 'Admin',
2 => 'SuperAdmin',
3 => 'SySAdmin',
];
@ -52,6 +54,9 @@ class HTMLHelper
case 2:
return 'badge-primary';
break;
case 3:
return 'badge-primary';
break;
}
}
@ -109,6 +114,22 @@ class HTMLHelper
return $ret;
}
public static function getProductsOptions($ids = array(), $all = true){
if($ids == null){
$ids = array();
}
$values = Product::where('active', 1)->get();
$ret = "";
if($all){
$ret .= '<option value="">'.__('no').'</option>\n';
}
foreach ($values as $value){
$attr = in_array($value->id, $ids) ? 'selected="selected"' : '';
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.'</option>\n';
}
return $ret;
}
public static function getCategoriesOptions($ids = array(), $all = true){
$values = Category::where('active', 1)->get();
$ret = "";