/** * @param string $backUrl * @param int $player_id * @return \Illuminate\Http\RedirectResponse */ public function add($backUrl = 'entree', $player_id = 0) { if ($player_id == 0) { return Redirect::route($backUrl); } $player = Player::find($player_id); // Cree Entree $entree = new Entree(); $entree->compet_id = MySession::getModel('compet')->id; $entree->statusentree_id = 1; $entree->teamname = ""; $entree->hcp = 0; $entree->save(); // Cree les EntreePlayers (en fonction du Compet->TypeCompet->nbplayers $nbPlayers = MySession::getModel('compet')->typecompet->nbplayers; for ($pl = 1; $pl <= $nbPlayers; $pl++) { $entreePlayer = new Entreeplayer(); $entreePlayer->entree_id = $entree->id; if ($pl == 1) { $entreePlayer->player_id = $player->id; $entreePlayer->hcp = $player->hcp; } $entreePlayer->num = $pl; $entreePlayer->save(); // get Categorie if ($pl == 1) { $entreePlayer->competcategorie_id = $entreePlayer->getCategorie(); $entreePlayer->save(); } } return Redirect::route($backUrl); }
/** * @param string $backUrl * @param int $categorie_id * @return \Illuminate\Http\RedirectResponse */ public function add($backUrl = 'compet', $categorie_id = 0) { if ($categorie_id == 0) { return Redirect::route($backUrl); } $categorie = Categorie::find($categorie_id); $userclub = new Competcategorie(); $userclub->categorie_id = $categorie->id; $userclub->compet_id = MySession::getModel('compet')->id; $userclub->tee_id = $categorie->tee_id; $userclub->save(); return Redirect::route($backUrl); }
<?php // listItem : nom de la procedure dans le model $listItem = 'newListItem'; // Clubs déjà selectionnes $playerExistes = MySession::getModel('compet')->getListPlayerId(); // Datas - cherche par Nom if ($inputs['nom'] == 'parNom') { $datas = Player::where('nom', 'LIKE', '%' . $inputs['search'] . '%')->whereNotIn('id', $playerExistes)->orderBy('nom', 'ASC')->get(); } // Datas - cherche par Licence if ($inputs['nom'] == 'parLicence') { $datas = Player::whereLicence($inputs['search'])->whereNotIn('id', $playerExistes)->orderBy('nom', 'ASC')->get(); } // Limit datas to show : if 0 or not exist then value no limit $param['maxData'] = '60'; // Sub-titre $param['sub-titre'] = 'Sélectionnez un joueur'; // Select Route $param['selectRoute'] = 'entreeplayer.place'; $param['selectText'] = ''; $param['moreParams'] = $inputs['id']; // Actions $param['actions'] = 'place'; // BackUrl $param['backUrl'] = 'entree'; ?> <!-- List.Blade -->
<?php // listItem : nom de la procedure dans le model $listItem = 'newListItem'; // Datas $datas = Categorie::whereNotIn('id', MySession::getModel('compet')->getListCategorieId())->get(); // Sub-titre $param['sub-titre'] = 'Sélectionner une catégorie'; // Add Route $param['addRoute'] = ''; $param['addText'] = ''; // Open Route $param['openRoute'] = ''; // Edit Route $param['editRoute'] = ''; $param['editText'] = ''; // Delete Route $param['deleteRoute'] = ''; $param['deleteText'] = ''; // Select Route $param['selectRoute'] = 'competcategorie.add'; $param['selectText'] = ''; $param['afterRoute'] = ''; // Actions $param['actions'] = 'select'; // BackUrl $param['backUrl'] = 'compet'; ?> <div class="information white">
<?php // listItem : nom de la procedure dans le model $listItem = 'newListItem'; // Datas $datas = MySession::getModel('compet')->competcategories; // Sub-titre $param['sub-titre'] = 'Les catégories'; // Add Route $param['addRoute'] = 'competcategorie.selectpage'; $param['addText'] = 'sélectionner une catégorie'; // Open Route $param['openRoute'] = ''; // Edit Route $param['editRoute'] = 'competcategorie.changetee'; $param['editText'] = ''; // Delete Route $param['deleteRoute'] = 'competcategorie.delete'; $param['deleteText'] = ''; // Select Route $param['selectRoute'] = ''; $param['selectText'] = ''; $param['afterRoute'] = ''; // Actions $param['actions'] = 'edit,delete'; // BackUrl $param['backUrl'] = 'compet'; ?> <div class="information white">
/** * Competcategorie constructor. * @param array $attributes */ public function __construct(array $attributes = array()) { $this->setRawAttributes(array_merge($this->attributes, array('categorie_id' => 0, 'compet_id' => MySession::getModel('compet')->id)), true); parent::__construct($attributes); }
$nbJoueurLibelle = gl("Nombre d'équipes dans un départ"); $nbJoueurDansFlightSelect = ['1' => 1]; } ?> {{ openContent($param['titre']) }} <?php // Open Form Xform::form('route', 'configdepart.create'); // Hidden Xform::startRow('hidden'); Xform::addText('_token', 'x', Session::getToken(), 2); Xform::addText('id', 'ID', $datas->id, 2); Xform::addText('backUrl', '', $param['backUrl']); Xform::addText('tour_id', 'TOUR_ID', MySession::getModel('tour')->id, 1); Xform::endRow(); // Get Fields Xform::startRow(); Xform::addSelect('parcour_id', Parcour::lists('nom', 'id'), 'Parcours', $datas->parcour_id, 4); Xform::addSelect('typeconfigdepart_id', ['1' => 'En ligne', '2' => 'Shotgun'], 'Type de départs', $datas->typeconfigdepart_id, 3); Xform::endRow(); Xform::startRow(); Xform::addText('nbjoueurs', $nbJoueurLibelle, $datas->nbjoueurs, 3); Xform::addSelect('starttee', ['1' => 1, '10' => 10], 'Au Trou', $datas->starttee, 2); Xform::addText('startheure', 'Commence à', $datas->startheure, 2); Xform::addSelect('interval', ['9' => '9 min', '10' => '10 min'], 'Toutes les', $datas->interval, 2); Xform::endRow(); Xform::startRow(); Xform::addSelect('slotbyflight', $nbJoueurDansFlightSelect, $nbJoueurDansFlight, $datas->slotbyflight, 4); Xform::addSelect('startergap', ['0' => 0, '1' => 1, '2' => 2, '3' => 3], 'Starter gap', $datas->startergap, 2);
$datas = $dsp->var['param']['datas']; $param = $dsp->var['param']; ?> {{ openContent($param['titre']) }} <?php // Open Form Xform::form('route', 'tour.create'); // Hidden Xform::startRow('hidden'); Xform::addText('_token', 'x', Session::getToken(), 2); Xform::addText('id', 'ID', $datas->id, 2); Xform::addText('backUrl', '', $param['backUrl']); Xform::addText('compet_id', 'COMPET_ID', MySession::getModel('compet')->id, 1); Xform::endRow(); // Get Fields Xform::startRow(); Xform::addDate('datetour', 'Date', $datas->datetour, 2); Xform::addSelect('formulecompet_id', $datas->compet->typecompet->listFormules(), 'Formule de jeu', $datas->formulecompet_id, 3); Xform::endRow(); // Buttons Xform::addSubmit(); Xform::addCancel($param['backUrl']); // Message bottom //Xform::addMessage('Ceci est un message'); ?> <!-- Close Form --> {{ Xform::show($errors,'left') }}
$datas = $dsp->var['param']['datas']; $param = $dsp->var['param']; ?> {{ openContent($param['titre']) }} <?php // Open Form Xform::form('route', 'compet.create'); // Hidden Xform::startRow('hidden'); Xform::addText('_token', 'x', Session::getToken(), 2); Xform::addText('id', 'ID', $datas->id, 2); Xform::addText('backUrl', '', $param['backUrl']); Xform::addText('domaine_id', 'DOMAINE_ID', MySession::getModel('domaine', 'domaine')->id, 1); Xform::endRow(); // Get Fields Xform::startRow(); Xform::addText('nom', 'Nom de la compétition', $datas->nom, 5); Xform::addDate('date', 'Date', $datas->date, 2); Xform::addSelect('nbtours', ['1' => 1, '2' => 2, '3' => 3, '4' => 4], 'Nombre de tours', $datas->nbtours, 3); Xform::endRow(); Xform::startRow(); Xform::addSelect('genrecompet_id', Genrecompet::lists('libelle', 'id'), 'Genre', $datas->genrecompet_id, 3); Xform::addSelect('typecompet_id', Typecompet::lists('libelle', 'id'), 'Type', $datas->typecompet_id, 3); Xform::addSelect('modecompet_id', Modecompet::lists('libelle', 'id'), 'Type', $datas->modecompet_id, 3); Xform::endRow(); Xform::startRow(); Xform::addText('maxplayers', 'Nombre de joueurs max', $datas->maxplayers, 4); Xform::addSelect('teeselection', [0 => 'Défini par la catégorie', 1 => 'Choix du joueur'], 'Selection du tee de départ', $datas->teeselection, 4);
<?php // listItem : nom de la procedure dans le model $listItem = 'newListItem'; // Datas $datas = MySession::getModel('compet')->entrees; // Sub-titre $param['sub-titre'] = 'Les inscriptions'; // Add Route $param['addRoute'] = 'player.selectpage'; $param['addText'] = 'Nouvelle inscription'; // Open Route $param['openRoute'] = ''; // Edit Route $param['editRoute'] = ''; $param['editText'] = ''; // Delete Route $param['deleteRoute'] = 'entreeplayer.delete'; $param['deleteText'] = ''; // Select Route $param['selectRoute'] = ''; $param['selectText'] = ''; $param['afterRoute'] = ''; // Actions $param['actions'] = 'delete'; // BackUrl $param['backUrl'] = 'entree'; ?> <div class="information white">
public function beforeCreate($id) { // Extend function create() // Format startheure (ex : 08:00) $this->dsp->var['param']['datas']['startheure'] = showHeure($this->dsp->var['param']['datas']['startheure']); // Nombre de joueurs (teams) dispo : Compet->maxjoueurs si création if ($this->dsp->var['param']['datas']['nbjoueurs'] == 0) { $this->dsp->var['param']['datas']['nbjoueurs'] = MySession::getModel('tour')->configDepartMaxPlace($id); } }
<?php $entrees = MySession::getModel('compet')->entrees; ?> {{ openContent(gl('Liste des inscriptions')) }} <div> {{ Xbutton::bttBack('compet') }} {{ Xbutton::bttAdd('player.selectpage',['entree'],'Ajouter un joueur') }} </div> <?php $teamPlayers = MySession::getModel('compet')->typecompet->nbplayers; ?> <table class="table table-condensed"> @foreach( MySession::getModel('compet')->entrees as $entree ) @if( $teamPlayers > 1 ) {{ Xtable::tr() }} {{ Xtable::openTd(['colspan'=>'99']) }} <table class="table table-condensed"> {{ Xtable::tr() }} {{ Xtable::openTd() }} <b>{{ MySession::getModel('compet')->typeDescription('',true,false) }}</b>
<div class="information white"> <div class="bloc-page-titre"> <table width="100%"> <tr> <td>{{ gl('Les configurations de départs') }}</td> <td class="right">{{ Xbutton::bttAdd('configdepart.create',['tour'],'Ajouter une Configuration') }}</td> </tr> </table> </div> <div> <?php $cat['datas'] = MySession::getModel('tour')->configdeparts; $cat['module'] = ''; $cat['actions'] = 'edit,delete'; $cat['backUrl'] = 'tour'; $catDatas = Dispatch::displayList($cat); ?> {{ $catDatas['code'] }} </div> </div>
<?php // listItem : nom de la procedure dans le model $listItem = 'newListItem'; // Datas $datas = MySession::getModel('domaine')->compets; // Sub-titre $param['sub-titre'] = 'Les compétitions'; // Add Route $param['addRoute'] = 'compet.create'; $param['addText'] = 'Ajouter une compétition'; // Open Route $param['openRoute'] = 'compet.open'; // Edit Route $param['editRoute'] = 'compet.create'; $param['editText'] = ''; // Delete Route $param['deleteRoute'] = 'compet.delete'; $param['deleteText'] = ''; // Select Route $param['selectRoute'] = ''; $param['selectText'] = ''; $param['afterRoute'] = ''; // Actions $param['actions'] = 'open,edit,delete'; // BackUrl $param['backUrl'] = 'domaine'; ?> <div class="information white">