- modules/fotolab updated imagej to current version & some cod fixes to make it work
[care2x.git] / Care2007 / modules / system_admin / edv_user_access_update.php
blob2207d494b9294e095e4a9398c501184047cc54a9
1 <?php
2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
3 define('LANG_FILE','edp.php');
4 $local_user='ck_edv_user';
5 require_once($root_path.'include/inc_front_chain_lang.php');
7 require_once($root_path.'include/inc_config_color.php');
9 /**
10 * The following require loads the access areas that can be assigned for
11 * user permissions.
13 require($root_path.'include/inc_accessplan_areas_functions.php');
15 $breakfile="edv.php?sid=".$sid."&lang=".$lang;
19 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN" "html.dtd">
21 <?php html_rtl($lang); ?>
22 <HEAD>
23 <?php echo setCharSet(); ?>
24 <?php
25 require($root_path.'include/inc_css_a_hilitebu.php');
27 <script language="javascript">
28 <!--
30 function gethelp(x,s,x1,x2,x3)
32 if (!x) x="";
33 urlholder="<?php echo $root_path; ?>help-router.php<?php echo URL_REDIRECT_APPEND ?>&helpidx="+x+"&src="+s+"&x1="+x1+"&x2="+x2+"&x3="+x3;
34 helpwin=window.open(urlholder,"helpwin","width=790,height=540,menubar=no,resizable=yes,scrollbars=yes");
35 window.helpwin.moveTo(0,0);
37 // -->
38 </script>
39 </HEAD>
41 <BODY topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=<?php echo $cfg['bot_bgcolor']?>>
44 <table width=100% border=0 cellspacing=0 >
45 <tr>
46 <td bgcolor="<?php echo $cfg['top_bgcolor']; ?>" height="45"><FONT COLOR="<?php echo $cfg['top_txtcolor']; ?>" SIZE=+2 FACE="Arial">
47 <STRONG> &nbsp; <?php echo "$LDEDP $LDUpdateRight" ?></STRONG></FONT></td>
48 <td bgcolor="<?php echo $cfg['top_bgcolor']; ?>" height="10" align=right>
49 <?php if($cfg['dhtml'])echo'<a href="javascript:window.history.back()"><img '.createLDImgSrc($root_path,'back2.gif','0').' style=filter:alpha(opacity=70) onMouseover=hilite(this,1) onMouseOut=hilite(this,0)>';?></a><a href="javascript:gethelp('edp.php','access','update')"><img <?php echo createLDImgSrc($root_path,'hilfe-r.gif','0') ?> <?php if($cfg['dhtml'])echo'style=filter:alpha(opacity=70) onMouseover=hilite(this,1) onMouseOut=hilite(this,0)>';?></a><a href="<?php echo $breakfile;?>"><img <?php echo createLDImgSrc($root_path,'close2.gif','0') ?> alt="<?php echo $LDClose ?>" <?php if($cfg['dhtml'])echo'style=filter:alpha(opacity=70) onMouseover=hilite(this,1) onMouseOut=hilite(this,0)>';?></a></td>
50 </tr>
51 <tr bgcolor="<?php echo $cfg['body_bgcolor']?>">
52 <td colspan=2><p><br>
53 <ul>
54 <?php
55 // initialize error flags
56 $error=0;
57 $errorname=0;
58 $erroruser=0;
59 $errorpass=0;
60 $errorbereich=0;
62 // get date and time
64 $curdate=date('Y-m-d');
65 $curtime=date('H:i:s');
67 /* Establish db connection */
68 if(!isset($db)||!$db) include($root_path.'include/inc_db_makelink.php');
69 if($dblink_ok)
72 if ($mode=='save')
74 //remove spaces
75 $username=trim(strtr($username,"+"," "));
76 $userid=trim($userid);
77 $pass=trim($pass);
79 // start checking input data for errors
80 if ($username==""){ $error=1; $errorname=1;};
81 if ($userid==""){$error=1; $erroruser=1;};
82 if ($pass==""){$error=1; $errorpass=1;};
83 if (($bereich1=="")and($bereich2=="")and($bereich3=="")and
84 ($bereich4=="")and($bereich5=="")and($bereich6=="")and($bereich7==""))
85 { $error=1; $errorbereich=1;};
87 if($error==0)
89 echo "<table bgcolor=#dddddd border=1 cellpadding=10 cellspacing=1>
90 <tr>
91 <td colspan=3><FONT SIZE=-1 FACE=Arial>";
93 //include('../include/inc_db_makelink.php');
95 $sql='UPDATE care_users SET
96 login_id="'.$userid.'",
97 password="'.$pass.'",
98 area1="'.$bereich1.'",
99 area2="'.$bereich2.'",
100 area3="'.$bereich3.'",
101 area4="'.$bereich4.'",
102 area5="'.$bereich5.'",
103 area6="'.$bereich6.'",
104 area7="'.$bereich7.'",
105 area8="'.$bereich8.'",
106 area9="'.$bereich9.'",
107 area10="'.$bereich10.'",
108 s_date="'.$curdate.'",
109 s_time="'.$curtime.'",
110 modify_id="'.$HTTP_COOKIE_VARS[$local_user.$sid].'"
111 WHERE name="'.$username.'"';
113 if($db->Execute($sql))
115 echo mysql_affected_rows()." $LDDataSaved <p>";
116 echo $LDAccessIndex[0].": ".$username."<br>";
117 echo $LDAccessIndex[1].": ".$userid."<br>";
118 echo $LDAccessIndex[2].": ".$pass."<br>";
119 echo $LDAccessIndex[4].": <br>";
120 if($bereich1!="") echo "$LDArea 1: ".$bereich1."<br>";
121 if($bereich2!="") echo "$LDArea 2: ".$bereich2."<br>";
122 if($bereich3!="") echo "$LDArea 3: ".$bereich3."<br>";
123 if($bereich4!="") echo "$LDArea 4: ".$bereich4."<br>";
124 if($bereich5!="") echo "$LDArea 5: ".$bereich5."<br>";
125 if($bereich6!="") echo "$LDArea 6: ".$bereich6."<br>";
126 if($bereich7!="") echo "$LDArea 7: ".$bereich7."<br>";
127 if($bereich8!="") echo "$LDArea 8: ".$bereich8."<br>";
128 if($bereich9!="") echo "$LDArea 9: ".$bereich9."<br>";
129 if($bereich10!="") echo "$LDArea 10: ".$bereich10."<br>";
132 else { echo "$LDDbNoSave<br>$sql"; }
134 echo '</td>
135 </tr>
136 </table>
137 <FONT SIZE=-1 FACE=Arial>
139 <FORM method="get" action="edv_user_access_edit.php">
140 <input type="hidden" name="sid" value="'.$sid.'">
141 <input type="hidden" name="lang" value="'.$lang.'">
142 <INPUT type="submit" value="'.$LDOK.'"></font></FORM>
144 <FORM method="get" action="edv_user_access_list.php">
145 <input type="hidden" name="sid" value="'.$sid.'">
146 <input type="hidden" name=lang value="'.$lang.'">
147 <INPUT type="submit" value="'.$LDListActual.'"></font></FORM>
149 </FONT>';
154 else
156 $sql='SELECT * FROM care_users WHERE login_id="'.$itemname.'"';
157 $ergebnis=$db->Execute($sql);
158 if($ergebnis)
160 $zeile=$ergebnis->FetchRow();
161 $username=$zeile['name'];
162 if ($mode!='save')
164 $userid=$zeile['login_id'];
165 $pass=$zeile['password'];
166 $bereich1=$zeile['area1'];
167 $bereich2=$zeile['area2'];
168 $bereich3=$zeile['area3'];
169 $bereich4=$zeile['area4'];
170 $bereich5=$zeile['area5'];
171 $bereich6=$zeile['area6'];
172 $bereich7=$zeile['area7'];
173 $bereich8=$zeile['area8'];
174 $bereich9=$zeile['area9'];
175 $bereich10=$zeile['area10'];
180 else { echo "$LDDbNoLink<br>$sql"; }
185 <?php if ($error==1)
187 echo "<FONT COLOR=red SIZE=+1 FACE=Arial>$LDInputError<p>";
193 <?php if ((($error==1)and($mode=='save'))or(($error==0)and($mode==""))) :; ?>
195 <form method="post" action="edv_user_access_update.php">
196 <table border=0 cellpadding=0 cellspacing=0 bgcolor=#666666>
197 <tr><td>
199 <table border="0" cellpadding="5" cellspacing="1">
200 <tr bgcolor="#dddddd">
201 <td>
203 <FONT SIZE=-1 FACE="Arial" color=#000080>
204 <?php echo $LDName ?>:
205 <font color=#800000>
206 <br>
207 <?php
208 echo " ".$username;
209 echo "<input type=hidden name=username value=".strtr($username," ","+").">";
212 <br>
213 </td>
214 <td><FONT SIZE=-1 FACE="Arial" color=#000080>
215 <?php if ($erroruser) {echo "<font color=red > <b>$LDUserId</b>";}
216 else { echo $LDUserId;} ?>
217 <br>
218 <input type=text name=userid
219 <?php if ($userid!="") echo "value=".$userid ; ?>
220 ><br>
221 </td>
222 <td><FONT SIZE=-1 FACE="Arial" color=#000080>
223 <?php if ($errorpass) {echo "<font color=red > <b>$LDPassword</b>";}
224 else { echo $LDPassword;} ?>
225 <br>
226 <input type=text name=pass
227 <?php if ($pass!="") echo "value=".$pass ; ?>
228 ><br>
229 </td>
230 </tr>
231 <tr bgcolor="#dddddd">
232 <td colspan=3><FONT SIZE=-1 FACE="Arial" color=#000080>
233 <?php if ($errorbereich) {echo "<font color=red > <b>$LDAllowedArea</b> </font>";}
234 else { echo $LDAllowedArea;} ?>
235 </td>
236 </tr>
237 <tr bgcolor="#dddddd">
238 <td valign=top><FONT SIZE=-1 FACE="Arial" color=#000080>
240 <?php echo $LDArea ?> 1:
241 <select name=bereich1 size=1>
242 <?php createselecttable($bereich1) ?>
243 </select>
245 <?php echo $LDArea ?> 2:
246 <select name=bereich2 size=1>
247 <?php createselecttable($bereich2) ?>
248 </select>
250 <?php echo $LDArea ?> 3:
251 <select name=bereich3 size=1>
252 <?php createselecttable($bereich3) ?>
253 </select>
255 <?php echo $LDArea ?> 4:
256 <select name=bereich4 size=1>
257 <?php createselecttable($bereich4) ?>
258 </select>
260 <?php echo $LDArea ?> 5:
261 <select name=bereich5 size=1>
262 <?php createselecttable($bereich5) ?>
263 </select>
264 <br>
265 </td>
266 <td valign=top><FONT SIZE=-1 FACE="Arial" color=#000080>
268 <?php echo $LDArea ?> 6:
269 <select name=bereich6 size=1>
270 <?php createselecttable($bereich6) ?>
271 </select>
273 <?php echo $LDArea ?> 7:
274 <select name=bereich7 size=1>
275 <?php createselecttable($bereich7) ?>
276 </select>
278 <?php echo $LDArea ?> 8:
279 <select name=bereich8 size=1>
280 <?php createselecttable($bereich8) ?>
281 </select>
283 <?php echo $LDArea ?> 9:
284 <select name=bereich9 size=1>
285 <?php createselecttable($bereich9) ?>
286 </select>
288 <?php echo $LDArea ?> 10:
289 <select name=bereich10 size=1>
290 <?php createselecttable($bereich10) ?>
291 </select>
292 <br>
293 </td>
294 <td valign="top"><FONT SIZE=1 FACE="verdana,Arial">
295 <font color=#000080 size=2><?php echo $LDAllowedArea ?>:</font><p>
296 <font size=2>
297 <?php
298 /**
299 * The following line calls the function contained in inc_accessplan_areas_functions.php
301 printAccessAreas();
304 </td>
305 </tr>
306 <tr bgcolor="#dddddd">
307 <td colspan=3><FONT SIZE=-1 FACE="Arial">
309 <input type="hidden" name="itemname" value="<?php echo $itemname ?>">
310 <input type="hidden" name="sid" value="<?php echo $sid; ?>">
311 <input type="hidden" name="lang" value="<?php echo $lang; ?>">
312 <input type="hidden" name="mode" value="save">
313 <input type="submit" value="<?php echo $LDSave ?>"> &nbsp;
314 <input type="reset" value="<?php echo $LDReset ?>">
315 </td>
316 </tr>
318 </table>
319 </td></tr>
320 </table>
321 </form>
324 <FORM method=get action="edv_user_access_list.php" >
325 <input type="hidden" name="sid" value="<?php echo $sid; ?>">
326 <input type="hidden" name="lang" value="<?php echo $lang; ?>">
327 <INPUT type="submit" value="<?php echo $LDCancel ?>"></font></FORM>
329 </FONT>
331 <?php endif; ?>
334 </ul>
336 </td>
337 </tr>
338 </table>
341 <?php
342 require($root_path.'include/inc_load_copyrite.php');
345 </FONT>
348 </BODY>
349 </HTML>