require "include/common.php";
require "include/shell.php";
require "include/dics.php";
require_once "include/pd.php";
require_once "include/interfaces.php";
require_once "include/sql.php";
//
session_start();
$userid = $_SESSION['userid'];
$userif = $_REQUEST['userif'];
if($userif)
$_SESSION['ifid'] = (int)$userif;
elseif(!$_SESSION['ifid'])
$_SESSION['ifid'] = 1;
$ifid = $_SESSION['ifid'];
$if = LoadInterface($ifid);
if($if['id'] == 1) {
$iseng = FALSE;
$nnm = "name";
}
else {
$iseng = TRUE;
$nnm = "engname";
}
$pageid = 1;
$astr = "(*)";
if(!is_admin($userid)) {
echo $if['err_no_access'];
exit;
};
$judgeid = (int)$_REQUEST[judgeid];
if($_REQUEST[update] == "judge") {
$judgeid = (int)$_REQUEST[judgeid];
$name = Shield($_REQUEST[name]);
$engname = Shield($_REQUEST[engname]);
$description = Shield($_REQUEST[description]);
$engdescription = Shield($_REQUEST[engdescription]);
$countryid = (int)$_REQUEST[countryid];
if($_REQUEST[breedexpert] == "on") $breedexpert = 1; else $breedexpert = 0;
if($judgeid)
$query = "UPDATE showjudges SET name=\"$name\", engname=\"$engname\", countryid=\"$countryid\", description=\"$description\", engdescription=\"$engdescription\", breedexpert=\"$breedexpert\" WHERE id=$judgeid";
else
$query = "INSERT INTO showjudges(name,engname,description,engdescription,countryid,breedexpert) VALUES(\"$name\",\"$engname\",\"$description\",\"$engdescription\",\"$countryid\",\"$breedexpert\")";
if(!$judgeid && data_select("name", array("name" => $name), "showjudges"))
ErrMsg($if['err_judge_presented']);
else
if(!mysql_query($query))
ErrMsg(mysql_error());
$mainfoto = $_FILES[mainfoto][tmp_name];
if($mainfoto)
LoadPhoto($judgeid, 0, $mainfoto, 7);
unset($judgeid);
}
switch($_REQUEST[screen]) {
case 10: // "COUNTRIES"
$title = mb_convert_case($if['main_oper_countries'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "
";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'countries', countryid: '$countryid'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'countries', countryid: '$countryid'});";
break;
case 12: // "KENNELS"
$kennelid = (int)$_REQUEST[kennelid];
$title = mb_convert_case($if['main_oper_kennels'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "
";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'kennels', kennelid: '$kennelid'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'kennels', kennelid: '$kennelid'});";
break;
case 14: // "USERS"
$title = mb_convert_case($if['main_oper_users'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "
";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'users', euserid: '$euserid'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'users', euserid: '$euserid'});";
break;
case 20: // "INTERFACE TERMS"
$title = mb_convert_case($if['main_oper_terms'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'itfvalues', valuename: '$valuename'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'itfvalues', valuename: '$valuename'});";
break;
case 22: // "TITLES"
$title = mb_convert_case($if['main_oper_titles'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "
\n
";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'titlestype', titleid: '$titleid'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'titlestype', titleid: '$titleid'});";
break;
case 24: // "CERTIFICATES"
$title = mb_convert_case($if['main_oper_cert'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "
\n
";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'certtype', certid: '$certid'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'certtype', certid: '$certid'});";
break;
case 30: // "SHOW JUDGES"
$title = mb_convert_case($if['main_oper_judges'], MB_CASE_UPPER, "UTF-8");
$outtext = Title($title, $mess);
$outtext .= "
\n
";
$outtext .= "
";
$c2 = "
";
$jq .= "$(\"#dicContent\").load('aj_dic_edit.php', {dic: 'showjudges', judgeid: '$judgeid'});";
$jq .= "$(\"#dicList\").load('aj_dic_list.php', {dic: 'showjudges', judgeid: '$judgeid'});";
break;
};
FormHeader(FALSE, $userid, $jq);
if($errstr)
$c1 .= $errstr;
if($outtext)
$c1 .= $outtext;
TwoColumns($c1, $c2);
FormEnding($userid,$id,$pageid);
?>