/** * Process datatables ajax request. * * @return \Illuminate\Http\JsonResponse */ public function search() { $auth_account = $this->auth_user->account; //return all accounts when we are in the system account //in a normal account only show the current linked one if ($auth_account->isSystemAccount()) { $accounts = Account::all(); } else { // retrieve the account as a collection $accounts = Account::where('id', '=', $auth_account->id)->get(); } return Datatables::of($accounts)->addColumn('actions', function ($account) { $actions = \Form::open(['route' => ['admin.accounts.destroy', $account->id], 'method' => 'DELETE', 'class' => 'form-inline']); $actions .= ' <a href="accounts/' . $account->id . '" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-eye-open"></span> ' . trans('misc.button.show') . '</a> '; $actions .= ' <a href="accounts/' . $account->id . '/edit" class="btn btn-xs btn-primary"><span class="glyphicon glyphicon-edit"></span> ' . trans('misc.button.edit') . '</a> '; if ($account->disabled) { $actions .= ' <a href="accounts/' . $account->id . '/enable' . '" class="btn btn-xs btn-success"><span class="glyphicon glyphicon-ok-circle"></span> ' . trans('misc.button.enable') . '</a> '; } else { $actions .= ' <a href="accounts/' . $account->id . '/disable' . '" class="btn btn-xs btn-warning"><span class="glyphicon glyphicon-ban-circle"></span> ' . trans('misc.button.disable') . '</a> '; } $actions .= \Form::button('<i class="glyphicon glyphicon-remove"></i> ' . trans('misc.button.delete'), ['type' => 'submit', 'class' => 'btn btn-danger btn-xs']); $actions .= \Form::close(); return $actions; })->make(true); }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::input_wrap('name', $this->blog_entry->name, array('class' => 'input-lg', 'placeholder' => __('Title')), null, Arr::get($this->errors, 'name')); ?> <?php echo Form::textarea_wrap('content', $this->blog_entry->content, array('class' => 'input-lg', 'placeholder' => __('Content')), true, null, Arr::get($this->errors, 'content'), null, true); ?> </fieldset> <fieldset> <?php echo Form::csrf(); ?> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : ''; ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Render view. * * @return string */ public function content() { ob_start(); if (self::$_request_type == Controller::REQUEST_AJAX) { $cancel_attributes = array('class' => 'ajaxify'); } else { $cancel_attributes = null; } echo Form::open($this->action, array('enctype' => 'multipart/form-data')); ?> <fieldset> <?php echo Form::file('file'); ?> </fieldset> <fieldset> <?php echo Form::csrf(); ?> <?php echo Form::button('save', '<i class="icon-upload icon-white"></i> ' . __('Upload'), array('type' => 'submit', 'class' => 'btn btn-primary btn-small')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), $cancel_attributes) : ''; ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
/** * Returns resource operations for the datatables or nested sets * * @param $resource * @param $id * @param $class * @return string */ function get_ops($resource, $id, $class = "btn") { if ($class == "btn") { $show_class = "btn btn-xs bg-navy"; $edit_class = "btn btn-xs bg-olive"; $delete_class = "btn btn-xs btn-danger destroy"; } else { $show_class = "inline-show"; $edit_class = "inline-edit"; $delete_class = "inline-delete"; } $show_path = route('admin.' . $resource . '.show', ['id' => $id]); $edit_path = route('admin.' . $resource . '.edit', ['id' => $id]); $delete_path = route('admin.' . $resource . '.destroy', ['id' => $id]); $ops = '<ul class="list-inline no-margin-bottom">'; $ops .= '<li>'; $ops .= '<a class="' . $show_class . '" href="' . $show_path . '"><i class="fa fa-search"></i> ' . trans('admin.ops.show') . '</a>'; $ops .= '</li>'; $ops .= '<li>'; $ops .= '<a class="' . $edit_class . '" href="' . $edit_path . '"><i class="fa fa-pencil-square-o"></i> ' . trans('admin.ops.edit') . '</a>'; $ops .= '</li>'; $ops .= '<li>'; $ops .= Form::open(['method' => 'DELETE', 'url' => $delete_path]); $ops .= Form::submit(' ' . trans('admin.ops.delete'), ['onclick' => "return confirm('" . trans('admin.ops.confirmation') . "');", 'class' => $delete_class]); $ops .= Form::close(); $ops .= '</li>'; $ops .= '</ul>'; return $ops; }
public function anyData() { $hotel = Hoteluri::with('HoteluriOferte'); return Datatables::of($hotel)->addColumn('action', function ($hotel) { return '<a href="' . url('auth/hoteluri', [$hotel->id, 'edit']) . '"><button type="submit" class="btn btn-primary btn-xs">Modifica</button></a> ' . \Form::open(['method' => 'DELETE', 'url' => ['auth/hoteluri', $hotel->id], "style" => "display:inline"]) . '<button type="submit" class="btn btn-danger btn-xs" onclick="if(confirm(\'Sigur doriti sa stergeti?\')) return true; else return false; ">Sterge</button>' . \Form::close(); })->make(true); }
/** * @param array $params * @param string $content * @param Smarty_Internal_Template $smarty * @param boolean $repeat * * @return string * * @author Kovács Vince */ function smarty_block_form($params, $content, Smarty_Internal_Template &$smarty, &$repeat) { if (is_null($content)) { return ''; } return Form::open($params) . $content . Form::close(); }
function delete_form($routeParams, $label = 'Delete') { $form = Form::open(['method' => 'DELETE', 'action' => $routeParams]); //dd($form); $form .= Form::submit($label, ['class' => 'btn btn-danger']); return $form .= Form::close(); }
function delete_to_route($routeName, $id) { $form = Form::open(['route' => [$routeName, $id], 'method' => 'delete']); $form .= Form::submit(Message::DELETE_BUTTON, ['class' => 'btn btn-danger', 'onclick' => 'return confirm("' . Message::DELETE_CONFIRM . '");']); $form .= Form::close(); return $form; }
function delete_form($url, $label = '<i class="fa fa-close"></i>') { $form = Form::open(['method' => 'DELETE', 'url' => $url, 'class' => 'destroy-form']); $form .= '<button type="submit" class="btn btn-link">' . $label . '</button>'; $form .= Form::close(); return $form; }
/** * Button generator for buttons used for @destroy actions * * @return string */ public function buttonDestroy($route, $extra) { $button = $this->open('destroy', $route, $extra); $button .= \Form::submit('Delete'); $button .= \Form::close(); return $button; }
/** * Delete form * @param $params * @param string $label * @return string */ function deleteForm($params, $label = 'Delete') { $html = Form::open(['method' => 'DELETE', 'route' => $params, 'class' => 'delete-form']); $html .= Form::submit($label, ['class' => 'btn btn-danger btn-delete']); $html .= Form::close(); return $html; }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::control_group(Form::input('name', $this->blog_entry->name, array('class' => 'input-xxlarge')), array('name' => __('Title')), Arr::get($this->errors, 'name')); ?> <?php echo Form::control_group(Form::textarea_editor('content', $this->blog_entry->content, array('class' => 'input-xxlarge'), true), array('content' => __('Content')), Arr::get($this->errors, 'content')); ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::csrf(); ?> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : ''; ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
function delete_form($request, $routeParams, $id, $modal, $url, $label = "Delete", $class = "btn btn-danger") { $form = Form::model($request, ['method' => 'DELETE', 'id' => 'formDelete', 'action' => [$routeParams, $id]]); $form .= Form::button('<i class="fa fa-trash fa-lg"></i> بلی', ['type' => 'submit', 'data-target' => "#{$modal}", 'data-url' => "{$url}", 'class' => "{$class} delete ", 'id' => 'btnDelete', 'data-id' => $id]); $form .= Form::close(); return $form; }
public function process($only_fields = FALSE) { $this->_fields_required['id'] = $this->_pos_data['id']; if (empty($this->_fields['URL'])) { $this->_fields['URL'] = url::site($this->action_return()); } foreach ($this->_fields_required as $field) { if (empty($field)) { return FALSE; } } $fields = array_merge($this->_fields_required, $this->_fields); $form = ''; if (!$only_fields) { $form .= Form::open(self::PAYMENT_URL, array('method' => 'post', 'name' => 'dotpay')); } foreach ($fields as $key => $value) { if (!empty($value)) { $form .= Form::hidden($key, $value); } } if (!$only_fields) { $form .= Form::button('platnosci', __("Przejdź do Dotpay.pl"), array('type' => 'submit')); $form .= Form::close(); $form .= '<script type="text/javascript">document.dotpay.submit();</script>'; } return $form; }
/** * Render view. * * @return string */ public function content() { ob_start(); echo Form::open(); ?> <fieldset> <?php echo Form::control_group(Form::input('name', $this->tag->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name')); ?> <?php echo Form::control_group(Form::input('description', $this->tag->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description')); ?> </fieldset> <fieldset class="form-actions"> <?php echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large')); ?> <?php echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel')); ?> </fieldset> <?php echo Form::close(); return ob_get_clean(); }
function delete_to_route_with_lang($params) { $form = Form::open(['route' => $params, 'method' => 'delete']); $form .= Form::submit(trans('messages.button_delete'), ['class' => 'btn btn-danger btn-sm', 'onclick' => 'return confirm("' . trans('messages.delete_confirm') . '");']); $form .= Form::close(); return $form; }
public function process($only_fields = FALSE) { if (empty($this->_fields_required['pos_id']) && empty($this->_fields_required['pos_auth_key'])) { $this->_set_active_pos(); } foreach ($this->_fields_required as $field) { if (empty($field)) { return FALSE; } } $this->_fields['ts'] = time(); $fields = array_merge($this->_fields_required, $this->_fields); $data = array('pos_id' => $fields['pos_id'], 'pay_type' => $fields['pay_type'], 'session_id' => $fields['session_id'], 'pos_auth_key' => $fields['pos_auth_key'], 'amount' => $fields['amount'], 'desc' => $fields['desc'], 'desc2' => $fields['desc2'], 'order_id' => $fields['order_id'], 'first_name' => $fields['first_name'], 'last_name' => $fields['last_name'], 'payback_login' => $fields['payback_login'], 'street' => $fields['street'], 'street_hn' => $fields['street_hn'], 'street_an' => $fields['street_an'], 'city' => $fields['city'], 'post_code' => $fields['post_code'], 'country' => $fields['country'], 'email' => $fields['email'], 'phone' => $fields['phone'], 'language' => $fields['language'], 'client_ip' => $fields['client_ip'], 'ts' => $fields['ts'], 'key' => $this->_pos_data['key']); $fields['sig'] = $this->_get_sig($data); unset($fields['key']); if (!$only_fields) { $form = Form::open(self::PAYMENT_URL . $this->_codepage . '/' . self::PAYMENT_NEW, array('method' => 'post', 'name' => 'platnoscipl')); } foreach ($fields as $key => $value) { if (!empty($value)) { $form .= Form::hidden($key, $value); } } if (!$only_fields) { $form .= Form::button('platnosci', __("Przejdź do Płatności.pl"), array('type' => 'submit')); $form .= Form::close(); $form .= '<script type="text/javascript">document.platnoscipl.submit();</script>'; } return $form; }
function delete_form($urlParams, $label = '削除') { $form = Form::open(['method' => 'DELETE', 'url' => $urlParams]); $form .= Form::submit($label, ['class' => 'btn btn-danger']); $form .= Form::close(); return $form; }
/** * Render view. * * @return string */ public function content() { ob_start(); echo $this->message; echo Form::open(); echo Form::input_wrap('email', $this->email, array('type' => 'email', 'required', 'class' => 'input-lg', 'placeholder' => __('Username or email')), __('Send a new password to'), null, __('We will send you a "new" password generated from the hash of your current, forgotten password.') . '<br><em>' . __('Please change your password after signing in!') . '</em>'); echo Form::button(null, '<i class="fa fa-envelope"></i> ' . __('Send'), array('class' => 'btn btn-primary')); echo Form::close(); ?> <hr /> <blockquote cite="http://dilbert.com/strips/comic/1996-09-05/"> <dl class="dl-horizontal"> <dt>Asok:</dt> <dd>I have forgotten my password. I humbly beg for assistance.</dd> <dt>Dogbert:</dt> <dd>I have no time for boring administrative tasks, you fool! I'm too busy upgrading the network.</dd> <dt>Asok:</dt> <dd>You could have given me a new password in the time it took to belittle me.</dd> <dt>Dogbert:</dt> <dd>Yeah, but which option would give me job satisfaction?</dd> </dl> <small class="pull-right"><a href="http://dilbert.com/strips/comic/1996-09-05/">Dilbert</a></small> </blockquote> <?php return ob_get_clean(); }
public function get_formulario() { $variable = Form::open(['url' => '/usuarios/formulario', 'method' => 'post']); $variable .= Form::text('campo'); $variable .= Form::submit('Enviar'); $variable .= Form::close(); return $variable; }
public function get_login() { echo "Hello! Welcome to the login page!"; echo Form::open('user/login', 'POST'); echo Form::text('username'); echo Form::submit('Click Me!'); echo Form::close(); }
/** * Display a listing of the resource. * * @return Response */ public function index() { echo Form::open(array('url' => 'l/ingreso', 'method' => 'post')); echo Form::text('username'); echo Form::text('password'); echo Form::submit('enviar'); echo Form::close(); }
/** * Form Component */ public static function formComponent() { $_templates = Themes::getTemplates(); foreach ($_templates as $template) { $templates[basename($template, '.template.php')] = basename($template, '.template.php'); } echo '<div class="col-xs-3">' . Form::open() . Form::hidden('csrf', Security::token()) . Form::label('sandbox_form_template', __('Sandbox template', 'sandbox')) . Form::select('sandbox_form_template', $templates, Option::get('sandbox_template'), array('class' => 'form-control')) . Html::br() . Form::submit('sandbox_component_save', __('Save', 'sandbox'), array('class' => 'btn btn-default')) . Form::close() . '</div>'; }
public function testWrap() { Form::open(['url' => '/formurl']); $field = Form::field('Field Title', 'textfield', 'control', 'help text'); Form::close(); $this->assertContains('<label for="textfield" class="col-md-3 control-label">Field Title</label>', $field); $this->assertContains('<p class="help-block">help text</p>', $field); $this->assertContains('control', $field); }
public function anyData() { $oferte = PrimaPaginaOferte::with('categorie'); return Datatables::of($oferte)->editColumn('Activ', function ($oferte) { return $oferte->Activ != 0 ? $val = 'Da' : ($val = 'Nu'); })->addColumn('action', function ($oferte) { return '<a href="' . url('auth/primapaginaoferte', [$oferte->id, 'edit']) . '"><button type="submit" class="btn btn-primary btn-xs">Modifica</button></a> ' . \Form::open(['method' => 'DELETE', 'url' => ['auth/primapaginaoferte', $oferte->id], "style" => "display:inline"]) . '<button type="submit" class="btn btn-danger btn-xs" onclick="if(confirm(\'Sigur doriti sa stergeti?\')) return true; else return false; ">Sterge</button>' . \Form::close(); })->make(true); }
public function testForm() { $html = Form::open(['url' => '/formurl']); $html .= Form::close(); $this->assertContains('/formurl', $html); $this->assertContains('<form method="POST"', $html); $this->assertContains('name="_token"', $html); $this->assertContains('</form>', $html); }
/** * Update Resource Readed Status * * @param array $routeParams * @param string $icon "Font Awesome Examples: check, eye, pencil" * @param string $size * @return Callable */ function update_readed_status($routeParams = [], $textColor = 'default', $icon = 'asterisk', $size = 'lg') { $form = Form::open(['route' => $routeParams, 'method' => 'patch', 'class' => 'inline']); $form .= '<button type="submit" class="btn btn-default">'; $form .= '<i class="text-' . $textColor . ' fa fa-' . $icon . ' fa-' . $size . '"></i>'; $form .= '</button>'; $form .= Form::close(); return $form; }
protected function doDisplay(array $context, array $blocks = array()) { // line 1 echo "<!-- Modal -->\n"; // line 2 echo Form::open("fanpage/add_fanpage"); echo "\n<div class=\"modal fade\" id=\"myModal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h4 class=\"modal-title\" id=\"myModalLabel\">Add new fanpage</h4>\n </div>\n <div class=\"modal-body\">\n <div class=\"form-group\">\n <label>Select a fanpage</label>\n <select class=\"form-control\" name=\"fanpage\">\n <?php if (!empty(\$user_pages)): ?>\n <?php foreach(\$user_pages as \$item): ?>\n <option value=\"<?php echo \$item['id'] ?>\" ><?php echo \$item['name'] ?></option>\n <?php endforeach; ?>\n <?php endif; ?> \n </select>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n <input type=\"submit\" name=\"submit\" class=\"btn btn-primary\" value=\"Save\"/>\n </div>\n </div>\n <!-- /.modal-content -->\n </div>\n <!-- /.modal-dialog -->\n</div>\n"; // line 31 echo Form::close(); }
/** * [delete_form_x description] * @param [type] $route [description] * @param [type] $parameters [description] * @param array $btnOptions [description] * @param array $frmOptions [description] * @return [type] [description] */ function delete_form_x($route, $parameters = null, $btnOptions = [], $frmOptions = []) { $btnDefaults = ['d_class' => 'btn', 'class' => 'btn-link', 'type' => 'submit', 'name' => 'deleteBtn', 'label' => "<i class='text-danger fa fa-remove'></i>", 'style' => '']; $btnOptions = array_merge($btnDefaults, $btnOptions); $frmDefaults = ['class' => '', 'name' => 'delete_form', 'name' => 'deleteBtn', 'method' => 'DELETE', 'display' => 'inline-block']; $frmOptions = array_merge($frmDefaults, $frmOptions); $form = Form::open(['route' => [$route, $parameter], 'method' => $frmOptions['method'], 'form_name' => $frmOptions['form_name'], 'id' => $frmOptions['form_name'], 'style' => $frmOptions['style'] . '; display: ' . $frmOptions['display']], $parameters); $form .= Form::button($btnOptions['label'], ['class' => $btnOptions['d_class'] . ' ' . $btnOptions['class'], 'type' => $btnOptions['type'], 'id' => $btnOptions['name'], 'name' => $btnOptions['name'], 'style' => $btnOptions['style']]); return $form .= Form::close(); }
public function anyData(Request $request) { DB::statement(DB::raw('set @rownum=0')); $pagini = PaginiStatice::select(['id', 'Ord', 'Nume', 'Zona', 'slug']); $datatables = Datatables::of($pagini)->editColumn('Nume', function ($row) { return "<a href='" . url('static/' . $row['slug']) . "' target='_blank'>" . $row['Nume'] . "</a>"; })->addColumn('action', function ($pagini) { return '<a href="' . url('auth/pagini_statice', [$pagini->id, 'edit']) . '"><button type="submit" class="btn btn-primary btn-xs">Modifica</button></a> ' . \Form::open(['method' => 'DELETE', 'url' => ['auth/pagini_statice', $pagini->id], "style" => "display:inline"]) . '<button type="submit" class="btn btn-danger btn-xs" onclick="if(confirm(\'Sigur doriti sa stergeti?\')) return true; else return false; ">Sterge</button>' . \Form::close(); }); return $datatables->make(true); }