<?php
//字幕滚动
if(file_exists('output/TextScroll.gif'))
{
	$pic_html = <<<pic
<div id="show_logo"><img id="show_img" src="output/TextScroll.gif"/></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:"TextScroll",logo_pic:$(":radio:checked").attr("value"),logo_text:$("#logo_text").val(),ScrollType:$("#ScrollType").val(),font_size:$("#font_size").val(),font_family:$("#font_family").val(),text_color:$("#text_color").val()},
	   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){alert(msg);
			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="5">
     <tbody><tr>
        <td width="25%">Logo选择：</td>
        <td>
			<input type="radio" checked="checked" value="logo001" name="logo_pic" id="logo001"><img src="images/logo001.gif"/>&nbsp;&nbsp;&nbsp;
			<input type="radio" value="logo002" name="logo_pic" id="logo002"><img src="images/logo002.gif"/>&nbsp;&nbsp;&nbsp;
			<input type="radio" value="logo003" name="logo_pic" id="logo003"><img src="images/logo003.gif"/>&nbsp;&nbsp;&nbsp;<br>
			<input type="radio" value="logo004" name="logo_pic" id="logo004"><img src="images/logo004.gif"/>&nbsp;&nbsp;&nbsp;
			<input type="radio" value="logo005" name="logo_pic" id="logo005"><img src="images/logo005.gif"/>&nbsp;&nbsp;&nbsp;
			<input type="radio" value="logo006" name="logo_pic" id="logo006"><img src="images/logo006.gif"/>&nbsp;&nbsp;&nbsp;<br>
			<input type="radio" value="logo007" name="logo_pic" id="logo007"><img src="images/logo007.gif"/>&nbsp;&nbsp;&nbsp;
			<input type="radio" value="logo008" name="logo_pic" id="logo008"><img src="images/logo008.gif"/>&nbsp;&nbsp;&nbsp;
			<input type="radio" value="logo009" name="logo_pic" id="logo009"><img src="images/logo009.gif"/>&nbsp;&nbsp;&nbsp;
        </td>
     </tr>
     <tr>
        <td>滚动文字：</td>
        <td>
         <input type="text" style="width: 155px;" id="logo_text" maxlength="10" value="Logo在线制作" name="logo_text">&nbsp;&nbsp;
                         滚动方式:&nbsp;
         <select style="width: 120px;" id="ScrollType" name="ScrollType">
			<option value="left_right" selected="selected">从左往右</option>
			<option value="right_left">从右往左</option>
			<option value="top_bottom">从上到下</option>
			<option value="bottom_top">从下到上</option>
		</select>    
        </td>
     </tr>
     
     <tr>
     	<td>字体：</td>
     	<td>
			<select name="font_family" id="font_family" style="width:155px;">
				<option value="simfang">仿宋</option>
				<option selected="selected" value="simsun">宋体(默认)</option>
				<option value="simkai">楷体</option>
				<option value="simhei">黑体</option>
				<option value="simli">隶书</option>
			</select>&nbsp;&nbsp;字号：
			<select style="width: 120px;" id="font_size" name="font_size">
				<option value="12">12</option>
				<option value="13" selected="selected">13</option>
				<option value="14">14</option>
				<option value="15">15</option>
			</select>
     	&nbsp;&nbsp;颜色:
     	&nbsp;&nbsp;<input style="width:100px;" onclick="showColor('text_color');" onkeyup="$(this).attr('value','');" type="text" id="text_color" name="text_color" value="#000000"">
     	</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>
</div>
$pic_html
html;
?>