<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php init_head(); ?>
<div id="wrapper">
  <div class="content">
      <div class="tw-mt-12 sm:tw-mt-0 col-md-8 col-md-offset-2">
    <div class="row mbot15">
      <div class="col-md-12">
        <h4 class="tw-font-bold tw-text-xl">
          <?= isset($material) ? _l('edit_item_group_material') : _l('new_item_group_material'); ?>
        </h4>
      </div>
    </div>
    <div class="panel_s">
        <?php echo form_open(admin_url('materials/material' . (isset($material) ? '/' . $material->id : ''))); ?>
          <?php echo form_hidden('materialid', isset($material) ? $material->id : ''); ?>
      <div class="panel-body">
          <div class="row">
            <div class="col-md-12">
              <?php echo render_input('name', 'material_name', isset($material) ? $material->name : ''); ?>
            </div>
          </div>
          <div class="row">
            <div class="col-md-3">
              <?php echo render_input('espessura', 'espessura', isset($material) ? $material->espessura : '', 'number', ['step'=>'0.01']); ?>
            </div>
            <div class="col-md-3">
              <?php echo render_input('altura', 'altura', isset($material) ? $material->altura : '', 'number', ['step'=>'0.01']); ?>
            </div>
            <div class="col-md-3">
              <?php echo render_input('comprimento', 'comprimento', isset($material) ? $material->comprimento : '', 'number', ['step'=>'0.01']); ?>
            </div>
            <div class="col-md-3">
              <?php echo render_input('valor', 'valor', isset($material) ? $material->valor : '', 'number', ['step'=>'0.01']); ?>
            </div>
          </div>
          <div class="row">
          <div class="col-md-3">
            <div class="form-group">
                <div class="checkbox checkbox-primary no-mtop checkbox-inline">
                <input 
                  type="checkbox" 
                  id="default_external" 
                  name="default_external" 
                  class="checkbox checkbox-primary no-mtop checkbox-inline"
                  value="1"
                  <?= isset($material) && $material->default_external ? 'checked' : '' ?>
                >
              <label for="default_external">
                Acabamento Externo (padrão)
              </label>
                </div>
            </div>
          </div>
          <div class="col-md-3">
            <div class="form-group">
                <div class="checkbox checkbox-primary no-mtop checkbox-inline">
                <input 
                  type="checkbox" 
                  id="default_internal" 
                  name="default_internal" 
                  value="1"
                  <?= isset($material) && $material->default_internal ? 'checked' : '' ?>
                >
              <label for="default_internal">
                Acabamento Interno (padrão)
              </label>
                </div>
            </div>
          </div>
        </div>
      </div>
          <div class="panel-footer text-right">
            <button type="submit" class="btn btn-primary only-save">
              <?= _l('submit'); ?>
            </button>
          </div>
        <?php echo form_close(); ?>
    </div>
  </div>
  </div>
</div>
<?php init_tail(); ?>
</body>
</html>