รายละเอียดของการตอบ ::
อันนี้เป็นโค้ด ระดับที่ 1
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.css"/>
<script src="jQuery/jquery-3.3.1.min.js"> </script>
<script src="bootstrap/js/bootstrap.js"> </script>
<script type="text/javascript" src="js/form.js"></script>
<?php include("logo_webcio.php");?>
<style>
.back-to-top {
cursor: pointer;
position: fixed;
bottom: 50px;
right: 20px;
display:none;
padding-top: 5px;
margin-bottom:25px;
}
</style>
<script>
$(document).ready(function(){
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
// scroll body to 0px on click
$('#back-to-top').click(function () {
$('#back-to-top').tooltip('hide');
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
$('#back-to-top').tooltip('show');
});
</script>
<script type="text/javascript">
function getvalue1(obj){
ministry_id = document.getElementById("ministry_id").value;
department_id = document.getElementById("department_id").value;
cio_firstname = document.getElementById("cio_firstname").value;
window.location='../cio/table_cio.php?ministry_id='+ministry_id
+'&department_id='+department_id
+'&cio_firstname='+cio_firstname;
}
//การค้นหา
function send1(frm) {
ministry_id = document.getElementById("ministry_id").value;
department_id = document.getElementById("department_id").value;
cio_firstname = document.getElementById("cio_firstname").value;
frm.action ='../cio/table_cio.php?ministry_id='+ministry_id
+'&department_id='+department_id
+'&cio_firstname='+cio_firstname;
frm.submit();
}
</script>
</head>
<body style="background-color:#E5FFCC">
<?
include('config/dbconnect.php');
include('config/global.php');
$link = sqlConnect();
sqlSelectDb($link,cio);
if(isset($_REQUEST['ministry_id']))
$ministry_id_get = $_REQUEST['ministry_id'];
else
$ministry_id_get = "";
if(isset($_REQUEST['department_id']))
$department_id_get = $_REQUEST['department_id'];
else
$department_id_get = "";
if(isset($_REQUEST['cio_firstname']))
$cio_firstname_get = $_REQUEST['cio_firstname'];
else
$cio_firstname_get = "";
$cio_firstname_trim = trim($cio_firstname_get);
/*
if(isset($_REQUEST['cio_lastname']))
$cio_lastname_get = $_REQUEST['cio_lastname'];
else
$cio_lastname_get = "";
$cio_lastname_trim = trim($cio_lastname_trim);
*/
// ใส่เงื่อนไขการค้นหา
if($ministry_id_get != "")
$where_search .= " and ministry_id = '$ministry_id_get'";
else
$where_search .= "";
if($department_id_get != "")
$where_search .= " and department_id = '$department_id_get'";
else
$where_search .= "";
if($cio_firstname_get != "")
$where_search .= " and (cio_firstname like '%$cio_firstname_trim%') || (cio_lastname like '%$cio_firstname_trim%') ";
else
$where_search .= "";
//----------------------------------------------------------------------------//
$query_cio1 = "select * from cio where cio_id > 0 $where_search ";
//echo $query_cio1;
$result_cio1 = sqlSelectQuery($link,$query_cio1);
$nums_rows1 = sqlNumRows($result_cio1);
$pagesize = 100; // แสดงจำนวนกระทู้ในแต่ละหน้า ในที่นี้จะแสดง 50 กระทู้
$totalpage = (int)($nums_rows/$pagesize); // หาจำนวนหน้าทั้งหมด
// ถ้าจำนวนหน้าเป็นเศษให้ปัดขึ้นไป
if(($nums_rows%$pagesize)!=0){
$totalpage+=1;
}
// หา record แรกที่จะแสดงของแต่ละหน้า
if(isset($page1)){
$pageno = $page1;
$start = $pagesize*($pageno-1);
}else{
$pageno = 1;
$start = 0;
}
$query_cio = "select * from cio where cio_id > 0 $where_search order by ministry_id,cio_firstname DESC limit $start,$pagesize ";
// echo $query_cio;
$result_cio = sqlSelectQuery($link,$query_cio);
$nums_cio = sqlNumRows($result_cio);
?>
<!-- header-->
<div >
<img src="img/Header5.png" width="100%" class="img-responsive" style="padding:1px;">
</div>
<!-- navigationbar-->
<div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://www.mdes.go.th/view/1/home">MDES</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li> <a href="staff_welcome.php"> <span class="glyphicon glyphicon-home"></span> หน้าหลัก</a></li>
<li><a href="table_cio.php"><span class="glyphicon glyphicon-user"></span> จัดการข้อมูล CIO</a></li>
<!--เทสดรอบดาวน์ -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-duplicate"></span> ออกรายงาน <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="cio_report.php"> รายงานข้อมูล CIO </a></li>
<li><a href="tableshow_ciotrain.php">รายงานโครงการที่ประชุม</a></li>
<!-- <li><a href="table_document.php"> ดาวน์โหลดเอกสาร</a></li> -->
</ul>
</li>
<!--ปิดเทสดรอบดาวน์ -->
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> ออกจากระบบ</a></li>
</ul>
</div>
</div>
</nav>
</div>
<!-- table -->
<div style="margin-bottom:45px">
<form id="show_cio" name="show_cio" method="post" action="output_cio.php?action=delete_cio">
<div class="container-fluid">
<div class="form-group panel panel-info">
<div class="panel-heading">
<div class="row ">
<div class="col-md-2"><br>
<center><h4><span class="glyphicon glyphicon-search"> </span>
<b><u>ค้นหาข้อมูล CIO</u></b> ::</h4></center>
</div>
<div class="col-md-3 ">
<center><label>กระทรวง:</label></center>
<select class="form-control" name="ministry_id" id="ministry_id" onchange="getvalue1(this);">
<option value="">--เลือกทั้งหมด--</option>
<?
$sqlMinistry=("SELECT * FROM ministry order by ministry_name ASC");
$resultMinistry = sqlSelectQuery($link,$sqlMinistry);
while($outputMinistry = sqlFetchArray($resultMinistry)){
$ministry_id = $outputMinistry['ministry_id'];
$ministry_name = $outputMinistry['ministry_name'];
if($ministry_id == $ministry_id_get){
?>
<option value="<?=$ministry_id?>" selected="selected"> <?=$ministry_name;?></option>
<? }else {?>
<option value="<?=$ministry_id?>">
<?=$ministry_name;?>
</option>
<? }
}
?>
</select>
</div>
<div class="col-md-3 ">
<center><label>กรม/กอง/แผนก:</label></center>
<select name="department_id" id="department_id" class="form-control" onchange="getvalue1(this);">
<option value="">--เลือกทั้งหมด--</option>
<?
$sqldepart=("select * from department where ministry_id='$ministry_id_get' order by department_id ASC");
$resultdepart = sqlSelectQuery($link,$sqldepart);
while($outputdepart = sqlFetchArray($resultdepart)){
$department_id = $outputdepart['department_id'];
$department_name = $outputdepart['department_name'];
if($department_id == $department_id_get){
?>
<option value="<?=$department_id?>" selected="selected">
<?=$department_name;?>
</option>
<? }else {?>
<option value="<?=$department_id?>">
<?=$department_name;?>
</option>
<? }
}
?>
</select>
</div>
<div class="col-md-3 ">
<center><label>ชื่อ - นามสกุล CIO:</label></center>
<input type="text" class="form-control" id="cio_firstname" placeholder="ชื่อ - นามสกุล CIO" name="cio_firstname" value="<?=$cio_firstname_get?>"/>
</div>
<div class="col-md-1 ">
<p> </p>
<button name="button" type="button" class="btn btn-success btn-sm" id="button" onclick="send1(show_cio)" value=" ค้นหา.. "/>
<span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</div>
<div class="col-md-1 "></div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-info">
<div class="panel-heading">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<center><h3 class="text-center " > <span class="glyphicon glyphicon-list-alt"> </span> จัดการข้อมูล CIO </h3></center>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<div align="left">
<button type="submit" class="btn btn-danger btn-sm" name="delete" value="ลบข้อมูล" onClick="return confirm_del(show_cio);">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
<span><strong>ลบข้อมูล</strong></span></button>
<button type="button" class="btn btn-success btn-sm" name="save" id="save" value="เพิ่มข้อมูล"
onClick="popupwindow('cio_form_add.php','_blank',1200,1000);"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
<span><strong>เพิ่มข้อมูล</strong></span></button>
<span class="text-center "></span>
</div>
</div>
</div>
</div>
<div class="panel-body table-responsive">
<div>
<p> <center>
<strong> จำนวนข้อมูล CIO
<?=$nums_rows1;?> ท่าน </strong></center></p>
<p align="right"> หน้าที่
<select name="page1" id="page1" onchange="getpage(this);" >
<? for($i=1;$i<=$totalpage;$i++){?>
<? if ($i == $page1){?>
<option value="<?=$i;?>" selected="selected"><?=$i;?></option>
<? } else {?>
<option value="<?=$i;?>"><?=$i;?></option>
<? }
}
?>
</select>
</p>
</div>
<table class="table table-hover table-bordered table-striped ">
<thead>
<tr>
<th width="3%" class="text-center info" > <input type="checkbox" name="selectedall" onClick="checked_all(show_cio)"> </th>
<th width="5%" class="text-center info"> ลำดับที่ </th>
<th width="8%" class="text-center info"> รูปประจำตัว </th>
<th width="20%" class="text-center info"> ข้อมูล สังกัดหน่วยงาน </th>
<th width="20%" class="text-center info"> ข้อมูล ชื่อ-สกุล </th>
<th width="16%" class="text-center info"> ข้อมูล ติดต่อ </th>
<th width="9%" class="text-center info"> <span class="glyphicon glyphicon-eye-open" aria-hidden="true"> ดูรายละเอียด</span> </th>
<th width="9%" class="text-center info"><span class="glyphicon glyphicon-wrench" aria-hidden="true"> แก้ไขข้อมูล</span> </th>
</tr>
<?php
$num=0;
while($output_cio= sqlFetchArray($result_cio)){
/* 1 */ $cio_id = $output_cio[cio_id];
/* 2 */ $coordinator_id = $output_cio[coordinator_id];
/* 3 */ $ministry_id = $output_cio[ministry_id];
/* 4 */ $department_id = $output_cio[department_id];
/* 5 */ $ciolevel_id = $output_cio[ciolevel_id];
/* 6 */ $ciotrain_id = $output_cio[ciotrain_id];
/* 7 */ $cio_titlename = $output_cio[cio_titlename];
/* 8 */ $cio_firstname = $output_cio[cio_firstname];
/* 9 */ $cio_lastname = $output_cio[cio_lastname];
/* 10*/ $cio_gender = $output_cio[cio_gender];
/* 11*/ $cio_assigndate = $output_cio[cio_assigndate];
/* 12*/ $cio_tel = $output_cio[cio_tel];
/* 13*/ $cio_phone = $output_cio[cio_phone];
/* 14*/ $cio_fax = $output_cio[cio_fax];
/* 15*/ $cio_email = $output_cio[cio_email];
/* 16*/ $cio_room = $output_cio[cio_room];
/* 17*/ $cio_floor = $output_cio[cio_floor];
/* 18*/ $cio_building = $output_cio[cio_building];
/* 19*/ $cio_number = $output_cio[cio_number];
/* 20*/ $cio_villagenum = $output_cio[cio_villagenum];
/* 21*/ $cio_road = $output_cio[cio_road];
/* 22*/ $cio_subarea = $output_cio[cio_subarea];
/* 23*/ $cio_area = $output_cio[cio_area];
/* 24*/ $cio_province = $output_cio[cio_province];
/* 25*/ $cio_zipcode = $output_cio[cio_zipcode];
/* 26*/ $cio_picfilename = $output_cio[cio_picfilename];
$query_ministry = "select * from ministry where ministry_id='$ministry_id' ORDER BY ministry_id ASC ";
$result_ministry = sqlSelectQuery($link,$query_ministry);
$output_ministry = sqlFetchArray($result_ministry);
$ministry_name = $output_ministry[ministry_name];
$query_department = "select * from department where department_id='$department_id' ORDER BY ministry_id ASC ";
$result_department = sqlSelectQuery($link,$query_department);
$output_department = sqlFetchArray($result_department);
$department_name = $output_department[department_name];
?>
<tbody>
<tr >
<td class="text-center"> <input name="i_topic[]" type="checkbox" value="<?=$cio_id?>"> </td>
<td class="text-center"> <? if($page1 == "") {echo $num+1; } else {echo (($page1-1)*25)+($num+1);}?> </td>
<td class="text-center"><center> <img src=" images/<?php echo $output_cio["cio_picfilename"];?> "width= "60px" height="60px" "/> </center>
</td>
<td class="text-center"><p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >กระทรวง ::</b> " ; ?></font>
<font style="color:#0040ff;"><?=$ministry_name;?></font></p><br>
<p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >กรม/กอง/แผนก ::</b> " ; ?></font> <font style="color:#0040ff;">
<?=$department_name ;?></font></p><br>
</td>
<td class="text-center">
<font style="color:#0040ff;"><?=$cio_titlename." ".$cio_firstname." ".$cio_lastname;?></font></p><br>
</td>
<td class="text-center"><p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >เบอร์โต๊ะทำงาน ::</b> " ; ?></font>
<font style="color:#0040ff;"> <?=$cio_tel;?></font></p>
<p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >เบอร์มือถือ ::</b> " ; ?></font> <font style="color:#0040ff;">
<?=$cio_phone;?></font></p>
<td width="9%" class="text-center">
<button type="button" class="btn btn-info btn-sm" name="detail" value="ดูรายละเอียด" id="detail"
onClick="popupwindow('cio_form_detail.php?cio_id=<?=$cio_id?>','_blank',1200,1000);">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span><span><strong> ดูรายละเอียด</strong></span>
</button> <input name="cio_id" type="hidden" value="<?=$cio_id?>" />
</td>
<td width="10%" class="text-center">
<button type="button" class="btn btn-warning btn-sm" name="edit" value="แก้ไข" id="edit"
onClick="popupwindow('cio_form_edit.php?cio_id=<?=$cio_id?>','_blank',1200,660);">
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span><span><strong> แก้ไขข้อมูล</strong></span>
</button> <input name="cio_id" type="hidden" value="<?=$cio_id?>" />
</td>
</tr>
</tbody>
<?php
$num++;
}
?>
</table>
<div style="margin-bottom:15px">
<button id="back-to-top" class="btn btn-info btn-lg back-to-top btn-sm " role="button" title="Click to return on the top page" data-toggle="tooltip" data-placement="left"><span class="glyphicon glyphicon-chevron-up"></span><span><strong> กลับสู่ด้านบน</strong></span></button>
</div>
</div>
</div>
</div>
</form>
</div>
<!--footer-->
<div style="padding-top:42px">
<div class=" navbar navbar-default navbar-fixed-bottom " style="background-color:#138c13;"/>
<p class="navbar-text " >
<p> </p>
<p><center>© 2018 - Ministry of Digital Economy and Society.</center></p>
</p>
</div>
</body>
</html>
โค้ดระดับที่ 2
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.css"/>
<script src="jQuery/jquery-3.3.1.min.js"> </script>
<script src="bootstrap/js/bootstrap.js"> </script>
<script type="text/javascript" src="js/form.js"></script>
<?php include("logo_webcio.php");?>
<style>
.back-to-top {
cursor: pointer;
position: fixed;
bottom: 50px;
right: 20px;
display:none;
padding-top: 5px;
margin-bottom:25px;
}
</style>
<script>
$(document).ready(function(){
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
// scroll body to 0px on click
$('#back-to-top').click(function () {
$('#back-to-top').tooltip('hide');
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
$('#back-to-top').tooltip('show');
});
</script>
<script type="text/javascript">
function getvalue1(obj){
ministry_id = document.getElementById("ministry_id").value;
department_id = document.getElementById("department_id").value;
cio_firstname = document.getElementById("cio_firstname").value;
window.location='../cio/table_coordinator.php?ministry_id='+ministry_id
+'&department_id='+department_id
+'&cio_firstname='+cio_firstname;
}
//การค้นหา
function send1(frm) {
ministry_id = document.getElementById("ministry_id").value;
department_id = document.getElementById("department_id").value;
cio_firstname = document.getElementById("cio_firstname").value;
frm.action ='../cio/table_coordinator.php?ministry_id='+ministry_id
+'&department_id='+department_id
+'&cio_firstname='+cio_firstname;
frm.submit();
}
</script>
</head>
<body style="background-color:#E5FFCC">
<?
include('config/dbconnect.php');
include('config/global.php');
$link = sqlConnect();
sqlSelectDb($link,cio);
if(isset($_REQUEST['ministry_id']))
$ministry_id_get = $_REQUEST['ministry_id'];
else
$ministry_id_get = "";
if(isset($_REQUEST['department_id']))
$department_id_get = $_REQUEST['department_id'];
else
$department_id_get = "";
if(isset($_REQUEST['cio_firstname']))
$cio_firstname_get = $_REQUEST['cio_firstname'];
else
$cio_firstname_get = "";
$cio_firstname_trim = trim($cio_firstname_get);
/*
if(isset($_REQUEST['cio_lastname']))
$cio_lastname_get = $_REQUEST['cio_lastname'];
else
$cio_lastname_get = "";
$cio_lastname_trim = trim($cio_lastname_trim);
*/
// ใส่เงื่อนไขการค้นหา
if($ministry_id_get != "")
$where_search .= " and ministry_id = '$ministry_id_get'";
else
$where_search .= "";
if($department_id_get != "")
$where_search .= " and department_id = '$department_id_get'";
else
$where_search .= "";
if($cio_firstname_get != "")
$where_search .= " and (cio_firstname like '%$cio_firstname_trim%') || (cio_lastname like '%$cio_firstname_trim%') ";
else
$where_search .= "";
//----------------------------------------------------------------------------//
$query_cio1 = "select * from cio where cio_id > 0 $where_search ";
//echo $query_cio1;
$result_cio1 = sqlSelectQuery($link,$query_cio1);
$nums_rows1 = sqlNumRows($result_cio1);
$pagesize = 100; // แสดงจำนวนกระทู้ในแต่ละหน้า ในที่นี้จะแสดง 50 กระทู้
$totalpage = (int)($nums_rows/$pagesize); // หาจำนวนหน้าทั้งหมด
// ถ้าจำนวนหน้าเป็นเศษให้ปัดขึ้นไป
if(($nums_rows%$pagesize)!=0){
$totalpage+=1;
}
// หา record แรกที่จะแสดงของแต่ละหน้า
if(isset($page1)){
$pageno = $page1;
$start = $pagesize*($pageno-1);
}else{
$pageno = 1;
$start = 0;
}
$query_cio = "select * from cio where cio_id > 0 $where_search order by ministry_id,cio_firstname ASC limit $start,$pagesize ";
// echo $query_cio;
$result_cio = sqlSelectQuery($link,$query_cio);
$nums_cio = sqlNumRows($result_cio);
?>
<!-- header-->
<div >
<img src="img/Header5.png" width="100%" class="img-responsive" style="padding:1px;">
</div>
<!-- navigationbar-->
<div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://www.mdes.go.th/view/1/home">MDES</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li> <a href="coordinator_welcome.php"> <span class="glyphicon glyphicon-home"></span> หน้าหลัก</a></li>
<li><a href="table_coordinator.php"><span class="glyphicon glyphicon-user"></span> จัดการข้อมูล CIO</a></li>
<!--เทสดรอบดาวน์ -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-duplicate"></span> ออกรายงาน <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="coordinator_report.php"> รายงานข้อมูล CIO </a></li>
<li><a href="tableshow_ciotrain.php">รายงานโครงการที่ประชุม</a></li>
<!-- <li><a href="table_document.php"> ดาวน์โหลดเอกสาร</a></li> -->
</ul>
</li>
<!--ปิดเทสดรอบดาวน์ -->
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> ออกจากระบบ</a></li>
</ul>
</div>
</div>
</nav>
</div>
<!-- table -->
<div style="margin-bottom:45px">
<form id="show_cio" name="show_cio" method="post" action="output_cio.php?action=delete_cio">
<div class="container-fluid">
<div class="form-group panel panel-warning">
<div class="panel-heading">
<div class="row ">
<div class="col-md-2"><br>
<center><h4><span class="glyphicon glyphicon-search"> </span>
<b><u>ค้นหาข้อมูล CIO</u></b> ::</h4></center>
</div>
<div class="col-md-3 ">
<center><label>กระทรวง:</label></center>
<select class="form-control" name="ministry_id" id="ministry_id" onchange="getvalue1(this);">
<option value="">--เลือกทั้งหมด--</option>
<?
$sqlMinistry=("SELECT * FROM ministry order by ministry_name ASC");
$resultMinistry = sqlSelectQuery($link,$sqlMinistry);
while($outputMinistry = sqlFetchArray($resultMinistry)){
$ministry_id = $outputMinistry['ministry_id'];
$ministry_name = $outputMinistry['ministry_name'];
if($ministry_id == $ministry_id_get){
?>
<option value="<?=$ministry_id?>" selected="selected"> <?=$ministry_name;?></option>
<? }else {?>
<option value="<?=$ministry_id?>">
<?=$ministry_name;?>
</option>
<? }
}
?>
</select>
</div>
<div class="col-md-3 ">
<center><label>กรม/กอง/แผนก:</label></center>
<select name="department_id" id="department_id" class="form-control" onchange="getvalue1(this);">
<option value="">--เลือกทั้งหมด--</option>
<?
$sqldepart=("select * from department where ministry_id='$ministry_id_get' order by department_id ASC");
$resultdepart = sqlSelectQuery($link,$sqldepart);
while($outputdepart = sqlFetchArray($resultdepart)){
$department_id = $outputdepart['department_id'];
$department_name = $outputdepart['department_name'];
if($department_id == $department_id_get){
?>
<option value="<?=$department_id?>" selected="selected">
<?=$department_name;?>
</option>
<? }else {?>
<option value="<?=$department_id?>">
<?=$department_name;?>
</option>
<? }
}
?>
</select>
</div>
<div class="col-md-3 ">
<center><label>ชื่อ - นามสกุล CIO:</label></center>
<input type="text" class="form-control" id="cio_firstname" placeholder="ชื่อ - นามสกุล CIO" name="cio_firstname" value="<?=$cio_firstname_get?>"/>
</div>
<div class="col-md-1 ">
<p> </p>
<button name="button" type="button" class="btn btn-success btn-sm" id="button" onclick="send1(show_cio)" value=" ค้นหา.. "/>
<span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</div>
<div class="col-md-1 "></div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-warning">
<div class="panel-heading">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<center><h3 class="text-center " > <span class="glyphicon glyphicon-list-alt"> </span> จัดการข้อมูล CIO </h3></center>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<div align="left">
<button type="button" class="btn btn-success btn-sm" name="save" id="save" value="เพิ่มข้อมูล"
onClick="popupwindow('form_coordinate_add.php','_blank',1200,1000);"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
<span><strong>เพิ่มข้อมูล</strong></span></button>
<span class="text-center "></span>
</div>
</div>
</div>
</div>
<div class="panel-body table-responsive">
<div>
<p> <center>
<strong> จำนวนข้อมูล CIO
<?=$nums_rows1;?> ท่าน </strong></center></p>
<p align="right"> หน้าที่
<select name="page1" id="page1" onchange="getpage(this);" >
<? for($i=1;$i<=$totalpage;$i++){?>
<? if ($i == $page1){?>
<option value="<?=$i;?>" selected="selected"><?=$i;?></option>
<? } else {?>
<option value="<?=$i;?>"><?=$i;?></option>
<? }
}
?>
</select>
</p>
</div>
<table class="table table-hover table-bordered table-striped ">
<thead>
<tr>
<th width="5%" class="text-center warning"> ลำดับที่ </th>
<th width="8%" class="text-center warning"> รูปประจำตัว </th>
<th width="29%" class="text-center warning"> ข้อมูล สังกัดหน่วยงาน </th>
<th width="23%" class="text-center warning"> ข้อมูล ชื่อ-สกุล </th>
<th width="16%" class="text-center warning"> ข้อมูล ติดต่อ </th>
<th width="9%" class="text-center warning"> <span class="glyphicon glyphicon-eye-open" aria-hidden="true"> ดูรายละเอียด</span> </th>
<th width="9%" class="text-center warning"><span class="glyphicon glyphicon-wrench" aria-hidden="true"> แก้ไขข้อมูล</span> </th>
</tr>
<?php
$num=0;
while($output_cio= sqlFetchArray($result_cio)){
/* 1 */ $cio_id = $output_cio[cio_id];
/* 2 */ $coordinator_id = $output_cio[coordinator_id];
/* 3 */ $ministry_id = $output_cio[ministry_id];
/* 4 */ $department_id = $output_cio[department_id];
/* 5 */ $ciolevel_id = $output_cio[ciolevel_id];
/* 6 */ $ciotrain_id = $output_cio[ciotrain_id];
/* 7 */ $cio_titlename = $output_cio[cio_titlename];
/* 8 */ $cio_firstname = $output_cio[cio_firstname];
/* 9 */ $cio_lastname = $output_cio[cio_lastname];
/* 10*/ $cio_gender = $output_cio[cio_gender];
/* 11*/ $cio_assigndate = $output_cio[cio_assigndate];
/* 12*/ $cio_tel = $output_cio[cio_tel];
/* 13*/ $cio_phone = $output_cio[cio_phone];
/* 14*/ $cio_fax = $output_cio[cio_fax];
/* 15*/ $cio_email = $output_cio[cio_email];
/* 16*/ $cio_room = $output_cio[cio_room];
/* 17*/ $cio_floor = $output_cio[cio_floor];
/* 18*/ $cio_building = $output_cio[cio_building];
/* 19*/ $cio_number = $output_cio[cio_number];
/* 20*/ $cio_villagenum = $output_cio[cio_villagenum];
/* 21*/ $cio_road = $output_cio[cio_road];
/* 22*/ $cio_subarea = $output_cio[cio_subarea];
/* 23*/ $cio_area = $output_cio[cio_area];
/* 24*/ $cio_province = $output_cio[cio_province];
/* 25*/ $cio_zipcode = $output_cio[cio_zipcode];
/* 26*/ $cio_picfilename = $output_cio[cio_picfilename];
$query_ministry = "select * from ministry where ministry_id='$ministry_id' ORDER BY ministry_id ASC ";
$result_ministry = sqlSelectQuery($link,$query_ministry);
$output_ministry = sqlFetchArray($result_ministry);
$ministry_name = $output_ministry[ministry_name];
$query_department = "select * from department where department_id='$department_id' ORDER BY ministry_id ASC ";
$result_department = sqlSelectQuery($link,$query_department);
$output_department = sqlFetchArray($result_department);
$department_name = $output_department[department_name];
?>
<tbody>
<tr >
<td class="text-center"> <? if($page1 == "") {echo $num+1; } else {echo (($page1-1)*25)+($num+1);}?> </td>
<td class="text-center"><center> <img src=" images/<?php echo $output_cio["cio_picfilename"];?> "width= "60px" height="60px" "/> </center>
</td>
<td class="text-center"><p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >กระทรวง ::</b> " ; ?></font>
<font style="color:#0040ff;"><?=$ministry_name;?></font></p><br>
<p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >กรม/กอง/แผนก ::</b> " ; ?></font> <font style="color:#0040ff;">
<?=$department_name ;?></font></p><br>
</td>
</td>
<td class="text-center">
<font style="color:#0040ff;"><?=$cio_titlename." ".$cio_firstname." ".$cio_lastname;?></font></p><br>
</td>
<td class="text-center"><p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >เบอร์โต๊ะทำงาน ::</b> " ; ?></font>
<font style="color:#0040ff;"> <?=$cio_tel;?></font></p>
<p align="left"><font style="color:#0080ff;" align="left"><? echo "<b >เบอร์มือถือ ::</b> " ; ?></font> <font style="color:#0040ff;">
<?=$cio_phone;?></font></p>
<td width="9%" class="text-center">
<button type="button" class="btn btn-warning btn-sm" name="detail" value="ดูรายละเอียด" id="detail"
onClick="popupwindow('ciotrain_form_detail.php?cio_id=<?=$cio_id?>','_blank',1200,1000);">
<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span><span><strong> ดูรายละเอียด</strong></span>
</button> <input name="cio_id" type="hidden" value="<?=$cio_id?>" />
</td>
<td width="10%" class="text-center">
<button type="button" class="btn btn-warning btn-sm" name="edit" value="แก้ไข" id="edit"
onClick="popupwindow('coordinator_form_edit.php?cio_id=<?=$cio_id?>','_blank',1200,660);">
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span><span><strong> แก้ไขข้อมูล</strong></span>
</button> <input name="cio_id" type="hidden" value="<?=$cio_id?>" />
</td>
</tr>
</tbody>
<?php
$num++;
}
?>
</table>
<div style="margin-bottom:15px">
<button id="back-to-top" class="btn btn-info btn-lg back-to-top btn-sm " role="button" title="Click to return on the top page" data-toggle="tooltip" data-placement="left"><span class="glyphicon glyphicon-chevron-up"></span><span><strong> กลับสู่ด้านบน</strong></span></button>
</div>
</div>
</div>
</div>
</form>
</div>
<!--footer-->
<div style="padding-top:42px">
<div class=" navbar navbar-default navbar-fixed-bottom " style="background-color:#138c13;"/>
<p class="navbar-text " >
<p> </p>
<p><center>© 2018 - Ministry of Digital Economy and Society.</center></p>
</p>
</div>
</body>
</html>