<?php
require dirname(__FILE__) . '/../tests/bootstrap.php';

$logger = new Dalten_Export_Api_Backend_Logger_Echo;
$rpc = new Serenity_Rpc_XmlRpc('http://import.sreality.cz/RPC2');
$backend = new Dalten_Export_Api_Backend_Sreality($rpc);
$backend->setLogger($logger);

$login = '4744';
$password = 'shestateshestate';
$softwareKey = 'dalt-001-ad';

$hash = $backend->getHash('4744');
$sessionId = $hash->output->sessionId;
$sessionIdFixed = substr($sessionId, 0, 48);
$hashKey = md5((string) $password) . (string) $softwareKey;
$sessionId = $sessionIdFixed . md5($sessionId . $hashKey);
$response = $backend->login($sessionId);

$sellers = array(1018,1028,1029,1033,1068,1163,1198,1360,1830,1697,1711,1750,1891,1892);


foreach ($sellers as $id) {
        $sessionId = $sessionIdFixed . md5($sessionId . $hashKey);


        $response = $rpc->delSeller(
                $sessionId,
                0,
                (string) $id
        );
}
