All pastes #524611 Raw Edit

Someone

public text v1 · immutable
#524611 ·published 2007-05-31 03:53 UTC
rendered paste body
<?php
session_start();

	//clears all session data - debugging only
	//unset($_SESSION['part_form']);
	//initiate connection to mysql
	include 'inc/config.php';
	include 'inc/opendb.php';
	
//we need to create the ecn_notes entry first to produce an ECN number
echo "Loading ECN data...<br />";
$add_ecn=$_SESSION['add_ecn']['ecn_data'];

echo "Filtering for query...<br />";
$insert = array();
foreach($add_ecn as $key => $value)
{
    //keys which we dont want to add
	if($key == 'planning'
     AND $key == 'nextstep')
        continue;
     $insert[] = $key.' = "'.$value.'"';
}


//       	$add_code = "INSERT INTO `callreg_tbl` ( `pcode` , `instock` , `nilstock` , `Reasoncode` ,  `date` , `userid` , `whs` ) VALUES ( '$pcode', '$instock', '$nilstock', '$reasoncode', '$date', '$userid', '$whs' )";
		echo "Inserting ECN data to mysql...<br />";
		mysql_query("INSERT INTO `Ecn_Notes` SET ".implode(',',$insert));
		echo mysql_errno() . ": " . mysql_error(). "\n";
		echo "<br /><br />";
		print_r($insert);
		$add_code = "FLUSH PRIVILEGES";
		mysql_query($add_code) or die('Error, insert query failed');
 
//		print('<br /><strong>Date raised:</strong> '.$add_ecn['Date_raised'].'<br />');
//		print('<strong>Implementation date:</strong> '.$add_ecn['Imp_Date'].'<br />');
//		print('<strong>Units affected:</strong> '.$add_ecn['Units_affected'].'<br />');
//		print('<strong>Reason for change:</strong> '.$add_ecn['Reason_Chng'].'<br />');
//		print('<strong>Assembly updated:</strong> '.$add_ecn['Assem_Details'].' ');
//		print('<strong>New assembly:</strong> '.$add_ecn['assem_new'].'<br />');
//		print('<strong>Drawing details:</strong> '.$add_ecn['Draw_detail'].'<br />');
		
	
echo "Closing connection...<br />";
		include 'inc/closedb.php';
		exit;

?>	
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ECN Confirmation</title>
<script language="JavaScript" type="text/javascript" src="ajax_search.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="confirmation"><input name="ecn_create" type="submit" value="Create ECN" />
</form>
</body>
</html>