123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568 |
- <{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=UpEvent" enctype="multipart/form-data" >
-
- <table class="table">
- <input type="hidden" name="events_id" value="<{$events_Data.id}>">
- <tr>
- <td>活动名称:</td>
- <td><input type="text" id="events_name" name="events_name" value="<{$events_Data.events_name}>" size="50" /></td>
- </tr>
- <tr>
- <td>活动状态: </td>
- <td>
- <{if time()<$events_Data.begin_time}>
- <span style="color: #5151A2;">[未开始]</span>
- <{/if}>
- <{if time() > $events_Data.begin_time && time() < $events_Data.end_time}>
- <span style="color: #00EC00;">[进行中]</span>
- <{/if}>
- <{if time() > $events_Data.end_time}>
- <span style="color: red;">[结束]</span>
- <{/if}>
- </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:$events_Data.begin_time}>"/> 例:<{"Y-m-d H:i:s"|date}>
- <input type="hidden" id="begin_unix_time" name="begin_unix_time" />
- </td>
- </tr>
- <tr>
- <td>结束时间:</td>
- <td>
- <input type="text" id="end_time" name="end_time" value="<{"Y-m-d H:i:s"|date:$events_Data.end_time}>" size="18" />
- <input type="hidden" id="end_unix_time" name="end_unix_time" />
- </td>
- </tr>
-
- <tr>
- <td>奖品领取结束时间:</td>
- <td>
- <input type="text" id="end_time_receive_prizes" name="end_time_receive_prizes" value="<{if $events_Data.end_time_receive_prizes}><{"Y-m-d H:i:s"|date:$events_Data.end_time_receive_prizes}><{/if}>" size="18" />
- <input type="hidden" id="end_unix_time_receive_prizes" name="end_unix_time_receive_prizes" />
- </td>
- </tr>
-
- <tr>
- <td>活动类型:</td>
- <td>
- <input type="hidden" name="type" value="<{$events_Data.type}>"/>
- <{$eventsType[$events_Data.type].desc}>
- </td>
- </tr>
- <tr>
- <td>活动显示状态:</td>
- <td>
- <{foreach from=$eventsDisplayStatus key=index item=display}>
- <{$display.desc}>:<input name="display" type="radio" value="<{$index}>" <{if $index==$events_Data.display}> checked <{/if}> />
- <{/foreach}>
- </td>
- </tr>
- <tr>
- <td>活动发货状态:</td>
- <td>
- <{foreach from=$deliveryType key=index item=delivery}>
- <{$delivery.desc}>:<input name="delivery" type="radio" value="<{$index}>" <{if $index==$events_Data.delivery}> checked <{/if}> />
- <{/foreach}>
- </td>
- </tr>
- <tr>
- <td>活动授权参与:</td>
- <td>
- <{foreach from=$eventsAuthorize key=index item=authorize}>
- <{$authorize.desc}>:<input name="authorize" type="radio" value="<{$index}>" <{if $index==$events_Data.authorize}> checked <{/if}> />
- <{/foreach}>
- </td>
- </tr>
- <tr>
- <td>活动头图:<br>[580*310px]</td>
- <td>
- <img src="<{$events_Data.img_url}>"></img>
- <input type="hidden" name='old_img_url' value="<{$events_Data.img_url}>" >
- <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"><{$events_Data.events_tips}></textarea></td>
- </tr>
- <tr>
- <td>活动操作提示语:</td>
- <td><input type="text" id="operationt_tips" name="operationt_tips" value="<{$events_Data.operationt_tips}>" size="50" /></td>
- </tr>
- <tr>
- <td>活动规则:<br>
- 注:如拷贝内容,请先粘贴到记事本之后在粘贴到右侧<br>
- 活动规则里的标题HTML代码示例:
- <pre style="font-size: 11px;padding: 2px;"><div class="ac_title_com_line"><span>活动规则</span></div></pre>
- </td>
- <td><textarea name="events_rules" id="events_rules"><{$events_Data.events_rules}></textarea></td>
- </tr>
-
- <{*领码*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_CODE'}>
- <tr style="display: none;">
- <td>二维码输出:</td>
- <td>
- <{foreach from=$eventsTwoDimensionalCodeType key=index item=codeType}>
- <{$codeType.desc}>:<input name="two_dimensional_code" type="radio" value="<{$index}>" <{if $index==$events_Data.two_dimensional_code}> checked <{/if}> />
- <{/foreach}>
- </td>
- </tr>
- <tr>
- <td>券名称:</td>
- <td>
- <input type="text" id="code_name" name="code_name" value="<{$events_Data.code_name}>" size="50" />
- </td>
- </tr>
- <tr>
- <td>券图片:<br>我的礼品中显示的图片</td>
- <td>
- <img src="<{$events_Data.code_img_url}>"></img>
- <input type="hidden" name='code_old_img_url' value="<{$events_Data.code_img_url}>" >
- <input type="file" accept="image/jpeg,image/png,image/bmp" name="code_image" multiple="multiple">
- </td>
- </tr>
- <tr>
- <td>允许每天用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>"></td>
- </tr>
- <tr>
- <td>允许每天IP参与次数:<br>注:0 不限制</td>
- <td><input name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>"></td>
- </tr>
- <tr>
- <td>允许用户获奖次数:<br>注:0 不限制</td>
- <td><input name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>"></td>
- </tr>
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <{/if}>
-
- <{*试用*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_TRY'}>
- <input type="hidden" name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>">
- <input type="hidden" name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>">
- <input type="hidden" name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>">
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <{/if}>
-
- <{*邀请涵*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_INVITATION'}>
- <input type="hidden" name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>">
- <input type="hidden" name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>">
- <input type="hidden" name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>">
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <tr>
- <td>白名单:<br>注:@分割</td>
- <td><textarea id="invitation_white_list" name="invitation_white_list"><{"@"|join:$events_Data.invitation_white_list}></textarea></td>
- </tr>
- <tr>
- <td>最大上线参与人数:<br>注:0 不限制</td>
- <td>
- <input name="participation_user_max_num" id="participation_user_max_num" value="<{if $events_Data.participation_user_max_num}><{$events_Data.participation_user_max_num}><{else}>0<{/if}>">
- </tr>
- <{/if}>
-
-
- <{*投票*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_VOTE'}>
- <tr>
- <td>允许每天用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>"></td>
- </tr>
- <tr>
- <td>允许每天IP参与次数:<br>注:0 不限制</td>
- <td><input name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>"></td>
- </tr>
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <input type="hidden" name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>">
- <{/if}>
-
- <{*收集字母*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_LETTERS'}>
- <tr>
- <td>允许每天用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>"></td>
- </tr>
- <tr>
- <td>允许每天IP参与次数:<br>注:0 不限制</td>
- <td><input name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>"></td>
- </tr>
- <tr>
- <td>允许用户获奖次数:<br>注:0 不限制</td>
- <td><input name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>"></td>
- </tr>
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <{/if}>
-
-
- <{*刮刮卡*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_SCRATCH'}>
- <tr>
- <td>允许每天用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>"></td>
- </tr>
- <tr>
- <td>允许每天IP参与次数:<br>注:0 不限制</td>
- <td><input name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>"></td>
- </tr>
- <tr>
- <td>允许用户获奖次数:<br>注:0 不限制</td>
- <td><input name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>"></td>
- </tr>
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <{/if}>
-
- <{*大转盘*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_TURNTABLE'}>
- <tr>
- <td>允许每天用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_num" id="participation_user_num" value="<{$events_Data.participation_user_num}>"></td>
- </tr>
- <tr>
- <td>允许每天IP参与次数:<br>注:0 不限制</td>
- <td><input name="participation_ip_num" id="participation_ip_num" value="<{$events_Data.participation_ip_num}>"></td>
- </tr>
- <tr>
- <td>允许用户获奖次数:<br>注:0 不限制</td>
- <td><input name="winning_user_num" id="winning_user_num" value="<{$events_Data.winning_user_num}>"></td>
- </tr>
- <tr>
- <td>允许用户参与次数:<br>注:0 不限制</td>
- <td><input name="participation_user_all_num" id="participation_user_all_num" value="<{$events_Data.participation_user_all_num}>"></td>
- </tr>
- <{/if}>
-
- <{*其他*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_OTHER'}>
- <tr>
- <td>跳转URL:</td>
- <td><input name="other_url" id="other_url" value="<{$events_Data.other_url}>"></td>
- </tr>
- <{/if}>
-
-
- <{*自定义表单*}>
- <{if $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_TRY'
- || $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_INVITATION'
- || $eventsType[$events_Data.type].kw == 'TYPE_EVENTS_CODE'
- }>
- <tr>
- <td>自定义表单: </td>
- <td>
- <table class="custom_from_table table">
- <tr>
- <th>名称</th>
- <th>类型</th>
- <th>最小长度</th>
- <th>验证规则</th>
- <th>是否必填</th>
- </tr>
- <{if $events_Data.forms}>
- <{foreach from=$events_Data.forms item=form}>
- <{if $form.type != 'select'}>
- <tr>
- <td><input name="f[0][name]" type="text" value="<{$form.name}>" /></td>
- <td>
- <select class="form_select" name="f[0][type]">
- <option value="text" <{if $form.type == 'text'}>selected<{/if}>>单行文本框</option>
- <option value="textarea" <{if $form.type == 'textarea'}>selected<{/if}>>多行文本框</option>
- <option value="select" <{if $form.type == 'select'}>selected<{/if}>>下拉菜单</option>
- </select>
- </td>
- <td><input name="f[0][rule][size]" type="text" value="<{$form.rule.size}>" /></td>
- <td>
- <select name="f[0][rule][regularid]">
- <option value="">无规则</option>
- <{foreach from=$formRegular item=item key=regularid}>
- <option value="<{$regularid}>" <{if $form.rule.regularid == $regularid}>selected="selected"<{/if}>><{$item.desc}></option>
- <{/foreach}>
- </select>
- </td>
- <td><input name="f[0][required]" type="checkbox" value="1" <{if $form.required}>checked<{/if}> /> </td>
- </tr>
- <{else}>
- <tr>
- <td><input name="f[0][name]" type="text" value="<{$form.name}>" /></td>
- <td>
- <select class="form_select" name="f[0][type]">
- <option value="text" <{if $form.type == 'text'}>selected<{/if}>>单行文本框</option>
- <option value="textarea" <{if $form.type == 'textarea'}>selected<{/if}>>多行文本框</option>
- <option value="select" <{if $form.type == 'select'}>selected<{/if}>>下拉菜单</option>
- </select>
- </td>
- <td>
- <textarea name="f[0][options]" class="form-control" placeholder=""><{$form.options}></textarea>
- </td>
- <td>多个选项换行分隔</td>
- <td><input name="f[0][required]" type="checkbox" value="1" <{if $form.required}>checked<{/if}> /> </td>
- </tr>
- <{/if}>
- <{/foreach}>
- <{else}>
- <tr>
- <td><input name="f[0][name]" type="text" value="" /></td>
- <td>
- <select class="form_select" name="f[0][type]">
- <option value="text">单行文本框</option>
- <option value="textarea">多行文本框</option>
- <option value="select">下拉菜单</option>
- </select>
- </td>
- <td><input name="f[0][rule][size]" type="text" value="" /></td>
- <td>
- <select name="f[0][rule][regularid]">
- <option value="">无规则</option>
- <{foreach from=$formRegular item=item key=regularid}>
- <option value="<{$regularid}>"><{$item.desc}></option>
- <{/foreach}>
- </select>
- </td>
- <td><input name="f[0][required]" type="checkbox" value="1" /> </td>
- </tr>
- <{/if}>
- </table>
- <a href="javascript:;" class="btn btn-primary btn-xs addRule">增加</a>
- </td>
- </tr>
- <{/if}>
- <{*/自定义表单*}>
-
- <{*微信分享*}>
- <tr>
- <td>微信分享设置:<br>
- </td>
- <td>
- <label>本活动不允许分享:<input name="weixinShare_notAllow" type="checkbox" <{if $events_Data.weixinShare.notAllow}>checked="checked"<{/if}> value="1"/></label>
- <table class="table">
- <tr>
- <td>标题</td>
- <td><input name="weixinShare_title" type="text" value="<{$events_Data.weixinShare.title}>" class="form-control"/></td>
- </tr>
- <tr>
- <td>内容</td>
- <td><textarea name="weixinShare_content" class="form-control" ><{$events_Data.weixinShare.content}></textarea></td>
- </tr>
- <tr>
- <td>图片</td>
- <td>
- <{if $events_Data.weixinShare.imgUrl}><img src="<{$events_Data.weixinShare.imgUrl}>" style="width:100px;" /><{/if}>
- <input name="weixinShare_imgUrl" type="hidden" value="<{$events_Data.weixinShare.imgUrl}>" />
- <input type="file" accept="image/jpeg,image/png,image/bmp" name="weixinShareImg" multiple="multiple">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <{*/微信分享*}>
- </table>
-
- <input type="submit" id="ti_sut" value="修改活动">
-
- </form>
- </div>
- <br>
- <div class="form_select_template" style="display:none;">
- <table>
- <tr>
- <td><input name="f[0][name]" type="text" value="" /></td>
- <td>
- <select class="form_select" name="f[0][type]">
- <option value="text">单行文本框</option>
- <option value="textarea">多行文本框</option>
- <option value="select" selected>下拉菜单</option>
- </select>
- </td>
- <td>
- <textarea name="f[0][options]" class="form-control" placeholder=""></textarea>
- </td>
- <td>多个选项换行分隔</td>
- <td><input name="f[0][required]" type="checkbox" value="1" /> </td>
- </tr>
- </table>
- </div>
- <div class="form_text_template" style="display:none;">
- <table>
- <tr>
- <td><input name="f[0][name]" type="text" value="" /></td>
- <td>
- <select class="form_select" name="f[0][type]">
- <option value="text" selected>单行文本框</option>
- <option value="textarea">多行文本框</option>
- <option value="select">下拉菜单</option>
- </select>
- </td>
- <td><input name="f[0][rule][size]" type="text" value="" /></td>
- <td>
- <select name="f[0][rule][regularid]">
- <option value="">无规则</option>
- <{foreach from=$formRegular item=item key=regularid}>
- <option value="<{$regularid}>"><{$item.desc}></option>
- <{/foreach}>
- </select>
- </td>
- <td><input name="f[0][required]" type="checkbox" value="1" /> </td>
- </tr>
- </table>
- </div>
- <div class="form_textarea_template" style="display:none;">
- <table>
- <tr>
- <td><input name="f[0][name]" type="text" value="" /></td>
- <td>
- <select class="form_select" name="f[0][type]">
- <option value="text">单行文本框</option>
- <option value="textarea" selected>多行文本框</option>
- <option value="select">下拉菜单</option>
- </select>
- </td>
- <td><input name="f[0][rule][size]" type="text" value="" /></td>
- <td>
- <select name="f[0][rule][regularid]">
- <option value="">无规则</option>
- <{foreach from=$formRegular item=item key=regularid}>
- <option value="<{$regularid}>"><{$item.desc}></option>
- <{/foreach}>
- </select>
- </td>
- <td><input name="f[0][required]" type="checkbox" value="1" /> </td>
- </tr>
- </table>
- </div>
- <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(){
-
- $('.custom_from_table tr').each(function (i, item) {
- $(item).find('input,select,checkbox,textarea').each(function (j, input) {
- input.name = input.name.replace(/\[\d+\]/, '['+ i +']');
- });
- });
-
- var events_name = $('#events_name').val();
- var begin_time = $('#begin_time').val();
- var end_time = $('#end_time').val();
- var end_time_receive_prizes = $('#end_time_receive_prizes').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);
- var end_unix_time_receive_prizes = '';
- if(end_time_receive_prizes){
- end_unix_time_receive_prizes = js_strto_time(end_time_receive_prizes);
- }
- $('#begin_unix_time').val(begin_date);
- $('#end_unix_time').val(end_date);
- $('#end_unix_time_receive_prizes').val(end_unix_time_receive_prizes);
- if(begin_date > end_date){
- alert('活动时间填写错误');
- return;
- }
- });
-
- $(".form_select").live('change', function () {
- var formType = $(this).val();
- console.log(formType);
- if (formType == 'select') {
- var form_select_template = $('.form_select_template tr:last').clone();
- $(this).parent().parent().replaceWith(form_select_template);
- }
-
- if (formType == 'text') {
- var form_select_template = $('.form_text_template tr:last').clone();
- $(this).parent().parent().replaceWith(form_select_template);
- }
-
- if (formType == 'textarea') {
- var form_select_template = $('.form_textarea_template tr:last').clone();
- $(this).parent().parent().replaceWith(form_select_template);
- }
-
- });
-
- $('.addRule').click(function () {
- var rule_template = $('.custom_from_table tr:last').clone();
- rule_template.find('input,select').val('');
- rule_template.find('input[name=required]').attr('checked', false);
- $('.custom_from_table tr:last').after(rule_template);
- });
-
- //判断正整数
- 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"}>
|