<div class="col-md-4">
  <div class="box box-body">
    <?php if(isset($profit->id)): ?>
    <?php echo Form::model($profit, array('method' => 'patch', 'route' => ['profits.update', $profit->id])); ?>

    <?php else: ?>
    <?php echo Form::open(array('route' => 'profits.store')); ?>

    <?php endif; ?>
    <div class="form-group">
      <?php echo Form::label('amount', Trans('profits.amount')); ?>

      <?php echo Form::number('amount', null, [
        'class' => 'form-control',
        'placeholder' => Trans('profits.amount'),
        'required'  => 'required',
        'step'  => "any",
      ]); ?>

    </div>
    <div class="form-group">
      <?php echo Form::label('type', Trans('profits.type')); ?>

      <?php
        if(App::getLocale() == "kh") {
          $type = [
            'income' => trans('profits.income'),
            'expense' => trans('profits.expense')
          ];
        }
        else {
          $type = [
            'income' => "Income",
            'expense' => "Expense"
          ];
        }
        $selected = isset($profit->type) ? $profit->type : "";
      ?>

      <?php echo Form::select('type',$type, $selected, ['class' => 'form-control']); ?>

    </div>
    <div class="form-group">
      <?php echo Form::label('description', Trans('profits.description')); ?>

      <?php echo Form::textarea('description', null, [
        'class' => 'form-control',
        'placeholder' => Trans('profits.description'),
        'rows' => '3'
      ]); ?>

    </div>

    <div class="form-group pull-right">
      <button type="submit" name="submit" class="btn btn-info">
        <?php if(isset($profit->id)): ?>
          <?php echo Trans('dashboard.crud.update'); ?>

        <?php else: ?>
          <?php echo Trans('buttons.add'); ?>

        <?php endif; ?>
      </button>
    </div>
    <?php echo Form::close(); ?>

  </div>

</div>
<div class="col-md-8">
  <div class="box box-body">
    <table class="table table-bordered table-hover" id="example2">
    </table>

  </div>
</div>
