<?php require "layout/innerHeader.php" ?>

<!-- content -->
<section class="content pagecontent">
  <div class="container">
    <aside class="leftmenu panel-shadow" id="leftmenu">
      <h3 class="title">
        <i class="icon-dashboard"></i> 我的操作台
        <i class="arrow" onclick="$('#leftmenu').toggleClass('opened')"></i>
      </h3>
      <ul>
        <li class="active"><a href="edit-account.php">企业基本信息</a></li>
        <li><a href="forgetPsChange.php">修改登录密码</a></li>
        <li><a href="order-detail.php">新增销售订单</a></li>
      </ul>
    </aside>


    <div class="content-box panel-shadow">
      <div class="page-title">
        <h2 class="title  border-theme"><span class="text-theme">企业基本信息</span></h2>
      </div>
      <form class="form-horizontal validate-form" name="basicInfo" id="basicInfo" autocomplete="off">
          <div class="form-group">
            <label class="col-md-2 control-label">邮箱</label>
            <div class="col-md-4">
              <p class="loadtext">XXXXXX@163.com</p>
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">
                <span class="glyphicon glyphicon-info-sign pr5"></span>
                如需修改，请联系客服
              </p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>联系人</label>
            <div class="col-md-4 has-error">
              <input type="text" class="form-control" name="name">
              <div class="help-block">请输入姓名</div>
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">&nbsp;</p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label">公司名称</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="company" value="XXXXX有限责任公司">
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">
                <span class="glyphicon glyphicon-info-sign pr5"></span>
                已通过企业认证，如需修改，请联系客服
              </p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>手机号码</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="mobile">
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">&nbsp;</p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>座机</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="phone">
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">&nbsp;</p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>传真</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="fax">
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">&nbsp;</p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>QQ</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="qq">
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">&nbsp;</p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label">公司网址</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="site">
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">
                <span class="glyphicon glyphicon-info-sign pr5"></span>
                请输入含http(s)://的网址
              </p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label">公司地址</label>
            <div class="col-md-4">
              <input type="text" class="form-control" name="address">
            </div>
            <div class="col-md-4">
            </div>
          </div>
          <div class="form-group upload-photo" id="photoGroup">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span> 公司LOGO</label>
            <div class="col-md-4">
              <input type="file" style="display: none;" id="uploadInput" accept="image/jpeg,image/jpg,image/png,image/gif" onchange="$('#imageUpload').val($(this).val())" autocomplete="off">
              <div class="input-group">
                <input type="text" class="form-control" value="" id="imageUpload" readonly="readonly" onclick="$('#uploadInput').click()" autocomplete="off">
                <span class="input-group-btn">
                  <button class="btn btn-default" type="button" onclick="$('#uploadInput').click()">浏览</button>
                </span>
              </div>
              <a class="photo magnific mt10" href="image/logo_blue.png"><span></span><img src="image/logo_blue.png"></a>
            </div>
            <div class="col-md-4">
              <p class="loadtext text-muted">
                <span class="glyphicon glyphicon-info-sign pr5"></span>
                LOGO图片大小建议 300px * 100px
              </p>
            </div>
          </div>
          <div class="form-group mt10">
						<div class="col-sm-8 col-sm-offset-2">
              <button type="button" class="btn btn-theme btn-confirm" id="submitRegister"><i class="icon-file-alt mr5"></i> 确认提交</button>
              <button type="button" class="btn btn-default ml10" onClick="$('#basicInfo')[0].reset();"><i class="icon-repeat mr5"></i>重填</button>
						</div>
					</div>
      </form>
    </div>
  </div>
</section>

<?php include "layout/footer.php" ?>
<script type="text/javascript">
$(function() {
  //图片预览
  $("#photoGroup").magnificPopup({
    delegate: ".magnific",
    type: "image",
    gallery: {
      enabled: false,
    },
    image: {
      tError: '图片无法显示，请检查图片路径是否正确',
    }
  });
  
  //从本地上传图片 
  $("#uploadInput").on("change",function(){
    if (window.File && window.FileList) {
      var $this = $(this);
      var	file = this.files[0];

      //文件尺寸过滤，这里设置最大容量为5mb
          if(file.size >= 5120000){
            $.gritter.add({
          class_name:'gritter-error',
          title: "不能添加",
          text:"图片容量过大，单张图片容量不能大于5MB！",
          time: 2000,
          sticky: false
        });
        return false;
          };
          
          //创建预览
      var reader = new FileReader(), htmlImage;
      reader.onload = function(e) {
        $("#photoGroup .magnific").attr("href", e.target.result);
        $("#photoGroup .magnific img").attr("src", e.target.result);
        $("#uploadInput").val("");
            };
            reader.readAsDataURL(file);
    }else {
      $.gritter.add({
        class_name:'gritter-error',
        title: "不能添加",
        text:"抱歉，你的浏览器不支持FileAPI，请升级浏览器！",
        time: 2000,
        sticky: false
      });
      return false;
    }
  });
});
</script>
</body>
</html>