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,027

HOME > PHP > PHP Forum > สอบถามหน่อยครับ จะให้แสดค่าตามรูปภาพ ต้องทำยังไงครับ



 

สอบถามหน่อยครับ จะให้แสดค่าตามรูปภาพ ต้องทำยังไงครับ

 



Topic : 116979



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



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




แสดงค่าไม่ตรงแสดงค่าไม่ตรง

Code (PHP)
<?php require_once('Connections/helpdesk.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

$colname_Recordset1 = "-1";
if (isset($_POST['word'])) {
  $colname_Recordset1 = $_POST['word'];
}
mysql_select_db($database_helpdesk, $helpdesk);
$query_Recordset1 = sprintf("SELECT id_servicerepair, informant, hardwareid, tel, date_informant, id_status, id_officer, detail_service FROM tbl_servicerepair WHERE hardwareid LIKE %s", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $helpdesk) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<?php require_once('connect.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" />
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/functions.js"></script>
<title>รายงานแจ้งซ่อม</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
<!--
.style7 {font-size: 14; font-weight: bold; }
.style8 {font-size: 14px}
body,td,th {
	font-size: 12px;
}
-->
</style>
</head>

<body>
<?php require_once('header.php');?>
<?php
        $total_count = mysql::scalar(
			"SELECT COUNT(*) FROM tbl_servicerepair"
		);
        $limit = 15;		
        $page = (int)$_GET['page'];		
        $p = new Pager($total_count, $limit, $page);
		$start = $p->offset();
	  	$s = "SELECT * FROM tbl_servicerepair ORDER BY id_servicerepair DESC LIMIT $start,$limit";
	  	$r = mysql::query($s);		
	  ?>
<br />
<br />
<table width="100%" border="0" cellpadding="5">
  <tr>
    <td><strong><span class="style6">หน้า :</span> <span class="style3">รายงานแผนกเทคโนโลยีสารสนเทศ</span></strong></td>
  </tr>
  <tr>
    <td><a href="report/report-service-branch.php">จำแนกตามสาขา</a> | <a href="report/report-service-department.php">จำแนกตามแผนก</a> | <a href="report/report-service-category.php">สถิติแยกตามประเภทซ่อม</a> | <a href="report/report-officer.php">สถิติการทำงานของเจ้าหน้าที่ | </a><a href="repair-report-search.php">ค้นหาตามหมายเลขเครื่อง</a></a></td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="repair-report-search.php">
      <label>
      <div align="center">
        <p><span class="style8">ค้นหา</span>
          <input name="word" type="text" id="Word" />
        </p>
        </div>
      <p align="center"><img src="images/png_1113.png" width="424" height="64" /></p>
      <table border="1" align="center">
        <tr>
          <td><div align="center"><span class="style7">หมายเลขเคส</span></div></td>
          <td><div align="center"><span class="style7">ชื่อผู้แจ้ง </span></div></td>
          <td><div align="center"><span class="style7">หมายเลขประจำเครื่อง</span></div></td>
          <td><div align="center"><span class="style7">เบอร์ โทร</span></div></td>
          <td><div align="center"><span class="style7">วันที่แจ้งซ่อม</span></div></td>
          <td><div align="center"><span class="style7">สถานะ</span></div></td>
          <td><div align="center"><span class="style7">ชื่อผู้ซ่อม</span></div></td>
          <td><div align="center"><span class="style7">วิธีซ่อม</span></div></td>
        </tr>
        <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['id_servicerepair']; ?></td>
          <td><?php echo $row_Recordset1['informant']; ?></td>
          <td><?php echo $row_Recordset1['hardwareid']; ?></td>
          <td><?php echo $row_Recordset1['tel']; ?></td>
          <td><?php echo $row_Recordset1['date_informant']; ?></td>
          <td><?php echo $row_Recordset1['id_status']; ?></td>
          <td><?php echo $row_Recordset1['id_officer']; ?></td>
          <td><?php echo $row_Recordset1['detail_service']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
      </table>
      <div align="center">
        <p>
          <input name="BTN" type="submit" id="BTN" value="Submit" />
          </p>
      </div>
      </label>
  </table>
        <br />
        <form id="form1" name="form1" method="post" action="">
        </form>
        <table width="38%" border="0" align="center">
          <tr>
            <td width="10%"><div align="center"><strong><span class="style3">หมายเหตุ :</span></strong></div></td>
            <td width="3%"><div align="center"><img src="images/1.gif" width="14" height="14" /></div></td>
            <td width="10%"><div align="center">รอการรับเรื่อง</div></td>
            <td width="7%"><div align="center"><img src="images/2.gif" width="47" height="23" /></div></td>
            <td width="12%"><div align="center">กำลังดำเนินงาน</div></td>
            <td width="3%"><div align="center"><img src="images/3.gif" width="15" height="12" /></div></td>
            <td width="14%"><div align="center">แก้ไขเสร็จเรียบร้อย</div></td>
          </tr>
        </table>
        <p>&nbsp;</p>
        <p>&nbsp;</p></td></form>    </td>
  </tr>
  
</table>
<form id="form2" name="form2" method="post" action="">
  <table width="100%" border="0" align="center" bgcolor="#666666">
    <tbody>
      <tr>
        <td bordercolor="#00CC33" bgcolor="#666666"><div align="center">
          <h1><strong>ระบบแจ้งซ่อมคอมพิวเตอร์ออนไลน์</strong></h1>
        </div></td>
      </tr>
      <tr>




Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-06-07 14:43:07 By : lata191 View : 691 Reply : 7
 

 

No. 1



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



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

Code (PHP)
$_CONFIG['status'][1] = 'รอการรับเรื่อง';
$_CONFIG['status'][2] = 'กำลังดำเนินงาน';
$_CONFIG['status'][3] = 'แก้ไขเสร็จเรียบร้อย';
echo $_CONFIG['status'][$row_Recordset1['id_status']];







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-07 16:24:14 By : 1241050
 


 

No. 2



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



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


2
ใส code แล้ว error ตามรูปครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-08 08:01:39 By : lata191
 

 

No. 3



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



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


------ของผมทำแบบนี้ครับ--------

ทำ Inner Join ระหว่าง table และบรรทัดที่ 127 เปลี่ยนจาก

<?php echo $row_Recordset1['name_status']; ?>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-08 08:25:24 By : saovarott159
 


 

No. 4



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



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


------ของผมทำแบบนี้ครับ--------

ทำ Inner Join ระหว่าง table และบรรทัดที่ 127 เปลี่ยนจาก

<?php echo $row_Recordset1['name_status']; ?>
inber join ยังไงครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-08 08:48:25 By : lata191
 


 

No. 5



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



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


ตอบความคิดเห็นที่ : 4 เขียนโดย : lata191 เมื่อวันที่ 2015-06-08 08:48:25
รายละเอียดของการตอบ ::
ตัวอย่างของผม ลองเอาไปประยุกต์ใช้ดูนะครับ

SELECT register.*, department.*, type.* FROM register inner join department on register.Dep_ID=department.Dep_ID inner join type on register.Type_ID=type.Type_ID

หรือตัวอย่าง ของท่านนี้ก็ได้ครับ https://www.thaicreate.com/php/forum/018135.html

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-08 08:54:53 By : saovarott159
 


 

No. 6



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



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


Code (PHP)
<?php
$id = (int)$_GET['id'];
$r = mysql::query(
	"SELECT tbl_servicerepair.*, name_status FROM ".
		"tbl_servicerepair LEFT JOIN  tbl_status_servicerepair ".
		"ON tbl_servicerepair.id_status = id_status.name_status ".
		"WHERE id_status='$id'"
	);
if (mysql_num_rows($r) == 0):
	echo 'not found';
else:
	$rs = mysql_fetch_assoc($r);
?>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-08 11:37:35 By : lata191
 


 

No. 7



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



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


เลือกเอาครับระหว่าง หนัก database server หรือ หนัก php (web server)
แค่ถ้าอยู่เครื่องเดียวกัน แบบไหนก็เหมือนกัน

ถ้า database กับ web อยู่คนละเครื่องกัน แนะนำให้ ใช้ php ช่วย แบบคห 2 ถูกแล้วครับ แต่ทำให้เป็น dynamic
เพราะมี database อยู่แล้ว

กำหนดเป็น array
Code (PHP)
$rs = $db->query( 'select id_status, name_status from tbl_status_servicerepair');
$config['status'] = array();
while( $ro=$rs->fetch_assoc()){
    $config['status'][$ro['id_status']]=$ro['name_status'];
}



ประวัติการแก้ไข
2015-06-08 11:40:34
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-08 11:39:42 By : Chaidhanan
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 00
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 อัตราราคา คลิกที่นี่