Source code:
<?php
include ('include_pet_fns.php');
// The shopping cart needs sessions, so we start one
session_start();
$petid = $_GET['petid'];
$spname = $_GET['spname'];//new
// get this pet out of database
$pet = get_pet_details($petid);
//$name = get_sp_name($spid);//new
$pet_name = $pet['name'];
$pet_name = str_replace("_"," ","$pet_name");
$pet_race = $pet['race'];
$pet_race = str_replace("_"," ","$pet_race");
do_html_header($pet_name);
// set url for "continue button"
$target = 'index.php';
if($pet['spid']) {
$target = 'show_sp.php?spid='.$pet['spid'];
}
echo '<table border="0" cellspacing="0" cellpadding="0" width="750">';
echo '<tr>';
echo '<td style="padding-left:5px;padding-top:5px">';
display_pet_details($pet,$spname);
echo '</td>';
echo '<td>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td style="padding-left:5px;padding-top:5px">';
// if logged in as admin, show edit pet links
if( check_admin_user() ) {
display_button("insert_pets_form.php?edit_pet=on&petid=$petid", 'edit-item', 'Edit Pet');
//display_button('admin.php', 'admin-menu', 'Admin Menu');
display_button($target, 'continue', 'Continue');
} else {
display_button("show_cart.php?new=$petid&spname=$spname", 'add-to-cart-back', 'Add '
.$pet['name'].' To My Shopping Cart');
display_button($target, 'continue-shopping', 'Continue Shopping');
}
echo '</td>';
echo '<td>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td> </td><td> </td>';
echo '</tr>';
echo '</table>';
do_html_footer();
?>