Php+bootstrap+datatable+jquery List of pages

Source: Internet
Author: User
Tags stmt

<! DOCTYPE html>

<meta http-equiv= "content-type" content= "text/html; Charset=utf-8 "/>

<script src= "jquery-1.8.3.min.js" type= "text/javascript" ></script>

<script>

$ (document). Ready (function () {

$ ("#table_local"). dataTable ({

"bsort": true,

"bautowidth": false,

"bfilter": true,

"binfo": true,

"bjqueryui": false,

When used with all true, turn on

"blengthchange": true,

"bpaginate": true,

Use together

"bscrollinfinite": true,

"bscrollcollapse": true,

"sscrolly": "",

Use together

"sscrollx": "100%",//disabled or 100% is actually only empty, even if 123 will also appear effect

"sscrollxinner": "100%",

Save client information in a cookie, understand

"bstatesave": true,

This is to select the number of entries per page, when using a two-dimensional array, the two-dimensional plane can only have two elements, the first is to display the number of entries per page option, The second is about these options explained

"alengthmenu": [5,10,20,50,100],

"alengthmenu": [[10, 25, 30, -1],[10, 25, "30", "all"]],

"icookieduration": 10,

Default number of page bars

Idisplaystart displaying data starting from the first few lines

"idisplaylength": 34,

' Full_numbers ' or ' Two_button ', default ' Two_button ' for specifying the pager style

"spaginationtype": ' Two_button ',

No. 0 Column descending order

"aasorting": [[0, "desc"]],

Hide some columns

/* "aocolumndefs": [{"bsearchable": false, "bvisible": false, "atargets": [2]},{"bvisible": false, "atargets": [3]} ], */

language: {

Lengthmenu: ' <select class= ' Form-control input-xsmall ' > ' + ' <option value= ' 1 ' >1</option> ' + ' < Option value= ">10</option> ' + ' <option value=" >20</option> ' + ' <option value= ">30" </option> ' + ' <option value= "+" >40</option> ' + ' <option value= ">50</option> ' + ' < /select> record ',//the top left corner of the paging size display.

Search: ' <span class= ' label label-success > search:</span> ',//the upper right corner of the text, you can write HTML tags


Paginate: {//pagination Style Content.

Previous: "previous page",

Next: "down",

First: "number one,"

Last: "final"

// },


Zerorecords: "no content",//table tbody content is empty, tbody content.

The following three constitute the contents of the overall lower left corner.

Info: "a total of _pages_ pages, showing the _start_ to the _end_, filtered to get _total_ bar, the initial _max_ bar",//the lower left corner of the information display, capitalized words are KEYWORDS.

Infoempty: "0 Records",//filter is empty when the lower left corner of the Display.

Infofiltered: ""//filter prompt at the bottom left after filtering,

// },

});

});

</script>

<link rel= "stylesheet" type= "text/css" href= "/km/media/css/datatables.bootstrap.min.css" >

<link rel= "stylesheet" type= "text/css" href= "/km/media/css/font-awesome.min.css" >

<link rel= "stylesheet" type= "text/css" href= "/km/media/css/bootstrap.min.css" >

<link rel= "stylesheet" type= "text/css" href= "/km/media/css/button.css" >

<!--[if IE 7]>

<link rel= "stylesheet" href= "path/to/font-awesome/css/font-awesome-ie7.min.css" >

<! [endif]-->

<script type= "text/javascript" src= "/km/media/js/jquery.datatables.min.js" ></script>

<script type= "text/javascript" src= "/km/media/js/datatables.bootstrap.js" ></script>


<div class= "panel panel-default" >

<div class= "panel-heading" >

<div class= "panel-title" >

<? echo iconv ("gb2312", "UTF-8", "performance transfer order query")?>

</div>

</div>

<div class= "panel-body" >

<table id= "table_local" class= "table table-bordered table-striped table-hover" >

<thead>

<tr align=center>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "application number")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "applicant")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "application department")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "application date")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "turn-out unit")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "transfer account")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "application amount")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "acknowledgment amount")?>

<th Align=center><font color=black><? echo iconv ("gb2312", "UTF-8", "signoff")?>

</tr>

</thead>


<tbody>

<?php

Require_once ('/php/public/opendb.inc ');

Require_once ('/php/public/openmydb.inc ');

Require ("/php/public/power.inc");


$sql = "select distinct a.exp_no,a.create_user,name (a.create_user), a.create_date,a.dept_no,a.acc_name,tot_amt1,tot _amt2,b.flow_code,a.form_key

From Exp_main A,flow b

where A.form_key=b.form_key ORDER BY a.exp_no Desc "; #echo "$sql";

$stmt = $dbh->prepare ("$sql");

$stmt->execute () | | Die ("error");

$i = 0;

While (list ($exp _no, $exp _man, $exp _man_name, $create _date, $dept _no, $acc _name, $tot _amt1, $tot _amt2, $flow _code, $form _key) = $stmt->fetch ()) {


List ($flow _code) =field ("select flow_code from It.flow where form_key= $form _key");

$current _user2= ';

If ($flow _code== ' Z ')

$current _user2=iconv ("gb2312", "UTF-8", "closed");

ElseIf ($flow _code== ' C ')

{

$child _sql= "select Form_key from Workflow_subflow where parent_key= ' $form _key ' and reply_flag= ' N '";

$chis = $dbh->prepare ("$child _sql");

$chis->execute () | | Die ("chile_err");


For ($j =0;list ($child _key) = $chis->fetch (); $j + +)

{

#if ($form _key== ' 100001245685 ') {echo "$child _key, $current _user2". <br> ';}

List ($current _user1) =fields ("select distinct current_user from It.subflow where form_key= ' $child _key '");

$current _n[$j]=iconv ("gb2312", "UTF-8", name ($current _user1));

$current _user2= $current _user2. " ($current _user1) ". $current _n[$j];

}

$current _user2=iconv ("gb2312", "UTF-8", ' sign in '). $current _user2;

}

Else

{

List ($current _user1, $current _user1name) =fields ("select current_user,name (current_user) from It.subflow where form_ key= $form _key ");

$current _user2= "($current _user1)". iconv ("gb2312", "UTF-8", $current _user1name);

}

$sel = "select get_depart_name (get_depart (' $exp _man ')), get_depart (' $exp _man ') from dual";

$STC = $dbh->prepare ("$sel");

$stc->execute () | | Die ("applicant Department error");

List ($depart _name, $getdepart) = $stc->fetch ();

$str 1= "select acc_depart_name from Acc_gl_depart where acc_depart_no= ' $dept _no '";

List ($DEP _name) =fields ("$str 1");

$ACC _name=iconv ("gb2312", "UTF-8", $ACC _name);

echo "<tr><td align=center id= $setcolor ><a href= ' Http://oracle.yungtay.com.cn/exp/exp_myquery_ my.php?exp_no= $exp _no&form_key= $form _key ' target= ' _blank ' > $exp _no</a>

<TD align=center id= $setcolor > $exp _man-". iconv (" gb2312 "," UTF-8 ", $exp _man_name)."

<TD align=center id= $setcolor > $getdepart-". iconv (" gb2312 "," UTF-8 ", $depart _name)."

<TD align=center id= $setcolor > $create _date

<TD align=center id= $setcolor > $dept _no-". iconv (" gb2312 "," UTF-8 ", $dep _name)."

<TD align=center id= $setcolor > $acc _name

<TD align=center id= $setcolor > $tot _amt1

<TD align=center id= $setcolor > $tot _amt2

<TD align=center id= $setcolor ><font size= $size > $current _user2</font> ";

Echo "</td>";

$i = $i +1;

}

?>




</div>

</div>



</body>










Php+bootstrap+datatable+jquery List of pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.