ECN details
"; // displays progressive results foreach($_SESSION['add_ecn'] as $add_ecn) { // print_r($add_ecn); print('
Date raised: '.$add_ecn['Date_raised'].'
'); print('Implementation date: '.$add_ecn['Imp_Date'].'
'); print('Units affected: '.$add_ecn['Units_affected'].'
'); print('Reason for change: '.$add_ecn['Reason_Chng'].'
'); print('Assembly updated: '.$add_ecn['Assem_Details'].' '); print('New assembly: '.$add_ecn['assem_new'].'
'); print('Drawing details: '.$add_ecn['Draw_detail'].'
'); } echo "
Parts affected
"; foreach($_SESSION['part_form'] as $part_form) { //print_r($part_form); print('
Part number: '.$part_form['txtSearch'].'
'); print('Part quanitity: '.$part_form['part_qty'].'
'); print('Part action: '.$part_form['part_num_action'].'
'); } echo "
Works orders
"; // displays progressive results foreach($_SESSION['wo_form'] as $part) { print(''.$part['Wo_details'].'
'); } echo "
Are these details correct? If not please use the navigation buttons and make changes where neccescary."; } //insert data into db elseif(isset($_POST["ecn_create"])) { //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...
"; $add_ecn=$_SESSION['add_ecn']; echo "Filtering for query...
"; $insert = array(); foreach($add_ecn as $key => $value) { //keys which we dont want to add if($key == 'nextstep' AND $key == 'planning') 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...
"; mysql_query("INSERT INTO `Ecn_Notes`".implode(',',$insert)); $add_code = "FLUSH PRIVILEGES"; mysql_query($add_code) or die('Error, insert query failed'); // print('
Date raised: '.$add_ecn['Date_raised'].'
'); // print('Implementation date: '.$add_ecn['Imp_Date'].'
'); // print('Units affected: '.$add_ecn['Units_affected'].'
'); // print('Reason for change: '.$add_ecn['Reason_Chng'].'
'); // print('Assembly updated: '.$add_ecn['Assem_Details'].' '); // print('New assembly: '.$add_ecn['assem_new'].'
'); // print('Drawing details: '.$add_ecn['Draw_detail'].'
'); echo "Closing connection...
"; include 'inc/closedb.php'; } else { echo "Something went wrong."; } ?> ECN Confirmation