Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,030

HOME > PHP > PHP Forum > การรวมจำนวนชั่วโมงทั้งหมดที่เข้าร่วมกิจกรรมของนักศึกษาแต่ละคนจะทำแบบไหนค่ะ



 

การรวมจำนวนชั่วโมงทั้งหมดที่เข้าร่วมกิจกรรมของนักศึกษาแต่ละคนจะทำแบบไหนค่ะ

 



Topic : 117576



โพสกระทู้ ( 12 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



ตัวอย่างภาพ
ต้องการบวกจำนวนชั่วโมงกิจกรรมทั้งหมดทำไงค่ะ



Tag : PHP, MySQL, Windows







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-07-05 22:59:12 By : muryateetity View : 817 Reply : 4
 

 

No. 1



โพสกระทู้ ( 146 )
บทความ ( 0 )



สถานะออฟไลน์


ไม่ทราบว่า มีการเขียนโค้ด หน้านี้ ยังไง หรอครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-07-06 05:31:21 By : san.saleah
 


 

No. 2



โพสกระทู้ ( 12 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

Code (PHP)
<?php
//include ("connect_db.php");
//$_SESSION["member_stdid"];
?>
<?
//session_start();
//if($_SESSION['member_stdid'] ==""){ // ถ้า $_SESSION['user'=ค่าว่าง แสดงว่าเขากำลังจะมาลักไก่เรา
//?>
<script type="text/javascript">
//alert ('สงวนสิทธิ์การใช้งานเฉพาะสมาชิกเท่านั้น \n กรุณาล๊อกอินเข้าสู่ระบบก่อนนะค่ะ \n...ขอบคุณค่ะ'); // เราก็แจ้งเลยว่า หยุด อย่าขยับ เจ้าหน้าที่ล้อมไว้หมดแล้ว 
//window.location="index.php"; // แล้วก็ส่งเขากลับไปหน้าแรก หรือหน้าสำหรับสมัครสมาชิกเลย 
</script>
<? //} ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบกิจกรรมนักศึกษา</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
<script type="text/javascript" src="js/bootstrap.min.js/"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<style type="text/css">
body{
	background-image: url("image/bag.jpg");
}

.aa{
	background-color: #D0E2EE;
	
}

th{
	text-align: center;
	background-color: #90c3ed;
	padding: 3px 3px;
}
.t{
	text-align: center;

}
.d:nth-child(even) {background: #fff}
.d:nth-child(odd) {background:#cff3f7}
p{
	padding-left: 5px;
	padding-top: 5px;
}
</style>

<body>
<table border="0" class="aa" width="80%" cellpadding="0" cellspacing ="0" align="center" valign="top">
		<tr>
			<td colspan="2">
 				<? include ("head.php");?>
			</td>
		</tr>
		<tr>
		<td>
			<? include ("menu2.php");?>
		</td>
		<td valign="top" width="95%" >
			<?php
	include ("connect_db.php");
?>
<table align="right" width="99%" border="0" align="center" >
	<tr>
		<td>
<div class="panel panel-primary">
	<br><h3 align="center">ผลการลงทะเบียนกิจกรรม</h3>
<div class="panel-body">
<form name="frmSearch" method="get" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
<table width="95%" border="0" align="center" cellpading="0" cellspacing="0" >
	<tr>
		<td>ผลการลงทะเบียน :  
			<input name="txtKeyword" type="text" id="txtKeyword" value="<?php echo $_GET["txtKeyword"];?>"> &nbsp;&nbsp;
			<input type="submit" value="ค้นหา">
		</td>
	</tr>
</table>
</form>
<?php
if($_GET["txtKeyword"] != "")
	// Search By Name or Email
	$strSQL = "SELECT * FROM regis LEFT JOIN activity ON (regis.act_id = activity.act_id) 
				WHERE (regis.student_id LIKE '%".$_GET["txtKeyword"]."%')";
	$objQuery = mysql_query($strSQL) or die ("ยังไม่มีผลลัพธ์การค้นหา[".$strSQL."]");
	$Num_Rows = mysql_num_rows($objQuery);

	$Per_Page = 10;   // Per Page

	$Page = $_GET["Page"];
	if(!$_GET["Page"])
	{
		$Page=1;
	}

	$Prev_Page = $Page-1;
	$Next_Page = $Page+1;

	$Page_Start = (($Per_Page*$Page)-$Per_Page);
	if($Num_Rows<=$Per_Page)
	{
		$Num_Pages =1;
	}
	else if(($Num_Rows % $Per_Page)==0)
	{
		$Num_Pages =($Num_Rows/$Per_Page) ;
	}
	else
	{
		$Num_Pages =($Num_Rows/$Per_Page)+1;
		$Num_Pages = (int)$Num_Pages;
	}

	$strSQL .=" order by regis.act_id ASC LIMIT $Page_Start , $Per_Page";
	$objQuery  = mysql_query($strSQL);

	?>
<table id="customers" width="600" border="1" align="center" >
	  <tr>
	  	<th colspan="5">
	  		ผลการเข้าร่วมกิจกรรม
	  	</th>
	  </tr>
	  <tr>
			<th width="190"> <div>ชื่อกิจกรรม</div></th>
			<th width="100"> <div align="center">วันที่จัด</div></th>
			<th width="98"> <div align="center">จำนวนชั่วโมง</div></th>
			<th width="80"> <div align="center">สถานะ</div></th>
	  </tr>
	<?
		$count_hrs = array();
		while ($objResult = mysql_fetch_array($objQuery)){
			array_push($count_hrs,$objResult["act_hour"]);

	?>
				<?php //echo array_count("$count_hrs"); ?>
		<tr>

			<td ><div><?php echo $objResult["act_name"];?></div></td>
			<td align="center"><?php echo $objResult["act_date"];?></td>
			<td align="center"><?php echo $objResult["act_hour"];?></td>
			<td align="center"><?php //echo $objResult["act_date"];?></td>
			
	  </tr>
	<?
		}
	?>
	  
</table>

	<br>
	Total <?php echo $Num_Rows;?> Record : <?php echo $Num_Pages;?> Page :
	<?php
	if($Prev_Page)
	{
		echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&txtKeyword=$_GET[txtKeyword]'><< Back</a> ";
	}

	for($i=1; $i<=$Num_Pages; $i++){
		if($i != $Page)
		{
			echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$_GET[txtKeyword]'>$i</a> ]";
		}
		else
		{
			echo "<b> $i </b>";
		}
	}
	if($Page!=$Num_Pages)
	{
		echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&txtKeyword=$_GET[txtKeyword]'>Next>></a> ";
	}
		
?>

		</td>
	</tr>
</table>
<tr>
		<td colspan="2" align="center">
 		<? include ("footer.php");?>
		</td>
	</tr>
</table>
			<script> 
				$(document).ready(function(){
				  $("#flip").click(function(){
				    $("#panel").slideToggle("slow");
				  });
				   $("#fli").click(function(){
				    $("#pane").slideToggle("slow");
				  });
				    $("#fl").click(function(){
				    $("#pan").slideToggle("slow");
				  });
				});
			</script>
</body>
</html>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-07-06 17:09:13 By : muryateetity
 

 

No. 3



โพสกระทู้ ( 3,155 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


Quote:
$total=0;
while ($objResult = mysql_fetch_array($objQuery)){
array_push($count_hrs,$objResult["act_hour"]);

?>
<?php //echo array_count("$count_hrs"); ?>
<tr>

<td ><div><?php echo $objResult["act_name"];?></div></td>
<td align="center"><?php echo $objResult["act_date"];?></td>
<td align="center"><?php echo $objResult["act_hour"];?></td>
<td align="center"><?php //echo $objResult["act_date"];?></td>

</tr>
<?
$total+=$objResult["act_hour"];
}

?>
<tr><td colspan='2'>รวมจำนวนชั่วโมง</td><td><?php echo $total;?></td></td>&nbsp;</td></tr>
</table>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-07-06 17:25:40 By : sakuraei
 


 

No. 4



โพสกระทู้ ( 12 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ทำได้แล้วค่ะ ขอบคุณพี่ๆ ทุกคนที่ช่วยสอนและให้คำแนะนำ
aaaa
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-07-06 20:13:22 By : muryateetity
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : การรวมจำนวนชั่วโมงทั้งหมดที่เข้าร่วมกิจกรรมของนักศึกษาแต่ละคนจะทำแบบไหนค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่