123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- use yii\helpers\Html;
- use yii\jui\DatePicker;
- use kartik\datetime\DateTimePicker;
- use yii\web\JsExpression;
- use yii\web\View;
- use yii\widgets\ActiveForm;
- use app\models\base\TopSlider;
- $model = new TopSlider();
- /* @var $this yii\web\View */
- /* @var $model app\models\base\TopSlider */
- /* @var $form yii\widgets\ActiveForm */
- ?>
- <div class="modal" tabindex="-1" data-show="false" id="modalcsl" data-backdrop="static" data-keyboard="false">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">Коммерческий слайдер</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <div class="top-slider-form">
- <?php $formsl = ActiveForm::begin([
- 'id' => 'TopSlider',
- 'action' => 'AjaxSave',
- 'enableAjaxValidation' => false,
- // 'validationUrl' => 'validation-rul',
- ]); ?>
- <input type="hidden" name="TopSlider[post_id]" value="<?=$news->id?>">
- <div class="row">
- <div class="col-md-6">
- <?= $formsl->field($model, 'published_from')->widget(DateTimePicker::classname(), [
- 'name' => 'published_from',
- 'options' => ['class' => 'form-control'],
- 'convertFormat' => true,
- 'type' => DateTimePicker::TYPE_COMPONENT_PREPEND,
- 'pluginOptions' => [
- 'format' => 'yyyy-MM-dd hh:i:s',
- 'startDate' => '2023-01-01 12:00',
- 'todayHighlight' => true,
- 'autoclose'=>true
- ]
- ])?>
- </div>
- <div class="col-md-6">
- <?= $formsl->field($model, 'published_to')->widget(DateTimePicker::classname(), [
- 'name' => 'published_to',
- 'options' => ['class' => 'form-control'],
- 'convertFormat' => true,
- 'type' => DateTimePicker::TYPE_COMPONENT_PREPEND,
- 'pluginOptions' => [
- 'format' => 'yyyy-MM-dd hh:i:s',
- 'startDate' => '2023-01-01 12:00',
- 'todayHighlight' => true,
- 'autoclose'=>true
- ]
- ])?>
- </div>
- </div>
- <?= $formsl->field($model, 'is_active')->checkbox() ?>
- <div class="form-group">
- <a href="javascript:senddata();" class="btn btn-success">Сохранить</a>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
- </div>
- <div class="modal-footer">
- </div>
- </div>
- </div>
- </div>
- <script>
- function senddata(){
- var form = $('#TopSlider');
- // console.log(form);
- $.getJSON( "/manager/top-slider/ajaxsave", form.serialize(), function( json ){
- console.log(json);
- if( json.success == 'err' ){
- alert(json.err);
- }
- } );
- }
- </script>
|