Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('Connections/con_KK.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($_GET['nama'])) {
- $colname_Recordset1 = $_GET['nama'];
- }
- mysql_select_db($database_con_KK, $con_KK);
- $query_Recordset1 = sprintf("SELECT * FROM daftar_peralatan WHERE Nama_Peralatan 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, $con_KK) 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;
- ?><style type="text/css">
- <!--
- body {
- background-image: url(_mmServerScripts/916518-full-size-all-sports-wallpaper-2560x1600-for-ipad-pro.jpg);
- }
- .style1 {color: #FFFFFF}
- .style2 {color: #000000}
- -->
- </style>
- <p> </p>
- <p align="center"><img src="thing" alt="" width="-1" height="-1" /></p>
- <p> </p>
- <form name="form1" method="get" action="">
- <table width="200" border="2">
- <tr>
- <td><span class="style1">Nama alatan</span></td>
- <td><span class="style1">
- <label>
- <input type="text" name="nama" id="nama">
- </label>
- </span></td>
- </tr>
- <tr>
- <td><span class="style1"></span></td>
- <td><span class="style1">
- <label>
- <input type="submit" name="Cari" id="Cari" value="Cari">
- </label>
- </span></td>
- </tr>
- </table>
- <div align="center"></div>
- <p> </p>
- </form>
- <table border="1" cellpadding="0">
- <tr>
- <td><span class="style1">ID_alatan</span></td>
- <td><span class="style1">Nama_Guru</span></td>
- <td><span class="style1">Nama_Peralatan</span></td>
- <td><span class="style1">Tarikh_Dimasukkan</span></td>
- <td><span class="style1">Kuantiti</span></td>
- </tr>
- <?php do { ?>
- <tr>
- <td><?php echo $row_Recordset1['ID_alatan']; ?></td>
- <td><?php echo $row_Recordset1['Nama_Guru']; ?></td>
- <td><?php echo $row_Recordset1['Nama_Peralatan']; ?></td>
- <td><?php echo $row_Recordset1['Tarikh_Dimasukkan']; ?></td>
- <td><span class="style2"><?php echo $row_Recordset1['Kuantiti']; ?></span></td>
- </tr>
- <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
- </table>
- <?php
- mysql_free_result($Recordset1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement