Code: Select all
<?php require_once('../Connections/BrowardLimo.php'); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.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
$Paramid_WADAspecials = "-1";
if (isset($_GET['id'])) {
$Paramid_WADAspecials = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']);
}
mysql_select_db($database_BrowardLimo, $BrowardLimo);
$query_WADAspecials = sprintf("SELECT id, specialName, createdBy, updatedBy, email, removeOn, date_added, comment FROM specials WHERE id = %s", GetSQLValueString($Paramid_WADAspecials, "int"));
$WADAspecials = mysql_query($query_WADAspecials, $BrowardLimo) or die(mysql_error());
$row_WADAspecials = mysql_fetch_assoc($WADAspecials);
$totalRows_WADAspecials = mysql_num_rows($WADAspecials);?>
<?php
// WA Application Builder Update
if (isset($_POST["Update_x"])) // Trigger
{
$WA_connection = $BrowardLimo;
$WA_table = "specials";
$WA_redirectURL = "specials_Detail.php?id=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_keepQueryString = false;
$WA_indexField = "id";
$WA_fieldNamesStr = "specialName|updatedBy|email|removeOn|comment";
$WA_fieldValuesStr = "".((isset($_POST["specialName"]))?$_POST["specialName"]:"") ."" . "|" . "".((isset($_POST["updatedBy"]))?$_POST["updatedBy"]:"") ."" . "|" . "".((isset($_POST["email"]))?$_POST["email"]:"") ."" . "|" . "".((isset($_POST["removeOn"]))?$_POST["removeOn"]:"") ."" . "|" . "".((isset($_POST["comment"]))?$_POST["comment"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_comparisonStr = " LIKE | LIKE | LIKE | LIKE | LIKE ";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_BrowardLimo;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
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);
}
}
?>
<!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"><!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Caracole" />
<title>admin</title>
<link href="favicon.ico" type="image/x-icon" rel="icon" />
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon" />
<link rel="stylesheet" type="text/css" href="../css/tripoli.simple.css" media="screen, projection, print" />
<link rel="stylesheet" type="text/css" href="../css/layout.css" media="screen, projection, print" />
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
document.write('<link rel="stylesheet" type="text/css" href="../css/js/js.css" media="screen, projection, print" />');
//]]>
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="../css/ie/ie.css" media="screen, projection, print" />
<![endif]-->
<!--[if lt IE 7]>
<script src="js/DD_belatedPNG_0.0.7a-min.js" type="text/javascript"></script>
<script>
DD_belatedPNG.fix(' #header, h1, h1 a, .close, .field,.paginate .current, .icon, .required-icon, .search input');
</script>
<link rel="stylesheet" href="../css/ie/ie6.css" type="text/css" media="screen, projection"/>
<![endif]-->
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- Header -->
<!-- InstanceBeginEditable name="top" -->
<div id="header">
<div class="container content">
<h1><a href="../index.php" title="Back to home">Titanium</a></h1>
<a href="http://www.pixelastic.com/" target="_blank" class="viewWebsite"><span>View website</span></a>
<div class="loginInfos"> You're logged in as <strong>Admin</strong>. <a href="#" title="Edit your settings">Edit your settings</a>, or <a href="#" title="Log out">Log out</a></div>
</div>
</div>
<!-- InstanceEndEditable -->
<!-- /Header -->
<!-- Global -->
<div id="page-content">
<!-- Sidebar -->
<!-- InstanceBeginEditable name="nav" -->
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="specials_Results.php">Specials</a></li>
<li><a href="email_Results.php">Email</a></li>
<li><a href="#">test</a></li>
<li><a href="#">Item 3.2</a></li>
<li><a href="#">Item 3.3</a></li>
</ul>
<!-- InstanceEndEditable -->
<!-- /Sidebar -->
<!-- InstanceBeginEditable name="mainContent" -->
<div class="admincontainer">
<div class="WADAUpdateContainer">
<?php if ($totalRows_WADAspecials > 0) { // Show if recordset not empty ?>
<form action="specials_Update.php?id=<?php echo(rawurlencode($row_WADAspecials['id'])); ?>" method="post" name="WADAUpdateForm" id="WADAUpdateForm">
<div class="WADAHeader">Update Record</div>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">specialName:</th>
<td class="WADADataTableCell"><input type="text" name="specialName" id="specialName" value="<?php echo(str_replace('"', '"', $row_WADAspecials['specialName'])); ?>" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"> </td>
</tr>
<tr>
<th class="WADADataTableHeader">createdBy:</th>
<td class="WADADataTableCell"><?php echo(str_replace('"', '"', $row_WADAspecials['createdBy'])); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"> </td>
</tr>
<tr>
<th class="WADADataTableHeader">updatedBy:</th>
<td class="WADADataTableCell"><input type="text" name="updatedBy" id="updatedBy" value="<?php echo(str_replace('"', '"', $row_WADAspecials['updatedBy'])); ?>" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"> </td>
</tr>
<tr>
<th class="WADADataTableHeader">email:</th>
<td class="WADADataTableCell"><input type="text" name="email" id="email" value="<?php echo(str_replace('"', '"', $row_WADAspecials['email'])); ?>" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"> </td>
</tr>
<tr>
<th class="WADADataTableHeader">removeOn:</th>
<td class="WADADataTableCell"><input type="text" name="removeOn" id="removeOn" value="<?php echo(str_replace('"', '"', $row_WADAspecials['removeOn'])); ?>" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"> </td>
</tr>
<tr>
<th class="WADADataTableHeader">date_added:</th>
<td class="WADADataTableCell"><?php echo(str_replace('"', '"', $row_WADAspecials['date_added'])); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader"> </th>
<td class="WADADataTableCell"> </td>
</tr>
<tr>
<th class="WADADataTableHeader">comment:</th>
<td class="WADADataTableCell"><textarea name="comment" id="comment" cols="32"><?php echo(str_replace('"', '"', $row_WADAspecials['comment'])); ?></textarea></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Update" id="Update" value="Update" alt="Update" src="../WA_DataAssist/images/Pacifica/Traditional_update.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="specials_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Pacifica/Traditional_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<?php echo(rawurlencode($row_WADAspecials['id'])); ?>" />
</div>
</form>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAspecials == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">No record found.</div>
</div>
<?php } // Show if recordset empty ?>
</div>
</div>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="footer" -->
<div id="footer">footer</div>
<!-- InstanceEndEditable -->
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($WADAspecials);
?>