<?php
/**
 * The colleague 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      Tingting Dai <daitingting@xirangit.com>
 * @package     User
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php
include $app->getModuleRoot() . 'common/view/header.html.php';
include '../../common/view/treeview.html.php';
js::set('deptID', $deptID);
?>
<div id='menuActions' class='search'>
  <form method='post' class='form-search w-300px'>
    <div class="input-group">
      <?php echo html::input('search', $search, "class='form-control search-query' placeholder='{$lang->user->inputColleague}'"); ?>
      <span class="input-group-btn">
        <?php echo html::submitButton($lang->user->searchUser,"btn btn-primary"); ?>
      </span>
    </div>
  </form>
</div>
<div class='main-row'>
  <div class='side-col'>
    <div class='panel'>
      <div class='panel-body'><div id='treeMenuBox'><?php echo $treeMenu;?></div></div>
    </div>
  </div>
  <div class='main-col'>
    <div class="panel">
      <div class='panel-body'>
        <div class='cards cards-user'>
          <?php foreach($users as $user):?>
          <div class='col-card'>
            <div class='card card-user gender-<?php echo $user->gender?>'>
              <div class='card-heading'>
                <?php if($user->avatar) echo html::image($user->avatar, "class='bg'");?>
                <div class='cover'></div>
                <div class='avatar'><?php if($user->avatar) echo html::image($user->avatar);?></div>
                <div class='title'>
                  <h4 class='user-realname'>
                    <?php echo $user->realname;?>
                    <span class='action'>
                      <a href='javascript:;' class='btn-vcard'><?php echo html::image(inlink('vcard', "user={$user->account}"));?></a>
                      <div class='vcard text-center'>
                        <?php echo html::image(inlink('vcard', "user={$user->account}"));?>
                      </div>
                    </span>
                  </h4>
                  <?php if($user->dept or $user->role):?>
                  <div class='user-info'>
                    <?php
                    if($user->dept) echo zget($depts, $user->dept, ' ');
                    if($user->role and $user->dept) echo '&nbsp;&nbsp;|&nbsp;&nbsp;';
                    if($user->role) echo zget($lang->user->roleList, $user->role);
                    ?>
                  </div>
                  <?php endif;?>
                </div>
              </div>
              <div class='card-content'>
                <dl class='contact-info'>
                  <?php $companyName = isset($config->company->name) ? $config->company->name : '';?>
                  <?php if($user->phone or $user->mobile) echo '<dt>' . $lang->user->phone . $lang->colon . '</dt><dd>' . $user->phone . $lang->slash . $user->mobile . '</dd>';?>
                </dl>
                <dl class='contact-info'>
                  <?php if($user->qq) echo "<dt>" . $lang->user->qq . $lang->colon . '</dt><dd>' . html::a("http://wpa.qq.com/msgrd?v=3&uin={$user->qq}&site={$companyName}&menu=yes", $user->qq, "target='_blank'") . "</dd>";?>
                </dl>
                <dl class='contact-info'>
                  <?php if($user->weixin) echo "<dt>" . $lang->user->weixin . $lang->colon . '</dt><dd>' . $user->weixin . "</dd>";?>
                </dl>
                <dl class='contact-info'>
                  <?php if($user->email) echo "<dt>" . $lang->user->email . $lang->colon . '</dt><dd>' . html::mailto($user->email, $user->email) . "</dd>";?>
                </dl>
                <dl class='contact-info'>
                  <?php if($user->address) echo "<dt>" . $lang->user->address . $lang->colon . '</dt><dd>' . $user->address . "</dd>";?>
                </dl>
              </div>
            </div>
          </div>
          <?php endforeach;?>
        </div>
        <div class='table-footer'><?php $pager->show();?></div>
      </div>
    </div>
  </div>
</div>
<?php include '../../../team/common/view/footer.html.php'; ?>
