<div class="panel panel-info panel-border top">
  <div class="panel-heading">
    <span class="panel-title">Edycja klienta: <u><?= $this -> _client['login'];?></u></span>
  </div>
  <div class="panel-heading p5" style="height: auto;">
    <div class="row mb10 pl5">
      <div class="col col-xs-12">
        <?= \Html::button(
                    array(
                      'class' => 'btn btn-sm btn-success',
                      'text'  => 'Zatwierdź',
                      'js'    => 'checkForm( "formularz" );',
                      'icon'  => 'fa-check-circle mr5'
                    )
                );?>
        <?= \Html::button(
                    array(
                      'class' => 'btn btn-sm btn-danger',
                      'text'  => 'Anuluj',
                      'url'   => '/?p=reseller_clients',
                      'icon'  => 'fa-times mr5'
                    )
                );?>
      </div>
    </div>
  </div>
  <div class="panel-body">    
    <form method="POST" action="/?p=reseller_clients" id="formularz" class="form-horizontal">
      <input type="hidden" name="reseller_id" value="<?= $this -> _reseller_id;?>" />
      <? if ( $this -> _client ):?>
        <input type='hidden' name='rw' value='save' />
        <input type='hidden' id="idk" name='client_id' value='<?= $this -> _client['id'];?>' />
      <? else:?>
        <input type='hidden' name='rw' value='add_new' />
        <input type='hidden' name='check' value='<?= mktime();?>' />
      <? endif;?>
      <div class="row">
        <div class="col col-md-6">
          <?= \Html::input(
                      array(
                        'name'  => 'login',
                        'class' => 'require',
                        'value' => $this -> _client['login'],
                        'label' => 'Login'
                      )
                  );?>
          <?= \Html::input(
                      array(
                        'name'  => 'password',
                        'label' => 'Hasło'
                      )
                  );?>
          <?= \Html::input_switch(
                      array(
                        'name'    => 'enabled',
                        'label'   => 'Aktywny',
                        'checked' => $this -> _client['enabled'] ? true : false,
                        'values'  => [
                          '0' => 'nie',
                          '1' => 'tak'
                        ]
                      )
                  );?>
          <div class="form-group">
            <label class="col-lg-4 control-label">Strony:</label>
            <div class="col-lg-8">
              <div class="row">
                <? if ( is_array( $this -> _sites ) ): foreach ( $this -> _sites as $site ):?>
                  <div class="col-xs-6">
                    <div class="checkbox-custom fill checkbox-primary mt10">
                      <input id="site_<?= $site['id'];?>" type="checkbox" value="<?= $site['id'];?>" name="sites[]" <? if ( in_array( $site['id'], $this -> _client['sites'] ) ):?>checked="checked"<? endif;?> />
                      <label for="site_<?= $site['id'];?>"><?= $site['name'];?></label>
                    </div>
                  </div>
                <? endforeach; endif;?>
              </div>
            </div>
          </div>
        </div>
      </div>
    </form>
  </div>
</div>
<script type='text/javascript'>
  $( function() 
  {
    disable_menu();
  });
</script>