<?php
/**
 * The create view file of user module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     user 
 * @version     $Id: create.html.php 4029 2016-08-26 06:50:41Z liugang $
 * @link        http://www.zdoo.com
 */
?>
<?php
include '../../common/view/header.html.php';
include '../../common/view/treeview.html.php';
?>
<?php if(!$userLeft):?>
<div class='alert alert-warning'>
  <p><?php echo $lang->user->exceeded;?></p>
</div>
<?php else:?>
<div id='mainTitle' class='clearfix'>
  <div class='btn-toolbar pull-left'>
    <?php if(!isonlybody()):?>
    <?php echo html::a('javascript:history.go(-1);', '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, "class='btn btn-back'");?>
    <div class="divider"></div>
    <?php endif;?>
    <div class="page-title">
      <span class="text"><?php echo $lang->user->create;?></span>
    </div>
  </div>
</div>
<div class='main-row'>
  <?php include './deptside.html.php';?>
  <div class='main-col'>
    <div class='panel'>
      <div class='panel-heading'>
        <strong><?php echo $lang->user->create;?></strong>
      </div>
      <div class='panel-body'>
        <form method='post' id='createForm'>
          <table class='table table-form'>
            <tr>
              <th><?php echo $lang->user->account;?></th>
              <td class='w-500px'>
                <div class='input-group'>
                  <?php echo html::input('account', '', "class='form-control w-350px' autocomplete='off'");?>
                  <span class='input-group-addon fix-border'><?php echo $lang->user->order;?></span>
                  <?php echo html::number('order', '', "class='form-control input-order' min='1'");?>
                </div>
              </td>
              <td></td>
            </tr>
            <tr>
              <th><?php echo $lang->user->realname;?></th>
              <td><?php echo html::input('realname', '', "class='form-control' autocomplete='off'");?></td><td></td>
            </tr>
            <tr>
              <th><?php echo $lang->user->password;?></th>
              <td>
                <div class='required required-wrapper'></div>
                <?php echo html::password('password1', '', "class='form-control' autocomplete='off'")?>
              </td>
              <td></td>
            </tr>  
            <tr>
              <th><?php echo $lang->user->password2;?></th>
              <td>
                <div class='required required-wrapper'></div>
                <?php echo html::password('password2', '', "class='form-control' autocomplete='off'");?>
              </td>
              <td></td>
            </tr>  
            <?php if($this->app->user->admin == 'super'):?>
            <tr>
              <th><?php echo $lang->user->super;?></th>
              <td><?php echo html::radio('admin', $lang->user->adminList, 'no');?></td>
              <td></td>
            </tr>
            <?php endif;?>
            <tr>
              <th><?php echo $lang->user->gender;?></th>
              <td><?php unset($lang->genderList['u']); echo html::radio('gender', $lang->genderList, '');?></td><td></td>
            </tr>  
            <tr>
              <th><?php echo $lang->user->dept;?></th>
              <td><?php echo html::select('dept', $depts, '', "class='form-control chosen'");?></td><td></td>
            </tr>
            <tr>
              <th><?php echo $lang->user->role;?></th>
              <td><?php echo html::select('role', $lang->user->roleList, '', "class='form-control chosen'");?></td>
              <td></td>
            </tr>
            <tr>
              <th><?php echo $lang->user->group;?></th>
              <td><?php echo html::select('group[]', $groups, '', "class='form-control chosen' multiple");?></td>
              <td></td>
            </tr>
            <tr>
              <th><?php echo $lang->user->join;?></th>
              <td><?php echo html::input('join', '', "class='form-control form-date'");?></td>
            </tr>
            <tr>
              <th><?php echo $lang->user->email;?></th>
              <td><?php echo html::input('email', '', "class='form-control' autocomplete='off'");?></td>
              <td></td>
            </tr>
            <tr>
              <th></th>
              <td class='form-actions' colspan='2'>
                <?php echo html::submitButton();?>
                <div id='duplicateError' class='hide'></div>
              </td>
            </tr>
          </table>
        </form>
      </div>
    </div>
  </div>
</div>
<div class='errorMessage hide'>
  <div class='alert alert-danger alert-dismissable'>
    <button aria-hidden='true' data-dismiss='alert' class='close' type='button'>×</button>
    <button type='button' class='btn btn-default' id='continueSubmit'><?php echo $lang->continueSave;?></button>
  </div>
</div>
<?php endif;?>
<?php include '../../common/view/footer.html.php';?>
