溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

php+bootstrap+dataTable+jquery分頁列表

發(fā)布時(shí)間:2020-07-08 10:07:10 來源:網(wǎng)絡(luò) 閱讀:654 作者:move__on 欄目:web開發(fā)

<!DOCTYPE HTML>

<html>

<head>

<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,

//配合使用 全都是true的時(shí)候開啟

"bLengthChange":true,

"bPaginate":true,

//配合使用

   "bScrollInfinite": true,

"bScrollCollapse": true,

       "sScrollY": "",

//配合使用

"sScrollX": "100%",//disabled or 100% 其實(shí)只要不是空,就算是123也會(huì)出現(xiàn)效果

"sScrollXInner": "100%",

//保存客戶端信息在cookie里,了解

"bStateSave":true,

//這個(gè)為選擇每頁的條目數(shù),當(dāng)使用一個(gè)二維數(shù)組時(shí),二維層面只能有兩個(gè)元素,第一個(gè)為顯示每頁條目數(shù)的選項(xiàng),第二個(gè)是關(guān)于這些選項(xiàng)的解釋

//"aLengthMenu":[5,10,20,50,100],

//"aLengthMenu":[[10, 25, 30, -1],[10, 25, "三十", "All"]],

"iCookieDuration":10,

//默認(rèn)分頁條數(shù)

//iDisplayStart 從第幾行開始顯示數(shù)據(jù)

"iDisplayLength":34,

//'full_numbers' or 'two_button', default 'two_button' 用于指定分頁器風(fēng)格

//"sPaginationType":'two_button',

//第0列降序排列

"aaSorting": [[0,"desc"]],

//隱藏某些列

/* "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">10</option>' + '<option value="20">20</option>' + '<option value="30">30</option>' + '<option value="40">40</option>' + '<option value="50">50</option>' + '</select>條記錄',//左上角的分頁大小顯示。

// search: '<span class="label label-success">搜索:</span>',//右上角的搜索文本,可以寫html標(biāo)簽


// paginate: {//分頁的樣式內(nèi)容。

// previous: "上一頁",

// next: "下",

// first: "第一",

// last: "最后"

// },


// zeroRecords: "沒有內(nèi)容",//table tbody內(nèi)容為空時(shí),tbody的內(nèi)容。

//下面三者構(gòu)成了總體的左下角的內(nèi)容。

// info: "總共_PAGES_ 頁,顯示第_START_ 到第 _END_ ,篩選之后得到 _TOTAL_ 條,初始_MAX_ 條 ",//左下角的信息顯示,大寫的詞為關(guān)鍵字。

// infoEmpty: "0條記錄",//篩選為空時(shí)左下角的顯示。

// infoFiltered: ""http://篩選之后的左下角篩選提示,

// },

});

});

</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>

</head>


<div class="panel panel-default">

    <div class="panel-heading">

        <div class="panel-title">

           <? echo iconv("gb2312","UTF-8"," 績(jī)效轉(zhuǎn)移單查詢")  ?>

        </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","申請(qǐng)單號(hào)")  ?>

     <th align=center><font color=black><? echo  iconv("gb2312","UTF-8","申請(qǐng)人") ?>

<th align=center><font color=black><? echo iconv("gb2312","UTF-8","申請(qǐng)部門") ?>

<th align=center><font color=black><? echo iconv("gb2312","UTF-8","申請(qǐng)日期") ?>

<th align=center><font color=black><? echo iconv("gb2312","UTF-8","轉(zhuǎn)出單位") ?>

<th align=center><font color=black><? echo iconv("gb2312","UTF-8","轉(zhuǎn)移科目") ?>

<th align=center><font color=black><? echo  iconv("gb2312","UTF-8","申請(qǐng)金額") ?>

<th align=center><font color=black><? echo iconv("gb2312","UTF-8","承認(rèn)金額") ?>

<th align=center><font color=black><? echo  iconv("gb2312","UTF-8","簽核者") ?>

        </tr>

 </thead>


<tbody>

<?php


$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 

              e 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","結(jié)案");

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",'會(huì)簽中').$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("申請(qǐng)人部門 error");  

      list($depart_name,$getdepart)=$stc->fetch();

 

$str1="select  acc_depart_name from acc_gl_depart where acc_depart_no='$dept_no'";

list($dep_name)=fields("$str1"); 

    

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

      echo "<tr><td align=center id=$setcolor>$exp_no

         <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>


</html>









向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI