Hi Claire,
On submit it should append the record num to the end of the URL and subsequently load the page with the data. The URL address 'code-type-edit.php?num=3' should work. It maybe in the PHP header code!
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php require_once "../cmsAdmin/lib/viewer_functions.php"; ?>
<?php if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } ?>
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
// load viewer library
$libraryPath = '../cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/report/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load record from 'code_types'
list($code_typesRecords, $code_typesMetaData) = getRecords(array(
'tableName' => 'code_types',
'orderBy' => 'title',
));
$code_typesRecord = @$claim_typesRecords[0]; // get first record
// load records from 'agency'
list($agencyRecords, $agencyMetaData) = getRecords(array(
'tableName' => 'agency',
'orderBy' => 'agency_name',
'loadUploads' => false,
'allowSearch' => false,
));
$index_color = "15497D";
//$index_color = "0944CE";
$sub_color = "C5D9ED";
//$sub_color = "#92";
$errorsAndAlerts = "";
//
$showSignupForm = true;
// process form
if (@$_REQUEST['save']) {
// turn off strict mysql error checking for: STRICT_ALL_TABLES
mysqlStrictMode(false); // disable Mysql strict errors for when a field isn't defined below (can be caused when fields are added later)
// add member company
//
$query = "UPDATE `{$TABLE_PREFIX}code_types` SET
title = '".mysql_escape( $_REQUEST['title'] )."',
company = '".mysql_escape( $_REQUEST['company'] )."',
discontinue = '".mysql_escape( $_REQUEST['discontinue'] )."',
updatedByUserNum = '".mysql_escape( $CURRENT_USER['num'] )."',
updatedDate = NOW()
WHERE num = '".mysql_escape( $_REQUEST['num'] )."'";
mysql_query($query) or die("MySQL Error:<br/>\n". htmlspecialchars(mysql_error()) . "\n");
$userNum = mysql_insert_id();
// show thanks
$errorsAndAlerts = "Thanks, We've created/updated your Code Type.<br/><br/>\n";
$errorsAndAlerts .= "<a href='http://www.reportpro1.com/start/code_types.php'>Click here to enter/edit another Code Type</a>.";
$_REQUEST = array(); // clear form values
$showSignupForm = false;
}
else
// prepopulate form with current user values
foreach ($code_typesRecords as $name => $value) {
if (array_key_exists($name, $_REQUEST)) { continue; }
$_REQUEST[$name] = $value;
}
$index_color = "15497D";
//$index_color = "0944CE";
$sub_color = "C5D9ED";
//$sub_color = "#92";
?>
nmsinc