/** * @param array $params * @param Smarty_Internal_Template $smarty * * @throws SmartyException * @return string * * @author Kovács Vince */ function smarty_function_form_select($params, Smarty_Internal_Template &$smarty) { if (!isset($params['_name'])) { throw new SmartyException('Missing _name attribute for form_select tag'); } $name = $params['_name']; $list = isset($params['_list']) ? $params['_list'] : array(); if (isset($params['_default'])) { $list = array('' => $params['_default']) + $list; } $selected = isset($params['_selected']) ? $params['_selected'] : (isset($params['_populate']) && $params['_populate'] ? \Input::get($name) : null); $range = isset($params['_range']) && $params['_range']; unset($params['_name']); unset($params['_list']); unset($params['_selected']); unset($params['_range']); unset($params['_populate']); if ($range) { if (!isset($params['_begin'])) { throw new SmartyException('Missing _begin attribute for form_select tag'); } if (!isset($params['_end'])) { throw new SmartyException('Missing _end attribute for form_select tag'); } $begin = $params['_begin']; $end = $params['_end']; unset($params['_begin']); unset($params['_end']); return Form::selectRange($name, $begin, $end, $selected, $params); } return Form::select($name, $list, $selected, $params); }
@extends('layout.master') @section('content') {!! Form::open() !!} <?php isset($request->numOfUsers) ? $n = $request->numOfUsers : ($n = 1); echo Form::selectRange('numOfUsers', 1, 20, $n) . " "; echo Form::label('lNumOfUsers', 'Number of Users'); echo '<br><br>'; isset($request->birthdate) ? $selected = true : ($selected = false); echo Form::checkbox('birthdate', 'birthdate', $selected); echo Form::label('lBirthdate', 'Birthdate'); echo '<br>'; isset($request->address) ? $selected = true : ($selected = false); echo Form::checkbox('address', 'address', $selected); echo Form::label('lAddress', 'Address'); echo '<br>'; isset($request->profile) ? $selected = true : ($selected = false); echo Form::checkbox('profile', 'profile', $selected); echo Form::label('lProfile', 'Profile'); echo '<br><br>'; echo Form::submit('Submit'); ?> {!! Form::close() !!} <p> @if(isset($users)) @foreach($users as $user) <h3> {{ $user->name }} </h3> <?php
@if(isset($pWord)) <div class="center"> <h2><?php echo $pWord; ?> </h2> </div> @endif </p> {!! Form::open() !!} <?php isset($request->numOfWords) ? $n = $request->numOfWords : ($n = 1); echo Form::selectRange('numOfWords', 1, 3, $n) . " "; echo Form::label('lNumOfWords', 'Number of Words'); echo '<br><br>'; isset($request->numOfChars) ? $n = $request->numOfChars : ($n = 0); echo Form::selectRange('numOfChars', 0, 3, $n) . " "; echo Form::label('lNumOfChars', 'Number of Characters'); echo '<br><br>'; isset($request->numOfNums) ? $n = $request->numOfNums : ($n = 0); echo Form::selectRange('numOfNums', 0, 3, $n) . " "; echo Form::label('lNumOfNums', 'Number of Nums'); echo '<br><br>'; echo Form::submit('Submit'); ?> {!! Form::close() !!} @stop
" data-date-format="mm-dd-yyyy"> <input value="<?php echo $data_esdeveniment; ?> " name="data" class="form-control" type="text" readonly="" style="width:150px;"> <span class="input-group-addon" style="width:0%; cursor:pointer"> <img src="/laravel/public/img/calendar_bootstrap.png" alt="Moderar" height="16" width="16"> </span> </div> <div style="display:inline-block; overflow: hidden"> <?php echo Form::selectRange('hora', 0, 23, $hora, array('class' => 'form-control', 'style' => 'width:85px; float:left; margin-right:10px; margin-left:14px;')); ?> <?php echo Form::label('punts', ':', array('style' => 'margin-top:6px;')); ?> </div> <?php $minuts = array(); $minuts['00'] = '00'; $minuts['05'] = '05'; $minuts['10'] = '10'; $minuts['15'] = '15'; $minuts['20'] = '20'; $minuts['25'] = '25';
@if(isset($pWord)) <div class="center"> <h2><?php echo $pWord; ?> </h2> </div> @endif </p> {!! Form::open() !!} <?php isset($request->numOfWords) ? $n = $request->numOfWords : ($n = 1); echo Form::selectRange('numOfWords', 1, 3, $n, ['id' => 'numOfWords']) . " "; echo Form::label('numOfWords', 'Number of Words'); echo '<br><br>'; isset($request->numOfChars) ? $n = $request->numOfChars : ($n = 0); echo Form::selectRange('numOfChars', 0, 3, $n, ['id' => 'numOfChars']) . " "; echo Form::label('numOfChars', 'Number of Characters'); echo '<br><br>'; isset($request->numOfNums) ? $n = $request->numOfNums : ($n = 0); echo Form::selectRange('numOfNums', 0, 3, $n, ['id' => 'numOfNums']) . " "; echo Form::label('numOfNums', 'Number of Nums'); echo '<br><br>'; echo Form::submit('Submit'); ?> {!! Form::close() !!} @stop
<?php // Form::macro('selectRangeWithDefault', function ($name, $start, $end, $selected = null, $default = null, $attributes = []) { if ($default === null) { return Form::selectRange($name, $start, $end, $selected, $attributes); } $items = []; if (!in_array($default, $items)) { $items['NULL'] = $default; Log::info('This is some useful information.'); } if ($start > $end) { $interval = -1; $startValue = $end; $endValue = $start; } else { $interval = 1; $startValue = $start; $endValue = $end; } for ($i = $startValue; $i < $endValue; $i += $interval) { $items[$i . ""] = $i; } $items[$endValue] = $endValue; return Form::select($name, $items, isset($selected) ? $selected : $default, $attributes); });
echo Form::email('emailrep', null, array('placeholder' => 'Repetir Email', 'class' => 'form-control', 'required', 'maxlength' => '60')); ?> <br/> <?php echo Form::password('contrasenya', array('placeholder' => 'Contraseña', 'class' => 'form-control', 'data-toggle' => 'popover', 'data-placement' => 'right', 'data-content' => 'Debe tener mínimo 6 carácteres', 'required', 'pattern' => '.{6,20}')); ?> <br/> <?php echo Form::label('fecha', 'Fecha de nacimiento: '); ?> <br/> <?php echo Form::selectRange('dia', 1, 31, null, array('class' => 'form-control', 'style' => 'width:85px; float:left; margin-right:45px; margin-left:35px;')); echo Form::selectRange('mes', 1, 12, null, array('class' => 'form-control', 'style' => 'width:85px; float:left; margin-right:45px;')); echo Form::selectRange('any', 2000, 1910, null, array('class' => 'form-control', 'style' => 'width:100px; float:left;')); ?> <br/> <br/> <br/> <small>Al crear una cuenta aceptas nuestra <a href="<?php echo route('politica.privacitat'); ?> "> política de privacidad </a> </small>
<br/> <?php echo Form::label('fecha', 'Fecha de nacimiento: '); ?> <br/> <?php $emaillog = Auth::user()->email_estudiant; $estudiant = Estudiant::find($emaillog); $mi_nacimiento = $estudiant->getData(); $mi_dia = date("d", strtotime($mi_nacimiento)); $mi_mes = date("m", strtotime($mi_nacimiento)); $mi_any = date("Y", strtotime($mi_nacimiento)); echo Form::selectRange('dia', 1, 31, $mi_dia, array('class' => 'form-control', 'style' => 'width:85px; float:left; margin-right:45px; margin-left:35px;')); echo Form::selectRange('mes', 1, 12, $mi_mes, array('class' => 'form-control', 'style' => 'width:85px; float:left; margin-right:45px')); echo Form::selectRange('any', 2000, 1910, $mi_any, array('class' => 'form-control', 'style' => 'width:100px; float:left; margin-right:10px')); ?> <br/> <br/> <br/> <?php echo Form::submit('Actualizar', array('class' => 'btn btn-primary btn-sm', 'style' => 'float:right;')); echo Form::close(); ?> </div> <br/> <?php $descripcio = $estudiant->getDescripcio();
@extends('layout.master') @section('content') {!! Form::open() !!} <?php isset($request->numOfParagraphs) ? $n = $request->numOfParagraphs : ($n = 1); echo Form::selectRange('numOfParagraphs', 1, 20, $n) . " "; echo Form::label('lNumOfParagraphs', 'Number of Paragraphs'); echo '<br><br>'; echo Form::submit('Submit'); ?> {!! Form::close() !!} <p> @if(isset($request->numOfParagraphs)) <?php $generator = new Badcow\LoremIpsum\Generator(); $paragraphs = $generator->getParagraphs($request->numOfParagraphs); echo implode('<p>', $paragraphs); ?> @endif </p> @stop
<?php echo Form::selectRange('days', 0, 2, null, array('class' => 'form-control')); ?> </div> <div class="input-group" style="margin-bottom: 10px;"> <span class="input-group-addon">Hours:</span> <?php echo Form::selectRange('hours', 0, 24, null, array('class' => 'form-control')); ?> </div> <div class="input-group" style="margin-bottom: 10px;"> <span class="input-group-addon">Minutes:</span> <?php echo Form::selectRange('mins', 0, 60, null, array('class' => 'form-control')); ?> </div> </div> <div class="form-group"> <?php echo Form::label('timerType', 'Timer Type'); ?> <?php echo Form::select('timerType', Timers::$timerType, '', array('id' => 'timerType', 'class' => 'form-control')); ?> </div> <div class="form-group"> <?php
@extends('layout.master') @section('content') {!! Form::open() !!} <?php isset($request->numOfUsers) ? $n = $request->numOfUsers : ($n = 1); echo Form::selectRange('numOfUsers', 1, 20, $n, ['id' => 'numOfUsers']) . " "; echo Form::label('numOfUsers', 'Number of Users'); echo '<br><br>'; isset($request->birthdate) ? $selected = true : ($selected = false); echo Form::checkbox('birthdate', 'birthdate', $selected, ['id' => 'birthdate']); echo Form::label('birthdate', 'Birthdate'); echo '<br>'; isset($request->address) ? $selected = true : ($selected = false); echo Form::checkbox('address', 'address', $selected, ['id' => 'address']); echo Form::label('address', 'Address'); echo '<br>'; isset($request->profile) ? $selected = true : ($selected = false); echo Form::checkbox('profile', 'profile', $selected, ['id' => 'profile']); echo Form::label('profile', 'Profile'); echo '<br><br>'; echo Form::submit('Submit'); ?> {!! Form::close() !!} <p> @if(isset($users)) @foreach($users as $user) <h3> {{ $user->name }} </h3> <?php
</div> @endif <?php $inputAttributes = ['class' => 'form-control']; $labelAttributes = ['class' => 'col-md-4 control-label']; ?> {!! Form::open(['class'=>'form-horizontal', 'role'=>'form', 'method'=>'POST', 'url'=>'reserve-room']) !!} <?php Form::macro('monthDayYear', function ($suffix = '') { echo Form::selectMonth($suffix !== '' ? 'month-' . $suffix : 'month', date('m')); echo Form::selectRange($suffix !== '' ? 'date-' . $suffix : 'date', 1, 31, date('d')); echo Form::selectRange($suffix !== '' ? 'year-' . $suffix : 'year', date('Y'), date('Y') + 3, date('Y')); }); ?> {!! Form::open(['class'=>'form-horizontal','role'=>'form', 'method'=>'POST', 'url'=>'/reserve-room']) !!} {!! Form::label(null, 'Start Date',$labelAttributes) !!} {!! Form::monthDayYear('-start') !!} {!! Form::label(null, 'End Date',$labelAttributes) !!} {!! Form::monthDayYear('-end') !!} {!! Form::submit('Reserve',['class'=>'btn btn-primary', 'style'=>'margin-right: 15px;']) !!} {!! Form::close() !!} </div> </div> </div> </div>