Coder Social home page Coder Social logo

php's People

Contributors

lois2014 avatar

Watchers

 avatar

php's Issues

thinkphp 分页应用模板

    import('ORG.Util.Page');   //引入

    $m=M('Profit'); // 数据库

    $count=$m->count();//查询 计算总数

    $Page=new Page($count,12);  //每页12条记录

    $Page->setConfig('header', '条记录');//总记录数

    $Page -> setConfig('theme', '<li><a>%totalRow% %header%</a></li> <li>%upPage%</li> <li>%downPage%</li> <li>%first%</li>  <li>%prePage%</li>  <li>%linkPage%</li>  <li>%nextPage%</li> <li>%end%</li> ');//(对thinkphp自带分页的格式进行自定义)

    $show = $Page->show();

     $result = $m->limit ($Page->firstRow . ',' . $Page->listRows )->order('tb_rid desc')->select (); //查询,数据

     $this->assign('result',$result);
     $this->assign('page',$show);

javascript 打开新窗口,HTML表格

<script type="text/javascript" language=“javascript”> function openWin(result){ var _url = "{:U('Admin/Goods/modify')}"+"&id="+result; //指定url var _name = ""; //指定窗口名称 var _feature = ""; //窗口效果 var _left = (window.screen.width - 400) / 2; //计算窗口居中时距离屏幕左边的距离 var _top = (window.screen.height - 300) / 2; //计算窗口居中时距离屏幕上方的距离 _feature += "left=" +_left + ","; //窗口的位置 _feature += "top=" + _top + ","; _feature += "width=400,"; //窗口的宽度 _feature += "height=300,"; //窗口的高度 _feature += "resizable=0,"; //大小不可更改,但是没用 _feature += "scrollbars=1,"; //滚动条显示 _feature += "menubar=0,toolbar=0,status=0,location=0,directories=0"; //菜单栏,工具栏, 状态栏的临时信息,当前URL的信息, Nav2和3的目录栏是否可见 var win = window.open(_url,_name,_feature); //open方法可以打开一个新窗口 //win.close(); } </script>

//表格显示

商品名称 购买奖励 一级分成 二级分成 三级分成 操作
{$result.tb_rname} {$result.tb_raward}% {$result.tb_rprofit1}% {$result.tb_rprofit2}% {$result.tb_rprofit3}% 查看
                       <input type="button" value="修改" onclick="openWin({$result['tb_rid']});">
                        <a href="javascript:drop_confirm('确定要删除这个用户吗?','{:U('Admin/Goods/del',array('id'=>$result['tb_rid']))}')">删除</a>
                  <script>
                          function drop_confirm(message,pathurl)
                          {
                                  if(confirm(message))
                                  {
                                          window.location.href=pathurl;
                                  }else
                                  {
                                      window.location.href="{:U('Admin/Goods/index')}";
                                          //return false;
                                  }
                          }
                  </script>



                    </td>
                </tr>
            </volist>

        </tbody>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.