Home > php教程 > php手册 > body text

WeMall micro mall source code voting plug-in Vote main source code

WBOY
Release: 2016-10-17 09:12:08
Original
1668 people have browsed it

WeMall微信商城源码投票插件Vote,用于商城的签到系统,分享了部分比较重要的代码,供技术员学习参考
WeMall微信商城源码投票插件Vote,用于商城的签到系统,分享了部分比较重要的代码,供技术员学习参考

AdminController.class.php<?php <br /> namespace Addons\Vote\Controller;<br> <br> class AdminController extends InitController<br> {<br> <br> <br>     public function __construct()<br>     {<br>         parent::__construct();<br>     }<br> <br>     public function index()<br>     {<br>         $config = M("AddonVoteConfig")->find();<br>         $this->assign("config", $config);<br> <br>         $record = D(’Addons://Vote/AddonVoteRecord’); // 实例化User对象<br>         $count = $record->count();// 查询满足要求的总记录数<br>         $Page =  new \Think\Page($count, 12);// 实例化分页类 传入总记录数和每页显示的记录数(25)<br>         $Page->setConfig(’theme’, "<div><ul> <li>%FIRST%</li> <li>%UP_PAGE%</li> <li>%LINK_PAGE%</li> <li>%DOWN_PAGE%</li> <li>%END%</li> <li><a> %HEADER%  %NOW_PAGE%/%TOTAL_PAGE% 页</a></li> </ul></div>");<br>           $show = $Page->show();// Display output in pages<br> // Perform paging data query. Note that the parameters of the limit method must use the attributes of the Page class<br> $record = $record->limit($Page->firstRow . ',' . $Page->listRows)->order("id desc")->relation(true)->select( );<br> <br>           $this->assign("record", $record);//Assignment data set<br>            $this->assign(’page’, $show);// Assignment paging output<br> <br>           $this->display();<br> }<br> <br> Public function addConfig()<br> {<br> M("AddonVoteConfig")->where(array("id" => "1"))->save($_POST);<br>           $this->success(’Set successfully’, ‘Admin/Admin/index/addon/Vote’);<br> }<br> }IndexController.class.php
<?php <br /> <br> namespace AddonsVoteController;<br> <br> class IndexController extends InitController<br> {<br> Public $appUrl = "";<br> Public function __construct()<br> {<br>           parent::__construct();<br>          $this->appUrl = "http://" . I("server.HTTP_HOST");<br> }<br> <br> Public function init()<br> {<br>          return R("App/Common/init");<br> }<br> <br> Public function oauthRegister($wxuser)<br> {<br>          return R("App/Common/oauthRegister", array($wxuser));<br> }<br> <br> Public function index()<br> {<br>          $user=R("App/Public/oauthLogin");<br> <br>             // if (!session("userUid")) {<br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     // $ URL = $ weobj- & gt; GetoAuthredirect ($ this- & gt; apprl. U_addons (’vote: // app/index/index’)); <br>                                                        header("location: $url");<br>                                                                                                                return;<br> //} else {/ // $ WXUSER = $ weobj- & gt; GetoAuthuserinfo ($ token ["access_token"], $ token ["openid"]; <br>                                                                    session("userUid", $wxuser["openid"]);<br>                                                                                                                                                                                                                                                         //                                                                       <br>          $user = M("User")->where(array("uid" => session("userUid")))->find();<br> <br>         $config = M("AddonVoteConfig")->find();<br>         $this->assign("config", $config);<br>         $this->assign("user", $user);<br> <br>         M("AddonVoteConfig")->where(array("id"=>$config["id"]))->setInc("visiter_num");<br>         $this->display();<br>     }<br> <br>     public function vote()<br>     {<br>         $username=M(’User’)->where(array("id"=>session("userId")))->find();<br>        <br>         M("AddonVoteRecord")->add(array("user_id"=>session("userId"),"username"=>$username[’username’]));<br>         M("AddonVoteConfig")->where(array("id"=>I("get.id")))->setInc("vote_num");<br>     }<br> }
Index_index.html
nbsp;html><br> <br> <br>     <meta> <br>     <meta> <br>     <meta> <br>     <title>投票系统</title> <br>     <meta> <br>     <meta> <br>     <!-- apple devices fullscreen --><br>     <meta> <br>     <meta> <br>     <link> <br>     <link> <br>     <link> <br>     <link> <br>     <link> <br> <br>     <script></script><br>     <script></script><br> <br> <br> <div> <br>     <div> <br>         <div> <br>             <div> <br>                 <div><img alt="WeMall micro mall source code voting plug-in Vote main source code" ></div> <br>                 <div> <br>                     <span>{$user.username}</span><br>                     <span>会员ID: {$user.id}</span><br>                 </div> <br>             </div> <br>             <div> <br>                 <a></a>                    href="">累计投票<span>{$config.vote_num}</span><br>                 <a></a>                    href="">访问量<span>{$config.visiter_num}</span><br>             </div> <br>         </div> <br>     </div> <br>     <div> <br>         <div> <br>             <ul> <br>                 <li> <br>                     <div> <br>                         <div> <br>                             <h5>项目:</h5> <span>{$config.name}</span><br>                         </div> <br>                     </div> <br>                 </li> <br>                 <li> <br>                     <div> <br>                         <div> <br>                             <h5>时间:</h5> <span>{$config.activity_time}</span><br>                         </div> <br>                     </div> <br>                 </li> <br>                 <li> <br>                     <div> <br>                         <div> <br>                             <h5>投票介绍:</h5> <span>{$config.about}</span><br>                         </div> <br>                     </div> <br>                 </li> <br>             </ul> <br>         </div> <br>     </div> <br>     <ul> <br>         <li><a>$config[\’id\’]))}’)"><span>点击投票</span></a></li> <br>     </ul> <br> </div> <br> <br> <script><br /> function openUrl(url){<br /> $.get(url , function (data) {<br /> alert(’投票成功!’);<br /> location.reload();<br /> });<br /> }<br /> <br /> </script><br> <br>
Admin_index.html
<section><br>     <h1> <br>         投票管理<br>         <small></small><br>     </h1> <br> </section><br> <section><br> <div> <br>     <div> <br>         <div> <br>                 <div> <br>                     <h3>大转盘设置</h3>  <br>                 <!-- /.box-tools --><br>                 </div> <br>             <div> <br>                                 <div> <br>                                     <div> <br>                             <a><i></i>投票设置</a><br>                         </div>    <br>                         <div> <br>                             <a><i></i>投票记录</a><br>                         </div> <br>                                <br>                             <div> <br>                                 <div> <br>                                     <br> <br>                                     <p><br> <br>                                     </p> <form></form>                                           onsubmit="return false;" class="form-horizontal"><br>                                         <div> <br>                                             <label>投票名称</label><br> <br>                                             <div> <br>                                                 <input>                                                        name="name" type="text"><br>                                             </div> <br>                                         </div> <br>                                         <div> <br>                                             <label>活动时间</label><br> <br>                                             <div> <br>                                                 <input>                                                        value="{$config.activity_time}" name="activity_time" type="text"><br>                                             </div> <br>                                         </div> <br>                                         <!-- <div class="form-group"><br /> <label class="control-label col-md-2">活动说明</label><br /> <br /> <div class="col-md-7"><br /> <!style给定宽度可以影响编辑器的最终宽度<br /> <script type="text/plain" id="myEditor" style="width:100%;height:340px;"></script><br /> </div><br /> </div> --><br>                                         <div> <br>                                                     <label>活动说明</label><br>                                                     <div> <br>                                                         <!--style给定宽度可以影响编辑器的最终宽度--><br>                                                         <script><br /> {$config.about}<br /> <br /> </script><br>                                                     </div> <br>                                                 </div> <br> <br>                                         <div> <br>                                             <label></label><br> <br>                                             <div> <br>                                                 <button></button>                                                         onclick="myFormSubmit(’{:u_addons(\’Vote://Admin/Admin/index\’)}’)"<br>                                                         type="submit">提交<br>                                                 <br>                                                 <button>取消</button><br>                                             </div> <br>                                         </div> <br>                                     <br>                                     <br>                                 </div> <br>                                 <div> <br>                                   <br>                                     <p><br> <br>                                     </p> <div> <br>                                         <table> <br>                                             <thead> <br>                                             <th> <br>                                                 <label><input>                                                               type="checkbox"><span></span></label><br>                                             </th> <br>                                             <th> <br>                                                 ID<br>                                             </th> <br>                                             <th> <br>                                                 用户名<br>                                             </th> <br>                                            <th> <br>                                                 时间<br>                                             </th> <br>                                             </thead> <br>                                             <tbody> <br>                                             <volist><br>                                                 <tr> <br>                                                     <td> <br>                                                         <label><input>                                                                       value="option1"><span></span></label><br>                                                     </td> <br>                                                     <td> <br>                                                         {$record.id}<br>                                                     </td> <br>                                                     <td> <br>                                                         {$record.username}<br>                                                     </td> <br>                                                     <td> <br>                                                         {$record.time}<br>                                                     </td> <br>                                                 </tr> <br>                                             </volist><br>                                             </tbody> <br>                                         </table> <br>                                         <div> <br>                                             <br>                                             {$page}<br>                                         </div> <br>                                         <br>                                     </div> <br>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           <br>                                                                                                                                                                                  ​ <br> <br> <br> <br> <!-- <include file="Common:umeditor"/> --><br> <br> <script type="text/javascript"><br /> // //Instancing editor<br /> // var um = UM.getEditor(’myEditor’, {<br /> // textarea: ‘about’<br /> // });<br /> <br /> // function setFocus() {<br /> // UM.getEditor(’myEditor’).focus();<br /> // }<br />        $(function() {<br /> //Asynchronous loading of the instantiated editor<br /> var editor = new UE.ui.Editor();<br />           editor.render("UEditor");<br /> });<br /> <br /> If (’{$config}’) {<br />           $(’select[name="status"]’).val(’{$config.status}’);<br />           $(’select[name="everyday"]’).val(’{$config.everyday}’);<br />                // UE.getEditor(’myEditor’).setContent(’{$config.activity_explain}’);<br /> }<br /> </script><br> <!-- <script><br /> If (’{$config}’) {<br />           $(’select[name="status"]’).val(’{$config.status}’);<br />           $(’select[name="everyday"]’).val(’{$config.everyday}’);<br />          UM.getEditor(’myEditor’).setContent(’{$config.about}’);<br /> }<br /> </script> --> <br> <br> Wemall official website address: www.wemallshop.com<br> <br> <br> <br> <br> Votevote.rar <br>( 1.73 MB download: 1 time) <br> <br><br><img src="/Uploads/editor/2016-10-12/57fd9f0a4172f.jpg" alt="WeMall micro mall source code voting plug-in Vote main source code" ><p class="attach"> <img src="/Public/Images/extension/common.gif" style="max-width:90%" style="max-width:90%" border="0" alt="WeMall micro mall source code voting plug-in Vote main source code" align="absmiddle"></p> </div> </div> </div> </div> </div> </div> </div></section>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template