0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
customtanningbed_dot_com
/
bed
/
Bed
/
[
Home
]
File: Rooms.php
<?php require_once('Connections/Bed.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; mysql_select_db($database_Bed, $Bed); $query_Recordset1 = "SELECT * FROM rooms WHERE (((`UserId` ) = '".$_REQUEST['UserId'] ."')AND ((`RoomType` ) = '".$_REQUEST['RoomType']."'))"; echo $query_Recordset1; $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $Recordset1 = mysql_query($query_limit_Recordset1, $Bed) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1); $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1; $NumberOfRows=mysql_num_rows( $all_Recordset1); echo $query_Recordset1." ".$all_Recordset1." ".$NumberOfRows; if($NumberOfRows==0){ $insertSQL = "INSERT INTO `rooms` (`RoomId` ,`UserId` ,`RoomType` ,`Width` ,`Height` ,`MF`,`Items`,`pics`,`ItemsXs` ,`ItemsYs` ,`ItemsWidths` ,`ItemsHeights` ,`ItemsRotation` )VALUES ('".$_REQUEST['RoomId']."', '".$_REQUEST['UserId']."', '".$_REQUEST['RoomType']."', '".$_REQUEST['Width']."', '".$_REQUEST['Height']."', '".$_REQUEST['MF']."', '".$_REQUEST['Items']."', '".$_REQUEST['pics']."', '".$_REQUEST['ItemsXs']."', '".$_REQUEST['ItemsYs']."', '".$_REQUEST[ItemsWidths]."', '".$_REQUEST[ItemsHeights]."', '".$_REQUEST['ItemsRotation']."')"; $Result1 = mysql_query($insertSQL, $Bed) or die(mysql_error()); echo "&Insert=".$Result1."&"; } else{echo "&Insert=0&"; } ?>