อยากทราบวิธีบันทึกข้อมูลอีกรอบที่มาจากการวนลูปครับ php
เอา tag php ครอบหน่อย เดี๋ยวมาดูใหม่อ่านแบบนี้ ปวดหัวตาลายพาลจะเป็นลม 555
Date :
2018-02-23 13:19:24
By :
Chaidhanan
ขอโทษครับ พึ่งทำกระทู้ครั้งแรกครับ
Code (PHP)
<?php
session_start();
if($_SESSION["TcID"] == "")
{
echo "<script>";
echo "alert(\" กรูณาเข้าสู่ระบบ\");";
echo "window.history.back()";
echo "</script>";
exit();
}
else{ };
require_once("../config.php");
require_once("../admin/function.php");
$AcID = $_GET['AcID'];
?>
<style>
input[type=submit] {
width: 8%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
</style>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 8px;
text-align: left;
}
</style>
<head>
<!-- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="x-ua-compatible" content="IE=9" /><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Register Activity system</title>
<meta name="description" content="Your Description Here">
<meta name="keywords" content="bootstrap themes, portfolio, responsive theme">
<meta name="author" content="ThemeForces.Com">
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-touch-icon-114x114.png">
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome/css/font-awesome.css">
<!-- Stylesheet
================================================== -->
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/responsive.css">
<script type="text/javascript" src="js/modernizr.custom.js"></script>
<link href='http://fonts.googleapis.com/css?family=Raleway:500,600,700,100,800,900,400,200,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Playball' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
</div>
</div>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<header class="main-header">
<!-- Logo -->
<a href="index.php" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>TEACHER</b></span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Messages: style can be found in dropdown.less-->
<!-- Notifications: style can be found in dropdown.less -->
<!-- Tasks: style can be found in dropdown.less -->
<li class="dropdown tasks-menu">
<ul class="dropdown-menu">
<li class="header"></li>
</ul>
</li>
<!-- User Account: style can be found in dropdown.less -->
<!-- Control Sidebar Toggle Button -->
</ul>
</div>
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<?php
include("teacher_menu.php");
?>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>วัดผลนักเรียน</h1>
<?php
include("name.php");
?>
</section>
<!-- Main content -->
<section class="content">
<div class="row"><!-- /.col --><!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-xs-12">
<div class="box"><!-- /.box-header -->
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tr>
<th width="24%">รหัสนักเรียน</th>
<th width="34%">ชื่อ-นามสกุล</th>
<th width="18%">ห้อง</th>
<th width="24%">ประเมินผล</th>
</tr>
<?php
$sql = 'select*
from tblregister as d1
INNER JOIN tblstudent as d2
on d1.StdID = d2.StdID
INNER JOIN tblactivities as d3
on d1.AcID = d3.AcID
INNER JOIN tblsubtitle as d4
on d2.StID = d4.StID
INNER JOIN tblstudentclass as d5
on d2.ScID = d5.ScID
where d3.AcID ="'.$AcID.'" ' ;
$result = mysqli_query($link,$sql);
$numrow = mysqli_num_rows($result);
?>
<?php
for($i=1;$i<=$numrow;$i++){
$x = mysqli_fetch_array($result);
?>
<form name="form1" action="teacher_evaluation_scorepro.php" method="GET">
<input type="hidden" value="<?php echo $AcID; ?> " name="acid2">
<tr>
<td><input type="hidden" value="<?php echo $x["StdID"]; ?> " name="student"><?php echo $x["StdID"]; ?> </td>
<td><?php echo $x["StDetail"];?> <?php echo $x["StdFristName"];?> <?php echo$x["StdLastName"]; ?> </td>
<td><?php echo $x["ScName"]; ?> </td>
<td>
<input type="radio" name="score[<?php echo $x["StdID"];?>]" id="radio[<?php echo $x["StdID"];?>]" value="ผ่าน" checked="checked" />ผ่าน
<input type="radio" name="score[<?php echo $x["StdID"];?>]" id="radio1[<?php echo $x["StdID"];?>]" value="ไม่ผ่าน" />ไม่ผ่าน
</td>
</tr>
<?php
}
?>
</tr>
</table>
<center><input type="submit" value="บันทึก" name="Submit"></center>
</form>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<?php
require '../footer.php';
?>
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Create the tabs --> <!-- Tab panes --></aside>
<!-- /.control-sidebar -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<!-- jQuery 3 -->
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="../bower_components/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->
<script src="../bower_components/raphael/raphael.min.js"></script>
<script src="../bower_components/morris.js/morris.min.js"></script>
<!-- Sparkline -->
<script src="../bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="../plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="../plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="../bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="../bower_components/moment/min/moment.min.js"></script>
<script src="../bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="../bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="../bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../dist/js/adminlte.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="../dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../ist/js/demo.js"></script>
</body>
</html>
Date :
2018-02-23 14:00:51
By :
qaz753951
ไม่ยากครับ
ศึกษา การ Multiple Insert php
ดูว่า Form HTML
insert ธรรมดา VS. Multiple Insert php
-------------------------
และ Code INSERT SQL ธรรมดา VS. Code SQL Multiple INSERT
แตกต่างกันอย่างไร
Date :
2018-02-24 08:32:13
By :
Hararock
ลองดูเรื่อง flow control การจัดวาง script อะไรควรมาก่อน อะไรมาทีหลัง
รูปแบบพื้นฐาน
Code (PHP)
<?php
/// code php
?><!doctype html>
<html>
<head>
<!-- link main css -->
<!-- style sheet for this html only -->
<!-- jquery.js -->
<!-- bootstrap.js -->
<!-- javascript for this html only -->
</head>
<body>
// content html
</body>
</html>
Date :
2018-02-24 08:57:23
By :
Chaidhanan
Load balance : Server 00