<?php 
error_reporting(0);
if(!$userlogined==true){exit("<script type=\"text/javascript\">location.href='".cd_webpath."user/login.php?login_referer=".cd_webpath."user/".rewrite_url('space.php?do=profile')."';</script>");}
?>
  <div class="user"> 
   <div class="user_center"> 
<?php
include_once('source/space_menu.php');
$current=SafeRequest("i","get");
$step = SafeRequest("step","get");
?>
<?php if($view==""){?>
    <div class="user_main"> 
     <div class="uMain_content"> 
      <div class="main_nav"> 
       <ul> 
        <li class="message"> <a class="on" href="<?php echo rewrite_url('space.php?do=profile');?>">个人资料</a> </li>
        <li class="skin"><a href="<?php echo cd_webpath.cd_webmlsinger?>/index.php?ac=skin&id=<?php echo $CcTvAi_com_userid?>" target="_blank">空间换肤</a></li>	  
        <li class="certify"> <a href="<?php echo rewrite_url('space.php?do=profile&view=applyCertify');?>">美女认证</a> </li>
       </ul> 
      </div> 
      <div class="big_list"> 
       <ul id="aa"> 
        <li id="cprofile"><a <?php if($current==""){echo ' class="current"';} ?> href="javascript:;"><span>基本资料</span></a></li>
        <li id="cavatar"><a <?php if($current=="avatar"){echo ' class="current"';} ?> href="javascript:;"><span>修改头像</span></a></li>
        <li id="cpassword"><a <?php if($current=="password"){echo ' class="current"';} ?> href="javascript:;"><span>修改密码</span></a></li>
        <li id="cprotection"><a <?php if($current=="protection"){echo ' class="current"';} ?> href="javascript:;"><span>修改密保</span></a></li>
        <li id="cnickname"><a <?php if($current=="nickname"){echo ' class="current"';} ?> href="javascript:;"><span>修改昵称</span></a></li>	
       </ul> 
      </div> 
      <div class="minHeight500"> 
<!--修改基本资料-->
       <div id="modifyProfile" class="profile" style="<?php if($current==""){echo "display:";}else{echo "display:none";} ?>;">
        <div class="title">
         <div class="name">修改基本资料</div>
        </div> 
        <ul> 
         <li> 
          <div class="name">昵　　称：</div>
          <div class="input"><span class="nickname"><?php echo $CcTvAi_com_nicheng;?></span></div></li>
         <li>
          <div class="name">性　　别：</div>
          <div class="input">	
          <select id="rsex" class="select_normal" name="rsex" style="width:70px;">
          <option value="1"<?php if($CcTvAi_com_sex=="帅哥"){ echo " selected=\"selected\"";} ?>>帅 哥</option>
          <option value="0"<?php if($CcTvAi_com_sex=="靓女"){ echo " selected=\"selected\"";} ?>>美 女</option>
          </select></li>
         <li>
          <div class="name">出　　生：</div>
          <div class="input">
         <select id="ryear" class="select_normal" name="ryear">
          <option value="0">请选择年</option>
<?php
//生日:年
for ($i=0; $i<100; $i++) {
	$they=date('Y')-$i;
	if ($they>="1970") {
		$selectstr=$they==date('Y', strtotime($CcTvAi_com_birthday)) ? ' selected' : '';
		echo "<option value=\"$they\"$selectstr>$they</option>";
	}
}
?>
         </select>
         <select id="rmonth" class="select_normal" name="rmonth">
          <option value="">请选择月</option>
<?php
//生日:月
for ($i=1; $i<13; $i++) {
	if ($i<=9) {
		$im="0" . $i;
	} else {
		$im=$i;
	}
	$selectstr=$im==date('m', strtotime($CcTvAi_com_birthday)) ? ' selected' : '';
	echo "<option value=\"$im\"$selectstr>$im</option>";
}
?>
         </select>
         <select id="rday" class="select_normal" name="rday">
          <option value="">请选择日</option>
<?php
//生日:日
for ($i=1; $i<32; $i++) {
	if ($i<=9) {
		$iday="0" . $i;
	} else {
		$iday=$i;
	}
	$selectstr=$iday==date('d', strtotime($CcTvAi_com_birthday)) ? ' selected' : '';
	echo "<option value=\"$iday\"$selectstr>$iday</option>";
}
?>
         </select>
         </div>
          <div id="mbirth" class="input_msg">请选择您的生日。</div></li>
         <li>
          <div class="name"><span>*</span>城　　市：</div>
          <div class="input"><input id="raddress" class="input_normal" type="text" value="<?php echo $CcTvAi_com_birthcity;?>" readonly="readonly" name="raddress" style="width: 190px; cursor: pointer;"/></div>
          <div id="maddress" class="input_msg">请单击选择您的所在城市。</div></li>
         <li>
          <div class="name"><span>*</span>Ｑ　　Ｑ：</div>
          <div class="input"><input id="rqq" class="input_normal" type="text" value="<?php echo $CcTvAi_com_qq;?>" maxlength="10" name="rqq" style="width:190px;"/></div>
          <div class="seh_list"><a class="seh_list_a" href="javascript:;" id="openQQ"><?php if($CcTvAi_com_hidden=="1"){ echo "公开QQ"; }else{ echo "不公开"; } ?><b class="arrow"></b></a>
          <div class="seh_sort" style="display: none;"><a href="javascript:;">公开QQ</a><a href="javascript:;">不公开</a></div>
          </div>
          <div id="mqq" class="input_msg">输入您的QQ号</div></li>
         <li>
          <div class="name"><span>*</span>邮　　箱：</div><div class="input"><input id="remail" class="input_normal" type="text" value="<?php echo $CcTvAi_com_email;?>" name="remail" style="width:190px;"/></div>
          <div id="memail" class="input_msg">安全邮箱能够帮您取回您忘记的密码。</div></li>
         <li>
          <div class="name"><span>*</span>个人介绍：</div>
          <div class="input"><textarea name="textfield" cols="30" rows="7" id="rselfIntroduce"><?php echo $CcTvAi_com_sign;?></textarea></div>
          <div id="mselfIntroduce" class="input_msg"></div></li>
         <li>
          <div class="name"></div>
          <div class="input"><span class="button-main"><span><button id="seveProfile" type="button">保存修改</button></span></span>
          </div></li>
        </ul> 
       </div> 
<!--修改头像-->
       <div id="modifyAvatar" class="profile" style="<?php if($current=="avatar"){echo "display:";}else{echo "display:none";} ?>;">
        <div class="title">
         <div class="name">修改头像</div>
        </div>
        <div class="avatar_box"> 
         <div class="avatarTitle">当前头像<span>设置头像</span> </div> 
         <div class="myAvatar"> 
          <img class="avatar-160" id="my-avatar" width="160" height="160" src="<?php echo linkuserphoto($CcTvAi_com_userid,200); ?>"/>
         </div> 
         <div class="myAvatarUpload"> 
		 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="432" height="316" id="tmp" align="middle">
		 <param name="allowScriptAccess" value="always" />
		 <param name="allowFullScreen" value="false" />
		 <param name="wmode" value="opaque" />
		 <param name="movie" value="<?php echo cd_webpath?>user/static/swf/avatar.swf"/>
		 <param name="quality" value="high" />
		 <param name="bgcolor" value="#ffffff" />
		 <embed src="<?php echo cd_webpath?>user/static/swf/avatar.swf" quality="high" wmode="opaque" bgcolor="#ffffff" width="432" height="316" name="browse" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_cn"/>
		 </object>
         </div> 
        </div> 
       </div> 
	   
<!--修改密码-->
       <div id="modifyPassword" class="profile" style="<?php if($current=="password"){echo "display:";}else{echo "display:none";} ?>;">
        <div class="title">
         <div class="name">修改密码</div>
        </div> 
        <ul> 
         <li> 
          <div class="name">当前密码：</div>
          <div class="input"><input id="roldpassword" class="input_normal" type="password" maxlength="20" name="roldpassword" style="width:190px;"></div>
          <div id="moldpassword" class="input_msg">请输入您当前使用的密码。</div></li>
         <li>
          <div class="name">设置新密码：</div>
          <div class="input"><input id="rpassword" class="input_normal" type="password" maxlength="20" name="rpassword" style="width:190px;"/></div>
          <div id="mpassword" class="input_msg">6到20个字符，请使用英文字母（区分大小写）、符号或数字。</div></li>
         <li>
          <div class="name">确认新密码：</div>
          <div class="input"><input id="rpassword2" class="input_normal" type="password" maxlength="20" name="rpassword" style="width:190px;"/></div>
          <div id="mpassword2" class="input_msg">再次输入您所设置的密码，以确认密码无误。</div></li>
         <li>
          <div class="name"></div>
          <div class="input"><span class="button-main"><span><button id="sevePassword" type="button">保存修改</button></span></span></div></li>
        </ul> 
       </div> 
<!--修改密保-->
       <div id="modifyProtection" class="profile" style="<?php if($current=="protection"){echo "display:";}else{echo "display:none";} ?>;">
        <div class="title">
         <div class="name">修改密保</div>
         </div>
        <ul> 
         <li> 
          <div class="name">当前密码：</div>
          <div class="input"><input id="rpasswords" class="input_normal" type="password" maxlength="20" name="rpasswords" style="width:190px;"></div>
          <div id="mpasswords" class="input_msg">请输入您当前使用的密码。</div></li>
         <li>
          <div class="name">设置密保问题：</div>
          <div class="input"><input id="rquestion" class="input_normal" type="text" value="<?php echo $CcTvAi_com_question; ?>" maxlength="20" name="rquestion" style="width:190px;"/></div>
          <div id="mquestion" class="input_msg">2到20个字符，中文、英文字母（区分大小写）、符号或数字。</div></li>
         <li>
          <div class="name">设置密保答案：</div>
          <div class="input"><input id="ranswer" class="input_normal" type="password" maxlength="20" name="ranswer" style="width:190px;"/></div>
          <div id="manswer" class="input_msg">2到20个字符，中文、英文字母（区分大小写）、符号或数字。</div></li>
         <li>
          <div class="name"></div>
          <div class="input"><span class="button-main"><span><button id="seveProtection" type="button">保存修改</button></span></span></div></li>
        </ul> 
       </div> 
<!--修改昵称-->
       <div id="modifyNickname" class="profile" style="<?php if($current=="nickname"){echo "display:";}else{echo "display:none";} ?>;">
        <div class="title">
         <div class="name">修改昵称</div>
        </div> 
        <ul> 
         <li> 
          <div class="name">昵称：</div>
          <div class="input"><span class="nickname"><?php echo $CcTvAi_com_nicheng;?></span></div></li>
         <li>
          <div class="name"><span>*</span>新昵称：</div>
          <div class="input"><input id="rnickname" class="input_normal" type="text" value="" maxlength="12" name="rnickname" style="width:150px;"/></div>
          <div id="mnickname" class="input_msg">请填写您的名字（不能使用空格、数字、和 &lt; &gt; ' " / \ 等非法字符）。</div></li>
         <li>
          <div class="name"></div>
          <div class="input"><span class="button-main"><span><button id="seveNickname" type="button">提交更改</button></span></span></div></li>
        </ul> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </div>  
</div> 
<?php }elseif($view=="applyCertify"){?>
    <div class="user_main"> 
     <div class="uMain_content"> 
      <div class="main_nav"> 
       <ul> 
        <li class="message"> <a href="<?php echo rewrite_url('space.php?do=profile');?>">个人资料</a> </li>
        <li class="skin"><a href="<?php echo cd_webpath.cd_webmlsinger?>/index.php?ac=skin&id=<?php echo $CcTvAi_com_userid?>" target="_blank">空间换肤</a></li>	  
        <li class="certify"> <a class="on" href="<?php echo rewrite_url('space.php?do=profile&view=applyCertify');?>">美女认证</a> </li>
       </ul> 
      </div> 
      <div class="main"> 
       <div id="tooltip" class="refresh"> 
       </div> 
      </div> 
      <div class="minHeight500"> 
<?php if($CcTvAi_com_sex == "帅哥"){ ?>
       <div class="nothing">您不是女性，无法参加美女认证！</div>
<?php }elseif($CcTvAi_com_checkmm == "1"){ ?>
       <div class="nothing">您已通过认证，无需再参加美女认证！</div>
<?php }else{ ?>
       <div id="modifyAvatar" class="profile">
        <div class="title"><div class="name">申请认证</div></div>
        <div class="avatar_box">
         <div class="state">认证状态：<?php if($CcTvAi_com_checkmm == "1"){ echo '<font color="#FF0000">已通过认证！</font>'; }elseif($CcTvAi_com_checkmm == "2"){ echo '<font color="#FF0000">已提交审核！</font>'; }else{ echo '未申请认证！'; }?></div>
<?php if($step == "2"){ ?>
         <div class="avatarTitle">摄像头拍照</div> 
         <div id="camera" class="camera"> 
          <div id="cam" class="cam"> <div id="webcam" class="webcam"></div> </div> 
          <div id="buttons" class="buttons"> 
           <div class="button_pane" id="shoot"><a id="btn_shoot" href="javascript:;" class="btn_camera">拍照</a></div> 
           <div class="button_pane hidden" id="upload"><a id="btn_upload" href="" class="btn_green">申请认证</a><a id="btn_cancel" href="javascript:;" class="btn_cancel">取消</a></div> 
           <div class="button_pane hidden" id="loading" style="display:none;"><a href="javascript:;" class="btn_cancel">上传中...</a></div> 
          </div> 
         </div> 
         <ul class="process"> 
          <li class="pro">认证流程</li>
          <li>1.请通过照相设备进行拍照，将拍好的视频照片上传至网站。</li>
          <li>2.我们会在最多不超过10小时内审核您的申请。</li>
          <li>3.审核通过后，您就可以成为认证用户点亮认证用户图标，并获得 <?php echo cd_usermmpoints; ?> 金币奖励。</li>
          <li style='color:#ff0000'>注：您的头像和认证照片必须是本人真实面貌，否则无法通过审核。</li>
          <li style='color:#ff0000'>如果在本页面中无法打开您的摄像头，您可以联系管理员QQ：<?php echo cd_webqq?>进行认证。</li>
         </ul> 
<?php }else{ ?>
         <div class="avatarTitle">您的个人头像</div>
          <div id="camera" class="camera">
           <div id="cam" class="cam"><img width="220" height="220" src="<?php echo linkuserphoto($CcTvAi_com_userid,200)?>" onerror="this.src='<?php echo cd_webpath?>user/static/images/noface_200x200.gif'" /></div>
            <div id="buttons" class="buttons"><div class="button_pane"><a id="next" href="<?php echo cd_webpath?>user/space.php?do=profile&view=applyCertify&step=2" class="btn_next">下一步</a></div></div>
         </div>
         <ul class="process"> 
          <li class="pro">认证流程</li> 
          <li>1.请通过照相设备进行拍照，将拍好的视频照片上传至网站。</li> 
          <li>2.我们会在最多不超过10小时内审核您的申请。</li> 
          <li>3.审核通过后，您就可以成为认证用户点亮认证用户图标，并获得 800 金币奖励。</li> 
          <li style="color:#ff0000">注：您的头像和认证照片必须是本人真实面貌，否则无法通过审核。</li> 
          <li style="color:#ff0000">如果在本页面中无法打开您的摄像头，您可以联系管理员QQ：<?php echo cd_webqq?>进行认证。</li> 
         </ul> 
<?php } ?>
         <div class="cannot_clear"> 
          <div class="alert">
           类似这样的头像，不会被审核通过
           <i class="arrow"></i>
          </div> 
          <ul> 
           <li><img src="<?php echo cd_webpath?>user/static/space/images/bad_photo/bad_photo4.jpg" /><p>遮住五官</p></li> 
           <li><img src="<?php echo cd_webpath?>user/static/space/images/bad_photo/bad_photo5.jpg" /><p>照片模糊</p></li> 
           <li><img src="<?php echo cd_webpath?>user/static/space/images/bad_photo/bad_photo6.jpg" /><p>裸露、纹身、吸烟</p></li> 
           <li><img src="<?php echo cd_webpath?>user/static/space/images/bad_photo/bad_photo1.jpg" /><p>非正面照</p></li> 
           <li><img src="<?php echo cd_webpath?>user/static/space/images/bad_photo/bad_photo3.jpg" /><p>表情过分夸张</p></li> 
           <li><img src="<?php echo cd_webpath?>user/static/space/images/bad_photo/bad_photo7.jpg" /><p>照片与本人形象差别过大</p></li> 
          </ul> 
         </div> 
        </div> 
       </div>
<?php } ?>
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
<?php }?>
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.min.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/core.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/card.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/dialog.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.plugins.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/common.js"></script> 
  <script type="text/javascript">listenMsg.start();nav.init();nav.userMenu();nav.helpNoticeInit();</script>
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/profile.js"></script>
<?php if($view=="applyCertify"){?>
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/camera/webcam.js"></script>
<?php }elseif($view==""){?>
  <script type="text/javascript">
profile.init();
select.init('openQQ');
function UploadPicSucceed(data) {
var tt = $('#my-avatar').attr('src');
var aa = $('#userInfo').attr('src');
var bb = $('#menu-avatar').attr('src');
$('#my-avatar').attr('src', tt + '?' + (new Date().getTime()));
$('#userInfo').attr('src', aa + '?' + (new Date().getTime()));
$('#menu-avatar').attr('src', bb + '?' + (new Date().getTime()));
alert('头像保存成功');
location.href = 'space.php?do=profile&i=avatar';
}
  </script>
<?php }?>
<?php if($step == "2"){ ?>
  <script type="text/javascript">profile.certifyInit();</script>
<?php } ?>
<?php include_once('source/space_footer.php');?>  
</body>
</html>