
อัพเดทวันที่: 27 พ.ค. 2558
|
โปรแกรมคำนวณพลังงานไฟฟ้าจากเครื่องใช้ไฟฟ้า เป็นโปรแกรม ที่ถูกพัฒนาขึ้นด้วยภาษาPHP ซึ่งใช้คำนวณหาค่าใช้จ่ายจากพลังงานไฟฟ้าที่ใช้ไป ว่าแต่ละเครื่องใช้ไฟฟ้าที่มีจำนวนวัตต์จะเสียค่าไฟฟ้าประมาณกี่บาท ลองไปชมโค้ดหรือดาวน์โหลดโปรแกรมได้จากด้านล่างเลยครับ
วีดีโอ
index.html
<!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>
<style type="text/css">
<!--
body {
background-color:#F66;
color:#fff;
}
-->
</style></head>
<body>
<form action="process.php" method="post">
<table width="500" border="0" align="center">
<tr>
<td colspan="2">
<div align="center"><h2>โปรแกรมคำนวณพลังงานไฟฟ้าจากเครื่องใช้ไฟฟ้า</h2></div></td>
</tr>
<tr>
<td width="150"><div align="right">เครื่องใช้ไฟฟ้าขนาด : </div></td>
<td width="212"><input type="text" name="watt" size="20" maxlength="100" /> วัตต์</td>
</tr>
<tr>
<td width="150"><div align="right">ยูนิละ : </div></td>
<td width="212"><input type="text" name="uni" size="20" maxlength="100" /> บาท</td>
</tr>
<tr>
<td colspan="2"> <div align="center"><input type="submit" value="คำนวณ" /></div></td>
</tr>
<tr>
<td colspan="2" style="font-size:14px; color:#F00;" align="center"></td>
</tr>
</table>
<div align="center"></div>
</body>
</html>
process.php
<!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>
</head>
<body>
<div align="center">
<h2>โปรแกรมคำนวณพลังงานไฟฟ้าจากเครื่องใช้ไฟฟ้า</h2>
<?
$watt=$_POST['watt'];
$uni=$_POST['uni'];
$watt=$watt/100;
$sum=$watt*$uni;
$month=$sum*30;
echo "จะเสียค่าไฟฟ้าวันละ ".$sum." บาท"."<br>";
echo "ดังนั้น เสียค่าไฟฟ้าต่อเดือน ".$month." บาทต่อเดือน (30 วัน)";
?>
</div>
</body>
</html>
|
ดูตัวอย่างโปรแกรม


กดlike เพื่อติดตามข่าวสารและโปรเจค โค้ดใหม่ๆอัพเดทอยู่เสมอ
Tag : โปรแกรมคำนวณพลังงานไฟฟ้า โค้ดภาษาphp โปรแกรมภาษาphp โปรเจคphpแจกฟรี ภาษาPHP ฟังก์ชั่นระบบ