/** * @param User $user * @param Pet $pet * * @return bool whether user can edit the pet */ public static function userCanEditPet($user, $pet) { $res = false; if ($user && $pet && $pet->getOwner()) { $res = $pet->getOwner()->getId() === $user->getId(); } return $res; }
/** * Execute the console command. * * @return mixed */ public function fire() { echo "\n| This command will fake a whole lot of pet data! It will create\n"; echo "| as many pet records as you specify, and then associate five\n"; echo "| random pictures in /public/img/uploads with each new pet\n\n"; echo "How many pets would you like to fake?\n> "; $n = intval($this->ask('')); echo "working..."; //get size, user, and species ids $species_ids = []; $size_ids = []; $user_ids = []; Species::all()->each(function ($species) use(&$species_ids) { $species_ids[] = $species->id; }); Size::all()->each(function ($size) use(&$size_ids) { $size_ids[] = $size->id; }); User::all()->each(function ($user) use(&$user_ids) { $user_ids[] = $user->id; }); $names = ['fido', 'fluffy', 'muffins', 'whiskers', 'benji', 'kitty']; $colors = ['white', 'brown', 'black', 'calico', 'grey']; $descriptions = ['Use lap as chair. I am the best pooping rainbow while flying in a toasted bread costume in space lick yarn hanging out of own butt and stare at wall turn and meow stare at wall some more meow again continue staring . Stare at ceiling light eat grass, throw it back up, yet make meme, make cute face. Eat and than sleep on your face climb leg, so has closed eyes but still sees you. Hunt by meowing loudly at 5am next to human slave food dispenser drink water out of the faucet hide at bottom of staircase to trip human chew iPad power cord poop in litter box, scratch the walls yet fall over dead (not really but gets sypathy). Poop in the plant pot lick plastic bags. Sniff other cat\'s butt and hang jaw half open thereafter intently sniff hand get video posted to internet for chasing red dot attack feet, yet immediately regret falling into bathtub but run in circles. I am the best knock over christmas tree hunt anything that moves. Eat a plant, kill a hand. Sweet beast thug cat . Meow all night having their mate disturbing sleeping humans flop over, so ears back wide eyed. Please stop looking at your phone and pet me behind the couch claw drapes, eat from dog\'s food asdflkjaertvlkjasntvkjn (sits on keyboard). Pee in the shoe human is washing you why halp oh the horror flee scratch hiss bite.', 'Poop in litter box, scratch the walls refuse to drink water except out of someone\'s glass or leave dead animals as gifts, and put toy mouse in food bowl run out of litter box at full speed . Run in circles intently stare at the same spot. Lounge in doorway. Walk on car leaving trail of paw prints on hood and windshield cat snacks. Refuse to drink water except out of someone\'s glass pelt around the house and up and down stairs chasing phantoms eat prawns daintily with a claw then lick paws clean wash down prawns with a lap of carnation milk then retire to the warmest spot on the couch to claw at the fabric before taking a catnap, so if it smells like fish eat as much as you wish or the dog smells bad. Leave hair everywhere meowzer! so chew iPad power cord, and poop on grasses yet sleep on dog bed, force dog to sleep on floor. Stare at wall turn and meow stare at wall some more meow again continue staring touch water with paw then recoil in horror spread kitty litter all over house but all of a sudden cat goes crazy chase laser instantly break out into full speed gallop across the house for no reason. Cat is love, cat is life. Sweet beast destroy the blinds pee in human\'s bed until he cleans the litter box, stare at wall turn and meow stare at wall some more meow again continue staring yet brown cats with pink ears and curl into a furry donut. Jump around on couch, meow constantly until given food, sit in box. Hide from vacuum cleaner human give me attention meow but has closed eyes but still sees you. Bathe private parts with tongue then lick owner\'s face lick butt love to play with owner\'s hair tie but poop in the plant pot for inspect anything brought into the house find something else more interesting. Mark territory mark territory stare out the window, but leave hair everywhere claws in your leg and get video posted to internet for chasing red dot. When in doubt, wash spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce but hunt by meowing loudly at 5am next to human slave food dispenser. Meow for food, then when human fills food dish, take a few bites of food and continue meowing jump launch to pounce upon little yarn mouse, bare fangs at toy run hide in litter box until treats are fed hack up furballs. Eat and than sleep on your face pelt around the house and up and down stairs chasing phantoms but touch water with paw then recoil in horror meow chase mice. I like big cats and i can not lie meowing non stop for food, tuxedo cats always looking dapper or hack up furballs asdflkjaertvlkjasntvkjn (sits on keyboard). Mark territory attack the dog then pretend like nothing happened shake treat bag, rub face on everything, for damn that dog . Get video posted to internet for chasing red dot sniff other cat\'s butt and hang jaw half open thereafter unwrap toilet paper i like big cats and i can not lie yet present belly, scratch hand when stroked, so poop on grasses chew foot. Meow paw at beetle and eat it before it gets away, eat from dog\'s food sun bathe, but scratch leg; meow for can opener to feed me but spit up on light gray carpet instead of adjacent linoleum and the dog smells bad. Leave hair everywhere kitty power! , human is washing you why halp oh the horror flee scratch hiss bite hide from vacuum cleaner meow all night having their mate disturbing sleeping humans. Mark territory spread kitty litter all over house play riveting piece on synthesizer keyboard thug cat . Hopped up on catnip purr while eating but scream at teh bath, make meme, make cute face or lick plastic bags yet spit up on light gray carpet instead of adjacent linoleum. Hide head under blanket so no one can see.', 'Eat from dog\'s food. Paw at beetle and eat it before it gets away play time, yet meow chase ball of string has closed eyes but still sees you hide when guests come over, and have secret plans. White cat sleeps on a black shirt stretch destroy couch as revenge. Leave hair everywhere put toy mouse in food bowl run out of litter box at full speed but asdflkjaertvlkjasntvkjn (sits on keyboard) ears back wide eyed yet my left donut is missing, as is my right asdflkjaertvlkjasntvkjn (sits on keyboard), or stare at ceiling. Vommit food and eat it again sun bathe intently sniff hand, fall over dead (not really but gets sypathy) paw at beetle and eat it before it gets away, for meow under the bed.']; $status = ['lost', 'found', 'adoptable']; $age = ['baby', 'young', 'adult', 'senior']; $gender = ['male', 'female', 'unknown']; $a_num = ['342335', '234567', '234412', '123123', '123345', '345345']; $breeds = ['doberman', 'short hair', 'long hair', 'husky']; $images = explode("\n", trim(`ls public/img/uploads`)); for ($i = 0; $i < $n; $i++) { if ($i % 10 == 0) { echo '.'; } $pet = new Pet(); $pet->name = $names[array_rand($names)]; $pet->species_id = $species_ids[array_rand($species_ids)]; $pet->status = $status[array_rand($status)]; $pet->color = $colors[array_rand($colors)]; $pet->age = $age[array_rand($age)]; $pet->description = $descriptions[array_rand($descriptions)]; $pet->gender = $gender[array_rand($gender)]; $pet->a_num = $a_num[array_rand($a_num)]; $pet->breed = $breeds[array_rand($breeds)]; $pet->size_id = $size_ids[array_rand($size_ids)]; $pet->user_id = $user_ids[array_rand($user_ids)]; $pet->save(); for ($j = 0; $j < 5; $j++) { $img = new Image(); $img->pet_id = $pet->id; $img->img_path = '/img/uploads/' . $images[array_rand($images)]; $img->save(); } } echo "\n"; $this->info('pets created!'); }
/** * Increase a pet's happiness level. * * Increases the pet's happiness level and destroys the item. * * @param Pet $pet * @param integer $quantity * @return string The success message. **/ public function playWith(Pet $pet, $quantity) { if ($quantity > $this->getQuantity()) { throw new ArgumentError("This stack does not have {$quantity} items."); } $pet->play($this->getHappinessBonus() * $quantity); $this->updateQuantity($this->getQuantity() - $quantity); return "{$pet->getPetName()} is happier now."; }
/** * Feed the item to a specified pet. * * Increases pet's hunger level and destroys the item. * * @param Pet $pet * @return string The success message. **/ public function feedTo(Pet $pet, $quantity) { if ($quantity > $this->getQuantity()) { throw new ArgumentError("This stack does not have {$quantity} items."); } // Do it before destroying the object. $pet->consume($this->getHungerBonus() * $quantity); $text = "You have fed {$pet->getPetName()} {$this->makeActionText($quantity)}."; $this->updateQuantity($this->getQuantity() - $quantity); return $text; }
/** * Render the Pet page */ public function renderPet() { $view_data['page_title'] = $this->pet->getName(); $view_data['pet'] = $this->pet; // Check if pet can be edited if (isset($this->logged_in_user) && PetUtils::userCanEditPet($this->logged_in_user, $this->pet)) { $view_data['edit_mode'] = true; } $this->renderTemplate('templates/header.php', $view_data); $this->renderTemplate('templates/pet_viewer_view.php', $view_data); $this->renderTemplate('templates/footer.php', $view_data); }
public function save(Pet $pet) { $petArray = ['age' => $petOwner->getAge(), 'hunger' => $petOwner->getHunger(), 'stress' => $petOwner->getStress(), 'alive' => $petOwner->getAlive()]; try { if ($pet->getNewborn()) { $this->insert('pet', $petArray); } else { $this->update('pet', $petArray, "pet_id = {$pet->getId}"); } } catch (Exception $e) { throw new Exception($e->getMessage()); } }
function play() { // Call the Pet::play() method: parent::play(); echo "<p>$this->name is fetching.</p>"; }
/** *echo "dog's name" is fetching */ function play() { parent::play(); //echo Satchel is playing echo "<p>{$this->name} is fetching. </p>"; //echo Satchel is fetching. }
/** * Execute the console command. * * @return mixed */ public function fire() { echo "\n--- Lets create some pet postings! ---\n\n"; echo "| This will create a new pet record with the prompted information,\n"; echo "| a random status, age, and color, and user, species, and breed\n"; echo "| ids that belong to the first record of each in the database.\n\n"; echo "| This command will also get a list of the files in /img/uploads\n"; echo "| and select one at random from the list to create a new image\n"; echo "| object and record to tie to the pet object we just created.\n\n"; echo "name \n> "; $name = $this->ask(''); echo "color\n> "; $color = $this->ask(''); echo "description\n> "; $description = $this->ask(''); $species = ['cat', 'dog', 'other']; $species = $species[array_rand($species)]; $status = ['lost', 'found', 'adoptable']; $status = $status[array_rand($status)]; $age = ['baby', 'young', 'adult', 'senior']; $age = $age[array_rand($age)]; $gender = ['male', 'female', 'unknown']; $gender = $gender[array_rand($gender)]; $a_num = ['342335', '234567', '234412', '123123', '123345', '345345']; $a_num = $a_num[array_rand($a_num)]; $pet = new Pet(); $pet->name = $name; $pet->species_id = Species::first()->id; $pet->status = $status; $pet->color = $color; $pet->age = $age; $pet->description = $description; $pet->gender = $gender; $pet->a_num = $a_num; $pet->breed_id = Breed::first()->id; $pet->user_id = User::first()->id; $pet->save(); $images = explode("\n", trim(`ls public/img/uploads`)); $petImg = $images[array_rand($images)]; $img = new Image(); $img->pet_id = $pet->id; $img->img_path = "/img/uploads/{$petImg}"; $img->save(); $this->info('pet created!'); }
public function editService(Service $service) { $allPets = Pet::all(); $pets = array(); foreach ($allPets as $pet) { $pets[$pet->id] = $pet->name; } return View::make('edit_service', compact('service', 'pets')); }
public function run() { User::create(['id' => 1, 'cedula' => '1014777780', 'name' => 'Administrador', 'password' => \Hash::make('1014777780'), 'email' => 'admin@mansion_mascota.com', 'phone' => '2621244', 'type' => 'admin']); User::create(['id' => 2, 'cedula' => '0812757578', 'name' => 'Usuario de pruebas', 'password' => \Hash::make('0812757578'), 'email' => 'test@mansion_mascota.com', 'phone' => '2621244', 'type' => 'admin']); $faker = Faker::create(); foreach (range(1, 10) as $index) { $user = User::create(['cedula' => $faker->randomNumber(10), 'name' => $faker->name, 'password' => \Hash::make('123456'), 'email' => $faker->email, 'phone' => $faker->phoneNumber, 'type' => 'user']); foreach (range(1, $faker->numberBetween(1, 2)) as $date) { $pet = Pet::create(['user_id' => $user->id, 'name' => $faker->firstName(), 'type' => $faker->randomElement(['perro', 'gato', 'pajaro', 'otro'])]); } foreach (range(1, $faker->numberBetween(1, 3)) as $date) { Appointment::create(['user_id' => $user->id, 'pet_id' => $pet->id, 'date' => $faker->dateTimeBetween('now', '+3 months'), 'note' => $faker->text(100 + $faker->numberBetween(10, 150))]); } } }
/** * Create a Basket instance given a user's id * @param mixed $userId * @return \Basket */ public function constructByUserId($userId) { $basketRows = Model\Basket::selectBasketByUserId($userId); $pets = array(); if (is_array($basketRows)) { foreach ($basketRows as $i => $row) { $parts = explode(':', $row['pet_id']); if (isset($parts[1])) { $pet = Pet::constructById($parts[1]); $pet->loadImages(); $pets[] = $pet; } } } return new Basket($userId, $pets); }
public static function is_watch_list_eligible($pet_wk, $watch_list_wk) { global $session; global $database; $pet = Pet::find_by_id($pet_wk); $watch_list_detail = Watch_List_Detail::find_by_sql("SELECT * FROM `watch_list_detail` WHERE `watch_list_wk` = " . $watch_list_wk . ";"); //echo '<pre>' . var_export($watch_list_detail, true) . '</pre>'; //debug //generate the dynamic MySQL statement $sql = "SELECT `p`.* FROM `pet` AS `p` "; $sql .= "INNER JOIN `breed` AS `b` ON `b`.`breed_wk` = `p`.`breed_wk` "; $sql .= "INNER JOIN `pet_type` AS `pt` ON `pt`.`pet_type_wk` = `b`.`pet_type_wk` "; $sql .= "WHERE `p`.`is_deleted` = 0 AND `p`.`pet_wk` = " . $pet_wk . " "; //loop through each criteria, determine if it's eligible foreach ($watch_list_detail as $item) { //if one of the min or max fields if (in_array($item->column_name, array('age_min', 'age_max', 'weight_min', 'weight_max'))) { if ($item->column_name == 'age_min') { $sql .= "AND `age` >= " . $item->value . " "; } else { if ($item->column_name == 'age_max') { $sql .= "AND `age` <= " . $item->value . " "; } else { if ($item->column_name == 'weight_min') { $sql .= "AND `weight` >= " . $item->value . " "; } else { if ($item->column_name == 'weight_max') { $sql .= "AND `weight` <= " . $item->value . " "; } } } } } else { //not one of the min or max fields $sql .= "AND " . ($item->column_name == 'pet_type' ? '`pt`' : '`p`') . ".`" . $item->column_name . "_wk` = " . $item->value . " "; } } $sql .= ";"; $result = Pet::find_by_sql($sql); //if the count of animals returned is 1, return true //else, return false if (count($result) == 1) { return true; } else { return false; } }
/** * Change a pet's color to the paintbrush's color (if available). * * Changes the pet's pet_specie_color_id and destroys the item. * * If a pet doesn't have the specific color built out in * pet_specie_pet_specie_color, a failure message will be shown and the * item will not be destroyed. * * @param Pet $pet * @return string The success (or failure) message. **/ public function paint(Pet $pet) { $color = new PetSpecie_PetSpecieColor($this->db); $color = $color->findOneBy(array('pet_specie_id' => $pet->getPetSpecieId(), 'pet_specie_color_id' => $this->getPetSpecieColorId())); // It's possible that that particular color is not built out for // that species (ie, nobody f*****g drew it). Handle that. if ($color == null) { return "You put the brush down, realizing that this color is not available for your pet."; } elseif ($pet->getPetSpecieColorId() == $color->getPetSpecieColorId()) { return "You frown and notice that {$pet->getPetName()} is already painted in {$color->getColorName()}."; } $pet->setPetSpecieColorId($color->getPetSpecieColorId()); $pet->save(); $this->updateQuantity($this->getQuantity() - 1); return "{$pet->getPetName()} looks snazzy in <strong>{$color->getColorName()}</strong>!"; }
public static function LoadPets($character_id, $locale) { $db = ConnectCharacterDatabase($locale); $ret = array(null, null, null); $q = $db->query("\r\nSELECT\r\n\tpetcashid1, petcashid2, petcashid3\r\nFROM\r\n\tcharacters\r\nWHERE\r\n\tinternal_id = " . $character_id); if ($q->num_rows > 0) { $data = $q->fetch_row(); for ($i = 0; $i < 3; $i++) { if ($data[$i] != 0) { $ret[$i] = Pet::LoadPet($character_id, $locale, $data[$i], $i + 1); } } } $q->free(); return $ret; }
<?php //require the framework require_once "../requires/initialize.php"; // create the page $page = new Page(); $page->name = "Add a Pet"; $page->is_admin_only = true; // this page allows ADMINs and STAFFs to add new pets /* Add Pet */ // Add the pet if the form is submitted if (isset($_POST["submit"])) { // create the new pet $new_pet = new Pet(); // check for name if (isset($_POST["name"])) { $new_pet->name = $_POST["name"]; } // check for breed/pet type if (isset($_POST["breed"])) { $new_pet->breed_wk = $_POST["breed"]; } // check for color $new_pet->color_wk = $_POST["color"]; // check for status $new_pet->status_wk = $_POST["status"]; // check for age $new_pet->age = $_POST["age"]; // check for weight $new_pet->weight = $_POST["weight"]; // check for rescued
/** * Fetch the userId and username of the poster of a pet and return a JSON formatted string with this data * @return string in JSON format */ public static function getPosterInfo() { $get = Core\Input::get(); if (isset($get['petId'])) { $pet = Pet::constructById($get['petId']); $userId = $pet->getUserId(); $user = User::constructById($userId); $userName = $user->getUsername(); return json_encode(array('userId' => $userId, 'userName' => $userName)); } return '{}'; }
//require the framework require_once "../requires/initialize.php"; // create the page $page = new Page(); $page->name = "Color Management"; $page->is_admin_only = true; // this page allows ADMINs and STAFFs to view colors, create new colors, // update current colors and delete current colors // if deleting a color if (isset($_GET["delete_color_wk"])) { $delete_color = Color::find_by_id($_GET["delete_color_wk"]); // check if any pets are referencing this color key // if they are, reassign them to 'color_wk' = 0 // which should be reserved for default "undefined" color while ($pet = Pet::find_by_name($delete_color->color_wk, "color_wk")) { $failed = false; // tracks if any of the color reassignments were not successful $pet->color_wk = 0; if ($pet->save()) { $session->message($session->message . $pet->name . "'s color changed to " . $pet->color_wk . ". "); } else { $session->message($session->message . "Unable to reassign " . $pet->name . "'s color at this time. "); $failed = true; } } // try to delete the color if (!$failed) { if ($delete_color->delete()) { $session->message($session->message . "The color " . $delete_color->name . " was successfully deleted! "); redirect_head(ROOT_URL . "admin/manage_colors.php");
/** * Created by PhpStorm. * User: ET * Date: 6/26/2015 * Time: 5:34 PM */ include 'Dog.php'; include 'Cat.php'; echo Pet::getCount() . "<-Total Pet object<br>"; // 0 $dog = new Dog('Satchel'); echo Pet::getCount() . "<-Total Pet object<br>"; // 1 $cat = new Cat('Bucky'); echo Pet::getCount() . "<-Total Pet object<br>"; // 2 $dog->eat(); $cat->eat(); $dog->sleep(); $cat->sleep(); $dog->play(); $cat->play(); echo "Unset dog object<br>"; unset($dog); echo Pet::getCount() . " Pet instance left<br>"; // 1 echo "Unset cat instance<br>"; unset($cat); echo Pet::getCount() . " Pet instance left<br>"; // 0 //unset($dog, $cat);
<?php require_once __DIR__ . '/../vendor/autoload.php'; require_once __DIR__ . '/../src/Pet.php'; session_start(); if (empty($_SESSION['list_of_pets'])) { $_SESSION['list_of_pets'] = array(); } $app = new Silex\Application(); $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . "/../views")); $app->get('/', function () use($app) { return $app['twig']->render('index.html.twig', array('pets' => Pet::getAll())); }); $app->post('/pet_list', function () use($app) { $pet = new Pet($_POST['nameInput']); $pet->savePet(); return $app['twig']->render('pet_list.html.twig', array('newPet' => $pet)); }); $app->post('/feed', function () use($app) { $testPet = $_SESSION['list_of_pets'][0]; $testPet->addFood(); var_dump($testPet); return $app['twig']->render('feed.html.twig'); }); $app->post('/genocide', function () use($app) { Pet::deleteAll(); return $app['twig']->render('genocide.html.twig'); }); return $app;
public function __construct($name, $years, $breed) { parent::__construct($name, $years); $this->breed = $breed; }
/** * Instantiate a Pet from a pet table row * @param array $row a row of the Pet table * @return \Pet */ public static function constructByRow($row) { if (isset($row['id'])) { $pet = new Pet($row['name'], $row['description'], $row['special_needs'], $row['weight'], $row['species'], $row['breed'], $row['age'], $row['sex'], $row['user_id'], $row['adoption_id'], $row['created'], $row['updated'], $row['visibility'], $row['approved']); $pet->setId($row['id']); return $pet; } return null; }
/** * Method description * * @return mixed The return value */ public function beforeValidate() { $this->breed = $this->breeds[$this->breed]; return parent::beforeValidate(); }
public function __construct($money, $name, $age) { parent::__construct($name, $age); $this->money = $money; }
/** * Update a pet by id * * @param Pet $pet * * @return bool */ public function updatePet($pet) { $id = $pet->getId(); $name = $pet->getName(); $experience = $pet->getExperience(); $brawn = $pet->getBrawn(); $guts = $pet->getGuts(); $essence = $pet->getEssence(); $speed = $pet->getSpeed(); $focus = $pet->getFocus(); $grit = $pet->getGrit(); $active = intval($pet->isActive()); $this->updatePetStatement->bind_param("siiiiiiiii", $name, $experience, $brawn, $guts, $essence, $speed, $focus, $grit, $active, $id); return $this->updatePetStatement->execute(); }
/** * echo "cat's name" is climbing */ function play() { parent::play(); echo "<p>{$this->name} is climbing</p>"; }
public function run() { $pet2 = new Pet(); $pet2->name = 'Sheba'; $pet2->status = 'available'; $pet2->color = 'mixed'; $pet2->age = 'adult'; $pet2->description = 'Hello! My name is Sheba, & I\'m a 3 year old cattle dog/lab mix. My last humans didn\'t take very good care of me, so the city took me away from them. Since they didn\'t love me enough to keep me healthy, I am heart worm positive and have a slight kennel cough. But don\'t worry! My amazing foster parents have started me on medications, & soon I\'ll be good as new! I dream every night about my new family. I really need a human that loves to play fetch and play outdoors as much as I do! I am very good at going potty outside and have exceptional inside manners. Most of all, I have so much love to give! I am silly, energetic, and despite my past, have such a good heart. Will you please open up yours and give me a chance? -Sheba'; $pet2->gender = 'Female'; $pet2->breed = 'Australian Cattle Dog/Blue Heeler / Labrador Retriever / Mixed (short coat)'; $pet2->user_id = User::first()->id; $pet2->species_id = '1'; $pet2->size_id = '2'; $pet2->a_num = 'A364168'; $pet2->save(); $pet2_img1 = new Image(); $pet2_img1->img_path = 'img/petimg/sheba1.png'; $pet2_img1->pet_id = $pet2->id; $pet2_img1->save(); $pet2_img2 = new Image(); $pet2_img2->img_path = 'img/petimg/sheba2.jpg'; $pet2_img2->pet_id = $pet2->id; $pet2_img2->save(); $pet3 = new Pet(); $pet3->name = 'Maribel'; $pet3->status = 'available'; $pet3->color = 'Tan and White'; $pet3->age = 'adult'; $pet3->description = 'Maribel is a very sweet, and loving gentle giant. She loves to be the center of attention. Maribel loves to play fetch, knows sit and stay. She gets along great with other dogs and likes to play with kids. Her favorite time of the day is Dinnertime :) Sweet Maribel has been through a lot in her short life, but despite it all she\'s still very loving and happy. She will make a great addition to any family!'; $pet3->gender = 'Female'; $pet3->breed = 'American Pit Bull Terrier (short coat)'; $pet3->user_id = User::first()->id; $pet3->species_id = '1'; $pet3->size_id = '3'; $pet3->a_num = 'A364378'; $pet3->save(); $pet3_img1 = new Image(); $pet3_img1->img_path = 'img/petimg/maribel1.jpg'; $pet3_img1->pet_id = $pet3->id; $pet3_img1->save(); $pet3_img2 = new Image(); $pet3_img2->img_path = 'img/petimg/maribel2.jpg'; $pet3_img2->pet_id = $pet3->id; $pet3_img2->save(); $pet4 = new Pet(); $pet4->name = 'Max'; $pet4->status = 'available'; $pet4->color = 'tan'; $pet4->age = 'adult'; $pet4->description = 'Max is a 25lb mixed Chihuahua that is sweet as can be. He is house, crate, & leash trained. He loves, I mean LOVES to play fetch with his ball. Max would do best with an active family that would already have another dog in their home. He loves to play & snuggle with other dogs. Max is just now learning that cats are ok, but he does still try chasing them. Max does great with kids. Max loves being outside. If you have a doggy door he would put it to excellent use. If you are looking for a cutie to snuggle with than Max is your boy.'; $pet4->gender = 'Male'; $pet4->breed = 'Chihuahua / Mixed (short coat)'; $pet4->user_id = User::first()->id; $pet4->species_id = '1'; $pet4->size_id = '1'; $pet4->a_num = 'A310113'; $pet4->save(); $pet4_img1 = new Image(); $pet4_img1->img_path = 'img/petimg/max1.png'; $pet4_img1->pet_id = $pet4->id; $pet4_img1->save(); $pet4_img2 = new Image(); $pet4_img2->img_path = 'img/petimg/max2.jpg'; $pet4_img2->pet_id = $pet4->id; $pet4_img2->save(); $pet5 = new Pet(); $pet5->name = 'Nilla'; $pet5->status = 'available'; $pet5->color = 'white'; $pet5->age = 'adult'; $pet5->description = 'Nilla is filled with energy and gets along with all animals. She is very submissive and can be trusted with small children. She is looking for a loving forever home. She was scheduled to be euthanized, but San Antonio Pets Alive! saved her and now they are helping her find the forever, loving home that she has never known.'; $pet5->gender = 'Female'; $pet5->breed = 'Labrador Retriever / Mixed (short coat)'; $pet5->user_id = User::first()->id; $pet5->species_id = '1'; $pet5->size_id = '2'; $pet5->a_num = 'A346070'; $pet5->save(); $pet5_img1 = new Image(); $pet5_img1->img_path = 'img/petimg/nilla1.jpg'; $pet5_img1->pet_id = $pet5->id; $pet5_img1->save(); $pet5_img2 = new Image(); $pet5_img2->img_path = 'img/petimg/nilla2.jpg'; $pet5_img2->pet_id = $pet5->id; $pet5_img2->save(); $pet6 = new Pet(); $pet6->name = 'Sebastian'; $pet6->status = 'available'; $pet6->color = 'orange'; $pet6->age = 'baby'; $pet6->description = 'Sebastian is a super lovable little guy who is missing his freedom to run around. He and his siblings had to be returned to the shelter because we the fosters took in our grandmother which has been placed on hospice. Our furr babies were getting to be too much for us to handle with grandma in the house. Sebastian has grown up knowing how to sleep quietly in a crate and play with our sweet pup. He has been around a 2yo and has been fine with her picking him up kinda crazy like, but hasnt had prolonged contact with toddlers. he is fine with the litterbox and LOVES to stare out the window at the birds at the feeder. He is definitely a real lovebug. one wierd trait, he loves the smell of irish spring bar soap. Its like cat nip to him!! whenever my husband would get out of the shower he would attack his feet ;-P Please give sebastian a home he will love you for ever!!! '; $pet6->gender = 'Male'; $pet6->breed = 'Domestic Short Hair / Tabby (short coat)'; $pet6->user_id = User::first()->id; $pet6->species_id = '2'; $pet6->size_id = '1'; $pet6->a_num = 'A330726'; $pet6->save(); $pet6_img1 = new Image(); $pet6_img1->img_path = 'img/petimg/sebastian1.png'; $pet6_img1->pet_id = $pet6->id; $pet6_img1->save(); $pet6_img2 = new Image(); $pet6_img2->img_path = 'img/petimg/sebastian2.jpg'; $pet6_img2->pet_id = $pet6->id; $pet6_img2->save(); $pet7 = new Pet(); $pet7->name = 'Matty'; $pet7->status = 'available'; $pet7->color = 'white'; $pet7->age = 'young'; $pet7->description = ' I can fit perfectly on your lap! Matty ID#297703 is a male, one-year old Chihuahua & Rat Terrier blend. He is a completely ADORABLE and tiny little dog ... the quintessential little lap dog. He loves going for walks and he does well with other dogs. Please come meet him and fall in love! He is neutered, current on vaccinations, microchipped and his adoption comes with one free month of pet health insurance. '; $pet7->gender = 'Male'; $pet7->breed = 'Chihuahua / Rat Terrier / Mixed (short coat)'; $pet7->user_id = User::first()->id; $pet7->species_id = '1'; $pet7->size_id = '2'; $pet7->a_num = 'A297703'; $pet7->save(); $pet7_img1 = new Image(); $pet7_img1->img_path = 'img/petimg/matty1.jpg'; $pet7_img1->pet_id = $pet7->id; $pet7_img1->save(); $pet7_img2 = new Image(); $pet7_img2->img_path = 'img/petimg/matty2.jpg'; $pet7_img2->pet_id = $pet7->id; $pet7_img2->save(); $pet8 = new Pet(); $pet8->name = 'Alex AKA Jade'; $pet8->status = 'available'; $pet8->color = 'white and black'; $pet8->age = 'young'; $pet8->description = 'Jade is one of the most loyal dogs I\'ve had the pleasure of fostering. She is full of love and just wants it back in return. She has to be the only dog and absolutely NO cats. She\'s very dominant so would make someone\'s best friend if you can have her as your only pet. She is an INSIDE dog she sleeps with my 3 year old and I. She protects the children as well as myself and sister. Please only serious inquiries. She\'s so full of love and deserves a forever home that can reciprocate her love. '; $pet8->gender = 'Female'; $pet8->breed = 'Great Dane / American Staffordshire Terrier (short coat)'; $pet8->user_id = User::first()->id; $pet8->species_id = '1'; $pet8->size_id = '3'; $pet8->a_num = 'A303622'; $pet8->save(); $pet8_img1 = new Image(); $pet8_img1->img_path = 'img/petimg/jade1.jpg'; $pet8_img1->pet_id = $pet8->id; $pet8_img1->save(); $pet8_img2 = new Image(); $pet8_img2->img_path = 'img/petimg/jade2.jpg'; $pet8_img2->pet_id = $pet8->id; $pet8_img2->save(); $pet9 = new Pet(); $pet9->name = 'Patch'; $pet9->status = 'available'; $pet9->color = 'white'; $pet9->age = 'adult'; $pet9->description = 'Patch is Special Needs as he distrusts people and can be quite aggressive. He was severely abused and neglected as his intake photos clearly show. He is a lover once he attaches to his one person, though. It takes about an hour once he is out of his crate and lots of treats. Then he wants to cuddle in your lap. He loves gentle ear rubs and gives kisses all the time. Patch is very quiet, not a yappy guy. Loves to be held and with his person as much as possible. He shows some interest in balls and play, but is more interested in attention. He has NEVER been destructive when left alone nor has he ever had an accident while in my home. Patch does fine with small dogss, and would do best in a single person home with very little human traffic (or at least where he could be put in a room away from anyone other then his person). He has come a very long way, and now needs his own person and a loving place to call home. '; $pet9->gender = 'Male'; $pet9->breed = 'Chihuahua / Rat Terrier / Mixed (short coat)'; $pet9->user_id = User::first()->id; $pet9->species_id = '1'; $pet9->size_id = '1'; $pet9->a_num = 'A303587'; $pet9->save(); $pet9_img1 = new Image(); $pet9_img1->img_path = 'img/petimg/patch1.jpg'; $pet9_img1->pet_id = $pet9->id; $pet9_img1->save(); $pet9_img2 = new Image(); $pet9_img2->img_path = 'img/petimg/patch2.jpg'; $pet9_img2->pet_id = $pet9->id; $pet9_img2->save(); $pet10 = new Pet(); $pet10->name = 'Avery'; $pet10->status = 'available'; $pet10->color = 'calico'; $pet10->age = 'young'; $pet10->description = 'FeLV+ Special Needs. Avery ID# 22316659 is a beautiful female, young adult Calico. She is a very sweet, quiet and gentle kitty. Avery is special needs because she is FeLV+positive. She is currently healthy. FeLV+ cats typically live up to 4 years or so after receiving their diagnosis and for the remainder of their life, they can only live with dogs, other non-feline pets, or o ther cats who are also FeLV+positive. They need to remain indoors always, eat a nutritionally-balanced diet and have veterinary care if they ever show signs of illness. Because Avery is FeLV+, her adoption fee is waived. She is spayed, current on vaccinations, microchipped and her adoption comes with one free month of pet health insurance. You can meet her at PETCO Ingram Park, 6001 NW Loop 410, San Antonio, TX 78238. Hours are Mondays-Fridays 11 a.m. until 8 p.m.; Saturdays & Sundays 10 a.m. until 7 p.m. For additional information, please write to petco.ingram@sanantoniopetsalive.org AND to Adopt@sanantoniopetsalive.org or call 220-370-7612. When inquiring about this pet, please be sure to give the pet\'s ID#.'; $pet10->gender = 'Female'; $pet10->breed = 'Domestic Short Hair'; $pet10->user_id = User::first()->id; $pet10->species_id = '2'; $pet10->size_id = '1'; $pet10->a_num = '22316659'; $pet10->save(); $pet10_img1 = new Image(); $pet10_img1->img_path = 'img/petimg/avery1.jpg'; $pet10_img1->pet_id = $pet10->id; $pet10_img1->save(); $pet10_img2 = new Image(); $pet10_img2->img_path = 'img/petimg/avery2.jpg'; $pet10_img2->pet_id = $pet10->id; $pet10_img2->save(); $pet12 = new Pet(); $pet12->name = 'Angel'; $pet12->status = 'available'; $pet12->color = 'tan and white'; $pet12->age = 'baby'; $pet12->description = 'Angel is a female, 12-week old American Staffy blend. Angel weighs approximately 10 1/2 pounds. Once she is spayed she will be adoption ready! If interested please inquire and we can make arrangements for a meet and greet and possible adoption. Angel is a bundle of energy. She loves to romp and play with her toys. Angel is cuddle bug and loves to give lots of hugs and kisses. Angel can be a laid back kind of girl, but she can keep up with her siblings in the playful puppy department. She has never been around young kids or cat. I have a teenage son and they love to play and chase him all around the house. Angel will be spayed, microchipped, current on vaccinations, and her adoption comes with one free month of pet health insurance! Please email me to meet this little bundle of love and remember ... when you adopt a puppy you are making a lifetime commitment to that puppy!'; $pet12->gender = 'Female'; $pet12->breed = 'American Staffordshire Terrier (short coat)'; $pet12->user_id = User::first()->id; $pet12->species_id = '1'; $pet12->size_id = '2'; $pet12->a_num = 'A360560'; $pet12->save(); $pet12_img1 = new Image(); $pet12_img1->img_path = 'img/petimg/angel1.jpg'; $pet12_img1->pet_id = $pet12->id; $pet12_img1->save(); $pet12_img2 = new Image(); $pet12_img2->img_path = 'img/petimg/angel2.jpg'; $pet12_img2->pet_id = $pet12->id; $pet12_img2->save(); $pet14 = new Pet(); $pet14->name = 'Annie'; $pet14->status = 'available'; $pet14->color = 'Brown Tabby'; $pet14->age = 'young'; $pet14->description = 'Can you give this sweet girl a home?'; $pet14->gender = 'Female'; $pet14->breed = 'Domestic Short Hair (short coat)'; $pet14->user_id = User::first()->id; $pet14->species_id = '2'; $pet14->size_id = '1'; $pet14->a_num = 'A327383'; $pet14->save(); $pet14_img1 = new Image(); $pet14_img1->img_path = 'img/petimg/annie1.jpg'; $pet14_img1->pet_id = $pet14->id; $pet14_img1->save(); $pet15 = new Pet(); $pet15->name = 'Billie'; $pet15->status = 'available'; $pet15->color = 'White'; $pet15->age = 'young'; $pet15->description = 'Billie is a very happy boy! He loves people and does great with other dogs. In true terrier fashion, Billie has endless energy and very high prey drive. He likes to chase birds, rabbits, cats, and anything else that runs! Billie is a young terrier and, as such, needs a minimum of 2 hours of exercise every day. He would do best in a very active home, with an experienced owner, or with a home that will work/challenge him.'; $pet15->gender = 'Male'; $pet15->breed = 'Terrier / Mixed (short coat)'; $pet15->user_id = User::first()->id; $pet15->species_id = '1'; $pet15->size_id = '2'; $pet15->a_num = 'A359510'; $pet15->save(); $pet15_img1 = new Image(); $pet15_img1->img_path = 'img/petimg/billie1.jpg'; $pet15_img1->pet_id = $pet15->id; $pet15_img1->save(); $pet15_img2 = new Image(); $pet15_img2->img_path = 'img/petimg/billie2.jpg'; $pet15_img2->pet_id = $pet15->id; $pet15_img2->save(); $pet16 = new Pet(); $pet16->name = 'Maximus'; $pet16->status = 'available'; $pet16->color = 'White and Black'; $pet16->age = 'adult'; $pet16->description = 'Maximus is the sweetest most loving dog ever. He makes my own dog (who I absolutely adore and love) look like a grump. Max will do just about anything for a nice belly rub or pat on the head. Max has a severed toe that has heeled completely. Max is still a little afraid to put a lot of pressure on his left front leg but it doesn\'t stop him from anything. He is extremely playful and active. He can keep up with my 100lb pitbull on any given day. He can sit and shake on command, and can almost "lay" too!!! Max is about 90% house broken but he will have it down in no time :-) He is also crate trained. I ABSOLUTELY LOVE Maximus! He is one of the best dogs I\'ve fostered. If I could keep him, I most definitely would. Max has stolen my heart. he deserves the most loving home possible as he will only return the love! Fantastic dog!'; $pet16->gender = 'Male'; $pet16->breed = 'American Staffordshire Terrier / Mixed (short coat)'; $pet16->user_id = User::first()->id; $pet16->species_id = '1'; $pet16->size_id = '3'; $pet16->a_num = 'A326218'; $pet16->save(); $pet16_img1 = new Image(); $pet16_img1->img_path = 'img/petimg/maximus1.jpg'; $pet16_img1->pet_id = $pet16->id; $pet16_img1->save(); $pet16_img2 = new Image(); $pet16_img2->img_path = 'img/petimg/maximus2.jpg'; $pet16_img2->pet_id = $pet16->id; $pet16_img2->save(); $pet17 = new Pet(); $pet17->name = 'Lady'; $pet17->status = 'available'; $pet17->color = 'White and Black'; $pet17->age = 'senior'; $pet17->description = 'Lady is just that - a lady! She is super easy to get along with, gets along with my other dogs, crate trained, house trained. She walks well on a lead without pulling and tugging. She does well with children but I wouldn\'t recommend they try to pick her up or carry her - she doesn\'t like that kind of handling. She loves to be petted and brushed and will lay in your lap given the chance. She even sits up and begs! Very sweet dog.'; $pet17->gender = 'Female'; $pet17->breed = 'Terrier / Mixed (medium coat))'; $pet17->user_id = User::first()->id; $pet17->species_id = '1'; $pet17->size_id = '1'; $pet17->a_num = 'A339813'; $pet17->save(); $pet17_img1 = new Image(); $pet17_img1->img_path = 'img/petimg/lady1.jpg'; $pet17_img1->pet_id = $pet17->id; $pet17_img1->save(); $pet17_img2 = new Image(); $pet17_img2->img_path = 'img/petimg/lady2.jpg'; $pet17_img2->pet_id = $pet17->id; $pet17_img2->save(); $pet18 = new Pet(); $pet18->name = 'Queenie'; $pet18->status = 'available'; $pet18->color = 'tortoiseshell'; $pet18->age = 'baby'; $pet18->description = 'Lady is just that - a lady! She is super easy to get along with, gets along with my other pets, crate trained, house trained. She walks well on a lead without pulling and tugging. She does well with children but I wouldn\'t recommend they try to pick her up or carry her - she doesn\'t like that kind of handling. She loves to be petted and brushed and will lay in your lap given the chance. She even sits up and begs! Very sweet dog.'; $pet18->gender = 'Female'; $pet18->breed = 'Domestic Short Hair (short coat)'; $pet18->user_id = '2'; $pet18->species_id = '2'; $pet18->size_id = '1'; $pet18->a_num = 'A340004'; $pet18->save(); $pet18_img1 = new Image(); $pet18_img1->img_path = 'img/petimg/queenie1.jpg'; $pet18_img1->pet_id = $pet18->id; $pet18_img1->save(); $pet19 = new Pet(); $pet19->name = 'Zach'; $pet19->status = 'available'; $pet19->color = 'black'; $pet19->age = 'young'; $pet19->description = 'Zacky is the sweetest and calmest puppy that I have ever met. He plays well with my other dogs but he is so content and happy to find a fuzzy monkey or a tennis ball and just sit quietly in the corner by himself while the others run circles around him. He doesn\'t give overwhelming or sloppy kisses, he is shy but perfectly so. He warms up quickly and enjoys attention but doesn\'t demand it or jump all over me. He is great with kids and other dogs. He is also great with training! He is crate trained, almost potty trained and has so far learned how to sit. Additionally he just falls asleep when out in public like when I take him to Marshalls, Ross or Pet Smart! Zacky just wants to be happy. I honestly dont know if anything bothers this perfect pup. He is excited to meet his furever family and love a person or a family of five. Additionally he HAD ringworm and has completed treatment, now he is just waiting for his fur to grow back in a few spots! PS Zacky is giving another puppy a kiss! Here a couple of cute videos: https://www.facebook.com/HudsonHappiness/videos/1106347876059680/ https://www.facebook.com/HudsonHappiness/videos/1117773634917104/'; $pet19->gender = 'Male'; $pet19->breed = 'Labrador Retriever / Mixed (medium coat)'; $pet19->user_id = '2'; $pet19->species_id = '1'; $pet19->size_id = '2'; $pet19->a_num = 'A345133'; $pet19->save(); $pet19_img1 = new Image(); $pet19_img1->img_path = 'img/petimg/zach1.jpg'; $pet19_img1->pet_id = $pet19->id; $pet19_img1->save(); $pet19_img2 = new Image(); $pet19_img2->img_path = 'img/petimg/zach2.jpg'; $pet19_img2->pet_id = $pet19->id; $pet19_img2->save(); $pet19_img3 = new Image(); $pet19_img3->img_path = 'img/petimg/zach3.jpg'; $pet19_img3->pet_id = $pet19->id; $pet19_img3->save(); $pet20 = new Pet(); $pet20->name = 'Howard'; $pet20->status = 'available'; $pet20->color = 'white'; $pet20->age = 'young'; $pet20->description = 'Howard is a sweet, playful little guy who can be outgoing once he warms up to you. He loves to give kisses and will climb right into your lap for love! He is learning to walk on a leash currently and has been doing great. Crate-trained. (House-trained status and personality with other dogs unknown until we are past the 7 day quarantine period!) Howard is currently being treated for demodectic mange (NON contagious) with oral medication currently.'; $pet20->gender = 'Male'; $pet20->breed = 'Chihuahua / Terrier / Mixed (short coat)'; $pet20->user_id = '2'; $pet20->species_id = '1'; $pet20->size_id = '2'; $pet20->a_num = 'A364023'; $pet20->save(); $pet20_img1 = new Image(); $pet20_img1->img_path = 'img/petimg/howard1.jpg'; $pet20_img1->pet_id = $pet20->id; $pet20_img1->save(); $pet20_img2 = new Image(); $pet20_img2->img_path = 'img/petimg/howard2.jpg'; $pet20_img2->pet_id = $pet20->id; $pet20_img2->save(); $pet21 = new Pet(); $pet21->name = 'Lulu'; $pet21->status = 'available'; $pet21->color = 'black'; $pet21->age = 'young'; $pet21->description = 'Lulu is a lover of everyone and everything! She loves babies, young children, new dogs and walking on the leash. Lulu often accompanies me to work and meets handfuls of new people and pets every day, so she is incredibly well socialized and even knows a few tricks!'; $pet21->gender = 'Male'; $pet21->breed = 'American Staffordshire Terrier / Mixed (short coat)'; $pet21->user_id = '2'; $pet21->species_id = '1'; $pet21->size_id = '3'; $pet21->a_num = 'A'; $pet21->save(); $pet21_img1 = new Image(); $pet21_img1->img_path = 'img/petimg/lulu1.jpg'; $pet21_img1->pet_id = $pet21->id; $pet21_img1->save(); $pet21_img2 = new Image(); $pet21_img2->img_path = 'img/petimg/lulu2.jpg'; $pet21_img2->pet_id = $pet21->id; $pet21_img2->save(); $pet21_img3 = new Image(); $pet21_img3->img_path = 'img/petimg/lulu3.jpg'; $pet21_img3->pet_id = $pet21->id; $pet21_img3->save(); $pet21_img4 = new Image(); $pet21_img4->img_path = 'img/petimg/lulu4.jpg'; $pet21_img4->pet_id = $pet21->id; $pet21_img4->save(); $pet22 = new Pet(); $pet22->name = 'Cookie'; $pet22->status = 'available'; $pet22->color = 'red'; $pet22->age = 'young'; $pet22->description = 'Cookie ID#365961 a female 1-year old Shepherd & possible cattle dog blend. She is an adorable, friendly, lovable girl! She is a beautiful and unusual red-brindle with white. She is fun-loving and great with other dogs. You are guaranteed to love Cookie! She is spayed, current on vaccinations and microchipped and her adoption comes with one free month of pet health insurance.'; $pet22->gender = 'Female'; $pet22->breed = 'Shepherd / Cattle Dog / Mixed (short coat)'; $pet22->user_id = '3'; $pet22->species_id = '1'; $pet22->size_id = '3'; $pet22->a_num = 'A365961'; $pet22->save(); $pet22_img1 = new Image(); $pet22_img1->img_path = 'img/petimg/cookie1.jpg'; $pet22_img1->pet_id = $pet22->id; $pet22_img1->save(); $pet22_img2 = new Image(); $pet22_img2->img_path = 'img/petimg/cookie2.jpg'; $pet22_img2->pet_id = $pet22->id; $pet22_img2->save(); $pet22_img3 = new Image(); $pet23 = new Pet(); $pet23->name = 'Lisa'; $pet23->status = 'available'; $pet23->color = 'white and tan'; $pet23->age = 'young'; $pet23->description = 'Lisa is one of the sweetest and most lovable pups you would ever want to meet. Lisa is 14# of sweetness and loves everyone she meets, although she has yet to meet a cat. Lisa is approximately 9 months old, and is a basset mix. She did have a little problem with sarcoptic mange previously, but it is all cleared up at this time. Lisa is housebroken, but will use potty pads if provided. When it is cold, she is more reluctant to go out on her own as well. She is doing well learning the leash and responds well to encouragement. Lisa has bonded her best friend here, Sabella, who is a Blue Lacy/retriever mix, who was very shy at first but is coming out of shell very nicely. Lisa’s friendly and outgoing nature has made such a difference in Sabella, that it would be wonderful if they could be adopted together, but it is not mandatory. '; $pet23->gender = 'Female'; $pet23->breed = 'Basset Hound (short coat)'; $pet23->user_id = '2'; $pet23->species_id = '1'; $pet23->size_id = '1'; $pet23->a_num = 'A355435'; $pet23->save(); $pet23_img1 = new Image(); $pet23_img1->img_path = 'img/petimg/lisa1.jpg'; $pet23_img1->pet_id = $pet23->id; $pet23_img1->save(); $pet23_img2 = new Image(); $pet23_img2->img_path = 'img/petimg/lisa2.jpg'; $pet23_img2->pet_id = $pet23->id; $pet23_img2->save(); $pet24 = new Pet(); $pet24->name = 'Spot'; $pet24->status = 'available'; $pet24->color = 'White and Black'; $pet24->age = 'adult'; $pet24->description = ' a male 3-year old dalmation & cattle dog blend. He is friendly, well-mannered and a "total sweetheart"! He LOVES going for walks and exploring! Please come meet him. Spot is neutered, current on vaccinations and microchipped. His adoption comes with one free month of pet health insurance. '; $pet24->gender = 'Male'; $pet24->breed = 'Dalmatian / Cattle Dog / Mixed (short coat)'; $pet24->user_id = '2'; $pet24->species_id = '1'; $pet24->size_id = '3'; $pet24->a_num = 'A342417'; $pet24->save(); $pet24_img1 = new Image(); $pet24_img1->img_path = 'img/petimg/spot1.jpg'; $pet24_img1->pet_id = $pet24->id; $pet24_img1->save(); $pet24_img2 = new Image(); $pet24_img2->img_path = 'img/petimg/spot2.jpg'; $pet24_img2->pet_id = $pet24->id; $pet24_img2->save(); }
$specie = $specie->findOneBy(array('pet_specie_id' => $specie_id, 'available' => 'Y')); if ($specie == null) { $ERRORS[] = 'Invalid specie ID specified.'; } else { $color = new PetSpecie_PetSpecieColor($db); $color = $color->findOneBy(array(array('table' => 'pet_specie_color', 'column' => 'color_img', 'value' => $color_id), array('table' => 'pet_specie', 'column' => 'pet_specie_id', 'value' => $specie->getPetSpecieId()), array('table' => 'pet_specie_color', 'column' => 'base_color', 'value' => 'Y'))); if ($color == null) { $ERRORS[] = 'Invalid color specified.'; } } // end pet exists if (sizeof($ERRORS) > 0) { draw_errors($ERRORS); } else { // Add pet. $pet = new Pet($db); $pet->setUserId($User->getUserId()); $pet->setPetSpecieId($specie->getPetSpecieId()); $pet->setPetSpecieColorId($color->getPetSpecieColorId()); $pet->setPetName($pet_name); $pet->setHunger($specie->getMaxHunger()); $pet->setHappiness($specie->getMaxHappiness()); $pet->setCreatedAt($pet->sysdate()); $pet->save(); // If the user has no other pets, make this the active one. if (sizeof($User->grabPets()) == 0) { $pet->makeActive(); } // Session mog $_SESSION['hilight_pet_id'] = $pet->getUserPetId(); // Redirect
<?php //require the framework require_once "../requires/initialize.php"; // create the page $page = new Page(); $page->name = "Delete Pet"; $page->is_admin_only = true; // check if pet_wk is set if (!isset($_GET["pet_wk"])) { $session->message("There is an error with the pet you were trying to access."); redirect_head(ROOT_URL); } $pet_wk = $_GET["pet_wk"]; $pet_found = Pet::find_by_id($pet_wk); // check that the pet_wk exists if (!$pet_found) { $session->message("There is an error with the pet you were trying to access."); redirect_head(ROOT_URL); } // check if the pet is deleted if ($pet_found->is_deleted == "1") { $session->message("The pet you are trying to delete has already been deleted."); redirect_head(ROOT_URL); } // if the user confirmd we're deleting the pet if (isset($_POST["confirm"])) { // delete the pet $pet_found->delete(); $session->message("The pet was successfully deleted!"); redirect_head(ROOT_URL . "search_pets.php");
<?php if ($__is_viewing_self || !IsHiddenObject('equip_pet')) { ?> <div id="inv_pet" style="display: none"> <?php MakeHideToggleButton('equip_pet'); ?> <select cur-pet="0" onchange="$('#pet_' + $(this).attr('cur-pet')).css('display', 'none'); $(this).attr('cur-pet', $(this).val()); $('#pet_' + $(this).attr('cur-pet')).css('display', '');"> <option value="0">Pet 1</option> <option value="1">Pet 2</option> <option value="2">Pet 3</option> </select> <?php $pets = Pet::LoadPets($internal_id, CURRENT_LOCALE); $inv_pos_offx = 136; $inv_pos_offy = 115; for ($i = 0; $i < 3; $i++) { $pet = $pets[$i]; $isfound = $pet !== null; ?> <div class="pet" style="display: <?php echo $i == 0 ? 'block' : 'none'; ?> ;" id="pet_<?php echo $i; ?> "> <span class="top-col lt"><?php echo $isfound ? $pet->name : '';