Passolution, Mails, Tickets,
This commit is contained in:
parent
0857a34766
commit
f79806ffe8
46 changed files with 556 additions and 831 deletions
|
|
@ -5,7 +5,10 @@ namespace App\Http\Controllers\API;
|
|||
use App\Http\Controllers\Controller;
|
||||
use App\Models\IQContentTree;
|
||||
use App\Models\IQContentTreeNode;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelGuide;
|
||||
use App\Models\TravelNationality;
|
||||
use App\Services\Passolution;
|
||||
|
||||
|
||||
class CMSContentController extends Controller
|
||||
|
|
@ -14,6 +17,70 @@ class CMSContentController extends Controller
|
|||
private $successKey = 'f6077389c9ce710e554763a5de02c8ec';
|
||||
|
||||
|
||||
public function passolution($lang, $nat, $destco, $tdat){
|
||||
|
||||
$data = [
|
||||
'lang' => $lang,
|
||||
'nat' => $nat,
|
||||
'destco' => $destco,
|
||||
'tdat' => $tdat,
|
||||
];
|
||||
$passolution = new Passolution();
|
||||
$passolution->fill($data);
|
||||
$html = $passolution->read();
|
||||
|
||||
return response()->json(['response' => $html]);
|
||||
|
||||
}
|
||||
|
||||
public function passolutionPost($lang){
|
||||
|
||||
$data = \Request::all();
|
||||
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: *');
|
||||
header('Access-Control-Allow-Headers: *');
|
||||
$headers = [
|
||||
'Access-Control-Allow-Methods' => 'POST,GET,OPTIONS,PUT,DELETE',
|
||||
'Access-Control-Allow-Headers' => 'Content-Type, X-Auth-Token, Origin, Authorization',
|
||||
];
|
||||
|
||||
if(!isset($data['nationality_id']) || !isset($data['travel_date_start']) || !isset($data['country_ids']) || !is_array($data['country_ids'])){
|
||||
return response()->json(['response' => 'Fehler bei der Anfrage'], 200, $headers);
|
||||
}
|
||||
|
||||
$TravelNationality = TravelNationality::find($data['nationality_id']);
|
||||
if(!$TravelNationality){
|
||||
return response()->json(['response' => 'Fehler bei der Anfrage: Nationalität nicht gefunden'], 200, $headers);
|
||||
}
|
||||
$destco = [];
|
||||
foreach ($data['country_ids'] as $country_id){
|
||||
$TravelCountry = TravelCountry::find($country_id);
|
||||
if(!$TravelCountry){
|
||||
return response()->json(['response' => 'Fehler bei der Anfrage: Travel Country nicht gefunden'], 200, $headers);
|
||||
}
|
||||
$destco[] = $TravelCountry->destco;
|
||||
}
|
||||
|
||||
$tdat = date("d-m-Y", strtotime($data['travel_date_start']));
|
||||
|
||||
$data = [
|
||||
'lang' => $lang,
|
||||
'nat' => $TravelNationality->nat,
|
||||
'destco' => trim(implode(',', $destco), ","),
|
||||
'tdat' => $tdat,
|
||||
];
|
||||
|
||||
$passolution = new Passolution();
|
||||
$passolution->fill($data);
|
||||
$html = $passolution->read();
|
||||
|
||||
return response()->json(['success' => true, "response" => $html, "data" => $data], 200, $headers);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function search()
|
||||
{
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue