|
|
|
อยากทราบว่าจะเปลี่ยนการแสดงข้อมูลในหน้านี้ ในส่วนของหมวดหมู่วิชา ถ้าเจอ1 ให้แสดงเป็น ภาษาไทย 2ภาษาอังกฤษ รู้สึกจะ error |
|
|
|
|
|
|
|
อยากทราบว่าจะเปลี่ยนการแสดงข้อมูลในหน้านี้ ในส่วนของหมวดหมู่วิชา ถ้าเจอ1 ให้แสดงเป็น ภาษาไทย 2ภาษาอังกฤษ
รู้สึกจะ error บรรทัด204 ครับ ชี้แนะผมทีคับ ขอบคุณครับ
Code (PHP)
<?
include("Con_DB.php");
if($submit == "Delete"){
if($_GET['id_prd'] != ''){
$dele = "delete from tb_product where id_prd = ".$_GET['id_prd']." ";
echo $dele;
$query = mssql_query($dele);
echo "<META HTTP-EQUIV='Refresh' CONTENT='0; URL=report_Book.php'>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>List Book</title>
<link rel="stylesheet" type="text/css" href="report/css/site-examples.css">
<link rel="stylesheet" type="text/css" href="report/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="report/css/dataTables.bootstrap.min.css">
<link id="switcher" href="css/themes/orange-theme.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<script type="text/javascript" src="report/js/site.js"></script>
<script type="text/javascript" src="report/js/jquery-1.11.3.js"></script>
<script type="text/javascript" src="report/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="report/js/dataTables.bootstrap.min.js"> </script>
<script type="text/javascript" src="report/js/demo.js"> </script>
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#myreport').DataTable({
"columns": [
{ "width": "5%" },
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
]
}
);
} );
</script>
</head>
<body>
<!--=========== BEGIN HEADER SECTION ================-->
<header id="header">
BEGIN MENU
<div class="menu_area">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container">
<div class="navbar-header">
<!-- FOR MOBILE VIEW COLLAPSED BUTTON-->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- LOGO -->
<!-- TEXT BASED LOGO-->
<a class="navbar-brand" href="index.html">The Act.<span>Book Stock</span></a>
<!-- IMG BASED LOGO -->
<!-- <a class="navbar-brand" href="index.html">
<img src="img/logo.png" alt="logo"></a>-->
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul id="top-menu" class="nav navbar-nav navbar-right main-nav">
<li class="active"><a href="index.php">เมนูหลัก</a></li>
<!---<li><a href="Add_Product.php">เพิ่มสินค้าในคลัง</a></li>
<li><a href="report_Book.php">สินค้าในคลัง</a></li>
<li><a href="#">เบิกสินค้าในคลัง</a></li>
<li><a href="#">รายการสั่งซื้อ</a></li>--->
</ul>
</div><!--/.nav-collapse-->
</div>
</nav>
</div>
<!-- END MENU-->
</header>
<!--=========== END HEADER SECTION ================-->
<?php
// include("Menu.php");
$str = " select id_prd, name_prd , ref_id_type , price , price_prd , photo_prd ";
$str .= " , status , ProductSize ,PageCount ,ProductExample ";
$str .= " , WholesalePrice , Instock ,CONVERT(VARCHAR(10),Indate,103) as date
, Indate , Quantity ,prd_grp from tb_product order by id_prd DESC " ;
$query = mssql_query($str);
?>
<div class="row"><div class="col-sm-12 col-md-12" style="height:90px;"></div> </div>
<div class="container" style="margin-top:5px;">
<div class="row">
<div class= "panel panel-warning">
<div class="panel-heading" style="background-color: #ff6a00; color: #fff;">
<h4 class="title">รายการสินค้าในคลัง</h4>
</div>
<div class="panel-body">
<div class="table-responsive">
<table id="myreport" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead style="text-align:center;">
<tr>
<th style="text-align: center;">ที่</th>
<th style="text-align: center;">ชื่อหนังสือ</th>
<th style="text-align: center;">ราคาปลีก</th>
<th style="text-align: center;">ราคาพิเศษ</th>
<th style="text-align: center;">ราคาส่ง</th>
<th style="text-align: center;">ผลิต</th>
<th style="text-align: center;">ค้างส่ง</th>
<th style="text-align: center;">ขายออก</th>
<th style="text-align: center;">event</th>
<th style="text-align: center;">คงเหลือ</th>
<th style="text-align: center;">หมวดหมู่วิชา</th>
<th style="text-align: center;"></th>
<th style="text-align: center;"></td>
</tr>
</thead>
<tbody>
<?
$ii=0;
while ($resuft = mssql_fetch_assoc($query)) {
$ii++;
?>
<tr >
<td style="text-align: center;"><?php echo $ii.'.';?></td>
<td style="width:20%;">
<? echo iconv('TIS-620','UTF-8',$resuft['name_prd']);?>
</td>
<td style="text-align: center;"><? echo $resuft['price'] ?></td>
<td style="text-align: center;"><? echo $resuft['price_prd'] ?></td>
<td style="text-align: center;"> <? echo $resuft['WholesalePrice']?></td>
<!--ผลิต-->
<td style="text-align: center;"><? echo $resuft['Quantity'] ?></td>
<!--ค้างส่ง-->
<td style="text-align: center;">
<?
$str2 = "select count(ref_id_order) as amount from tb_order_detail A inner join tb_order B on A.ref_id_order = B.id_order
where ref_id_prd = '".$resuft['id_prd']."' and B.status = 2 group by ref_id_prd " ;
$querysql2 = mssql_query($str2);
$resuft2 = mssql_fetch_array($querysql2);
echo $resuft2['amount'];
$Outstanding = $resuft2['amount'];
?>
</td>
<!--ขายออก-->
<td style="text-align: center;">
<?
$str3 = "select count(ref_id_order) as amount1 from tb_order_detail A
inner join tb_order B on A.ref_id_order = B.id_order
where ref_id_prd = '".$resuft['id_prd']."' and B.status = 3
and finance is not null and financeDate is not null and PostOffice = 1 and PostDate is not null
group by ref_id_prd " ;
$querysql3 = mssql_query($str3);
$resuft3 = mssql_fetch_array($querysql3);
echo $resuft3['amount1'];
$salse = $resuft3['amount1'];
?>
</td>
<td style="text-align: center;">
<?
$str5 = "select sum(amount) as amount , A.borrowed , B.eventid , B.id_prd
from tb_borrow A inner join tb_Return B on A.eventid = B.eventid and A.id_prd = B.id_prd
where B.id_prd = '".$resuft['id_prd']."'
group by A.borrowed , B.eventid , B.id_prd" ;
$query5 = mssql_query($str5);
$row5 = mssql_fetch_array($query5);
$amount5 = $row5['amount'];
$borrowed = $row5['borrowed'];
$AB = $borrowed - $amount5;
echo $AB;
?>
</td>
<!--คงเหลือ-->
<td style="text-align: center;">
<?
$Instock = $resuft['Instock'];
if($salse != 0){
$Total = $Instock-$salse;
echo $Total;
}else{
echo $resuft['Instock'];
}
?>
</td>
<td style="text-align: center;"><?
if $resuft['prd_grp']==1
{echo"ถาษาไทย"}
else if $resuft['prd_grp']==2
{echo"ภาษาอังกฤษ"}
</td>
<td style="text-align:center;">
<a href="report_Book.php?submit=Delete&id_prd=<? echo $resuft['id_prd']?>">
<img src="img/delete.png"></a>
</td>
<td style="text-align:center;">
<a href="edit.php?id_prd=<? echo $resuft['id_prd']?>">
<img src="img/edit-icon.png"></a>
</td>
</tr>
<?
}
mssql_free_result($query);
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php
mssql_close($objConnect);
?>
</body>
</html>
Tag : PHP
|
ประวัติการแก้ไข 2018-03-30 11:24:06
|
|
|
|
|
Date :
2018-03-30 11:23:25 |
By :
sanwa |
View :
705 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
if($resuft['prd_grp']==1){
echo"ถาษาไทย"
}else{
echo"ภาษาอังกฤษ"}
|
|
|
|
|
Date :
2018-03-30 11:48:47 |
By :
Hararock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|