0 ? '90' : '').'0;url=brewer_info.php?k='.$Key.$Add; } else { $Page='0;url=failed.php'; } $Submit=(array_key_exists('SUBMIT', $_POST) && !empty($_POST['SUBMIT'])); if (array_key_exists('RELOAD', $_POST) && !empty($_POST['RELOAD'])) { $Page='0;url=brewer_sess.php?k='.$Key.$Add.'&s=0'; $Submit=FALSE; $e_sess['RELOAD']=TRUE; } $sess=array(); $e_sess=array(); $query='select * from sessions order by ses_seq'; $sess_res=mysqli_query($db, $query); while ($sess_row=mysqli_fetch_assoc($sess_res)) { $chk='SESS_'.$sess_row['ses_seq']; if (array_key_exists($chk, $_POST) && !empty($_POST[$chk])) { $sess[]=$sess_row['ses_seq']; } } $query='select * from sessions order by ses_seq'; $sess_res=mysqli_query($db, $query); while ($sess_row=mysqli_fetch_assoc($sess_res)) { $query='select count(*) from session_prefs where brewer="'.$BrewerNo.'" and ses_seq="'.$sess_row['ses_seq'].'"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); if (in_array($sess_row['ses_seq'], $sess)) { if ($cnt_row[0] == 0) { $query='insert into session_prefs values(null, "'.$BrewerNo.'", "'.$sess_row['ses_seq'].'")'; if (mysqli_query($db, $query)) { $query='insert into changelog values (null, null, "'.$Key.'", "session_prefs","A","","'.$BrewerNo.':'.$sess_row['ses_seq'].'", "", "")'; mysqli_query($db, $query); } else { $e_sess['INSERT_'.$sess_row['ses_seq']]=TRUE; } } } else { if ($cnt_row[0] > 0) { $query='delete from session_prefs where brewer="'.$BrewerNo.'" and ses_seq="'.$sess_row['ses_seq'].'"'; if (mysqli_query($db, $query)) { $query='insert into changelog values (null, null, "'.$Key.'", "session_prefs","D","","'.$BrewerNo.':'.$sess_row['ses_seq'].'", "", "")'; mysqli_query($db, $query); } else { $e_sess['DEL_'.$sess_row['ses_seq']]=TRUE; } } } } ?>
0 ? 'EP' : ''), $Key, $BrewerNo); ?>

'."\n"; if (!$Submit || count($e_sess) != 0) { if (!$e_sess['RELOAD']) { BuildHidden($sess, TRUE); BuildHidden($e_sess); echo ''."\n"; } else { echo ''."\n"; } } echo ''."\n"; if (!array_key_exists('RELOAD', $e_sess)) { echo ''."\n"; } ?>