{extends file="layout/layout.tpl"}
{block name=main}
<div class="slim-mainpanel">
      <div class="container">
        <div class="slim-pageheader">
          <ol class="breadcrumb slim-breadcrumb">
            <li class="breadcrumb-item"><a href="#">Admin</a></li>
            <li class="breadcrumb-item"><a href="#">User</a></li>
            <li class="breadcrumb-item active" aria-current="page">Create</li>
          </ol>
          <h6 class="slim-pagetitle">Create user</h6>
        </div><!-- slim-pageheader -->

        <div class="section-wrapper">
          {if $error}
          <div class="alert alert-danger mg-b-0" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
            <strong>[ERROR]</strong> {$error->listErrors()}
          </div><br>
          {/if}
          {if $msg}
          <div class="alert alert-success mg-b-0" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
            <strong>[SUCCESS]</strong> {$msg}
          </div><br>
          {/if}

          <form method="POST" action="{base_url()}/admin/addlicense">
          <div class="form-layout">
            <div class="row mg-b-25">
              <div class="col-lg-12">
                <div class="form-group">
                  <label class="form-control-label">UserName or ID: <span class="tx-danger">*</span></label>
                      <select class="form-control select2-show-search" name="username" data-placeholder="Select an username">
                        <option label="Choose one"></option>
                        {foreach key=i item=k from=$users}
                        <option value="{$k['Name']}">{$k['Name']}</option>
                        {/foreach}
                      </select>
                </div>
              </div><!-- col-4 -->
              <div class="col-lg-12">
                <div class="form-group">
                  <label class="form-control-label">Customer Name: <span class="tx-danger">*</span></label>
                  <input class="form-control" type="text" value="{set_value('customername')}" name="customername" placeholder="Enter CustomerName">
                </div>
              </div><!-- col-4 -->
              <div class="col-lg-12">
                <div class="form-group">
                  <label class="form-control-label">Machine IP: <span class="tx-danger">*</span></label>
                  <input class="form-control" type="text" value="{set_value('ip')}" name="ip" placeholder="Enter Machine IP">
                </div>
              </div><!-- col-4 -->

              <div class="col-lg-12">
                <div class="form-group">
                  <label class="form-control-label">Update: <span class="tx-danger">*</span></label>
                  <input class="form-control" type="text" value="{set_value('updaten')}" name="updaten" placeholder="Enter Update pack">
                </div>
              </div><!-- col-4 -->
              <div class="col-lg-12">
                <div class="form-group">
                  <label class="form-control-label">Days: <span class="tx-danger">*</span></label>
                  <input class="form-control" type="text" value="{set_value('days')}" name="days"  placeholder="Enter days max 365">
                </div>
              </div><!-- col-4 -->
              <div class="col-lg-12">
                <div class="form-group mg-b-10-force">
                  <label class="form-control-label">HardwareID: <span class="tx-danger">*</span></label>
                  <input class="form-control" type="text" name="hdid" value="{set_value('hdid')}" placeholder="HardwareID">
                </div>
              </div><!-- col-8 -->
              <div class="col-lg-12">
                <div class="form-group mg-b-10-force">
                  <label class="form-control-label">Status: <span class="tx-danger">*</span></label>
                  <select class="form-control select2" name="status" data-placeholder="Choose status" tabindex="-1" aria-hidden="true">
                    <option label="Choose status"></option>
                    <option value="0">Desativada</option>
                    <option value="1" selected>Ativada</option>
                  </select>

              </div>
              </div><!-- col-4 -->
              <div class="col-lg-12">
                <div class="form-group mg-b-10-force">
                  <label class="form-control-label">Version: <span class="tx-danger">*</span></label>
                  <select class="form-control select2" name="plan" data-placeholder="Choose plan" tabindex="-1" aria-hidden="true">
                    <option label="Choose Version"></option>
                    <option value="16">Season 2</option>
                    <option value="12">Season 4</option>
                    <option value="4" selected>Season 6</option>
                    <option value="8">Season 8</option>
                  </select>

              </div>
              </div><!-- col-4 -->
            </div><!-- row -->

            <div class="form-layout-footer">
              <button type="submit" id="update" class="btn btn-primary bd-0">Add license</button>
              <button class="btn btn-secondary bd-0">Cancel</button>
            </div><!-- form-layout-footer -->
          </div><!-- form-layout -->
                    <input type="hidden" name="{csrf_token()}" value="{csrf_hash()}" />
        </form>
        </div><!-- section-wrapper -->

      </div><!-- container -->
    </div>

{/block}