2 error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
);
3 require('./roots.php');
4 require($root_path.'include/inc_environment_global.php');
6 * CARE2X Integrated Hospital Information System Deployment 2.2 - 2006-07-10
7 * GNU General Public License
8 * Copyright 2002,2003,2004,2005,2006 Elpidio Latorilla
11 * See the file "copy_notice.txt" for the licence notice
13 define('LANG_FILE','intramail.php');
14 $local_user='ck_intra_email_user';
15 require_once($root_path.'include/inc_front_chain_lang.php');
18 if(!isset($maxrow)||
(isset($maxrow)&&empty($maxrow))||
!isset($folder)||
(isset($folder)&&empty($folder))) { header("location:intra-email.php".URL_REDIRECT_APPEN
."&mode=listmail"); exit;}
19 if(isset($create)&&$create) {
20 $del0="t=$t&r=$r&f=$f&s=$s&d=$d&z=$z";
22 for($i=0;$i<$maxrow;$i++
) {
24 if(isset($
$delbuf)&&$
$delbuf){ $delok=1; break;}
27 if(!isset($delok)||
!$delok) {
28 header("location:intra-email.php".URL_REDIRECT_APPEND
."&mode=listmail"); exit;}
33 require_once($root_path.'include/inc_config_color.php'); // load color preferences
35 $thisfile=basename(__FILE__
);
36 //foreach($arg as $v) echo "$v<br>"; //init db parameters
37 $dbtable='care_mail_private_users';
40 $modetypes=array('sendmail','listmail');
42 $sql="SELECT $folder, lastcheck FROM $dbtable WHERE email='".$HTTP_COOKIE_VARS[$local_user.$sid]."'";
43 if($ergebnis=$db->Execute($sql))
45 if($ergebnis->RecordCount())
47 $result=$ergebnis->FetchRow();
48 $inb=explode("_",trim($result[$folder]));
49 for($i=0;$i<sizeof($inb);$i++
)
51 for($n=0;$n<$maxrow;$n++
)
54 if(!isset($
$delbuf)||
!$
$delbuf) continue;
55 $delbuf2=trim(strtr($
$delbuf,"+"," "));
56 //echo "$delbuf2<br>$inb[$i]<br>";
57 if(eregi($delbuf2,trim($inb[$i])))
59 $trash=array_splice($inb,$i,1);
65 $result[$folder]=implode("_",$inb);
66 $sql="UPDATE $dbtable SET $folder='".$result[$folder]."', lastcheck='".$result['lastcheck']."'
67 WHERE email='".$HTTP_COOKIE_VARS[$local_user.$sid]."'";
70 $ok=$db->Execute($sql);
71 if($ok&&$db->CommitTrans()) {
73 // update the recyle folder
76 $sql="SELECT trash, lastcheck FROM $dbtable WHERE email='".$HTTP_COOKIE_VARS[$local_user.$sid]."'";
77 if($ergebnis=$db->Execute($sql))
79 if($ergebnis->RecordCount())
81 $result=$ergebnis->FetchRow();
83 for($n=0;$n<$maxrow;$n++
)
86 if(!isset($
$delbuf)||
!$
$delbuf) continue;
87 $delbuf2=trim(strtr($
$delbuf,"+"," "));
88 //echo $delbuf2."<br>";
89 if($result['trash']=="") $result['trash']=$delbuf2."\r\n";
90 else $result['trash'].="_".$delbuf2."\r\n";
92 $sql="UPDATE $dbtable SET trash='".$result['trash']."', lastcheck='".$result['lastcheck']."'
93 WHERE email='".$HTTP_COOKIE_VARS[$local_user.$sid]."'";
95 $ok=$db->Execute($sql);
100 echo "$LDDbNoUpdate<br>$sql";
104 } else { echo "$LDDbNoRead<br>$sql"; }
106 header("location:intra-email.php?sid=$sid&lang=$lang&mode=listmail&l2h=$l2h&folder=$folder");
108 $db->RollbackTrans();
109 echo "$LDDbNoUpdate<br>$sql";
112 }else { echo "$LDDbNoRead<br>$sql"; }