"; } 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; } 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; } 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; } else { $namesuppld=false; $namesuppld_err=true; } // test for name unique if (mysqli_num_rows(mysqli_query($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; } } 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; } // test for sessdir supplied if (strlen(trim($sessdir))) { $dirsuppld=true; } else { $dirsuppld=false; $dirsuppld_err=true; } if ($ttlsuppld && $dirsuppld) { mysqli_query($drs_db,"update config set value=\"$sessttl\" where name=\"session_ttl_days\""); if ($ostype == 'WIN') { mysqli_query($drs_db,"update config set value=\"$sessdir\" where name=\"win_server_session_dir\""); } else { mysqli_query($drs_db,"update config set value=\"$sessdir\" where name=\"unix_server_session_dir\""); } } } // ******** end database manipulation ******** pagetable("begin"); if (!$print) { pageblock("left","begin"); sidemenu(); pageblock("left","end"); } pageblock("right","begin"); banner($print); echo "
"; echo "
"; $curapn=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"app_name\""))[0]; $curbnr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"banner\""))[0]; $curftr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"footer_message\""))[0]; $curpereffhlp=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"period_eff_help_txt\""))[0]; echo " Display Configuration Parameters



"; echo " Application Name (will appear at the top of every page):



"; echo " Banner (will appear at the top and bottom of pages):  


Footer Message (will appear at the bottom of pages):



Period Effective Help Text :




    


"; 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

Select the color you'd like to change then use the color picker to select a new color

Page background color# ____
Menu background color# ____
Normal text color# ____
Link color# ____
Visited link color# ____
Heading color# ____


   

 

\"\"

R H
G S
B V

#
 
"; 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="
"; $buttontags="          
"; // pull current values from database $currentvalues=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from banners where bannerid=$bnrid")); $bnrname=$currentvalues["bannername"]; $bnrcolor=$currentvalues["bannercolor"]; $bnrtextcolor=$currentvalues["textcolor"]; $bnrcoloropts=""; foreach($basic_colors as $cname => $chex) { if ($chex==$bnrcolor) { $bnrcoloropts=$bnrcoloropts . ""; } else { $bnrcoloropts=$bnrcoloropts . ""; } } $bnrtextcoloropts=""; foreach($basic_colors as $cname => $chex) { if ($chex==$bnrtextcolor) { $bnrtextcoloropts=$bnrtextcoloropts . ""; } else { $bnrtextcoloropts=$bnrtextcoloropts . ""; } } } else { // set form options for add $sectiontitle="Add New Banner

"; $formtag=""; $bnrname=""; $buttontags=" "; // set default values $bnrcolor="#000000"; $bnrtextcolor="#FFFFFF"; $bnrcoloropts=""; foreach($basic_colors as $cname => $chex) { if ($chex==$bnrcolor) { $bnrcoloropts=$bnrcoloropts . ""; } else { $bnrcoloropts=$bnrcoloropts . ""; } } $bnrtextcoloropts=""; foreach($basic_colors as $cname => $chex) { if ($chex==$bnrtextcolor) { $bnrtextcoloropts=$bnrtextcoloropts . ""; } else { $bnrtextcoloropts=$bnrtextcoloropts . ""; } } } echo " $sectiontitle $formtag
Banner Name (text displayed in the banner):  

Banner Color (background color of the banner):  

Banner Text Color (text color of the banner, different than banner color):  

$buttontags


"; // 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.

"; while ($tablerow=mysqli_fetch_assoc($existingdata)) { printf(" ", $tablerow["bannerid"],$tablerow["bannerid"], $tablerow["bannercolor"],$tablerow["textcolor"],$tablerow["bannername"]); } echo "
Banner IDBanner
%s %s
"; echo "
"; if ($ttlsuppld_err) format_message(1,"Session expiration time cannot be blank."); if ($dirsuppld_err) format_message(1,"Server session file directory cannot be blank."); $curttl=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"session_ttl_days\""))[0]; if ($ostype == 'WIN') { $curssdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"win_server_session_dir\""))[0]; } else { $curssdir=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"unix_server_session_dir\""))[0]; } echo " Miscellaneous Configuration Parameters



Session expiration time (users will have to log in again after this long) :   days

Server session file directory (must be writable by the web server process) :


Force logout of all users  



    
"; echo "
"; banner($print); pageblock("right","end"); pagetable("end"); framework("end","","",$print); ?>