<?php
include '../classes/class.loader.php';
$db = new db();

$user_id = $_SESSION['user_id'];
$check_for_blanks = $db->query("SELECT * FROM `user_animals` WHERE `user_id` = '$user_id' AND `name` = '' AND breed = '' AND date_of_birth = '' AND age = 0 AND sex = '' AND spay_neutered = '' AND last_vaccination_date = '' and regular_veterinarian = '' AND contact_number = '' AND insurance_name = '' AND insurance_contact = '' AND image_file = ''");
if ($check_for_blanks->num_rows > 0) {
    echo 2;
} else {
    $add_new_res = $db->query("INSERT INTO `user_animals`( `name`, `breed`, `date_of_birth`, `age`, `sex`, `spay_neutered`, `last_vaccination_date`, `regular_veterinarian`, `contact_number`, `insurance_name`, `insurance_contact`, `user_id`, `image_file`,`breeder_id`) VALUES ('','','',0,'','','','','','','',$user_id,'',0)");
    if ($add_new_res) {
        echo 1;
    } else {
        echo 0;
    }
}
