<div class="col-md-12 ">
  <div class="kt-portlet__head ">
    <div class="kt-portlet__head-label">
      <h3 class="kt-portlet__head-title">Update Periods</h3>
    </div>
    <div class="kt-portlet__head-toolbar">
      <div class="kt-portlet__head-wrapper">
            <a href="<?php echo $_SERVER['HTTP_REFERER'] ?>" class="btn btn-primary text-white btn-icon-sm">
          <i class="la la-long-arrow-left"></i>Back</a>
      </div>
    </div>
  </div>
  <div class="kt-portlet__body">
    <form role="form" class="kt-form" id="budgets_period_create" action="<?php echo e(url('budgets/periods/period_update/'.$id)); ?>" method="post">
      <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
      <input type="hidden" value="<?php echo e(Auth::user()->company_id); ?>" name="company_id" />
      <div class="row">
        <div class=" form-group col-sm-7">
          <div class="input-daterange input-group" id="date-range">
            <?php if(count($periods_data)>0): ?>
              <?php foreach($periods_data as $row): ?>
                <?php if($row->id==$id): ?>
                  <input type="text" class="form-control" name="from" id="from" autocomplete="off"   placeholder="Start Date" value="<?php echo $row->from;?>"  >
                  <div class="input-group-append">
                    <span class="input-group-text">To</span>
                  </div>
                  <input type="text" class="form-control" name="to" id="to"  placeholder="End Date" value="<?php echo $row->to;?>"  >
                <?php endif; ?>
              <?php endforeach; ?>
            <?php endif; ?>
          </div>
        </div> 
        <div class="form-group  col-sm-3">
          <?php if(count($periods_data)>0): ?>
            <?php foreach($periods_data as $row): ?>
              <?php if($row->id==$id): ?>
                <input type="text" class="form-control" name="name"  placeholder="Period Name" value="<?php echo $row->name;?>" />
              <?php endif; ?>
            <?php endforeach; ?>
          <?php endif; ?>
        </div>
        <div class="col-sm-2">
          <button class=" btn btn-success waves-effect waves-light" type="submit">Update</button>
        </div>
      </div>
    </form>
  </div>
</div>