Location: PHPKode > projects > lcdata > lcdata-0.0.1/frontend-web/frmuserdetail.php3
<?

$frm_color='c0c0a0';
include 'includes/funktions.php';
$conn = connectdb();
getuserdaten();

$frm_color_row = $frm_color_high;


if (($doadd==true)){
  if (gidhasright("$gidfrmusr1",$Rfrmadd)){
	$sql    = "INSERT INTO known_users (ku_maxlogon, ku_maxrows) VALUES (1,50)";
	$result = SQL_exec ($conn, $sql);

	$oid    = pg_getlastoid($result);
	$sql    = "SELECT * FROM known_users WHERE oid=$oid";
	$result = SQL_exec ($conn, $sql);
        $data   = pg_fetch_object ($result, 0);

        $userid = $data->ku_userid;
        $edit=true;

	$sql    = "INSERT INTO gidrights (gr_gid,gr_userid,gr_userrights) SELECT '$data->ku_gid' as gid, '$usrd->ku_userid' as userid, cr_userrights FROM create_gidrights WHERE cr_gid=$gidfrmusr1 AND cr_userid=0";
	$result = SQL_exec ($conn, $sql);
	$sql    = "INSERT INTO gidrights (gr_gid,gr_userid,gr_userrights) SELECT '$data->ku_gid' as gid, cr_userid, cr_userrights FROM create_gidrights WHERE cr_gid=$gidfrmusr1 AND cr_userid>0";
	$result = SQL_exec ($conn, $sql);
  }
}

if (($deletenew==true)){
  $result = SQL_exec ($conn, "SELECT * FROM known_users WHERE ku_userid=$selectgroup");
  $data = pg_fetch_object ($result, 0);
  if (gidhasright($data->ku_gid,$Rgidedit)){
    $sql    = "DELETE FROM group2user WHERE gu_groupid=$selectgroup AND gu_userid=$userid";
    $result = SQL_exec ($conn, $sql);
  }  
  DOuser2group(1,0);
}

dohistory("frmuserdetail.php3?userid=$userid");


print "<html>\n<head>";

if (($save==true)){
  $result = SQL_exec ($conn, "SELECT * FROM known_users WHERE ku_userid='$userid'");
  $data = pg_fetch_object ($result, 0);
  if (gidhasright($data->ku_gid,$Rgidedit)){
    $sql="UPDATE known_users set ku_name='$name', ku_lan='$set_lan', ku_pname='$pname', ku_sname='$sname', ku_email='$email', ku_maxlogon='$maxlogon', ku_maxrows='$maxrows', ku_lasttime='now', ku_mailpopup=$set_mailpopup, ku_remember=$set_remember WHERE ku_userid='$userid'";
    $result = SQL_exec ($conn, $sql); 
    if (($usrd->ku_userid=$data->ku_userid) && ($data->ku_lan != $set_lan)){
      print "<script language=\"JavaScript\">\n";
      print "<!--\n";
      print "parent.kopfframe.location=\"kopf.php3\"\n";
      print "//-->\n";
      print "</script>\n";
    }
  }
}

require 'includes/labels.php';

timerefresh('prefs_page',"SELECT ku_lasttime as lasttime FROM known_users WHERE ku_userid='$userid' ORDER BY ku_lasttime DESC");

$result = SQL_exec ($conn, "SELECT * FROM known_users WHERE ku_userid='$userid'");
$data = pg_fetch_object ($result, 0);
   
print "</head>\n<body bgcolor=\"#$frm_color\">\n<center><h2>$lb_prefform</h2>\n";


if (($edit==true)){
  if (gidhasright($data->ku_gid,$Rgidedit)){
   
    print "<form action=\"frmuserdetail.php3?$dummy&save=true&userid=$data->ku_userid&burl=$burl\" Method=\"POST\"><table border=1>\n";
    print "<table border=0>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_id</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_userid &#160;</td></tr>\n";

    if (empty($set_lan)) $set_lan=$lan;
    print"<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_language</th><td width=200 bgcolor=\"$frm_color_row\"><select name=\"set_lan\" size=1>\n";
    auswahl  ($set_lan,"de",$lb_de);
    auswahl  ($set_lan,"en",$lb_en);
    print"</select>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_username2</th><td width=200 bgcolor=\"$frm_color_row\"><input type=\"text\" name=\"name\" value=\"$data->ku_name\"></td></tr>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_pname</th><td width=200 bgcolor=\"$frm_color_row\"><input type=\"text\" name=\"pname\" value=\"$data->ku_pname\"></td></tr>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_sname</th><td width=200 bgcolor=\"$frm_color_row\"><input type=\"text\" name=\"sname\" value=\"$data->ku_sname\"></td></tr>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_email</th><td width=200 bgcolor=\"$frm_color_row\"><input type=\"text\" name=\"email\" value=\"$data->ku_email\"></td></tr>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_maxlogon</th><td width=200 bgcolor=\"$frm_color_row\"><input type=\"text\" name=\"maxlogon\" value=\"$data->ku_maxlogon\"></td></tr>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_maxrows</th><td width=200 bgcolor=\"$frm_color_row\"><input type=\"text\" name=\"maxrows\" value=\"$data->ku_maxrows\"></td></tr>\n";
    print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_mail_pop_up</th><td width=200 bgcolor=\"$frm_color_row\">";
    if (empty($set_mailpopup)) $set_mailpopup=$data->ku_mailpopup;
    print "<select name=\"set_mailpopup\" size=1>\n";
    auswahl  ($set_mailpopup,1,$lb_yes);
    auswahl  ($set_mailpopup,0,$lb_no);
    print "</select>\n</td></tr>\n";

print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_remember</th><td width=200 bgcolor=\"$frm_color_row\">";
    if (empty($set_remember)) $set_remember=$data->ku_remember;
    print "<select name=\"set_remember\" size=1>\n";
    auswahl  ($set_remember,1,$lb_yes);
    auswahl  ($set_remeber,0,$lb_no);
    print "</select>\n</td></tr>\n";

    print "</table><br>";
    print " <a href=\"frmuserdetail.php3?$dummy&edit=true&userid=$data->ku_userid&burl=$burl\" ><img src=\"gfx/$lan/reload.gif\" border=0></a>";
    print " <a href=\"frmuserdetail.php3?$dummy&userid=$data->ku_userid&burl=$burl\" ><img src=\"gfx/$lan/cancel.gif\" border=0></a>";
    if (gidhasright($data->ku_gid,$Rgidedit)){
     print " <input type=IMAGE src=\"gfx/$lan/save.gif\" border=0>";
    }
    print "</form>";
  }
}
else{
  print "<table border=0>\n";
  print "<tr valign=\"top\"><td><table border=0>";
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_id</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_userid &#160;</td></tr>\n";
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_language</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_lan &#160;</td></tr>\n";  
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_username2</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_name &#160;</td></tr>\n";  
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_pname</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_pname &#160;</td></tr>\n";  
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_sname</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_sname &#160;</td></tr>\n";  
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_email</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_email &#160;</td></tr>\n";
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_maxlogon</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_maxlogon &#160;</td></tr>\n";  
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_maxrows</th><td width=200 bgcolor=\"$frm_color_row\">$data->ku_maxrows &#160;</td></tr>\n";  
  print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_mail_pop_up</th><td width=200 bgcolor=\"$frm_color_row\">";
  if ($data->ku_mailpopup==1) print "$lb_yes";
  if ($data->ku_mailpopup==0) print "$lb_no";
  print "&#160;</td></tr>\n";  

print "<tr><th height=$row_height width=100 bgcolor=\"$frm_color_head\">$lb_remember</th><td width=200 bgcolor=\"$frm_color_row\">";
  if ($data->ku_remember==1) print "$lb_yes";
  if ($data->ku_remember==0) print "$lb_no";
  print "&#160;</td></tr>\n";


  print "</table></td><td><table border=0>";
  print "<tr><th height=$row_height width=300 bgcolor=\"$frm_color_head\" colspan=2>Benutzer ist in diesen Gruppen</th></tr>\n";

  $result2 = SQL_exec ($conn, "SELECT * FROM user2group,known_users WHERE ug_groupid=ku_userid AND ug_userid=$data->ku_userid AND ug_groupid!=ug_userid");
  for($row=0;$row<pg_numrows( $result2 );$row++)
  {
     $data2 = pg_fetch_object ($result2, $row);
 
     if($row%2){
       $frm_color_row=$frm_color_row1;
     }
     else{
       $frm_color_row=$frm_color_row2;
     } 
     print "<tr><td height=$row_height bgcolor=\"#$frm_color_row\">$data2->ku_name &#160;</td><td bgcolor=\"#$frm_color_row\"><a href=\"frmuserdetail.php3?$dummy&deletenew=true&userid=$data->ku_userid&selectgroup=$data2->ku_userid&burl=$burl\"><img src=\"gfx/$lan/delete.gif\" border=0></a></tr>\n";
  }

  print "</table></td></tr>";
  print "</table><br>";



  print "<a href=\"$usrd->us_burl\" ><img src=\"gfx/$lan/back.gif\" border=0></a> ";
  if (gidhasright($data->ku_gid,$Rgidedit)){
    print "<a href=\"frmuserdetail.php3?$dummy&edit=true&userid=$data->ku_userid&burl=$burl\"><img src=\"gfx/$lan/edit.gif\" border=0></a> ";
  }



}
print "<br></center></body>\n</html>\n";
?>

Return current item: lcdata