poster_add.tpl.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. //$show_header = $show_validator = $show_scroll = 1;
  4. $show_dialog = $show_header = 1;
  5. include $this->admin_tpl('header', 'admin');
  6. $thisExt = isset($this->M['ext'])?$this->M['ext']:'';
  7. $authkey = upload_key('1,'.$thisExt.',1');
  8. ?>
  9. <script language="javascript" type="text/javascript" src="<?php echo JS_PATH;?>formvalidator.js" charset="UTF-8"></script>
  10. <script language="javascript" type="text/javascript" src="<?php echo JS_PATH;?>formvalidatorregex.js" charset="UTF-8"></script>
  11. <div class="subnav">
  12. <div class="content-menu ib-a blue line-x">
  13. <?php if(isset($big_menu)) echo '<a class="add fb" href="'.$big_menu[0].'"><em>'.$big_menu[1].'</em></a> ';?>
  14. <?php echo admin::submenu($_GET['menuid'],$big_menu); ?><span>|</span><a href="javascript:window.top.art.dialog({id:'setting',iframe:'?m=poster&c=space&a=setting', title:'<?php echo L('module_setting')?>', width:'540', height:'320'}, function(){var d = window.top.art.dialog({id:'setting'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'setting'}).close()});void(0);"><em><?php echo L('module_setting')?></em></a>
  15. </div>
  16. </div>
  17. <form method="post" action="?m=poster&c=poster&a=add" id="myform">
  18. <table class="table_form" width="100%" cellspacing="0">
  19. <tbody>
  20. <tr>
  21. <th width="100"><?php echo L('poster_title')?>:</th>
  22. <td><input name="poster[name]" id="name" class="input-text" type="text" size="25"></td>
  23. </tr>
  24. <tr>
  25. <th><?php echo L('for_postion')?>:</th>
  26. <td><?php if($spaceid) { echo '<b style="color:#F60;">',$sinfo['name'],'</b>&nbsp;[',$TYPES[$sinfo['type']],']<input type="hidden" name="poster[spaceid]" value="'.$spaceid.'">'; } else {?><select name="poster[spaceid]" id="spaceid" onchange="AdsType(this.value)">
  27. <option value=''><?php echo L('please_select')?></option>
  28. <?php foreach($spaces as $s) {?>
  29. <option value="<?php echo $s['spaceid']?>"><?php echo $s['name']?></option>
  30. <?php } ?></select><?php }?></td>
  31. </tr>
  32. <tr>
  33. <th align="right" valign="top"><?php echo L('poster_type')?>:</th>
  34. <td valign="top" colspan="2"><?php echo form::select($setting['type'], '', 'name="poster[type]" id="type" onchange="AdsType(this.value)"', $default);?>
  35. </td>
  36. </tr>
  37. <tr>
  38. <th><?php echo L('line_time')?>:</th>
  39. <td><?php echo form::date('poster[startdate]', date('Y-m-d H:i:s', SYS_TIME), 1)?></td>
  40. </tr>
  41. <tr>
  42. <th><?php echo L('down_time')?>:</th>
  43. <td><?php echo form::date('poster[enddate]', '', 1)?></td>
  44. </tr>
  45. </tbody>
  46. </table><?php if(array_key_exists('images', $setting['type'])) {?><div class="pad-10" id="imagesdiv" style="display:">
  47. <fieldset>
  48. <legend><?php echo L('photo_setting')?></legend>
  49. <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?>
  50. <table width="100%" class="table_form">
  51. <tbody>
  52. <tr>
  53. <th width="80"><?php echo L('linkurl')?>:</th>
  54. <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][linkurl]" id="linkurl<?php echo $i;?>" size="30" value="http://" /></td>
  55. <td rowspan="2"><a href="javascript:flashupload('imgurl<?php echo $i;?>_images', '<?php echo L('upload_photo')?>','imgurl<?php echo $i;?>',preview,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo IMG_PATH;?>icon/upload-pic.png" id="imgurl<?php echo $i;?>_s" width="105" height="88"></a><input type="hidden" id="imgurl<?php echo $i;?>" name="setting[images][<?php echo $i;?>][imageurl]"></td>
  56. </tr>
  57. <tr>
  58. <th><?php echo L('alt')?>:</th>
  59. <td class="y-bg"><input type="text" class="input-text" name="setting[images][<?php echo $i;?>][alt]" id="alt<?php echo $i;?>" size="30" /></td>
  60. </tr>
  61. </table>
  62. <?php } } else {?>
  63. <table width="100%" class="table_form">
  64. <tbody>
  65. <tr>
  66. <th width="80"><?php echo L('linkurl')?>:</th>
  67. <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][linkurl]" id="linkurl3" size="30" value="http://" /></td>
  68. <td rowspan="2"><a href="javascript:flashupload('imgurl_images', '<?php echo L('upload_photo')?>','imgurl',preview,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>');void(0);"><img src="<?php echo IMG_PATH;?>icon/upload-pic.png" id="imgurl_s" width="105" height="88"></a><input type="hidden" id="imgurl" name="setting[images][1][imageurl]"></td>
  69. </tr>
  70. <tr>
  71. <th><?php echo L('alt')?>:</th>
  72. <td class="y-bg"><input type="text" class="input-text" name="setting[images][1][alt]" id="alt3" size="30" /></td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <?php } ?>
  77. </fieldset></div><?php } if(array_key_exists('flash', $setting['type'])) {?>
  78. <div class="pad-10" id="flashdiv" style="display:none;">
  79. <fieldset>
  80. <legend><?php echo L('flash_setting')?></legend>
  81. <?php if($setting['num']>1) { for($i=1; $i<=$setting['num']; $i++) {?>
  82. <table width="100%" class="table_form">
  83. <tbody>
  84. <tr>
  85. <th width="80"><?php echo L('flash_url')?>:</th>
  86. <td class="y-bg"><input type="text" class="input-text" name="setting[flash][<?php echo $i;?>][flashurl]" id="flashurl<?php echo $i;?>" size="40" /></td>
  87. <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl<?php echo $i;?>_images', '<?php echo L('flash_upload')?>','flashurl<?php echo $i;?>',submit_attachment,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td>
  88. </tr>
  89. </tbody>
  90. </table>
  91. <?php } } else {?>
  92. <table width="100%" class="table_form">
  93. <tbody>
  94. <tr>
  95. <th width="80"><?php echo L('flash_url')?>:</th>
  96. <td class="y-bg"><input type="text" class="input-text" name="setting[flash][1][flashurl]" id="flashurl" size="40" /></td>
  97. <td class="y-bg"><input type="button" class="button" onclick="javascript:flashupload('flashurl_images', '<?php echo L('flash_upload')?>','flashurl',submit_attachment,'1,<?php echo $thisExt?>,1','poster', '', '<?php echo $authkey?>')" value="<?php echo L('flash_upload')?>"></td>
  98. </tr>
  99. </tbody>
  100. </table>
  101. <?php } ?>
  102. </fieldset></div><?php } if(array_key_exists('text', $setting['type'])) {?><div class="pad-10" id="textdiv" style="display:">
  103. <fieldset>
  104. <legend><?php if ($sinfo['type']=='code') { echo L('code_setting'); } else { echo L('word_link'); } ?></legend>
  105. <table width="100%" class="table_form">
  106. <tbody>
  107. <?php if($sinfo['type']=='code') {?>
  108. <tr>
  109. <th width="80"><?php echo L('code_content')?>:</th>
  110. <td class="y-bg"><textarea name="setting[text][code]" id="code" cols="55" rows="6"><?php echo $info['setting']['code']?></textarea></td>
  111. </tr>
  112. <?php } else {?>
  113. <tr>
  114. <th width="80"><?php echo L('word_content')?>:</th>
  115. <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][title]" value="<?php echo $info['setting'][1]['title']?>" id="title" size="30" /></td>
  116. </tr>
  117. <tr>
  118. <th><?php echo L('linkurl')?>:</th>
  119. <td class="y-bg"><input type="text" class="input-text" name="setting[text][1][linkurl]" id="link" size="30" value="<?php echo $info['setting'][1]['linkurl']?>" /></td>
  120. </tr><?php }?>
  121. </tbody>
  122. </table>
  123. </fieldset></div><?php }?>
  124. <div class="bk15" style="margin-left:10px; line-height:30px;"><input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="button">&nbsp;<input type="reset" value=" <?php echo L('goback')?> " class="button" onclick="history.go(-1)"></div>
  125. </form>
  126. </body>
  127. </html>
  128. <script type="text/javascript">
  129. function AdsType(type) {
  130. $('#imagesdiv').css('display', 'none');
  131. $('#flashdiv').css('display', 'none');
  132. $('#'+type+'div').css('display', '');
  133. }
  134. $(document).ready(function(){
  135. $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
  136. $('#name').formValidator({onshow:"<?php echo L('please_input_name')?>",onfocus:"<?php echo L('name_three_length')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:6,onerror:"<?php echo L('adsname_no_empty')?>"}).ajaxValidator({type:"get",url:"",data:"m=poster&c=poster&a=public_check_poster",datatype:"html",cached:false,async:'true',success : function(data) {
  137. if( data == "1" )
  138. {
  139. return true;
  140. }
  141. else
  142. {
  143. return false;
  144. }
  145. },
  146. error: function(){alert("<?php echo L('server_busy')?>");},
  147. onerror : "<?php echo L('ads_exist')?>",
  148. onwait : "<?php echo L('checking')?>"
  149. });
  150. $('#type').formValidator({onshow:"<?php echo L('choose_ads_type')?>",onfocus:"<?php echo L('type_selected')?>",oncorrect:"<?php echo L('correct')?>",defaultvalue:"images"}).inputValidator({min:1,onerror: "<?php echo L('choose_ads_type')?>"});
  151. $('#startdate').formValidator({onshow:"<?php echo L('online_time')?>",onfocus:"<?php echo L('online_time')?>",oncorrect:"<?php echo L('correct')?>"}).functionValidator({fun:isDateTime});
  152. $('#enddate').formValidator({onshow:"<?php echo L('one_month_no_select')?>",onfocus:"<?php echo L('down_time')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator();
  153. <?php if(array_key_exists('text', $setting['type'])) {?>
  154. <?php if($sinfo['type']=='text') {?>
  155. $('#title').formValidator({onshow:'<?php echo L('link_content')?>',onfoucs:'<?php echo L('link_content')?>',oncorrect:'<?php echo L('correct')?>'}).inputValidator({min:1,onerror:'<?php echo L('no_link_content')?>'});
  156. <?php } elseif($sinfo['type']=='code') {?>
  157. $('#code').formValidator({onshow:"<?php echo L('input_code')?>",onfocus:"<?php echo L('input_code')?>",oncorrect:"<?php echo L('correct')?>"}).inputValidator({min:1,onerror:'<?php echo L('input_code')?>'});
  158. <?php } }?>
  159. });
  160. function preview(uploadid,returnid){
  161. var d = window.top.art.dialog({id:uploadid}).data.iframe;
  162. var in_content = d.$("#att-status").html().substring(1);
  163. $('#'+returnid).val(in_content);
  164. $('#'+returnid+'_s').attr('src', in_content);
  165. }
  166. </script>
  167. <script type="text/javascript" src="<?php echo JS_PATH?>swfupload/swf2ckeditor.js"></script>