error[]=$error; $this->counter[$type]++; $this->counter['total']++; } //geef het aantal fouten terug function aantal($type='total'){ return $this->counter[$type]; } //alle tot dan toe opgetreden errors negeren function clear(){ $this->counter=NULL; $this->error=NULL; } //errors weergeven function output(){ if(is_array($this->error)){ foreach($this->error as $key=>$val){ if(!empty($val['advanced'])){ $advanced=' (Geavanceerd)'; }else{ $advanced=NULL; } $output.=''.$val['text'].''.$advanced.'
'; } $output=venster("Er zijn fouten opgetreden",$output,"100%","both"); } return($output); } } $error=new error(); ?>output[$plaats]=NULL; }else{ $this->output=NULL; } $error->clear(); } //output toevoegen function add($text,$plaats='text'){ $this->output[$plaats].=$text; } //output returnen function draw($plaats='text'){ if($plaats=='text'){ global $error; $out= $error->output(); } $out.= $this->output[$plaats]; return $out; } } $output=new output; ?>add($text,$plaats); } //email versturens function email($adres,$subject,$file,$data='',$spoed=true){ global $error; global $config; global $sql; $inhoud=new layout("emails/".$file); if(is_array($data)){ $inhoud->assign($data); } $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers.="From:".$config['email']["from"]."\r\n"; $headers.="BCC:".$config['email']["report"]."\r\n"; $headers.="BCC:".$config['email']["report"]."\r\n"; //if($spoed){ @mail($adres,$subject,$inhoud->draw(),$headers) or $error->add("Het versturen van deze email is mislukt","mail",$adres); /*}else{ $sql->query("INSERT INTO `klanten`.`email` ( `id` , `tekst` , `titel` , `to` , `headers` ) VALUES ( NULL , '".$inhoud->draw()."', '".$subject."', '".$adres."', '".$headers."' ); "); }*/ } //cookie maken function cookie($naam,$inhoud,$tijd=0){ global $config; setcookie($naam,$inhoud,$tijd); } //ga naar function ganaar($url){ header("location: ". $url); } function datum($stamp,$mode="full"){ if($mode=="time"){ return date("H:i:s",$stamp); } elseif($mode=="date"){ return date("d-m-Y",$stamp); } else{ return date("d-m-Y H:i:s",$stamp); } } function write_backup($tabel,$id){ global $sql; $show=$sql->result("select * from ".$tabel." where id=".$id); $aant=count($show); $i=1; $keys="("; $vals="("; foreach($show as $key=>$val){ if($key=="id"){ $keys.="id_oud"; $vals.=$val; }else{ $keys.=$key; $vals.="'".$val."'"; } if($i<$aant){ $keys.=","; $vals.=","; } $i++; } $keys.=")"; $vals.=")"; $sql->query("insert into ".$tabel."_oud ".$keys." values ".$vals); } //klant specefiek script maken function ks(){ global $config; $config['ks']=true; } function no_layout(){ global $config; $config['parse_layout']=false; } ?>