...
This commit is contained in:
parent
ddbd95573f
commit
3611556228
2 changed files with 15 additions and 0 deletions
|
|
@ -327,5 +327,11 @@ class TourController extends Controller
|
|||
return redirect('/tour/'.$tour_id);
|
||||
}
|
||||
|
||||
public function create_room($tour_id,$capacity) {
|
||||
Log::info("create_room Controller started");
|
||||
$user=Auth::user();
|
||||
Tour::create_room($tour_id,$capacity);
|
||||
return redirect('tour/'.$tour_id.'/edit');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace App;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Tour extends Model
|
||||
{
|
||||
|
|
@ -51,6 +52,14 @@ class Tour extends Model
|
|||
return false;
|
||||
}
|
||||
|
||||
public static function create_room($tour_id,$capacity) {
|
||||
$tour = Tour::find($tour_id);
|
||||
$name="Einzelzimmer";
|
||||
if ($capacity!=1) { $name="Doppelzimmer";}
|
||||
$sql="INSERT INTO tour_rooms (name,tour_id,capacity,created_at,updated_at) VALUES ('".$name."',".$tour_id.",".$capacity.",now(),now());";
|
||||
DB::insert($sql);
|
||||
}
|
||||
|
||||
public static function toGermanDate($engDate)
|
||||
{
|
||||
error_log("to german Date:");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue