Wrong page code: use this instead
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once('../Connections/handbagsWA.php'); ?>
<?php require_once("../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
?>
<?php
$maxRows_WADADynListprodcategory = 1000;
$pageNum_WADADynListprodcategory = 0;
if (isset($_GET['pageNum_WADADynListprodcategory'])) {
$pageNum_WADADynListprodcategory = $_GET['pageNum_WADADynListprodcategory'];
}
$startRow_WADADynListprodcategory = $pageNum_WADADynListprodcategory * $maxRows_WADADynListprodcategory;
mysql_select_db($database_handbagsWA, $handbagsWA);
$query_WADADynListprodcategory = "SELECT CatID, CatName FROM prodcategory ORDER BY CatName";
$query_limit_WADADynListprodcategory = sprintf("%s LIMIT %d, %d", $query_WADADynListprodcategory, $startRow_WADADynListprodcategory, $maxRows_WADADynListprodcategory);
$WADADynListprodcategory = mysql_query($query_limit_WADADynListprodcategory, $handbagsWA) or die(mysql_error());
$row_WADADynListprodcategory = mysql_fetch_assoc($WADADynListprodcategory);
if (isset($_GET['totalRows_WADADynListprodcategory'])) {
$totalRows_WADADynListprodcategory = $_GET['totalRows_WADADynListprodcategory'];
} else {
$all_WADADynListprodcategory = mysql_query($query_WADADynListprodcategory);
$totalRows_WADADynListprodcategory = mysql_num_rows($all_WADADynListprodcategory);
}
$totalPages_WADADynListprodcategory = ceil($totalRows_WADADynListprodcategory/$maxRows_WADADynListprodcategory)-1;?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../prodimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "clear.gif",
'ResizeType' => "2",
'ResizeWidth' => "450",
'ResizeHeight' => "0",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "ProdImage", "2", "[NewFileName]_[Increment]", "true", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $handbagsWA;
$WA_table = "products";
$WA_sessionName = "WADA_Insert_products";
$WA_redirectURL = "products_Detail.php";
$WA_keepQueryString = false;
$WA_indexField = "ProdID";
$WA_fieldNamesStr = "ProdName|ProdShortDesc|ProdLongDesc|ProdPrice|ProdSKU|ProdThumb|ProdImage|ProdCatID|ProdWeight|ProdDiscMin|ProdDiscPrice";
$WA_fieldValuesStr = "".((isset($_POST["ProdName"]))?$_POST["ProdName"]:"") ."" . "|" . "".((isset($_POST["ProdShortDesc"]))?$_POST["ProdShortDesc"]:"") ."" . "|" . "".((isset($_POST["ProdLongDesc"]))?$_POST["ProdLongDesc"]:"") ."" . "|" . "".((isset($_POST["ProdPrice"]))?$_POST["ProdPrice"]:"") ."" . "|" . "".((isset($_POST["ProdSKU"]))?$_POST["ProdSKU"]:"") ."" . "|" . "".((isset($_POST["ProdThumb"]))?$_POST["ProdThumb"]:"") ."" . "|" . "".((isset($_POST["ProdImage"]))?$_POST["ProdImage"]:"") ."" . "|" . "".((isset($_POST["ProdCatID"]))?$_POST["ProdCatID"]:"") ."" . "|" . "".((isset($_POST["ProdWeight"]))?$_POST["ProdWeight"]:"") ."" . "|" . "".((isset($_POST["ProdDiscMin"]))?$_POST["ProdDiscMin"]:"") ."" . "|" . "".((isset($_POST["ProdDiscPrice"]))?$_POST["ProdDiscPrice"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NULL|none,none,NULL";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_handbagsWA;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
?>