<?php
//纯文本Logo
if(file_exists('output/puretext.png'))
{
	list($width, $height, $type, $attr) = getimagesize("output/puretext.png");
	$pic_html = <<<pic
<div id="show_logo" padding-top:10px;padding-bottom:10px;"><img id="show_img" src="output/puretext.png"/><span>宽*高:{$width}px*{$height}px</span></div>
pic;
}
else
{
	$pic_html = <<<pic
<div style="display:none;" id="show_logo"><img id="show_img" src=""/></div>	
pic;
}

$js = <<<js
<link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
<script type="text/javascript" src="../../script/colorpicker.js"></script>
<script type="text/javascript" src="../../script/helper.js"></script>
<script type="text/javascript">
function showColor(src)
{
	$('#'+src).ColorPicker({
		onSubmit: function(hsb, hex, rgb, el) {
			colorValue = '#'+hex;
    		$(el).val(colorValue);
    		$(el).ColorPickerHide();
		},
		onBeforeShow: function () {
    		$(this).ColorPickerSetColor(this.value);
    	}
	}).bind('keyup', function(){
    	$(this).ColorPickerSetColor(this.value);
    });
}
function ajaxSend()
{
	$.ajax({
	   type: "POST",
	   url: "server.php",
	   data: {id:"puretext",logo_shadow_color:$('#logo_shadow_color').val(),website_shadow_color:$('#website_shadow_color').val(),check_website:$("#check_website").attr('checked'),logo_text:$("#logo_text").val(),font_family:$("#font_family").val(),font_size:$("#font_size").val(),logo_website:$("#logo_website").val(),website_font_family:$("#website_font_family").val(),website_font_size:$("#website_font_size").val(),logo_border:$("#logo_border").val(),logo_text_color:$("#logo_text_color").val(),website_color:$("#website_color").val(),border_color:$("#border_color").val(),logo_shadow:$("#logo_shadow").attr("checked"),website_shadow:$("#website_shadow").attr("checked"),bg_color:$(":radio:checked").attr("value")},
	   beforeSend:function(msg){
	   		$("#show_logo").css('display','block');
	   		$("#show_img").remove();
			$("#show_logo").append("<img id='show_img' src='images/loadingAnimation.gif'/>");
		},
	   success: function(msg){
	   		if(msg.substr(0,6) == 'notice')
	   		{
	   			msg = msg.substring(6);
	   			$('#notice').empty();
	   			$('#notice').css('display','block').append(msg);
	   			$("#show_logo").remove();
	   		}
	   		else
	   		{
				window.location.reload();
			}
   	   },
   	   error: function(msg){
   	   	 	alert(msg);
   	   }
	});
}
</script>
js;

$html = <<<html
<div style="text-align:left;font-size:18px;font-family:'microsoft yahei';color:#006ec6;">纯文字风格</div>
<div class="tabstyle"></div>
<div class="divSettings">	
	<table cellspacing="0" cellpadding="5" width="100%" border="0">
		<tbody>
			<tr>
            	<td style="width: 70px" valign="top" nowrap>
                        <span>LOGO文本:</span>
                </td>
                <td>
                	<div>
                            <input name="logo_text" type="text" value="建站之星" maxlength="20" id="logo_text" style="width:350px;" />
                   	</div>
                </td>
          	</tr>
            <tr>
                    <td style="width: 70px; height: 29px" valign="top" nowrap>
                        <font>LOGO字体: </font>
                    </td>
                    <td style="height: 29px">
                        <select name="font_family" id="font_family" style="width:104px;">
							<option value="simfang">仿宋</option>
							<option selected="selected" value="simsun">宋体(默认)</option>
							<option value="simkai">楷体</option>
							<option value="simhei">黑体</option>
							<option value="simli">隶书</option>
							<option value="simyou">幼圆</option>
							<option value="msyh">微软雅黑</option>
							<option value="msyhbd">微软雅黑加粗</option>
							<option value="sthupo">华文琥珀</option>
							<option value="stxihei">华文细黑</option>
							<option value="stxinwei">华文新魏</option>
							<option value="stxingka">华文行楷</option>
							<option value="fzstk">方正舒体</option>
							<option value="sursong">方正超大字体</option>
						</select>
                        &nbsp; 字号:
                        <select name="font_size" id="font_size" style="width:72px;">
							<option value="10">10</option>
							<option value="15">15</option>
							<option value="20">20</option>
							<option selected="selected" value="25">25</option>
							<option value="30">30</option>
							<option value="35">35</option>
							<option value="40">40</option>
						</select>
                        &nbsp;px
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px" valign="top" nowrap>
                        <span>LOGO网址:</span>
                    </td>
                    <td>

                        <div class="errorbox-good">
                            <input name="logo_website" type="text" value="www.sitestar.cn" maxlength="20" id="logo_website" style="width:210px;" /><font
                                face="宋体">&nbsp;&nbsp; </font>
                            <input id="check_website" type="checkbox" name="check_website" checked="checked" /><label for="check_website">显示网址(默认)</label></div>
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px; height: 29px" valign="top" nowrap>
                        <font face="Arial, sans-serif" size="-1">网址字体: </font>

                    </td>
                    <td style="height: 29px">
                        <font face="宋体">
                            <select name="website_font_family" id="website_font_family" style="width:104px;">
								<option value="simfang">仿宋</option>
								<option selected="selected" value="simsun">宋体(默认)</option>
								<option value="simkai">楷体</option>
								<option value="simhei">黑体</option>
								<option value="simli">隶书</option>
								<option value="simyou">幼圆</option>
								<option value="msyh">微软雅黑</option>
								<option value="msyhbd">微软雅黑加粗</option>
								<option value="sthupo">华文琥珀</option>
								<option value="stxihei">华文细黑</option>
								<option value="stxinwei">华文新魏</option>
								<option value="stxingka">华文行楷</option>
								<option value="fzstk">方正舒体</option>
								<option value="sursong">方正超大字体</option>
							</select>
                            &nbsp;字号:
                            <select name="website_font_size" id="website_font_size" style="width:72px;">
								<option value="10">10</option>
								<option value="15">15</option>
								<option selected="selected" value="20">20</option>
								<option value="25">25</option>
								<option value="30">30</option>
								<option value="35">35</option>
								<option value="40">40</option>
							</select>
                            &nbsp;px</font>
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px; height: 29px" valign="top" nowrap>
                        <font face="Arial, sans-serif" size="-1">边框宽度: </font>
                    </td>

                    <td style="height: 29px">
                        <select name="logo_border" id="logo_border" style="width:100px;">
							<option value="0">不添加边框</option>
							<option selected="selected" value="1">1(默认)</option>
							<option value="2">2</option>
							<option value="3">3</option>
						</select>
                        &nbsp;px
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px" valign="top" nowrap>
                        <span>颜色设置:</span>
                    </td>
                    <td>
				                         文字颜色:<input onclick="showColor('logo_text_color');" onkeyup="$(this).attr('value','');" name="logo_text_color" type="text" value="0066cc" id="logo_text_color" style="width:80px;" />
				                         网址颜色:<input onclick="showColor('website_color');" onkeyup="$(this).attr('value','');" name="website_color" type="text" value="0066cc" id="website_color" style="width:80px;" />
				                         边框颜色:<input onclick="showColor('border_color');" onkeyup="$(this).attr('value','');" name="border_color" type="text" value="0066cc" id="border_color" style="width:80px;" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px; height: 29px" valign="top" nowrap>
                        <font face="Arial, sans-serif" size="-1">描边设置: </font>
                    </td>
                    <td style="height: 29px">
                        <font face="宋体">
                            <input id="logo_shadow" type="checkbox" name="logo_shadow" /><label for="logo_shadow">LOGO文本添加描边效果</label>&nbsp;
                           	文本描边颜色:<input value="#000000" onclick="showColor('logo_shadow_color');" onkeyup="$(this).attr('value','');" style="width:80px;" id="logo_shadow_color" type="text" name="logo_shadow_color"><br>
                            <input style="margin-top:8px;" id="website_shadow" type="checkbox" name="website_shadow" /><label for="website_shadow">域名添加描边效果</label></font>
                           	<span style="margin-left:30px;">域名描边颜色:<input value="#000000" onclick="showColor('website_shadow_color');" onkeyup="$(this).attr('value','');" style="width:80px;" id="website_shadow_color" type="text" name="website_shadow_color"></span>
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px; height: 29px" valign="top" nowrap>
                        <font face="Arial, sans-serif" size="-1">图片背景: </font>
                    </td>
                    <td style="height: 29px">
                        <font face="宋体"></font>
                        <span style="display:inline-block;height:18px;width:328px;"><input id="bg_color_0" type="radio" name="bg_color" value="white" checked="checked" />白色(默认)<input id="bg_color_1" type="radio" name="bg_color" value="transparent" />透明色(适合网站背景色为非白色的网站)</span>
                    </td>
                </tr>
                <tr>
                    <td style="width: 70px">
                    </td>
                    <td>
                        <input onclick="ajaxSend();" type="button" value="创建我的Logo >>" id="logo_button" style="width:244px;" />
                    </td>
                </tr>
            </tbody>
        </table>
        &nbsp;&nbsp;<div id="notice" style="display:none;margin-top:5px;"></div>
</div>	
$pic_html
html;
?>