<?php
/*
 * 注意：此文件由tpl_engine编译型模板引擎编译生成。
 * 如果您的模板要进行修改，请修改 templates/default/uiparts/homeleft.html
 * 如果您的模型要进行修改，请修改 models/uiparts/homeleft.php
 *
 * 修改完成之后需要您进入后台重新编译，才会重新生成。
 * 如果您开启了debug模式运行，那么您可以省去上面这一步，但是debug模式每次都会判断程序是否更新，debug模式只适合开发调试。
 * 如果您正式运行此程序时，请切换到service模式运行！
 * 
 * 如有您有问题请到官方论坛（http://tech.jooyea.com/bbs/）提问，谢谢您的支持。
 */
?><?php
	//引入语言包
	$mn_langpackage=new menulp;
	
	$holder_ID=short_check(get_argg('h'));
	$send_msgscrip='modules.php?app=msg_creator&2id='.$holder_ID.'&nw=2';
	$add_friend="javascript:mypalsAddInit($holder_ID)";
	$leave_word='modules.php?app=msgboard_more&user_id='.$holder_ID;
	$send_hi="hi_action($holder_ID)";
	$send_report="report_action(10,$holder_ID,$holder_ID);";

	if(!isset($user_id)){
	  	$send_msgscrip="javascript:parent.goLogin();";
	  	$add_friend='javascript:parent.goLogin()';
	  	$leave_word="javascript:parent.goLogin();";
	  	$send_hi='javascript:parent.goLogin()';
	  	$send_report='javascript:parent.goLogin()';
	  	set_session('pre_login_url',$_SERVER["REQUEST_URI"]);
	}

	//数据表定义
	$t_data_count=$tablePreStr."data_count";
	$sql="select * from $t_data_count where user_id=$holder_ID";
	$data_num=$dbo->getRow($sql);
	$hi_num=$data_num['hi_num'];
	$blog_num=$data_num['blog_num'];
	$poll_num=$data_num['poll_num'];
	$share_num=$data_num['share_num'];
	$pals_num=$data_num['pals_num'];
	$photo_num=$data_num['photo_num'];
	$group_num=$data_num['group_num'];
	$mood_num=$data_num['mood_num'];
	$msgboard_num=$data_num['msg_num'];
	$scrip_num=$data_num['scrip_num'];
?>
<script language=javascript>
function goLogin(){
	Dialog.confirm("<?php echo $pu_langpackage->pu_login;?>",function(){top.location="index.php";});
}

function mypalsAddInit(other_id)
{
	  xmlhttp=InitAjax();
	  xmlhttp.open("GET","do.php?act=add_mypals&other_id="+other_id,true);
	  xmlhttp.onreadystatechange=function(){
		  	if(xmlhttp.readyState==4&&xmlhttp.status==200){
			  	  var return_str=xmlhttp.responseText;
				    var	return_text=return_str.replace(/[\s\n\r]/g,"");
			      if(return_text=="success"){
							Dialog.alert_ok("<?php echo $mp_langpackage->mp_suc_add;?>");
						}else{
							Dialog.alert(return_text);
						}
		 	  }
	  }
	  xmlhttp.send(null);
}
 	
  
  function hi_action_int(){
  	<?php echo $send_hi;?>;
  }
  
  function report_action_int(){
  	<?php echo $send_report;?>;
  }
  
  function report_action(type_id,user_id,mod_id){
		var point=Get_mouse_position("loc");
		$("report").style.display='';
		$("report").style.top=point[1]-20+"px";
		$("report").style.left=point[0]-50+"px";
		$("report").innerHTML=
		"<table style='background-color:white'>"+
		"<tr><caption><b><?php echo $pu_langpackage->pu_report;?></b></caption></tr>"+
		"<tr><td><?php echo $pu_langpackage->pu_report_info;?></td></tr>"+
		"<tr><td><?php echo $pu_langpackage->pu_report_re;?></td></tr>"+
		"<tr><td><textarea id='reason' style='width:260px;height:100px'></textarea></td></tr>"+
		"<tr><td><input type='button' class='top_button' value='<?php echo $u_langpackage->u_b_con;?>' onclick='act_report(\""+type_id+"\","+user_id+","+mod_id+");' /><input type='button' onclick='cancel_report();' class='top_button' value='<?php echo $u_langpackage->u_b_can;?>' /></td></tr>"+
		"</table>";  	
  }
  
	function hi_action(uid){
		var point=Get_mouse_position("loc");
		document.getElementById("button_action").onclick=function(){send_hi(uid);};
		document.getElementById("hi_window").style.display="";
		document.getElementById("hi_window").style.top=point[1]-20+"px";
		document.getElementById("hi_window").style.left=point[0]-50+"px";
	}
	
	function cancel_hi(){
		document.getElementById("hi_window").style.display="none";
	}
	
	function send_hi(uid){
		var hi_type=document.getElementsByName("hi_type");
		
		for(def=0;def<hi_type.length;def++){
			if(hi_type[def].checked==true){
				var hi_t=hi_type[def].value;
			}
		}
		var xmlhttp=InitAjax();
		xmlhttp.open("GET","do.php?act=user_add_hi&to_userid="+uid+"&hi_t="+hi_t);
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState==4&&xmlhttp.status==200){
				document.getElementById("hi_window").style.display="none";
	  	  var return_str=xmlhttp.responseText;
		    var	return_text=return_str.replace(/[\s\n\r]/g,"");
		    if(return_text=="success"){
		    	Dialog.alert_ok("<?php echo $hi_langpackage->hi_success;?>");
		    }else{
		    	Dialog.alert(return_text);
		    }
			}
		}
		xmlhttp.send(null);
	}
  
</script>
<div class="main_l left">
      
        <div class="c_t">
          <div class="c_t_l left"></div>
          <div class="c_t_r right"></div>
        </div>
        <div class="c_m">
        <div class="myphoto"><img src='<?php echo str_replace("_small","",$user_info['user_ico']);?>' class='user_ico'></div>
        <div class="extratool"><ul>
          <li class="extratool_5"><a href='<?php echo $add_friend;?>'><?php echo $mn_langpackage->mn_add_pals;?></a></li>
          <li class="extratool_2"><a href='<?php echo $send_msgscrip;?>' target='frame_content'><?php echo $mn_langpackage->mn_send_scrip;?></a></li>
          <li class="extratool_3"><a href='modules.php?app=mood_more&user_id=<?php echo $holder_ID;?>'  target='frame_content'><?php echo $mn_langpackage->mn_scan_mood;?></a></li>
          <li class="extratool_4"><a href='<?php echo $leave_word;?>' target='frame_content'><?php echo str_replace("{sex}",$user_thirdperson,$mn_langpackage->mn_mes);?></a></li>
          <li class="extratool_1"><a href='javascript:void(0)' onclick='hi_action_int();'><?php echo $hi_langpackage->hi_say_hi;?></a></li>
          <?php if($holder_ID!=$user_id){?>
          <li class="jubao"><a href="javascript:void(0);" onclick="report_action_int();"><?php echo str_replace("{sex}",$user_thirdperson,$mn_langpackage->mn_report_who);?></a></li></ul>
         	<?php }?>
          <?php if($holder_ID==$user_id){?>
          <li class="extratool_6"><a href="modules.php?app=user_dressup" target='frame_content'><?php echo $mn_langpackage->mn_user_dressup;?></a></li></ul>
         	<?php }?>
         </div>
          
          <ul class="clear"><h4><?php echo $mn_langpackage->mn_user;?></h4>
          <div class="clear"></div>
          <li class="tool_1"><a href="modules.php?app=blog&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_blog;?></a><span><?php echo $blog_num;?></span></li>
          <li class="tool_2"><a href="modules.php?app=album_list&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_album;?></a><span><?php echo $photo_num;?></span></li>
          <li class="tool_9"><a href="modules.php?app=share_list&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_share;?></a><span><?php echo $share_num;?></span></li>
          <li class="tool_3"><a href="modules.php?app=<?php echo $friendHref;?>&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_pal;?></a><span><?php echo $pals_num;?></span></li>
          <?php if($holder_ID==$user_id){?>
          <li class="tool_5"><a href="modules.php?app=msg_minbox&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_scrip;?></a><span><?php echo $scrip_num;?></span></li>
          <?php }?>
          <?php if($holder_ID==$user_id){?>
          <li class="tool_4"><a href="modules.php?app=user_hi" target='frame_content'><?php echo $mn_langpackage->mn_hi;?></a><span><?php echo $hi_num;?></span></li>
          <?php }?>
          <li class="tool_6"><a href="modules.php?app=poll_list&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_poll;?></a><span><?php echo $poll_num;?></span></li>
          <li class="tool_7"><a href="modules.php?app=msgboard_more&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_msg;?></a><span><?php echo $msgboard_num;?></span></li>
          <li class="tool_8"><a href="modules.php?app=mood_more&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_mood;?></a><span><?php echo $mood_num;?></span></li>
          <li class="tool_10" style=" border-bottom:none"><a href="modules.php?app=group&user_id=<?php echo $holder_ID;?>" target='frame_content'><?php echo $mn_langpackage->mn_group;?></a><span><?php echo $group_num;?></span></li>
          </ul>
          <div class="clear"></div>
    <!-- plugins !-->  
    <div id="plugin_menu">
    	<?php echo show_plugins($plugin_menu);?>
    </div>
    <!-- plugins !-->              
        </div>
        <div class="c_bt">
          <div class="c_bt_l left"></div>
          <div class="c_bt_r right"></div>
        </div>
    </div>