Advertisement
Guest User

LAMZHENGJIE

a guest
Jun 27th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. <?php require_once('Connections/con_KK.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7.  
  8. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  9.  
  10. switch ($theType) {
  11. case "text":
  12. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  13. break;
  14. case "long":
  15. case "int":
  16. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  17. break;
  18. case "double":
  19. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  20. break;
  21. case "date":
  22. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  23. break;
  24. case "defined":
  25. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  26. break;
  27. }
  28. return $theValue;
  29. }
  30. }
  31.  
  32. $maxRows_Recordset1 = 10;
  33. $pageNum_Recordset1 = 0;
  34. if (isset($_GET['pageNum_Recordset1'])) {
  35. $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
  36. }
  37. $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
  38.  
  39. $colname_Recordset1 = "-1";
  40. if (isset($_GET['nama'])) {
  41. $colname_Recordset1 = $_GET['nama'];
  42. }
  43. mysql_select_db($database_con_KK, $con_KK);
  44. $query_Recordset1 = sprintf("SELECT * FROM daftar_peralatan WHERE Nama_Peralatan LIKE %s", GetSQLValueString("%" . $colname_Recordset1 . "%", "text"));
  45. $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
  46. $Recordset1 = mysql_query($query_limit_Recordset1, $con_KK) or die(mysql_error());
  47. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  48.  
  49. if (isset($_GET['totalRows_Recordset1'])) {
  50. $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
  51. } else {
  52. $all_Recordset1 = mysql_query($query_Recordset1);
  53. $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
  54. }
  55. $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
  56. ?><style type="text/css">
  57. <!--
  58. body {
  59. background-image: url(_mmServerScripts/916518-full-size-all-sports-wallpaper-2560x1600-for-ipad-pro.jpg);
  60. }
  61. .style1 {color: #FFFFFF}
  62. .style2 {color: #000000}
  63. -->
  64. </style>
  65. <p>&nbsp;</p>
  66. <p align="center"><img src="thing" alt="" width="-1" height="-1" /></p>
  67. <p>&nbsp;</p>
  68. <form name="form1" method="get" action="">
  69. <table width="200" border="2">
  70. <tr>
  71. <td><span class="style1">Nama alatan</span></td>
  72. <td><span class="style1">
  73. <label>
  74. <input type="text" name="nama" id="nama">
  75. </label>
  76. </span></td>
  77. </tr>
  78. <tr>
  79. <td><span class="style1"></span></td>
  80. <td><span class="style1">
  81. <label>
  82. <input type="submit" name="Cari" id="Cari" value="Cari">
  83. </label>
  84. </span></td>
  85. </tr>
  86. </table>
  87. <div align="center"></div>
  88. <p>&nbsp;</p>
  89. </form>
  90.  
  91.  
  92. <table border="1" cellpadding="0">
  93. <tr>
  94. <td><span class="style1">ID_alatan</span></td>
  95. <td><span class="style1">Nama_Guru</span></td>
  96. <td><span class="style1">Nama_Peralatan</span></td>
  97. <td><span class="style1">Tarikh_Dimasukkan</span></td>
  98. <td><span class="style1">Kuantiti</span></td>
  99. </tr>
  100. <?php do { ?>
  101. <tr>
  102. <td><?php echo $row_Recordset1['ID_alatan']; ?></td>
  103. <td><?php echo $row_Recordset1['Nama_Guru']; ?></td>
  104. <td><?php echo $row_Recordset1['Nama_Peralatan']; ?></td>
  105. <td><?php echo $row_Recordset1['Tarikh_Dimasukkan']; ?></td>
  106. <td><span class="style2"><?php echo $row_Recordset1['Kuantiti']; ?></span></td>
  107. </tr>
  108. <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
  109. </table>
  110. <?php
  111. mysql_free_result($Recordset1);
  112. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement