|
|
|
อยากส่งค่า id ไปอีกหน้า แล้วให้แสดง id แบบ session |
|
|
|
|
|
|
|
หน้าส่งค่าไปครับ ตอนนี้ค่าแสดงครับแต่ อยากให้ค่า id มันอยู่ในรูปแบบ session
Code (PHP)
<?php
session_start();
include ('config/config.php');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>จัดการวัตถุดิบ</title>
<!-- BOOTSTRAP STYLES-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FONTAWESOME STYLES-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- CUSTOM STYLES-->
<link href="assets/css/custom.css" rel="stylesheet" />
<!-- GOOGLE FONTS-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
<link rel="stylesheet" type="text/css" href="tool/DataTables-1.10.13/media/css/dataTables.bootstrap.css">
<link rel="stylesheet" href="tool/datepicker/css/datepicker.css">
</head>
<body>
<div id="wrapper">
<?php include ('menu.php'); ?>
<div id="page-wrapper" >
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<div class="alert alert-success" role="alert"><h4><a href="index.php" style="color: #666666">หน้าหลัก</a> / วางแผนการผลิต</h4></div>
</div>
</div>
<form class="form-horizontal" name="form1" method="post" role="form" action="pages/insert_SC.php">
<div class="alert alert-warning" role="alert">
<div class="form-group">
<label for="inputType" class="col-md-7 control-label">Document No : </label>
<div class="col-md-4">
<input type="text" class="form-control" name="MRP" placeholder="MRP-SC" OnKeyPrees="return chknumber($this)">
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-6">
<div class="form-group row">
<label for="inputKey" class="col-md-2 control-label">issue by:</label>
<div class="col-md-3">
<input type="text" name="issue_by" class="form-control" placeholder="issue by">
</div>
<label for="inputKey" class="col-md-3 control-label">issue Date:</label>
<div class="col-md-3">
<input type="text" name="issue_Date" class="form-control datepicker" id="datepicker" placeholder="issue Date">
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<div class="form-group row">
<label for="inputKey" class="col-md-1 control-label">Department:</label>
<div class="col-md-2">
<input type="text" name="Department" class="form-control" placeholder="Department">
</div>
<label for="inputValue" class="col-md-1 control-label">Category:</label>
<div class="col-md-2">
<input type="text" name="Category" class="form-control" placeholder="Category">
</div>
<label for="inputKey" class="col-md-1 control-label">Code:</label>
<div class="col-md-2">
<input type="text" name="Code" class="form-control" placeholder="Code">
</div>
<label for="inputKey" class="col-md-1 control-label">Customer:</label>
<div class="col-md-2">
<input type="text" name="Customer" class="form-control" placeholder="Customer">
</div>
</div>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-sm-4 col-sm-offset-5 ">
<button type="submit" class="btn btn-info" onsubmit="JavaScript:return chksubmit();"><i class="fa fa-plus-circle"></i> บันทึก</button>
<button type="reset" class="btn btn-danger"><i class="fa fa-refresh"></i> ยกเลิก</button>
</div>
</div>
</form>
<?php
$strSQL = "SELECT * FROM plan_order where sc_id " ;
$objQuery = mysqli_query($conn,$strSQL);
?>
<p></p>
<div id="prodata_table">
<table id="table_id" class="table table-bordered">
<thead>
<th class="text-center" width="5%">SC</th>
<th class="text-center" width="5%">ประเภท</th>
<th class="text-center" width="5%">วันที่รับเรื่อง</th>
<th class="text-center" width="10%">รายละเอียด</th>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($objQuery))
{
?>
<tr>
<td class="text-center"><a href="add_item.php?sc_id=<?php echo $row["sc_id"];'' ?>"><?php echo $row["sc_id"]; ?></a></td> <------------------------!ส่งค่าตรงนี้ครับ------------------>
<td class="text-center"><?php echo $row['cat'] ?></td>
<td class="text-center"><?php echo date('d-m-Y', strtotime($row["issue_date"])); ?></td>
<td class="text-center">
<button class="btn btn-success "><a style="color: #ffffff;"><i class="fa fa-desktop"></i></a></button>
<button class="btn btn-warning "><a style="color: #ffffff;"><i class="fa fa-cog"></i></a></button>
<a href="JavaScript:if(confirm('ต้องการลบข้อมูลหรือไม่ ?')==true){window.location='pages/delete_sc.php?sc_id=<?php echo $row["sc_id"]; ?>';}" style="color: #ffffff;"><button class="btn btn-danger "><i class="fa fa-bitbucket"></i></button></a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="assets/js/jquery-3.1.0.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="tool/datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript">
$(function(){
$('.datepicker').datepicker();
});
</script>
<script type="text/javascript" src="tool/DataTables-1.10.13/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="tool/DataTables-1.10.13/media/js/dataTables.bootstrap.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#table_id').dataTable( {
"oLanguage": {
"sLengthMenu": "แสดง _MENU_ เร็คคอร์ด ต่อหน้า",
"sZeroRecords": "ไม่เจอข้อมูลที่ค้นหา",
"sInfo": "แสดง _START_ ถึง _END_ ของ _TOTAL_ เร็คคอร์ด",
"sInfoEmpty": "แสดง 0 ถึง 0 ของ 0 เร็คคอร์ด",
"sInfoFiltered": "(จากเร็คคอร์ดทั้งหมด _MAX_ เร็คคอร์ด)",
"sSearch": "ค้นหา :"
}
} );
});
</script>
<script src="assets/js/jquery.metisMenu.js"></script>
<script src="assets/js/custom.js"></script>
</body>
</html>
หน้าแสดง ID ครับ
Code (PHP)
<?php
session_start();
include ('config/config.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>จัดการวัตถุดิบ</title>
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<link href="assets/css/custom.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
<link rel="stylesheet" type="text/css" href="tool/DataTables-1.10.13/media/css/dataTables.bootstrap.css">
<link rel="stylesheet" href="tool/datepicker/css/datepicker.css">
</head>
<body>
<div id="wrapper">
<?php include ('menu.php'); ?>
<div id="page-wrapper" >
<div id="page-inner">
<div class="row">
<div class="col-md-12">
<div class="alert alert-info" role="alert"><h4><a href="index.php" >หน้าหลัก</a> / <a href="add_plan.php" >วางแผนการผลิต</a> / สร้างวันที่ผลิต</h4></div>
<?php
$strSQL1 = "SELECT * FROM plan_order WHERE sc_id = '".@$_GET["sc_id"]."' ";
$objQuery1 = mysqli_query($conn,$strSQL1) or die ("Error Query [".$strSQL1."]");
$objResult1 = mysqli_fetch_array($objQuery1);
?>
<form action="order.php" method="post">
<form class="form-inline">
<input type="text" class="form-control" name="txt_scid" value="<?php echo $objResult1["sc_id"]; ?>">
<div class="form-group">
<label for="exampleInputEmail2">วันที่</label>
<input type="text" name="issue_Date" class="form-control datepicker" id="datepicker" placeholder="" style="width: 190px;">
</div>
<input type="submit" class="btn btn-success" value="Add">
</form>
<?php
$strSQL = "SELECT * FROM product order by id_auto desc ";
$objQuery = mysqli_query($conn,$strSQL);
?>
<div class="table-responsive">
<table id="table_id" class="table table-bordered">
<thead>
<th class="text-center" width="10%">รหัสสินค้า</th>
<th width="40%">รายละเอียดสินค้า</th>
<th class="text-center" width="8%">จำนวน</th>
<th class="text-center" width="8%">เพิ่มลงในแผน</th>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($objQuery))
{
?>
<tr>
<form action="order.php" method="post">
<td><?php echo $row['pro_id'] ?></td>
<td><input style="width: 700px;" type="text" class="form-control" name="txtpro_name" value="<?php echo $row["pro_name"];?>"></td>
<td class="text-center"><input type="text" name="txtQty" value="0" class="form-control" style="width: 70px;"></td>
<td class="text-center">
<input type="hidden" name="txtProductID" value="<?php echo $row["id_auto"];?>">
<input type="submit" class="btn btn-success" value="Add"></td>
</form>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<br><br><a href="show.php">ดูรายการวัตถุดิบ</a> | <a href="clear.php">ลบรายการทั้งหมด</a>
</div>
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<!-- /. WRAPPER -->
<script src="assets/js/jquery-3.1.0.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="tool/datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript">
$(function(){
$('.datepicker').datepicker();
});
</script>
<script type="text/javascript" src="tool/DataTables-1.10.13/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="tool/DataTables-1.10.13/media/js/dataTables.bootstrap.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#table_id').dataTable( {
"scrollY": "350px",
"paging": false,
"oLanguage": {
"sLengthMenu": "แสดง _MENU_ เร็คคอร์ด ต่อหน้า",
"sZeroRecords": "ไม่เจอข้อมูลที่ค้นหา",
"sInfo": "แสดง _START_ ถึง _END_ ของ _TOTAL_ เร็คคอร์ด",
"sInfoEmpty": "แสดง 0 ถึง 0 ของ 0 เร็คคอร์ด",
"sInfoFiltered": "(จากเร็คคอร์ดทั้งหมด _MAX_ เร็คคอร์ด)",
"sSearch": "ค้นหา :"
}
} );
});
</script>
<script src="assets/js/jquery.metisMenu.js"></script>
<script src="assets/js/custom.js"></script>
</body>
</html>
Tag : PHP
|
ประวัติการแก้ไข 2017-03-24 14:05:30 2017-03-24 14:06:08 2017-03-24 14:07:08 2017-03-24 14:08:14 2017-03-24 14:08:52
|
|
|
|
|
Date :
2017-03-24 14:03:53 |
By :
golfza034 |
View :
2371 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
session_start();
$_SESSION['sc_id'] = $_GET['sc_id']
|
|
|
|
|
Date :
2017-03-24 14:27:43 |
By :
apisitp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เวลาเอาไปใช้
session_start();
echo $_SESSION['sc_id'];
|
|
|
|
|
Date :
2017-03-24 16:08:11 |
By :
apisitp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2017-03-24 17:48:41 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|