<TITLE>DI user info</TITLE>
<BODY BGcolor=BLACK TEXT=WHITE ALINK=BLUE VLINK=BLUE LINK=BLUE>

<!
$sock=msqlConnect();
if ($sock<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }

if (msqlSelectDB($sock, "DI")<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }


if (msqlQuery($sock, "SELECT * FROM dis_users WHERE nmbr=$nmbr")<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }
$fd=msqlStoreResult();
$data=msqlFetchRow($fd);

if (#$data==0) {
   $greska="Sorry, this user has been deleted.<BR>Probably in last few minutes.";
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$greska</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }

   $user=$data[1]; $password=$data[2]; $ppassword=$data[2]; $name=$data[3];
   $surname=$data[4]; $title=(int)$data[5]; $usr_other_title=$data[6]; 
   $job_title=(int)$data[7]; $h_street=$data[8]; 
   $h_city=$data[9]; $h_country=$data[11]; $h_zip=$data[10];
   $h_phone=$data[12]; $company=$data[13];  $dept=$data[14];
   $w_street=$data[15];  $w_city=$data[16]; $w_zip=$data[17];
   $w_country=$data[18];  $w_phone1=$data[19]; $fax=$data[21];
   $w_phone2=$data[20]; $w_account=$data[22]; $account=$data[23]; 
   $home_page=$data[26]; $email1=$data[24]; $email2=$data[25];
   $di_page=(int)$data[28];

if (msqlQuery($sock, "SELECT * FROM title ORDER BY nmbr")<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }
$fd=msqlStoreResult();
$data=msqlFetchRow($fd);
$i=0;
$title_n[0]=0;
$title_s[0]="Other";
$title_l[0]="Other";
while(#$data>0) {
   $i= $i + 1;
   $title_n[$i]=(int)$data[0];
   $title_s[$i]=$data[1];
   $title_l[$i]=$data[2];
   $data=msqlFetchRow($fd);
   }
msqlFreeResult($fd);
$title_num=$i;

if (msqlQuery($sock, "SELECT * FROM job_title ORDER BY nmbr")<0) {
   echo("<CENTER><TABLE WIDTH=400 BORDER=2 BGCOLOR=RED>\n");
   echo("<TR><TD>\n<BR><CENTER>$ERRMSG</CENTER><BR>\n</TD></TR>\n</TABLE>\n");
   exit(0);
   }
$fd=msqlStoreResult();
$data=msqlFetchRow($fd);
$i=0;
$jobtitle_n[0]=0;
$jobtitle_s[0]="None";
$jobtitle_l[0]="None";
while(#$data>0) {
   $i= $i + 1;
   $jobtitle_n[$i]=(int)$data[0];
   $jobtitle_s[$i]=$data[1];
   $jobtitle_l[$i]=$data[2];
   $data=msqlFetchRow($fd);
   }
msqlFreeResult($fd);
$jobtitle_num=$i;

echo("<TABLE >\n");

echo("<TR><TD WIDTH=20%>");

$in=open("./pic-name $email1", "<|");
if ($in<0) {
   echo("Error: $ERRMSG\n");
   fatal();
   }
$slk=chop(readln($in));
close($in);

echo("$slk</TD>\n");

echo("<TD WIDTH=\"60%\">\n");
$sta=$usr_other_title;
if ((int)$title>0) {
   $sta=$title_n[$title];
   }
echo("<B><FONT SIZE=+3>$name $surname, $sta<BR>\n");

if ((int)$job_title>0) {
   echo("</FONT><U><FONT SIZE=+1>");
   $sta=$jobtitle_s[$job_title];
   echo("$sta\n");
   }
echo("</FONT></U></B><BR>\n");

echo("<DT><B><FONT SIZE=+0>Address for corespondance:</FONT><FONT SIZE=+1></FONT></B></DT>\n");
if ($company!="") {
   echo("<DT><B><FONT SIZE=+0>$company</FONT></B></DT>\n");
   echo("<DT><B><FONT SIZE=+0>$w_street,</FONT></B></DT>\n");
   echo("<DT><B><FONT SIZE=+0>$w_zip, $w_city</FONT></B></DT>\n");
   echo("<DT><B><FONT SIZE=+0>$w_country</FONT></B></DT>\n");
if ($w_phone1!="") {
   echo("<DT><B><FONT SIZE=+0>phone $w_phone1</FONT></B></DT>\n");
   }
if ($w_phone2!="") {
   echo("<DT><B><FONT SIZE=+0>phone $w_phone2</FONT></B></DT>\n");
   }
if ($fax!="") {
   echo("<DT><B><FONT SIZE=+0>fax $fax</FONT></B></DT>\n");
   }
}
else {
   echo("<DT><B><FONT SIZE=+0>$h_street,</FONT></B></DT>\n");
   echo("<DT><B><FONT SIZE=+0>$h_zip, $h_city</FONT></B></DT>\n");
   echo("<DT><B><FONT SIZE=+0>$h_country</FONT></B></DT>\n");
if ($h_phone!="") {
   echo("<DT><B><FONT SIZE=+0>phone $h_phone</FONT></B></DT>\n");
   }
}
if ($email1!="") {
   echo("<P><B><FONT SIZE=+1>Email: <A HREF=\"mailto:$email1\">$email1</A></FONT></B><BR>\n");
   }
if ($email2!="") {
   echo("<P><B><FONT SIZE=+1>Email: <A HREF=\"mailto:$email2\">$email2</A></FONT></B><BR>\n");
   }

echo("</TABLE></TD></P><BR>\n");

>

</BODY>
</HTML>
