Tech name cannot be blank.
";
}
// test for name unique
if (mysqli_num_rows(mysqli_query($db,"select techid from techs where techname=\"$name\" and techid!=\"$techid\""))) {
if (mysqli_num_rows(mysqli_query($db,"select techid from techs where techname=\"$name\""))) {
$nameunique=0;
echo "
Tech name already exists.
";
} else {
$nameunique=1;
}
} else {
$nameunique=1;
}
// test for matching passwords
if ($pass!="password_is_unchanged") {
if ($pass==$passconf) {
$passmatch=1;
$passhash=password_hash($pass,PASSWORD_DEFAULT);
$namepassupdqry=("update techs set techname=\"$name\",techpass=\"$passhash\" where techid=\"$techid\"");
} else {
$passmatch=0;
echo "
The passwords you supplied don't match.
";
}
} else {
$passmatch=1;
$namepassupdqry="update techs set techname=\"$name\" where techid=\"$techid\"";
}
if ($namesuppld && $nameunique && $passmatch) {
mysqli_query($db,$namepassupdqry);
mysqli_query($db,"update techs set shift=\"$shift\" where techid=\"$techid\"");
}
}
if ($updatedisplay) {
// display settings
if ($display_showts) $display_showts=1; else $display_showts=0;
if ($display_techalpha=="a") $display_techalpha=1; else $display_techalpha=0;
if ($display_subjalpha=="a") $display_subjalpha=1; else $display_subjalpha=0;
// test for urlchunk supplied
if (strlen(trim($display_urlchunk))) {
$chunksuppld=1;
} else {
$chunksuppld=0;
echo "
URL chunk size cannot be blank.
";
}
if ($chunksuppld) {
putsetting('url_chunk_size',$display_urlchunk,$techid);
putsetting('show_ts',$display_showts,$techid);
putsetting('tech_alpha',$display_techalpha,$techid);
putsetting('subj_alpha',$display_subjalpha,$techid);
putsetting('log_style',$display_logstyle,$techid);
}
}
if ($setcolor) {
// color settings
$hexcolor="#".ltrim($hexcolor);
putsetting($modcolor,$hexcolor,$techid);
}
if ($resetcustom) mysqli_query($db,"delete from customs where customtech=\"$techid\"");
sidemenu();
pageblock("left","end");
}
pageblock("right","begin");
// pull my current data from tables
$curname=dblookup($db,"techs","techid","techname",$techid);
$curshift=dblookup($db,"techs","techid","shift",$techid);
$pass=$passconf="password_is_unchanged";
// other values from customs
$curlchunk=getsetting('url_chunk_size',$techid)["value"];
$curts=getsetting('show_ts',$techid)["value"];
$curtdo=getsetting('tech_alpha',$techid)["value"];
$cursdo=getsetting('subj_alpha',$techid)["value"];
$curbgc=getsetting('background_color',$techid)["value"];
$cursbc=getsetting('sidebar_color',$techid)["value"];
$curmbgc=getsetting('menubg_color',$techid)["value"];
$curtc=getsetting('text_color',$techid)["value"];
$curlc=getsetting('link_color',$techid)["value"];
$curvlc=getsetting('vlink_color',$techid)["value"];
$curhc=getsetting('heading_color',$techid)["value"];
$curlogstyle=getsetting('log_style',$techid)["value"];
// show the form
echo "