incoming array ";
//var_dump($incoming);
// ******** begin database manipulation ********
$nameunique_err=$namesuppld_err=$ttlsuppld_err=$dirsuppld_err=false;
if ($update_display) {
// remove html tags from footer_message and sanitize
$display_footer=strip_tags($display_footer);
$clean_display_footer=mysqli_real_escape_string($drs_db,$display_footer);
// remove html tags from app name and sanitize
$display_appname=strip_tags($display_appname);
$clean_display_appname=mysqli_real_escape_string($drs_db,$display_appname);
// remove html tags from functional help text and sanitize
$display_funchelp=strip_tags($display_funchelp);
$clean_display_funchelp=mysqli_real_escape_string($drs_db,$display_funchelp);
// remove html tags from device term and sanitize
$display_device_term=strip_tags($display_device_term);
$clean_display_device_term=mysqli_real_escape_string($drs_db,$display_device_term);
// remove html tags from discovered term and sanitize
$display_discovered_term=strip_tags($display_discovered_term);
$clean_display_discovered_term=mysqli_real_escape_string($drs_db,$display_discovered_term);
// remove html tags from short discovered term and sanitize
$display_discovered_term_short=strip_tags($display_discovered_term_short);
$clean_display_discovered_term_short=mysqli_real_escape_string($drs_db,$display_discovered_term_short);
// remove html tags from functional term and sanitize
$display_functional_term=strip_tags($display_functional_term);
$clean_display_functional_term=mysqli_real_escape_string($drs_db,$display_functional_term);
// remove html tags from short functional term and sanitize
$display_functional_term_short=strip_tags($display_functional_term_short);
$clean_display_functional_term_short=mysqli_real_escape_string($drs_db,$display_functional_term_short);
// remove html tags from functional yes and sanitize
$display_functional_yes=strip_tags($display_functional_yes);
$clean_display_functional_yes=mysqli_real_escape_string($drs_db,$display_functional_yes);
// remove html tags from functional no and sanitize
$display_functional_no=strip_tags($display_functional_no);
$clean_display_functional_no=mysqli_real_escape_string($drs_db,$display_functional_no);
// remove html tags from short functional yes and sanitize
$display_functional_yes_short=strip_tags($display_functional_yes_short);
$clean_display_functional_yes_short=mysqli_real_escape_string($drs_db,$display_functional_yes_short);
// remove html tags from short functional no and sanitize
$display_functional_no_short=strip_tags($display_functional_no_short);
$clean_display_functional_no_short=mysqli_real_escape_string($drs_db,$display_functional_no_short);
mysqli_query($drs_db,"update config set value=\"$clean_display_appname\" where name=\"app_name\"");
mysqli_query($drs_db,"update config set value=\"$display_banner\" where name=\"banner\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_footer\" where name=\"footer_message\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_funchelp\" where name=\"functional_help_txt\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_device_term\" where name=\"device_term\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_discovered_term\" where name=\"discovered_term\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_discovered_term_short\" where name=\"discovered_term_short\"");
mysqli_query($drs_db,"update config set value=\"$display_disc_drop_data\" where name=\"disc_drop_data\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_term\" where name=\"functional_term\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_term_short\" where name=\"functional_term_short\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_yes\" where name=\"functional_yes\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_no\" where name=\"functional_no\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_yes_short\" where name=\"functional_yes_short\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_no_short\" where name=\"functional_no_short\"");
echo "";
}
if ($update_colors) {
if ($newbgc) mysqli_query($drs_db,"update config set value=\"$newbgc\" where name=\"background_color\"");
if ($newmbgc) mysqli_query($drs_db,"update config set value=\"$newmbgc\" where name=\"menubg_color\"");
if ($newtc) mysqli_query($drs_db,"update config set value=\"$newtc\" where name=\"text_color\"");
if ($newlc) mysqli_query($drs_db,"update config set value=\"$newlc\" where name=\"link_color\"");
if ($newvlc) mysqli_query($drs_db,"update config set value=\"$newvlc\" where name=\"vlink_color\"");
if ($newhc) mysqli_query($drs_db,"update config set value=\"$newhc\" where name=\"heading_color\"");
echo "";
}
if ($reset_colors) {
mysqli_query($drs_db,"update config set value=defaultvalue where name like \"%_color\"");
echo "";
}
if ($add_banner) {
// do error checking
// remove html tags from banner name
$bnrname=strip_tags($bnrname);
// test for name supplied
if (strlen(trim($bnrname))) {
$namesuppld=true;
$namesuppld_err=false;
} else {
$namesuppld=false;
$namesuppld_err=true;
}
// test for name unique
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\""))) {
$nameunique=false;
$nameunique_err=true;
} else {
$nameunique=true;
$nameunique_err=false;
}
if ($namesuppld && $nameunique) {
// sanitize banner name
$clean_bnrname=mysqli_real_escape_string($drs_db,$bnrname);
// modify the table
mysqli_query($drs_db,"insert into banners(bannername,bannercolor,textcolor) values(\"$clean_bnrname\",\"$bnrcolor\",\"$bnrtxtcolor\")");
}
}
if ($edit_banner) {
if ($delete_banner) {
mysqli_query($drs_db,"delete from banners where bannerid=\"$bnrid\"");
unset($edit_banner);
}
if ($update_banner) {
// do error checking
// remove html tags from banner name
$bnrname=strip_tags($bnrname);
// test for name supplied
if (strlen(trim($bnrname))) {
$namesuppld=true;
$namesuppld_err=false;
} else {
$namesuppld=false;
$namesuppld_err=true;
}
// test for name unique
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\" and bannerid!=\"$bnrid\""))) {
if (mysqli_num_rows(mysqli_query($drs_db,"select bannerid from banners where bannername=\"$bnrname\""))) {
$nameunique=false;
$nameunique_err=true;
} else {
$nameunique=true;
$nameunique_err=false;
}
} else {
$nameunique=true;
}
if ($namesuppld && $nameunique) {
// sanitize banner name
$clean_bnrname=mysqli_real_escape_string($drs_db,$bnrname);
// modify the table
mysqli_query($drs_db,"update banners set bannername=\"$bnrname\",bannercolor=\"$bnrcolor\",textcolor=\"$bnrtxtcolor\" where bannerid=\"$bnrid\"");
}
}
}
if ($update_misc) {
if ($logoutall) {
if ($ostype == 'WIN') {
$sessfileloc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"win_server_session_dir\""))[0];
} else {
$sessfileloc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"unix_server_session_dir\""))[0];
}
foreach (glob($sessfileloc."/*") as $sessfile) {
unlink($sessfile);
}
}
// test for sessttl supplied
if (strlen(trim($sessttl))) {
$ttlsuppld=true;
} else {
$ttlsuppld=false;
$ttlsuppld_err=true;
}
if ($ttlsuppld) {
mysqli_query($drs_db,"update config set value=\"$sessttl\" where name=\"session_ttl_days\"");
}
}
// ******** end database manipulation ********
pagetable("begin");
if (!$print) {
pageblock("left","begin");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
banner($print);
echo " ";
echo "
";
$curbgc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"background_color\""))[0];
$curmbgc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"menubg_color\""))[0];
$curtc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"text_color\""))[0];
$curlc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"link_color\""))[0];
$curvlc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"vlink_color\""))[0];
$curhc=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"heading_color\""))[0];
echo "
Color Configuration Parameters
";
echo "
";
if ($nameunique_err) format_message(1,"Banner name already exists. Please try another.");
if ($namesuppld_err) format_message(1,"Banner name cannot be blank.");
if ($edit_banner) {
// set form options for editing
$sectiontitle="Modify Banner
";
$formtag="
";
// show the table of entities
$existingdata=mysqli_query($drs_db,"select * from banners where bannerid!=1 order by bannerid asc");
echo "
Existing Banners Click on the Banner ID to edit.
Banner ID
Banner
";
while ($tablerow=mysqli_fetch_assoc($existingdata)) {
printf("