Mister Spy Say ="Hello Kids ... :D"
___ ____ _ _____
| \/ (_) | | / ___|
| . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _
| |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | |
| | | | \__ \ || __/ | /\__/ / |_) | |_| |
\_| |_/_|___/\__\___|_| \____/| .__/ \__, |
| | __/ |
|_| |___/
Bot Mister Spy V3
Mister Spy
Mister Spy
<?php
ini_set('memory_limit', '128M');
require_once('../library/class.sraservice.php');
require_once('../library/class.animales.php');
require_once('../library/class.pdre.php');
require_once('../library/class.pdres.php');
require_once('../library/class.exis.php');
require_once('../library/class.exiss.php');
require_once('../library/class.extr.php');
require_once('../library/class.extrs.php');
require_once('../library/class.sexos.php');
require_once('../library/class.mail.php');
function readCsv($filename) {
$rows = array();
$handle = fopen($filename, "r");
if ($handle) {
while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) {
$rows[] = $data;
}
fclose($handle);
}
return $rows;
}
function getAsoc($asoc) {
if ($asoc == 'BRASIL') {
return 291;
} elseif ($asoc == 'URUGUAY') {
return 25;
} elseif ($asoc == 'CHILE') {
return 70;
}
return 0;
}
function create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM) {
$oAnimales = new Animales();
$oExtrs = new Extrs();
$oExiss = new Exiss();
$oPdres = new Pdres();
$oAnimal = null;
$oAnimales = null;
$create = false;
// Si el código de asociación es 0 es nacional, sino es extranjero
if ($asocCodi != 0) {
$oAnimales = $oExtrs;
if (!$oAnimal = $oExtrs->GetAnimalBySBA($sba, $rp, Sexos::GetByNombre($sexo), $asocCodi)) {
$oAnimal = new Extr();
$create = true;
}
} else {
if (Sexos::GetByNombre($sexo) == Sexos::Macho) {
$oAnimales = $oPdres;
if (!$oAnimal = $oPdres->GetAnimalBySBA($sba, $rp)) {
$oAnimal = new Pdre();
$create = true;
}
} else {
$oAnimales = $oExiss;
if (!$oAnimal = $oExiss->GetAnimalBySBA($sba, $rp)) {
$oAnimal = new Exis();
$create = true;
}
}
}
$oAnimal->HBAE = $sba;
$oAnimal->RAZA = 4000;
$oAnimal->HBEX = $sba;
$oAnimal->ASOC = $asocCodi;
$oAnimal->ASOX = $asocCodi;
$oAnimal->RGST = null;
$oAnimal->RPEX = $rp;
$oAnimal->NOMB = $nombre;
$oAnimal->FNAC = $fnac;
$oAnimal->CPEL = $cpel;
$oAnimal->SEXO = Sexos::GetByNombre($sexo);
$oAnimal->ASOP = $asocP;
$oAnimal->HBAP = $sbaP;
$oAnimal->RPPD = $rpP;
$oAnimal->ASOM = $asocM;
$oAnimal->HBAM = $sbaM;
$oAnimal->RPMD = $rpM;
$oAnimal->PROP = 843440;
print_r($oAnimal);
print_r('<br><br>');
if ($create) {
$oAnimales->Create($oAnimal);
} else {
$oAnimales->Update($oAnimal);
}
}
try {
$oAnimales = new Animales();
$oExtrs = new Extrs();
$oExiss = new Exiss();
$oPdres = new Pdres();
$animales = readCsv('uruguay.csv');
if ($animales && count($animales) > 0) {
$count = 0;
foreach ($animales as $animal) {
if ($count == 0) {
$count++;
continue;
}
$asocCodi = getAsoc($animal[4]);
$asocCodiP = getAsoc($animal[5]);
$asocCodiM = getAsoc($animal[17]);
$asocCodiPP = getAsoc($animal[9]);
$asocCodiPM = getAsoc($animal[13]);
$asocCodiMP = getAsoc($animal[21]);
$asocCodiMM = getAsoc($animal[25]);
try {
// Creo animal
create($animal[0], $animal[1], $asocCodi, $animal[2], $animal[3], $animal[29], $animal[30], $animal[6], $animal[7], $asocCodiP, $animal[18], $animal[19], $asocCodiM);
// Creo padre
// create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM)
create($animal[6], $animal[7], $asocCodiP, 'MACHO', $animal[8], '2000-01-01', 1, $animal[10], $animal[11], $asocCodiPP, $animal[14], $animal[15], $asocCodiPM);
// Creo abuelo paterno
// create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM)
create($animal[10], $animal[11], $asocCodiPP, 'MACHO', $animal[12], '2000-01-01', 1, '', '', '', '', '', '');
// Creo abuela paterna
// create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM)
create($animal[14], $animal[15], $asocCodiPM, 'HEMBRA', $animal[16], '2000-01-01', 1, '', '', '', '', '', '');
// Creo madre
// create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM)
create($animal[18], $animal[19], $asocCodiM, 'HEMBRA', $animal[20], '2000-01-01', 1, $animal[22], $animal[23], $asocCodiMP, $animal[26], $animal[27], $asocCodiMM);
// Creo abuelo materno
// create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM)
create($animal[22], $animal[23], $asocCodiMP, 'MACHO', $animal[24], '2000-01-01', 1, '', '', '', '', '', '');
// Creo abuela materna
// create($sba, $rp, $asocCodi, $sexo, $nombre, $fnac, $cpel, $sbaP, $rpP, $asocP, $sbaM, $rpM, $asocM)
create($animal[26], $animal[27], $asocCodiMM, 'HEMBRA', $animal[28], '2000-01-01', 1, '', '', '', '', '', '');
// exit;
} catch(Exception $ex) {
echo '<li style="color: red">' . $ex->getMessage() . '</li>';
}
print_r('<br>----------------------------<br><br>----------------------------<br><br>----------------------------<br><br>----------------------------<br>');
print_r('<br>----------------------------<br><br>----------------------------<br><br>----------------------------<br><br>----------------------------<br>');
}
}
} catch (Exception $e) {
echo '<li style="color: red">' . $e->getMessage() . '</li>';
}
?>
Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat