<?php include mayi_tpl('inc_header');?><link rel="Stylesheet" type="text/css" href="template/css/new.dialog.css" /><link rel="stylesheet" type="text/css" href="template/css/new.my.css" /><link href='../template/global/magic-check.css' rel='stylesheet' type='text/css'><script language="javascript" src="template/jquery.172.min.js"></script><script language="javascript" src="template/javascript.js"></script></head>
<script type="text/javascript">
function submitForm(){
	if(document.form1.title.value==""){
		document.form1.title.focus();
		alert("请填写文章标题！");
		return false
	}
	if(document.form1.catid.value==""){
		document.form1.catid.focus();
		alert("请选择所属分类！");
		return false
	}
	if(document.form1.source.value==""){
		document.form1.source.focus();
		alert("请填写文章来源！");
		return false
	}
	if(document.form1.content.value==""){
		document.form1.content.focus();
		alert("请填写文章内容！");
		return false
	}
	return true
}
</script>
<body class="blue"><div class="container">
<div id="main" class="main section-setting">
        <div class="clearfix main-inner">
            <div class="content">
                <div class="clearfix content-inner">
                    <div class="content-main">
                        <div class="content-main-inner">
                            <div class="pwrap setting-userinfo">
                                <div class="phead"><div class="phead-inner"><div class="phead-inner">
                                    <h3 class="ptitle"><span><?php echo ($ac == 'edit' ? '修改' : '发布')?>投稿</span></h3>
                                    <p class="pextra"><a href="index.php?m=tougao&tid=<?=$tid?>&type=corp"><span>&laquo; 返回<?=$tougaotype[$tid]['typename']?></span></a></p>
                                </div></div></div>
                                <div class="pbody">
                                    <div id="msg_success"></div>
                                    <div id="msg_error"></div>
                                    <div id="msg_alert"></div>
                                    <div style="display:none;">
    <iframe width=0 height=0 src='' id="iframe_city" name="iframe_city"></iframe> 
    <iframe width=0 height=0 src='' id="iframe_area" name="iframe_area"></iframe> 
    <iframe width=0 height=0 src='' id="iframe_street" name="iframe_street"></iframe> 
    <form method="post" target="iframe_city" id="form_city"></form>
    <form method="post" target="iframe_area" id="form_area"></form>
    <form method="post" target="iframe_street" id="form_street"></form>
</div>
                                    <form action="index.php?m=tougao&ac=<?=$ac?>" enctype="multipart/form-data" method="post" name="form1" onSubmit="return submitForm();">
                                    <?php if($ac == 'edit'){?>
                                    	<input name="id" value="<?=$id?>" type="hidden">
                                    <?php }?>
                                    <input name="author" value="<?=$row[userid]?>" type="hidden">
                                    <div class="formgroup cleafix">
                                        <div class="formrow">
                                            <h3 class="label"><label>标题</label></h3>
                                            <div class="form-enter">
                                                <input name="title" type="text" class="text" value="<?=$edit['title']?>" style="width:300px">
                                            </div>
                                        </div>
                                        <input name="cityid" value="1" type="hidden">
                                        
                                        <div class="formrow">
                                            <h3 class="label">隶属分类</h3>
                                            <div class="form-enter">
                                                <select name='catid'  class="input">
                                                  <option value=''>请选择主分类...</option>
                                                  <?php echo cat_list('channel',0,$edit[catid]);?>
                                                </select>
                                            </div>
                                        </div>
                                        
                                        <div class="formrow">
                                            <h3 class="label">来源</h3>
                                            <div class="form-enter">
                                                <input name="source" type="text" class="text" value="<?=$edit['source']?$edit['source']:$row[tname]?>" style="width:300px">
                                            </div>
                                        </div>
                                        
                                        <div class="formrow">
                                            <h3 class="label">相关图片</h3>
                                            <div class="form-enter">
                                                <input type="file" name="tougao_image" size="30" id="litpic">
                                            </div>
                                        </div>
                                        <? if($edit[imgpath]){?>
                                        <div class="formrow">
                                            <h3 class="label">原来的图片</h3>
                                            <div class="form-enter">     
                                                <?php
                                                echo "<img src=".$mymps_global[SiteUrl]."".$edit[imgpath]." style='width:200px'/>\r\n";
                                                ?>
                                            </div>
          								</div>
                                        <? }?>
                                        <div class="formrow">
                                            <h3 class="label">详细内容</h3>
                                            <?php echo $acontent?>
                                        </div>

                                        <div class="formrow formrow-action"><h3 class="label">&nbsp;</h3><span class="minbtn-wrap"><span class="btn"><input type="submit" value="提交保存" class="button" name="tougao_submit" /></span></span>
                                        </div>
                                    </div>
                                    </form>
                                    
                                </div>
                                <div class="pfoot"><p><b>-</b></p></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php include mayi_tpl('inc_foot');?>
</div>
</body>
</html>