Reiseland Kontaktdaten, Rabatt API

This commit is contained in:
Kevin Adametz 2019-11-07 17:08:16 +01:00
parent 8f29c15a2b
commit 70704be1ea
30 changed files with 471 additions and 95 deletions

View file

@ -121,7 +121,7 @@ class HTMLHelper
}
public static function getDraftTypes($setId = false){
$options = DraftType::all()->sortByDesc('id');
$options = DraftType::all()->sortByDesc('id')->sortByDesc('pos');
$ret = "";
foreach ($options as $option){
$attr = ($option->id == $setId) ? 'selected="selected"' : '';
@ -165,17 +165,23 @@ class HTMLHelper
}
public static function getTravelCountriesOptions($countryId = false){
$checked = [];
if($countryId){
!is_array($countryId) ? $checked = array($countryId) : $checked = $countryId;
}
$options = TravelCountry::where('active_backend',1)->get();
$ret = '';
foreach ($options as $option){
$attr = ($option->crm_id === $countryId) ? 'selected="selected"' : '';
$attr = (in_array($option->crm_id, $checked)) ? 'selected="selected"' : '';
$ret .= '<option value="'.$option->crm_id.'" '.$attr.'>'.$option->name.'</option>\n';
}
return $ret;
}
public static function getTravelUserOptions($id = false){
$options = TravelUser::all();
public static function getTravelUserOptions($id = false, $order = "ASC"){
$options = TravelUser::orderBy('id', $order)->get();
$ret = '';
foreach ($options as $option){
$attr = ($option->id === $id) ? 'selected="selected"' : '';