<?php $__env->startSection('content'); ?>
    <div class="card card-outline-info">
        <div class="card-header">
            <h4 class="m-b-0 text-white">Create Pins</h4>
        </div>
    <div class="card-body">
    <?php echo Form::open(['method' => 'POST','id'=> '7', 'data-parsley-validate'=>'', 'route' => ['admin.pins.store']]); ?>

        <div class="form-body control-group">
            <h3 class="card-title">Pin & User</h3>
            <hr>
            <div class="row p-t-20">
              <div class="col-md-6">
                  <div class="form-group">
                    <?php echo Form::label('pinno', 'Number of Pins*', ['class' => 'control-label']); ?>

                    <?php echo Form::number('pinno', old('pinno'), ['class' => 'form-control', 'id'=>'pinno', 'placeholder' => 'Number of Pins', 'required']); ?>

                    <p class="help-block">Number of Pins</p>
                    <?php if($errors->has('pinno')): ?>
                        <p class="help-block error">
                            <?php echo e($errors->first('pinno')); ?>

                        </p>
                    <?php endif; ?>
                  </div>
              </div>
              <!--/span-->
              <div class="col-md-6">
                  <div class="form-group">
                    <?php echo Form::label('plan', 'Select Pin*', ['class' => 'control-label']); ?>

                    <select name="plan" class="form-control" id="plan_id">
                    <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $package): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($key); ?>"> <?php echo $package['name']; ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                   <p class="help-block"></p>
                    <?php if($errors->has('plan')): ?>
                        <p class="help-block error">
                            <?php echo e($errors->first('plan')); ?>

                        </p>
                    <?php endif; ?>
                  </div>
              </div>
              <!--/span-->
            </div>
            <div class="row p-t-20">
                <div class="col-md-6">
                    <div class="form-group">
                        <?php echo Form::label('user_id', 'User Id*', ['class' => 'control-label']); ?>

                        <input type="text" name="user_id" id="sponsor-typeahead" class="form-control" placeholder="Username" value="<?php echo e(old('user_id')); ?>" required="" style="margin-bottom: 0px; " />
                        <p class="help-block"></p>
                        <?php if($errors->has('user_id')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('user_id')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
                <!--/span-->
                <div class="col-md-6">
                    <div class="form-group">
                        <?php echo Form::label('sponsor_name', 'Users name*', ['class' => 'control-label']); ?>

                        <?php echo Form::text('sponsor_name', old('sponsor_name'), ['class' => 'form-control', 'id' => 'sponsor_name', 'placeholder' => '','disabled'=>'']); ?>

                        <p class="help-block"></p>
                        <?php if($errors->has('sponsor_name')): ?>
                            <p class="help-block error">
                                <?php echo e($errors->first('sponsor_name')); ?>

                            </p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    <?php echo Form::submit('Submit', ['class' => 'btn btn-danger']); ?>

    <?php echo Form::close(); ?>

    </div>
    </div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('javascript'); ?>
    <!-- Date picker plugins css -->
    <link href="<?php echo e(url('assets')); ?>/plugins/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
    <!-- Daterange picker plugins css -->
    <link href="<?php echo e(url('assets')); ?>/plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet">
    <link href="<?php echo e(url('assets')); ?>/plugins/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <!-- Date Picker Plugin JavaScript -->
    <script src="<?php echo e(url('assets')); ?>/plugins/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
    <!-- Date range Plugin JavaScript -->
    <script src="<?php echo e(url('assets')); ?>/plugins/timepicker/bootstrap-timepicker.min.js"></script>
    <script src="<?php echo e(url('assets')); ?>/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
    <script src="<?php echo e(url('assets')); ?>/js/jqBootstrapValidation.js"></script>
    <link href="<?php echo e(url('assets')); ?>/plugins/EasyAutocomplete/easy-autocomplete.min.css" rel="stylesheet">
    <script src="<?php echo e(url('assets')); ?>/plugins/EasyAutocomplete/jquery.easy-autocomplete.min.js"></script>
    <script src="<?php echo e(url('assets')); ?>/js/typeahead.bundle.js"></script>
    <!-- Parsley -->
    <script>
      jQuery('.mydatepicker, #datepicker').datepicker({format: 'dd-mm-yyyy'});

      $(document).ready(function() {
        $("form#create_pins").not("[type=submit]").jqBootstrapValidation();
      });

      var options = {

        url: function(phrase) {
          return "<?php echo e(url('/')); ?>/admin/users/getSponsors/" + phrase;
        },

        getValue: function(element) {
          return element.username;
        },

        template: {
            type: "description",
            fields: {
                description: "full_name"
            }
        },
        list: {
              onSelectItemEvent: function() {
                var data = $("#sponsor-typeahead").getSelectedItemData().full_name;
                $("input#sponsor_name").val(data).trigger("change");
              }
        },
        theme: "plate-dark",
        ajaxSettings: {
          dataType: "json",
          method: "GET",
          data: {
            dataType: "json"
          }
        },
        preparePostData: function(data) {
          data.phrase = $("#sponsor-typeahead").val();
          return data;
        },

        requestDelay: 400
      };

      $("#sponsor-typeahead").easyAutocomplete(options);
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH G:\xampp\htdocs\yeselectricv.loc\resources\views/admin/pins/create.blade.php ENDPATH**/ ?>