$tag_val) { if (in_array($tag, $NotEmpty) && empty($tag_val)) { $e_note[$tag.'_R']=TRUE; } } if (count($e_note) == 0) { if (!$Edit) { $query='insert into style_note values(null, "'.$Comp_SG.'", "'.$NoteNum.'", "'.$note['NOTE'].'", now())'; if (!mysqli_query($db, $query)) { $e_note['INSERT']=TRUE; } else { $query='insert into changelog values(null, null, "'.$Key.'", "style_note", "A", "", "'.$Comp_SG.':'.$NoteNum.'", "", "")'; mysqli_query($db, $query); } } else { $query='select * from style_note where sg="'.$Comp_SG.'" and note_num="'.$NoteNum.'"'; $note_res=mysqli_query($db, $query); $note_row=mysqli_fetch_assoc($note_res); foreach ($Map as $tag => $row) { if ($note[$tag] != $o_note[$tag]) { if ($o_note[$tag] != $note_row[$row]) { $e_note[$tag.'_C']=TRUE; } } } if (count($e_note) == 0) { foreach ($Map as $tag => $row) { if ($note[$tag] != $o_note[$tag]) { $query='update style_note set '.$row.'="'.$note[$tag].'" where sg="'.$Comp_SG.'" and note_num="'.$NoteNum.'"'; if (!mysqli_query($db, $query)) { $e_note['UPDATE']=TRUE; } else { $query='insert into changelog values(null, null, "'.$Key.'", "style_note", "C", "'.$row.'", "'.$Comp_SG.':'.$NoteNum.'", "'.$o_note[$tag].'", "'.$note[$tag].'")'; mysqli_query($db, $query); } } } } } } if (count($e_note) != 0) { $Page='note.php?k='.$Key.'&n='.$NoteNum.'&s=1&a='.$Action; } else { $Page='note_list.php?k='.$Key; } ?>

Validating Style Note

'."\n"; echo 'Style Note '.$NoteNum.' '.($Edit ? 'Updated' : 'Created')."\n"; echo ''."\n"; echo ''."\n"; } ?>
'."\n"; echo '