123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <{include file="admin/header.html"}><{include file="admin/nav.html"}>
- <{include file="get_kindeditor.html"}>
- <div class="container">
- <form id="myform" method="post" action="<{$web_cfg.domain}>?c=admin_Lottery&a=AddEvent" enctype="multipart/form-data" >
-
- <table class="table">
- <tr>
- <td>活动名称:</td>
- <td><input type="text" id="events_name" name="events_name" size="50" /></td>
- </tr>
- <tr>
- <td>开始时间:</td>
- <td>
- <input type="text" id="begin_time" name="begin_time" size="18" value="<{"Y-m-d H:i:s"|date}>" /> 例:<{"Y-m-d H:i:s"|date}>
- <input type="hidden" id="begin_unix_time" name="begin_unix_time" value="<{"Y-m-d H:i:s"|date}>" />
- </td>
- </tr>
- <tr>
- <td>结束时间:</td>
- <td>
- <input type="text" id="end_time" name="end_time" size="18" value="<{"Y-m-d H:i:s"|date}>"/>
- <input type="hidden" id="end_unix_time" name="end_unix_time" value="<{"Y-m-d H:i:s"|date}>" />
- </td>
- </tr>
- <tr>
- <td>活动类型:</td>
- <td>
- <select name="type" id="type">
- <{foreach from=$eventsType key=index item=type}>
- <option value="<{$index}>"><{$type.desc}></option>
- <{/foreach}>
- </select>
- </td>
- </tr>
- <tr>
- <td>活动头图:<br>[580*310px]</td>
- <td><input type="file" accept="image/jpeg,image/png,image/bmp" name="image" multiple="multiple"></td>
- </tr>
- <tr>
- <td>活动提示:<br>
- 注:如拷贝内容,请先粘贴到记事本之后在粘贴到右侧</td>
- <td><textarea name="events_tips" id="events_tips" rows="5" cols="40"></textarea></td>
- </tr>
- <tr>
- <td>活动规则:<br>
- 注:如拷贝内容,请先粘贴到记事本之后在粘贴到右侧</td>
- <td><textarea name="events_rules" id="events_rules" rows="5" cols="40"></textarea></td>
- </tr>
- </table>
-
- <input type="submit" id="ti_sut" value="创建活动">
-
-
- </form>
- </div>
- <br>
- <script type="text/javascript">
- var ROOT_DOMAIN = '<{$web_cfg.domain}>';
- KindEditor.ready(function(K) {
- var editor_events_rules = K.create('textarea[name=events_rules]', {
- themeType:'simple',
- items:[
- 'source','image', 'multiimage'
- ],
- allowFileManager : true,
- uploadJson : ROOT_DOMAIN + '/?c=kindeditor&a=updateJson',
- fileManagerJson : ROOT_DOMAIN + '/?c=kindeditor&a=fileManagerJson'
- });
- var editor_events_tips = K.create('textarea[name=events_tips]', {
- allowFileManager : true,
- items:[
- 'source','image', 'multiimage'
- ],
- uploadJson : ROOT_DOMAIN + '/?c=kindeditor&a=updateJson',
- fileManagerJson : ROOT_DOMAIN + '/?c=kindeditor&a=fileManagerJson'
- });
- });
- KISSY.use("node, io, json,jquery", function(S, Node, IO, JSON, jQuery){
-
-
- $('#ti_sut').click(function(){
- var events_name = $('#events_name').val();
- var begin_time = $('#begin_time').val();
- var end_time = $('#end_time').val();
- if (events_name == '' || begin_time == '' || end_time == '') {
- alert('活动信息填写有误');
- return;
- }
- var begin_date = js_strto_time(begin_time);
- var end_date = js_strto_time(end_time);
-
- $('#begin_unix_time').val(begin_date);
- $('#end_unix_time').val(end_date);
- if(begin_date > end_date){
- alert('活动时间填写错误');
- return;
- }
- var type = $('#type').val();
- if(type==0){
- alert('请选择活动类型');
- return ;
- }
-
- });
-
- //判断正整数
- function forcheck(ss){
- var type = "^[0-9]*[1-9][0-9]*$";
- var re = new RegExp(type);
- if (ss.match(re) == null) {
-
- return false;
- }
- return true;
- }
-
- // 日期转换时间戳
- function js_strto_time(str_time){
- str_time = str_time.trim();
- var new_str = str_time.replace(/:/g, '-');
- new_str = new_str.replace(/ /g, '-');
- var arr = new_str.split("-");
- var datum = new Date(Date.UTC(arr[0], arr[1] - 1, arr[2], arr[3] - 8, arr[4], arr[5]));
- return strtotime = datum.getTime() / 1000;
- }
- String.prototype.trim = function() {
- return (this.replace(/^\s+|\s+$/g,""));
- }
- });
- </script>
- <{include file="admin/bottom.html"}>
|