<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="save" content="history"> 
<title><?php echo V('-:tpl/title');?>管理后台</title>
<link href="<?php echo W_BASE_URL;?>css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo W_BASE_URL;?>js/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo W_BASE_URL;?>js/admin.js"></script>
<script>
$(function() {
	$('input[type="text"]').blur(function() {
		checkForm(this);
		if (this.id == 'nick') {
			getInfo(this.value, '#url');
		}
	})
});
function getInfo(nick, target) {
	var $target = $(target);
	if (nick != '' && $.trim($target.val()) == '') {
		$.post('<?php echo URL('admin/celebrity.getInfo');?>',{'nick': nick}, function(json) {
			json = eval('(' + json + ')');
			if (json.url != '') {
				$('#url').val('<?php echo W_BASE_HTTP;?>' + json.url);
			}
			if (json.description != '') {
				$('#description').val(json.description);
			}
		});
	}
}
</script>
</head>
<body>
     <div class="wrap">
     	<div class="position">当前位置：微博管理<em>></em>名人推荐<em>></em><strong><?php if ($info['id']) {?>编辑<?php } else { ?>添加<?php } ?>推荐</strong></div>
        <!--搜索结果列表-->
        <div class="cr_form">
                <form method="post" name="form_user" id="form_user" action="" onsubmit="return checkForm(this);">
                        <input type="hidden" id="id" name="id" value="<%$info.user_id%>" />
                        <table cellspacing="0">
                        	<tr>
                            	<td width="315" class="tbtitle"><label for="nick"><em>*</em>推荐名人昵称：</label></td>
                                <td></td>
                            </tr>
                            <tr class="from_row">
                                <td width="315">
                                <?php if ($info) {?>
                                <?php echo $info['nick'];?>
                                <?php } else {?>
                                <input type="text" name="nick" id="nick" class="insert_text" valid="required" value="<?php echo $info['nick'];?>" />
                                <?php } ?>
                                </td>
                                <td><div id="nick_msg"></div></td>
                            </tr>
                            <tr>
                            	<td colspan="2" class="tbtitle"><label for="url"><em>*</em>推荐地址：</label></td>
                            </tr>
                            <tr class="from_row">
                                <td>
                                <?php if ($info) {?>
                                <a href="<?php echo $info['url'];?>" target="_blank"><?php echo W_BASE_HTTP . $info['url'];?></a>
                                <?php } else {?>
                                    <input name="url" type="text" id="url" value="<?php W_BASE_HTTP .$info['url'];?>" class="insert_text" valid="required" />
                                <?php } ?>
                                </td>
                                <td><div id="url_msg"></div></td>
                            </tr>
                            <tr>
                            	<td colspan="2" class="tbtitle"><label for="description">推荐名人介绍：</label></td>
                            </tr>   
                            <tr class="from_row">
                                <td>
                                <?php if ($info) {?>
                                <?php echo $info['description'];?>
                                <?php } else {?>
                                    <input name="description" type="text" id="description" value="<?php $info['description'];?>" class="insert_text" valid="norequired" />
                                <?php } ?>
                                </td>
                                <td><div id="description_msg"></div></td>
                            </tr>
                            <tr>
                            	<td colspan="2" class="tbtitle"><label for="orders">排序：</label></td>
                            </tr> 
                            <tr class="from_row">
                                <td>
                                    <input name="orders" type="text" id="orders" value="<?php echo $info['orders'];?>" class="insert_text" valid="norequired" />
                                </td>
                                <td><div id="orders_msg"></div></td>
                            </tr>
                                
                                <tr>
                                    <td colspan="2" class="cr_formop">
                                        <input type="hidden" name="id" value="<?php echo $info['id'];?>" />
                                        <span class="button"><input name="" type="submit" value="提 交" /></span>
                                    </td>
                                </tr>
                               
                       </table>
                </form>
        </div>
		<div class="info_tips">
            <p>1.名人推荐将取前12名在爱说茶馆前端网页中显示，每次显示3人，共分4页；</p>
            <p>2.显示内容包括头像、昵称、介绍，点击后在此设定的网页；</p>
            <p>3.取前12名的选择方式为优先选择设置的排序数值较小的内容，排序相同选择ID较小的内容。</p>
            <p>4.昵称请输入此用户当前在微博中使用的昵称。</p>
        </div>
     </div>  
</body>
</html>
