head	1.3;
access;
symbols
	yes-v1-stable:1.3;
locks; strict;
comment	@# @;


1.3
date	2008.02.28.14.39.16;	author cvs;	state Exp;
branches;
next	1.2;

1.2
date	2008.02.28.11.09.24;	author cvs;	state Exp;
branches;
next	1.1;

1.1
date	2008.02.28.11.07.09;	author cvs;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Dateinamen crypten
@
text
@<?php
include('../inc/yes_get_sha1_from_string.inc.php');
include('includes/config.ebayapi.inc.php');
function _get_d($string){
	return yes_get_sha1_from_string($string);
}
function _get_fn($string){
	global $save_prefixes;
	$extensions = array('.pdf','.txt','.csv','.xml');
	foreach($save_prefixes as $k=>$v){
		if(strstr($string,$v)){
			$split = split($string,$v);
			$pre = $split[0];
			$do = substr($string,strlen($pre),strlen($string));
			foreach($extensions as $ke=>$ev){
				if(strstr($do,$ev)){
					$do_split = split($do,$ev);
					$do_ext = $do_split[0];
					$do_string = substr($do,0,(strlen($do)-strlen($do_ext)));
					break;
				}
			}
			if(!$do_ext)
				$do_ext = $do;
			$string = $pre.yes_get_sha1_from_string($do_string).$do_ext;
			break;
		}
	}
	return $string;
}
$excludes = array('auctionfees','RAexport','.','..');
$save_prefixes = array(
	'KOMPLETTPAKETLISTE_',
	'KOMPLETTPAKETLISTE_',
	'PRODUKTLISTE_',
	'DRUCKLISTE_GESAMT_',
	'HERMES-BESTELLSCHEIN-',
	'VORVERSANDLISTE_GESAMT_',
	'HERMESXML-',
	'RA_AUTOEXPORT_'
);


$versender = array('Danzas','GLS','Postpaket','Hermes','DPD','EasyToSend','Haus_Zustellung','Haus-Zustellung','Hermesweb','Intraship','Post','UPS','Gepard');
foreach($versender as $k=>$v){
	$save_prefixes[] = 'PAKETLISTE-'.$v.'_';
	$save_prefixes[] = strtolower($v);
}

@@unlink('exportdata/fee.tar.gz');
@@unlink('exportdata/auctionfees/gebuehren.csv');
@@unlink('exportdata/auctionfees/provision.csv');
@@rmdir('exportdata/auctionfees/');


$path = 'exportdata/';
$d = dir($path);
$directorys = array();
while (false !== ($entry = $d->read())) {
	if(is_dir($path.$entry) and !in_array($entry,$excludes)){
		$directorys[] = $entry;
	}
}
$d->close();
/*** FILES */
foreach($directorys as $k=>$v){
	$d = dir($path.$v.'/');
	while (false !== ($entry = $d->read())) {
		if(!in_array($entry,$excludes)){
			$new_name = _get_fn($entry);
			rename($path.$v.'/'.$entry,$path.$v.'/'.$new_name);
		}
	}
	$d->close();
}

/*** DIRECTORYS */
foreach($directorys as $k=>$v){
	rename($path.$v,$path._get_d($v));
}

/*** RA EXPORTE */
$path = 'exportdata/RAexport/';
$d = dir($path);
while (false !== ($entry = $d->read())) {
	if(!in_array($entry,$excludes)){
		$new_name = _get_fn($entry);
		rename($path.$entry,$path.$new_name);
	}
}
$d->close();
?>
@


1.2
log
@dateien verschl
@
text
@d4 3
d34 1
d39 2
a40 1
	'HERMESXML-'
d49 7
d65 1
a65 1
echo '<table border="1"><tr><td><b>Neu</b></td><td><b>Alt</b></td></tr>';
d70 2
a71 2
			$string_to_sha1 = _get_fn($entry);
			echo '<tr><td>'._get_fn($entry).'</td><td>'.$entry."</td></tr>";
d76 16
a91 1
echo '</table>';
@


1.1
log
@dateien verschl
@
text
@a32 2
	'gepard',
	'dpd',
d42 1
@

