Ejemplo n.º 1
2
 protected function launch()
 {
     echo Html::beginForm($this->url, 'get');
     echo Html::input('text', $this->queryParam, $this->query);
     echo Html::submitButton(\Yii::t('gromver.platform', 'Find'));
     echo Html::endForm();
 }
Ejemplo n.º 2
2
 public function run()
 {
     SelectAsset::register($this->view);
     FilterAsset::register($this->view);
     $values = [];
     foreach ($this->data as $value) {
         $value = strval($value);
         $values[$value] = $value;
     }
     if (!$this->default) {
         $this->default = $this->multiple ? array_keys($values) : key($values);
     }
     $selected = $this->selected($this->default);
     // Setup options
     $options = ['id' => $this->name, 'name' => $this->name . '[]', 'style' => 'width: 300px;', 'class' => 'selectpicker'];
     $extra = ['title' => 'Not selected'];
     if ($this->multiple) {
         $extra['multiple'] = 'multiple';
     }
     if ($this->placeholder) {
         $extra['title'] = strval($this->placeholder);
     }
     $options = array_merge($options, $extra);
     if (!$this->method) {
         $this->method = 'get';
     }
     // Render
     echo Html::beginForm(Url::canonical(), $this->method, ['data-pjax' => '1', 'id' => $this->name]);
     echo Html::beginTag('select', $options, ['data-pjax' => '1']);
     echo Html::renderSelectOptions($selected, $values);
     echo Html::endTag("select");
     echo Html::endForm();
     parent::run();
 }
Ejemplo n.º 3
2
 public function actionForm()
 {
     echo Html::beginForm();
     echo Html::checkboxList('test', ['value 1' => 'item 1', 'value 2' => 'item 2', 'value 3' => 'item 3'], isset($_POST['test']) ? $_POST['test'] : null, function ($index, $label, $name, $value, $checked) {
         return Html::label($label . ' ' . Html::checkbox($name, $value, $checked), null, ['class' => 'inline checkbox']);
     });
     echo Html::submitButton();
     echo Html::endForm();
     print_r($_POST);
 }
Ejemplo n.º 4
1
 public function run()
 {
     $id = $this->getId();
     echo Html::beginForm(Url::canonical(), 'get', ['data-pjax' => '1', 'id' => $this->name]);
     echo Html::beginTag('div');
     echo Html::beginTag("select", ['id' => $id, 'multiple' => 'multiple', 'class' => 'invisible', 'style' => 'width: ' . $this->width . 'px;', 'name' => $this->name . '[]']);
     echo Html::renderSelectOptions($this->selectedValues, $this->_allValues);
     echo Html::endTag("select");
     echo Html::submitButton('OK', ['style' => 'margin: 0 5px;']);
     echo Html::endTag('div');
     echo Html::endForm();
     echo "<script type='text/javascript'>";
     echo "\$('#{$id}').removeClass('invisible');";
     echo "\$('#{$id}').multipleSelect()";
     echo "</script>";
 }
Ejemplo n.º 5
0
 public function run()
 {
     echo Html::beginForm(Url::to([$this->actionUrl]), 'post', []);
     if (!empty($this->returnUrl)) {
         echo Html::hiddenInput('returnUrl', $this->returnUrl);
     }
     echo Html::dropDownList('language', Yii::$app->language, Yii::$app->czaHelper->getEnabledLangs(), ['id' => $this->htmlId(), 'onchange' => 'this.form.submit()']);
     echo Html::endForm();
 }
Ejemplo n.º 6
0
 protected function honeypot()
 {
     $field = Html::beginTag('div', ['class' => '', 'style' => 'display:none']);
     $field .= Html::label(Yii::t('app', 'Excuse me, but leave this field in blank'), "_email", ['class' => 'control-label']);
     $field .= Html::textInput("_email", null, ['id' => '_email', 'class' => 'form-control']);
     $field .= Html::endTag('div') . ' ';
     $field .= Html::endForm();
     return $field;
 }
Ejemplo n.º 7
0
 /**
  * @return string
  */
 public function renderNavItem()
 {
     $output = '<li>' . Html::beginForm($this->action, $this->method, $this->formOptions) . '<div class="input-group">';
     $output .= Html::input('text', $this->name, $this->value, $this->inputOptions);
     $output .= '<div class="input-group-btn">';
     $output .= Html::button('<i class="glyphicon glyphicon-search"></i>', $this->buttonOptions);
     $output .= '</div></div>' . Html::endForm() . '</li>';
     return $output;
 }
Ejemplo n.º 8
0
 private function _getList()
 {
     $menuItems = [];
     if (\Yii::$app->user->isGuest) {
         //          $menuItems[] = ['label' => 'Signup', 'visible' => \humanized\user\Module::getInstance()->params['enableSignUp'], 'url' => ['/user/account/signup']];
         $menuItems[] = ['label' => 'Login', 'url' => ['/user/account/login']];
     } else {
         $menuItems[] = '<li>' . Html::beginForm(['/user/account/logout'], 'post') . Html::submitButton('Logout (' . \Yii::$app->user->identity->email . ')', ['class' => 'btn btn-link']) . Html::endForm() . '</li>';
     }
     return $urls;
 }
Ejemplo n.º 9
0
 /**
  * Renders the sort links.
  * @return string the rendering result
  */
 protected function renderSortLinks()
 {
     $attributes = empty($this->attributes) ? array_keys($this->sort->attributes) : $this->attributes;
     $links = [];
     foreach ($attributes as $key => $name) {
         $links[$name] = $name;
     }
     echo Html::beginForm(null, 'get', []);
     echo Html::dropDownList('sort', null, $links, ['prompt' => 'Sortiraj po']);
     echo Html::submitButton('<i class="fa fa-sort"></i>', ['class' => 'btn btn-default margin-left-5']);
     echo Html::endForm();
 }
Ejemplo n.º 10
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     $popover = '';
     $popover .= Html::beginForm($this->action);
     if ($this->content) {
         $popover .= $this->content;
     }
     $popover .= Html::submitButton($this->btnText, ['class' => 'btn btn-success']);
     $popover .= Html::hiddenInput('id', $this->model['id']);
     $popover .= Html::endForm();
     $this->content = $popover;
     return parent::run();
 }
Ejemplo n.º 11
0
 public function renderForm()
 {
     $action = ArrayHelper::remove($this->formOptions, 'action', '');
     $method = ArrayHelper::remove($this->formOptions, 'method', 'post');
     if (!isset($this->formOptions['id'])) {
         $this->formOptions['id'] = 'msg-form';
     }
     $content = Html::beginForm($action, $method, $this->formOptions);
     if (is_string($this->formView)) {
         $content .= $this->getView()->render($this->formView, array_merge(['widget' => $this], $this->formParams));
     } else {
         $content .= call_user_func($this->formView, $this);
     }
     $content .= Html::endForm();
     return $content;
 }
Ejemplo n.º 12
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     if (!empty($this->_fields)) {
         throw new InvalidCallException('Each beginField() should have a matching endField() call.');
     }
     if ($this->enableClientScript) {
         $id = $this->options['id'];
         $options = Json::htmlEncode($this->getClientOptions());
         $attributes = Json::htmlEncode($this->attributes);
         $view = $this->getView();
         ActiveFormAsset::register($view);
         $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
     }
     echo Html::endForm();
     $this->registerClientEvents();
 }
Ejemplo n.º 13
0
 private function buildForm()
 {
     $id = $this->_config['formId'];
     $opts = [];
     if ($id != '') {
         $opts['id'] = $id;
     }
     $form = Html::beginForm($this->_action, 'post', $opts);
     $form .= Html::hiddenInput('formid', $this->blockId);
     $form .= $this->renderFields();
     $form .= $this->renderCaptcha();
     $form .= $this->renderNote();
     $form .= Html::tag('div', Html::submitButton('Отправить'));
     $form .= Html::endForm();
     $form .= Html::tag('div', '', ['id' => 'feedback-message']);
     $this->registerScript();
     return $form;
 }
Ejemplo n.º 14
0
 public static function end()
 {
     $w = self::$stack[count(self::$stack) - 1];
     $view = $w->getView();
     if ($c = count($w->structurePath) > 0) {
         throw new \yii\base\Exception(sprintf("%d unclosed relations", $c));
     }
     echo Html::endForm();
     $w->createMappings();
     // if we don't have any data, initialize empty attributes, otherwise attributes are not created by mapping
     if (empty($w->data)) {
         foreach ($w->structure as $key => $value) {
             foreach ($value as $key2 => $value2) {
                 $w->data[$key2] = null;
             }
         }
     }
     if ($w->bind) {
         $w->bind($w->data, $w->errors);
     }
     parent::end();
 }
Ejemplo n.º 15
0
 /**
  * Renders the page buttons.
  * 
  * @return string the rendering result
  */
 protected function renderPageButtons()
 {
     // <div class="pagination" rel="jbsxBox" totalCount="<?php echo $totalCount;"
     // numPerPage=" echo $numPerPage;" pageNumShown="5"
     // currentPage=" echo $currentPage;"></div>
     //总条数
     $totalCount = $this->pagination->totalCount;
     // 总页数
     $pageCount = $this->pagination->getPageCount();
     // 当前页
     $currentPage = $this->pagination->getPage() + 1;
     // 每页大小
     $pageSize = $this->pagination->getPageSize();
     $options = ArrayHelper::merge(['rel' => $this->rel, 'totalCount' => $totalCount, 'numPerPage' => $pageSize, 'currentPage' => $currentPage, 'pageNumShown' => 5, 'targetType' => $this->targetType], $this->options);
     $pagerForm = '';
     $pagerForm .= Html::beginForm(Yii::$app->request->absoluteUrl, 'POST', ['id' => 'pagerForm']);
     $pagerForm .= Html::hiddenInput('pageNum', 1);
     $pagerForm .= Html::hiddenInput('numPerPage', $pageSize);
     $pagerForm .= Html::endForm();
     $html = '<div class="' . $this->options['class'] . '" targetType="' . $this->targetType . '" totalCount="' . $totalCount . '" numPerPage="' . $pageSize . '" pageNumShown="10" currentPage="' . $currentPage . '"></div>';
     return $pagerForm . $html;
     //return $pagerForm.Html::tag('div', '',$options);
 }
Ejemplo n.º 16
0
<h4>Managers</h4> 
<?php 
use yii\bootstrap\Html;
?>
 
			<?php 
echo Html::beginForm('managers');
?>
 
			
			These are the managers for the group
			<p>&nbsp;</p>
		<?php 
echo Html::dropDownList('managers', array_keys(\yii::$app->CollectionComponent->managerList($collectionModel->id)), \yii::$app->CollectionComponent->managerList($collectionModel->id), ['multiple' => 'multiple', 'id' => 'manager-select', 'style' => 'width:80%']);
?>
 
<?php 
echo \yii\helpers\Html::endForm();
?>
 
Ejemplo n.º 17
0
 public function testEndForm()
 {
     $this->assertEquals('</form>', Html::endForm());
 }
Ejemplo n.º 18
0
 /**
  * Runs the widget.
  * This registers the necessary javascript code and renders the form close tag.
  */
 public function run()
 {
     echo Html::endTag('div');
     echo $this->renderActions(self::BUTTONS_POSITION_BOTTOM);
     if (!empty($this->attributes)) {
         $id = $this->options['id'];
         $options = Json::encode($this->getClientOptions());
         $attributes = Json::encode($this->attributes);
         $view = $this->getView();
         ActiveFormAsset::register($view);
         $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
     }
     if ($this->fake) {
         echo Html::endTag('div');
     } else {
         echo Html::endForm();
     }
 }
Ejemplo n.º 19
0
 /**
  * Runs the widget.
  * This registers the necessary javascript code and renders the form close tag.
  */
 public function run()
 {
     if (!empty($this->attributes)) {
         $id = $this->options['id'];
         $options = Json::encode($this->getClientOptions());
         $attributes = Json::encode($this->attributes);
         $view = $this->getView();
         ActiveFormAsset::register($view);
         $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
     }
     echo Html::endForm();
 }
$this->registerJs('$("#btnrem").on("click",function(){var input_insumo = \'inputinsumo\'+(i-1);$(\'#\'+input_insumo).empty();console.log(input_insumo);$("[name=\'idprodutoInsumo[]\']").remove();i = i-1;})');




?>			
</div>
<div class="form-group">
	<?= Html::submitButton($modelProdutoVenda->isNewRecord ? Yii::t('yii', 'Create') : Yii::t('yii', 'Update'), ['class' => 'btn btn-success']) ?>
	<input class="btn btn-primary" type='button' id='btnadd' value="Adicionar mais insumos">
	<!-- <input class="btn btn-primary" type='button' id='btnrem' value="Remover Insumo"> -->


</div>

<?php ActiveForm::end(); ?>


<?=  Html::beginForm('/applanchonete/web/insumos/create','post',['id'=>'idd']) ?>
<div id="dynamicInput">
</br>

</div>
<?= Html::endForm() ?>
</div>
<script type="text/javascript">
function removeins(id){
	$('#inputinsumo'+id).empty();
}

</script>
    /**
     * @inheritdoc
     */
    public function run()
    {
        echo Html::endForm();
        $id = $this->options['id'];
        $builderId = $this->builder->getId();
        $view = $this->getView();
        if ($this->rules) {
            $rules = Json::encode($this->rules);
            $view->registerJs("\$('#{$builderId}').queryBuilder('setRules', {$rules});");
        }
        $frm = Inflector::variablize("frm-{$id}-querybuilder");
        $btn = Inflector::variablize("btn-{$id}-querybuilder-reset");
        $view->registerJs("var {$frm} = \$('#{$id}');");
        $view->registerJs(<<<JS
    var {$btn} = {$frm}.find('button:reset:first');
    if ({$btn}.length){
        {$btn}.on('click', function(){
            \$('#{$builderId}').queryBuilder('reset');
        });
    }
JS
);
        $view->registerJs(<<<JS
{$frm}.on('submit', function(){
    var rules = \$('#{$builderId}').queryBuilder('getRules');
    if (\$.isEmptyObject(rules)) {
        return false;
    } else {
        var input = \$(this).find("input[name='{$this->rulesParam}']:first");
        input.val(JSON.stringify(rules));
    }
});
JS
);
    }
Ejemplo n.º 22
0
echo Html::encode($this->title);
?>
</title>
    <?php 
$this->head();
?>
</head>
<body>
<?php 
$this->beginBody();
?>

<div class="wrap">
    <?php 
NavBar::begin(['brandLabel' => 'Тестовое задание', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'Главная', 'url' => ['/site/index']], ['label' => 'Книги', 'url' => ['/book/index']], Yii::$app->user->isGuest ? ['label' => 'Вход', 'url' => ['/site/login']] : '<li>' . Html::beginForm(['/site/logout'], 'post') . Html::submitButton('Выход (' . Yii::$app->user->identity->username . ')', ['class' => 'btn btn-link']) . Html::endForm() . '</li>']]);
NavBar::end();
?>

    <div class="container">
        <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
        <?php 
echo $content;
?>
    </div>
</div>

<footer class="footer">
    <div class="container">
Ejemplo n.º 23
0
    <?php 
$this->beginBody();
?>
    <div class="container"><body style="overflow-y: scroll">
        <?php 
NavBar::begin(['brandLabel' => 'Spec Shop', 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]);
$menuItems = [['label' => 'Home', 'url' => Yii::$app->homeUrl], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']]];
if (Yii::$app->user->isGuest) {
    $menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
    $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
    $card = new CardList();
    $number = $card->GetNumberOfProducts(Yii::$app->user->identity->id);
    $menuItems[] = ['label' => 'My Account', 'url' => ['/account/index']];
    $menuItems[] = ['label' => 'My Card[' . $number . ']', 'url' => ['/card/index']];
    $menuItems[] = '<li>' . Html::beginForm(['/site/logout'], 'post') . Html::submitButton('Logout (' . Yii::$app->user->identity->username . ')', ['class' => 'btn btn-link']) . Html::endForm() . '</li>';
}
echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems]);
NavBar::end();
?>
        <div class="container">
            <?php 
echo Breadcrumbs::widget(['links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
            <?php 
echo Alert::widget();
?>
            <?php 
echo $content;
?>
        </div>
Ejemplo n.º 24
0
                                <?php 
echo Html::activeTextInput($productForm, 'quantity', array('size' => 3, 'maxlength' => 3, 'style' => 'text-align: center'));
?>
                            </div>
                            <div style="float: left; margin-left: 5px">
                                <?php 
echo Html::submitButton('Add to cart', ['id' => 'cart-btn', 'class' => 'btn btn-default btn-block', 'name' => 'cart-button', 'style' => 'background: #ff6666; color: #FFF; border: 1px solid #ff9999; border-radius: 0; font-size: 12px']);
?>
                            </div>
                            <div class="clear"><?php 
echo Html::error($productForm, 'quantity');
?>
</div>
                        </div>
                        <?php 
Html::endForm();
?>
                    </div>
                </div>
                <div class="clearfix"></div>

                <div class="cd-tabs">
                    <ul class="cd-tabs-navigation">
                        <li><a data-toggle="tab" href="#desc" class="selected">Description </a></li>
                        <li><a data-toggle="tab" href="#rev">Reviews (1)</a></li>
                    </ul>

                    <div class="tab-content">
                        <div id="desc" class="tab-pane fade in active facts">
                            <p class="all-text">
                                <?php 
Ejemplo n.º 25
0
 /**
  * Will generate the stripe form
  * @return string the generated stripe's modal form
  */
 private function generateStripeForm()
 {
     return Html::beginForm($this->action, 'POST', $this->formOptions) . $this->generateScriptTag() . Html::endForm();
 }
Ejemplo n.º 26
0
 /**
  * cnb_form
  *
  * @param array $params
  *
  * @return string
  *
  * @throws InvalidArgumentException
  */
 public function cnb_form($params, $formId = '', $autosubmit = false, $liqpayBtnNum = 11)
 {
     if (isset($params['language']) && in_array($params['language'], $this->_supportedLangs)) {
         $lang = $params['language'];
     } elseif (isset($params['language']) && !in_array($params['language'], $this->_supportedLangs)) {
         throw new \InvalidArgumentException('LiqPay: Language is not supported');
     } else {
         $lang = $params['language'] = self::DEFAULT_LANG;
     }
     $params = $this->cnb_params($params);
     $form = Html::beginForm($this->_checkout_url, 'post', ['accept-charset' => 'utf-8', 'id' => $formId]) . Html::hiddenInput('data', base64_encode(json_encode($params))) . Html::hiddenInput('signature', $this->cnb_signature($params)) . ($autosubmit ? $this->autoSubmit($formId) : Html::input('image', 'btn_text', null, ['src' => '//static.liqpay.com/buttons/p' . $liqpayBtnNum . $lang . '.radius.png'])) . Html::endForm();
     return $form;
 }
Ejemplo n.º 27
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\data\ArrayDataProvider;
use yii\helpers\ArrayHelper;
/**
 * @var yii\web\View $this
 */
$this->title = Yii::t('rbac', 'Generate Routes');
$this->params['breadcrumbs'][] = ['label' => Yii::t('rbac', 'Routes'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<h1><?php 
echo Yii::t('rbac', 'Generate Routes');
?>
</h1>

<?php 
echo Html::beginForm();
echo GridView::widget(['dataProvider' => new ArrayDataProvider(['allModels' => $new]), 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'checkboxOptions' => function ($model) {
    return ['value' => ArrayHelper::getValue($model, 'name'), 'checked' => true];
}], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'name']]]);
echo Html::submitButton(Yii::t('rbac', 'Append'), ['name' => 'Submit', 'class' => 'btn btn-primary']);
echo Html::endForm();
Ejemplo n.º 28
-1
 /**
  * @inheritdoc
  */
 public function run()
 {
     if (!empty($this->_fields)) {
         throw new InvalidCallException('Each beginField() should have a matching endField() call.');
     }
     echo Html::endForm();
 }
Ejemplo n.º 29
-1
 public function run()
 {
     echo Html::beginForm($this->getComponent()->paymentAction, 'post', $this->options);
     echo Html::hiddenInput('shopId', $this->getComponent()->shopId);
     echo Html::hiddenInput('scid', $this->getComponent()->scId);
     echo Html::hiddenInput('sum', $this->order->getTotalPrice());
     echo Html::hiddenInput('customerNumber', $this->userIdentity->getCustomerId());
     if (is_array($this->paymentType)) {
         echo Html::dropDownList('paymentType', array_keys($this->paymentType)[0], $this->paymentType);
     }
     if (is_array($this->data)) {
         foreach ($this->data as $key => $value) {
             echo Html::hiddenInput($key, $value);
         }
     }
     if ($phone = $this->userIdentity->getCustomerPhone()) {
         echo Html::hiddenInput('cps_phone', $phone);
     }
     if ($email = $this->userIdentity->getCustomerEmail()) {
         echo Html::hiddenInput('cps_email', $email);
     }
     if ($orderId = $this->order->getId()) {
         echo Html::hiddenInput('orderNumber', $orderId);
     }
     echo Html::submitButton(Yii::t($this->getComponent()->messagesCategory, $this->submitText));
     echo Html::endForm();
 }
Ejemplo n.º 30
-1
 /**
  * Display modal window with form for selecting visible columns.
  */
 public function run()
 {
     $visibleColumns = $this->gridManager->getVisibleColumns($this->gridId);
     if ($visibleColumns === false) {
         $visibleColumns = array_keys($this->columnsList);
     }
     $columnsList = [];
     for ($i = 0; $i != count($visibleColumns); $i++) {
         $key = $visibleColumns[$i];
         if (isset($this->columnsList[$key])) {
             $columnsList[$key] = $this->columnsList[$key];
             unset($this->columnsList[$key]);
         }
     }
     $columnsList = array_merge($columnsList, $this->columnsList);
     $modal = Modal::begin($this->modalOptions);
     echo Html::beginForm($this->actionForm, $this->methodForm, $this->formOptions);
     echo Html::checkboxList('columns', $visibleColumns, $columnsList, ['class' => 'checkbox columns-list']);
     echo Html::beginTag('div', ['class' => 'form-group']);
     echo Html::submitButton($this->submitBtnLabel, $this->submitBtnOptions);
     echo Html::endTag('div');
     echo Html::endForm();
     Modal::end();
     $pluginSortableOptions = Json::encode($this->pluginSortableOptions);
     $this->view->registerJs("jQuery('#{$modal->id} .columns-list').sortable({$pluginSortableOptions});");
 }