Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin Vrel
projet-cdaw
Commits
1acd782b
Commit
1acd782b
authored
Nov 30, 2020
by
Zohten
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gvipers.imt-lille-douai.fr/QVrel/projet-cdaw
parents
e3df21c7
f9fc14c4
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
142 additions
and
11 deletions
+142
-11
Game.php
Laravel/app/Game.php
+2
-2
TournamentController.php
Laravel/app/Http/Controllers/TournamentController.php
+19
-0
User.php
Laravel/app/User.php
+1
-1
create-tournament.blade.php
Laravel/resources/views/create-tournament.blade.php
+107
-0
home.blade.php
Laravel/resources/views/home.blade.php
+2
-3
app.blade.php
Laravel/resources/views/layouts/app.blade.php
+3
-1
web.php
Laravel/routes/web.php
+8
-4
No files found.
Laravel/app/
Models/
Game.php
→
Laravel/app/Game.php
View file @
1acd782b
<?php
namespace
App
\Models
;
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
Game
extends
Model
{
protected
$connection
=
'
esport
'
;
protected
$connection
=
'
mysql
'
;
protected
$table
=
'game'
;
protected
$primaryKey
=
'gamer_id'
;
public
$incrementing
=
true
;
...
...
Laravel/app/Http/Controllers/TournamentController.php
0 → 100644
View file @
1acd782b
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
App\Game
;
class
TournamentController
extends
Controller
{
public
function
index
()
{
$games
=
Game
::
all
();
return
view
(
'create-tournament'
,
[
'games'
=>
$games
]);
}
public
function
createTournament
(){
}
}
Laravel/app/
Models/
User.php
→
Laravel/app/User.php
View file @
1acd782b
<?php
namespace
App
\Models
;
namespace
App
;
use
Illuminate\Contracts\Auth\MustVerifyEmail
;
use
Illuminate\Foundation\Auth\User
as
Authenticatable
;
...
...
Laravel/resources/views/create-tournament.blade.php
View file @
1acd782b
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
="
container
">
<div class="
row
justify
-
content
-
center
">
<div class="
col
-
md
-
8
">
@if (isset(
$post
))
@if(
$post
)
<div class="
alert
alert
-
success
" role="
alert
">
Le tournoi a été créé.
</div>
$else
<div class="
alert
alert
-
danger
" role="
alert
">
Un erreur est intervenue, merci de réessayer.
</div>
@endif
@endif
<div class="
card
-
header
">Créer un tournoi</div>
<div class="
card
-
body
">
<form method="
POST
" action="
/
form
">
@csrf
<div class="
form
-
group
row
">
<label for="
select
-
game
" class="
col
-
md
-
4
col
-
form
-
label
text
-
md
-
right
">Choisissez un jeu</label>
<div class="
col
-
md
-
6
">
<select name="
select
-
game
" id="
select
-
game
" class="
custom
-
select
" required autofocus>
@foreach (
$games
as
$game
)
<option value="
{{
$game
->
id_game
}}
">{{
$game->id_game
}}</option>
@endforeach
</select>
</div>
</div>
<div class="
form
-
group
row
">
<label for="
tournament
-
name
" class="
col
-
md
-
4
col
-
form
-
label
text
-
md
-
right
">Nom du tournoi</label>
<div class="
col
-
md
-
6
">
<input name="
tournament
-
name
" id="
tournament
-
name
" type="
text
" class="
form
-
control
" required>
</div>
<div class="
invalid
-
feedback
">
Veuillez saisir un nom.
</div>
</div>
<div class="
form
-
group
row
">
<label for="
date
-
begin
" class="
col
-
md
-
4
col
-
form
-
label
text
-
md
-
right
">Date du début du tournoi</label>
<div class="
col
-
md
-
6
row
pr
-
0
" name="
date
-
begin
" id="
date
-
begin
">
<div class="
col
-
md
-
3
">
<select name="
day
-
begin
" id="
day
-
begin
" class="
custom
-
select
" required autofocus>
@for (
$i
= 1;
$i
< 32;
$i
++)
<option value="
{{
$i
}}
">{{
$i
}}</option>
@endfor
</select>
</div>
<div class="
col
-
md
-
5
">
<select name="
month
-
begin
" id="
month
-
begin
" class="
custom
-
select
" required autofocus>
@for (
$i
= 1;
$i
< 13;
$i
++)
<option value="
{{
$i
}}
">{{ date('F', mktime(0,0,0,
$i
) ) }}</option>
@endfor
</select>
</div>
<div class="
col
-
md
-
4
">
<select name="
day
-
begin
" id="
day
-
begin
" class="
custom
-
select
" required autofocus>
@for (
$i
= date('Y');
$i
< date('Y') + 20;
$i
++)
<option value="
{{
$i
}}
">{{
$i
}}</option>
@endfor
</select>
</div>
</div>
</div>
<div class="
form
-
group
row
">
<label for="
date
-
end
" class="
col
-
md
-
4
col
-
form
-
label
text
-
md
-
right
">Date du fin du tournoi</label>
<div class="
col
-
md
-
6
row
pr
-
0
" name="
date
-
end
" id="
date
-
end
">
<div class="
col
-
md
-
3
">
<select name="
day
-
end
" id="
day
-
end
" class="
custom
-
select
" required autofocus>
@for (
$i
= 1;
$i
< 32;
$i
++)
<option value="
{{
$i
}}
">{{
$i
}}</option>
@endfor
</select>
</div>
<div class="
col
-
md
-
5
">
<select name="
month
-
end
" id="
month
-
end
" class="
custom
-
select
" required autofocus>
@for (
$i
= 1;
$i
< 13;
$i
++)
<option value="
{{
$i
}}
">{{ date('F', mktime(0,0,0,
$i
) ) }}</option>
@endfor
</select>
</div>
<div class="
col
-
md
-
4
">
<select name="
day
-
end
" id="
day
-
end
" class="
custom
-
select
" required autofocus>
@for (
$i
= date('Y');
$i
< date('Y') + 20;
$i
++)
<option value="
{{
$i
}}
">{{
$i
}}</option>
@endfor
</select>
</div>
</div>
</div>
<div class="
form
-
group
row
">
<button class="
btn
btn
-
primary
mx
-
auto
" type="
submit
">Submit form</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
Laravel/resources/views/home.blade.php
View file @
1acd782b
...
...
@@ -5,7 +5,6 @@
<div class="
row
justify
-
content
-
center
">
<div class="
col
-
md
-
8
">
<div class="
card
">
<div class="
card
-
header
">{{ __('Dashboard') }}</div>
<div class="
card
-
body
">
@if (session('status'))
...
...
@@ -14,7 +13,7 @@
</div>
@endif
{{ __('You are logged in!') }}
Bienvenue sur ma page d'accueil.
</div>
</div>
</div>
...
...
Laravel/resources/views/layouts/app.blade.php
View file @
1acd782b
...
...
@@ -33,7 +33,9 @@
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<!-- Left Side Of Navbar -->
<ul
class=
"navbar-nav mr-auto"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"{{ url('/form') }}"
>
{{ __('Créer un tournoi') }}
</a>
</li>
</ul>
<!-- Right Side Of Navbar -->
...
...
Laravel/routes/web.php
View file @
1acd782b
...
...
@@ -16,15 +16,19 @@ use Illuminate\Support\Facades\Route;
Route
::
get
(
'/'
,
function
()
{
return
view
(
'home'
);
});
Route
::
get
(
'/template'
,
function
()
{
return
view
(
'main'
);
});
/*
Route::get('/vue2', 'MonControleur@index');
Route::get('/{firstname}/{name}', function ($firstname, $name) {
return "Koukou $firstname $name";
});
*/
Auth
::
routes
();
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
Route
::
get
(
'/form'
,
'TournamentController@index'
);
//Routes de test
Route
::
get
(
'/formtest'
,
'TournamentController@createTournament'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment