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()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ class CMSContentInfoController extends Controller
|
|||
|
||||
}
|
||||
|
||||
|
||||
private function checkAvailable($type, $wday){
|
||||
|
||||
$contents = [];
|
||||
|
|
@ -210,7 +209,6 @@ class CMSContentInfoController extends Controller
|
|||
|
||||
}
|
||||
|
||||
|
||||
private function checkBetweenHoliday($type, \Carbon $cdate){
|
||||
$holidays = CMSInfoHoliday::where($type, true)->get();
|
||||
foreach ($holidays as $holiday){
|
||||
|
|
|
|||
|
|
@ -31,11 +31,13 @@ class TravelNationalityController extends Controller
|
|||
if($data['id'] === "new"){
|
||||
$model = TravelNationality::create([
|
||||
'name' => $data['name'],
|
||||
'nat' => $data['nat'],
|
||||
'active' => isset($data['active']) ? true : false,
|
||||
]);
|
||||
}else{
|
||||
$model = TravelNationality::find($data['id']);
|
||||
$model->name = $data['name'];
|
||||
$model->nat = $data['nat'];
|
||||
$model->active = isset($data['active']) ? true : false;
|
||||
$model->save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ use App\Models\IQContentSite;
|
|||
use App\Models\IQContentSiteField;
|
||||
use App\Models\IQContentTree;
|
||||
use App\Models\IQContentTreeNode;
|
||||
use App\Models\TravelCountry;
|
||||
use App\Models\TravelGuide;
|
||||
use App\Models\TravelNationality;
|
||||
use Illuminate\Support\Str;
|
||||
use IqContent\LaravelFilemanager\Controllers\FileController;
|
||||
use IqContent\LaravelFilemanager\Controllers\FolderController;
|
||||
|
|
@ -64,9 +66,6 @@ class ContentLinkController extends Controller
|
|||
|
||||
public function store()
|
||||
{
|
||||
|
||||
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
|
@ -222,6 +221,64 @@ class ContentLinkController extends Controller
|
|||
|
||||
}
|
||||
|
||||
//import
|
||||
public function import()
|
||||
{
|
||||
$text = "";
|
||||
$val = [];
|
||||
|
||||
$data = [
|
||||
'text' => $text,
|
||||
'values' => $val,
|
||||
];
|
||||
return view('sys.tools.import', $data);
|
||||
}
|
||||
|
||||
public function importStore()
|
||||
{
|
||||
|
||||
$data = Request::all();
|
||||
|
||||
$lines = explode(PHP_EOL, $data['text']);
|
||||
|
||||
if($data['action'] === 'import_TN'){
|
||||
foreach ($lines as $line){
|
||||
$ex = explode(';', $line);
|
||||
$t_n = TravelNationality::whereName(trim($ex[1]))->first();
|
||||
if($t_n){
|
||||
$t_n->nat = $ex[0];
|
||||
$t_n->save();
|
||||
}else{
|
||||
TravelNationality::create([
|
||||
'name' => trim($ex[1]),
|
||||
'nat' => $ex[0],
|
||||
'active' => false,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($data['action'] === 'import_CT') {
|
||||
foreach ($lines as $line){
|
||||
$ex = explode(';', $line);
|
||||
$t_c = TravelCountry::whereName(trim($ex[1]))->first();
|
||||
if($t_c){
|
||||
dump($t_c->name);
|
||||
$t_c->destco = $ex[0];
|
||||
$t_c->save();
|
||||
|
||||
$tc = \App\Models\Sym\TravelCountry::find($t_c->crm_id);
|
||||
$tc->destco = $ex[0];
|
||||
$tc->save();
|
||||
}
|
||||
}
|
||||
dd("");
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
||||
private function replaceYoutubeDiv(&$val, $travelGuide)
|
||||
{
|
||||
|
|
@ -656,63 +713,4 @@ class ContentLinkController extends Controller
|
|||
|
||||
|
||||
|
||||
//tree_title
|
||||
/* public function tree()
|
||||
{
|
||||
$text = "";
|
||||
$val = [];
|
||||
$trees = IQContentTree::all();
|
||||
foreach ($trees as $tree){
|
||||
foreach ($tree->iq_content_tree_nodes as $tree_node){
|
||||
|
||||
$text .= $tree_node->id." -- ".$tree_node->title."\n";
|
||||
foreach ($tree_node->iq_content_sites as $site){
|
||||
if(isset($site->travel_guide->meta_title)){
|
||||
if(isset($val[$tree_node->id])){
|
||||
if(strlen($site->travel_guide->meta_title) > strlen($val[$tree_node->id])){
|
||||
$val[$tree_node->id] = $site->travel_guide->meta_title;
|
||||
}
|
||||
}else{
|
||||
$val[$tree_node->id] = $site->travel_guide->meta_title;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'text' => $text,
|
||||
'values' => $val,
|
||||
];
|
||||
return view('sys.tools.trees', $data);
|
||||
}
|
||||
|
||||
public function treeStore()
|
||||
{
|
||||
|
||||
$trees = IQContentTree::all();
|
||||
$val = [];
|
||||
foreach ($trees as $tree){
|
||||
foreach ($tree->iq_content_tree_nodes as $tree_node){
|
||||
foreach ($tree_node->iq_content_sites as $site){
|
||||
if(isset($site->travel_guide->meta_title)){
|
||||
if(isset($val[$tree_node->id])){
|
||||
if(strlen($site->travel_guide->meta_title) > strlen($val[$tree_node->id])){
|
||||
$val[$tree_node->id] = $site->travel_guide->meta_title;
|
||||
}
|
||||
}else{
|
||||
$val[$tree_node->id] = $site->travel_guide->meta_title;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($val[$tree_node->id])){
|
||||
$tree_node->title = $val[$tree_node->id];
|
||||
$tree_node->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return redirect()->back();
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ class TravelUserBookingFewoController extends Controller
|
|||
}
|
||||
//Mails
|
||||
//CASCADE
|
||||
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', __('Buchung gelöscht sowie die Reservierung im Sterntrous Kalender'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue