@ -113,11 +113,11 @@ class Locations extends AbstractController
$request->request->get("loc_tags") == ""
$request->request->get("loc_tags") == ""
) {
) {
$notice = "All fields are required, champ.";
$notice = "All fields are required, champ.";
return $this->render("back/locations.twig", [
return $render->page(
"title" => "Bad Space | Locations | Add" ,
["mode" => "add", "notice" => $notice] ,
"notice" => $notice ,
"Bad Space | Locations | Add" ,
"mode" => "add "
"back/locations.twig "
] );
);
}
}
//once everything clears, upload images and process request
//once everything clears, upload images and process request
@ -132,29 +132,26 @@ class Locations extends AbstractController
}
}
$response = $locations->modifyLocation($request, $result["id"], $mode, $request->request->get("uuid"));
$response = $locations->modifyLocation($request, $result["id"], $mode, $request->request->get("uuid"));
if ($response["status"]) {
if ($response["status"]) {
$options = [];
if ($mode == 'add') {
if ($mode == 'add') {
$options = [
return $render->page(
"title" => "Bad Space | Locations | Add" ,
["mode" => $mode, "notice" => $response["message"]] ,
"notice" => $response["message"] ,
"Bad Space | Locations | Add" ,
"mode" => $mode
"back/locations.twig"
] ;
) ;
} else {
} else {
$location = $locations->getLocationbyUUID($request->request->get("uuid"));
$location = $locations->getLocationbyUUID($request->request->get("uuid"));
$options = [
return $render->page(
"title" => "Bad Space | Locations | Edit",
["mode" => $mode, "notice" => $response["message"], "location" => $location[0]],
"mode" => $mode,
"Bad Space | Locations | Edit",
"notice" => $response["message"],
"back/locations.twig"
"location" => $location[0]
);
];
}
}
return $this->render("back/locations.twig", $options);
} else {
} else {
return $this->render("back/locations.twig", [
return $render->page(
"title" => "Bad Space | Locations | Error" ,
["mode" => $mode, "notice" => $response["message"]] ,
"notice" => $response["message"] ,
"Bad Space | Locations | Error" ,
"mode" => $mode
"back/locations.twig"
] );
);
}
}
}
}
} else {
} else {
@ -227,17 +224,17 @@ class Locations extends AbstractController
$response = $locations->addMultipleLocations($file, $result["id"]);
$response = $locations->addMultipleLocations($file, $result["id"]);
if ($response["status"]) {
if ($response["status"]) {
$notice = "New locations added! Take a break.";
$notice = "New locations added! Take a break.";
return $this->render("back/locations.twig", [
return $render->page(
"title" => "Bad Space | Locations | Add" ,
["mode" => "bulk-add", "notice" => $response["message"], ] ,
"notice" => $response["message"] ,
"Bad Space | Locations | Bulk Add" ,
"mode" => "bulk-add "
"back/locations.twig "
] );
);
} else {
} else {
return $this->render("back/locations.twig", [
return $render->page(
"title" => "Bad Space | Locations | Add" ,
["mode" => "bulk-add", "notice" => $response["message"], ] ,
"notice" => $response["message"] ,
"Bad Space | Locations | Bulk Add" ,
"mode" => "bulk-add "
"back/locations.twig "
] );
);
}
}
}
}
} else {
} else {