<?php 
/**
 * The edit view of contact 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     contact 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php if(helper::isAjaxRequest()):?>
<?php include '../../../sys/common/view/header.modal.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php else:?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php endif;?>
<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->leads->edit . ' ' . $contact->realname;?></span>
    </div>
  </div>
</div>
<form method='post' id='contactForm' action="<?php echo helper::createLink('leads', 'edit', "contactID=$contact->id")?>">
  <div class='panel'>
    <div class='panel-body w-p80'>
      <fieldset> 
        <legend class='text-muted'><?php echo $lang->contact->generalInfo;?></legend>
        <table class='table table-form'>
          <tr>
            <th class='w-80px'><?php echo $lang->contact->realname;?></th>
            <td><?php echo html::input('realname', $contact->realname, "class='form-control'");?></td>
            <th><?php echo $lang->contact->gender;?></th>
            <td><?php unset($lang->genderList->u); echo html::radio('gender', $lang->genderList, $contact->gender);?></td>
          </tr>
          <tr>
            <th><?php echo $lang->contact->origin;?></th>
            <td><?php echo html::input('origin', $contact->origin, "class='form-control'");?></td>
            <th><?php echo $lang->contact->email;?></th>
            <td><?php echo html::input('email', $contact->email, "class='form-control' placeholder='{$lang->contact->emailTip}'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->contact->company;?></th>
            <td><?php echo html::input('company', $contact->company, "class='form-control'");?></td>
            <th><?php echo $lang->contact->qq;?></th>
            <td><?php echo html::input('qq', $contact->qq, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->contact->mobile;?></th>
            <td><?php echo html::input('mobile', $contact->mobile, "class='form-control'");?></td>
            <th><?php echo $lang->contact->weixin;?></th>
            <td><?php echo html::input('weixin', $contact->weixin, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->contact->phone;?></th>
            <td><?php echo html::input('phone', $contact->phone, "class='form-control'");?></td>
          </tr>
        </table>
      </fieldset> 
      <fieldset> 
        <legend class='text-muted'><?php echo $lang->contact->otherInfo;?></legend>
        <table class='table table-form'>
          <tr>
            <th><?php echo $lang->contact->birthday;?></th>
            <td><?php echo html::input('birthday', formatTime($contact->birthday), "class='form-control form-date'");?></td>
            <th><?php echo $lang->contact->weibo;?></th>
            <td><?php echo html::input('weibo', empty($contact->weibo) ? 'http://weibo.com/' : $contact->weibo, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->contact->skype;?></th>
            <td><?php echo html::input('skype', $contact->skype, "class='form-control'");?></td>
            <th><?php echo $lang->contact->site;?></th>
            <td><?php echo html::input('site', empty($contact->site) ? 'http://' : $contact->site, "class='form-control'");?></td>
          </tr>
          <tr>
            <th><?php echo $lang->contact->desc;?></th>
            <td colspan='3'><?php echo html::textarea('desc', $contact->desc, "rows='3' class='form-control'");?></td>
          </tr>
          <tr>
            <th></th>
            <td colspan='3' class='form-actions'><?php echo html::submitButton() . html::backButton();?></td>
          </tr>
        </table>
      </fieldset>
      <?php echo $this->fetch('action', 'history', "objectType=contact&objectID={$contact->id}")?>
    </div>
  </div>
</form>
<?php if(helper::isAjaxRequest()):?>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
<?php else:?>
<?php include '../../common/view/footer.html.php';?>
<?php endif;?>
