Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/userexit/exit_oncron.txt
<?php
//USEREXIT file
//Code placed here modifies standard odb functionality

/*
if(file_exists(cfg_data_path.'/ftp/data.txt'))
{
  echo 'data import'.CRLF;

  echo 'Backup...'.CRLF;
  rename(cfg_data_path.'/ftp/data.txt',cfg_data_path.'/ftp/data-'.date('Ymd').'.txt');
  echo 'Backup OK'.CRLF;

  
  //preparing proper csv file for import
  $file_path=cfg_data_path.'/ftp/data-'.date('Ymd').'.csv';
  $fp=fopen($file_path,'wb');
  
  //adding headers
  echo 'Adding headers...'.CRLF;
  fwrite($fp,'"Bestell Nr.","Material Nr.","Beschreibung","Kommentar für Marketing","Ländercode","Lieferdatum","Druckunterlagen Versand bis","Lieferant","Bestell Datum","Sachgruppe"'.CRLF);
  echo 'Adding headers OK'.CRLF;

  //utf8 encoding
  echo 'UTF8 encoding...'.CRLF;
  $content=file_get_contents(cfg_data_path.'/ftp/data-'.date('Ymd').'.txt');
  $content=conv($content,'iso-8859-2');
  fwrite($fp,$content);
  fclose($fp);
  echo 'UTF8 encoding OK'.CRLF;

  $result=import_data($file_path,'termine');
  
  if($result)
  {
    echo 'Success '.$result.CRLF;
    send_email('hide@address.com','data import OK','data import OK');
  }
  else
  {
    send_email('hide@address.com','data import FAILED','data import failed');
  }
}
*/

/*

$ServerName = '{pop.gmail.com:995/pop3/ssl/novalidate-cert}INBOX'; //gmail
$UserName = "hide@address.com";
$PassWord = "xxx";
import_emails($ServerName,$UserName,$PassWord);


*/


?>
Return current item: OpenBizMap