<?php

include("_dirinfo.php");
include (PATH_TO_ROOT."init.php");

$db->ChangeDatabase(DB_WARPIT_USERSPOOL);
if ($_FILES['uploadLink']['tmp_name']) {
	
	$id_project = $_POST['id_project'];
	
	$tmpName = 'telManagerUpload';
	$fh = fopen($_FILES['uploadLink']['tmp_name'], 'r');
	str_replace("\xAO", "\x20", $oldstring);
	while ( $struktura = str_replace(array("\n", "\r",),'',  trim( fgets($fh) ) ) )
	{
		$values[] = "( $id_project, '$struktura' ) ";
	}
	fclose($fh);
	$sql = "INSERT IGNORE INTO _RedirectLinks (id_project,wwwlink) VALUES ".implode(',',$values);
	$db->SQLexecute($sql);
	
	echo "{success: true}";
	exit;
}
echo "{success: false}";
?>