コード例 #1
0
ファイル: add_pet.php プロジェクト: onielmartinjr/cen4010
        if (!$database->query($sql)) {
            $session->message("There was an issue adding the pet; please try again.");
            redirect_head(ROOT_URL . "admin/" . file_name_with_get());
        }
    }
    //redirect to see new animal
    redirect_head(ROOT_URL . "view_pet.php?pet_wk={$new_pet_wk}");
}
// header
require_once "../requires/template/header.php";
?>
	
	
	
	<section id="registration" class="container"><form class="center" role="form" action="<?php 
echo file_name_with_get();
?>
" enctype="multipart/form-data" method="post" ><fieldset class="registration-form">
		Name: <br><div class="form-group"><input type="text" class="form-control" name="name" value="" required/></div>
		<!-- default value needed for form -->
			<input type="hidden" class="form-control" name="MAX_FILE_SIZE" value="10000000" />
		Image:  <br><div class="form-group"><input type="file" class="btn btn-default btn-file btn-md" name="file_upload" /></div>
		Breed:  <br><div class="form-group"><select name="breed" class="form-control"></div>
				  <option value="0">Undefined</option>
				  <?php 
//we need to display all available items
//do a concatenation of the pet type and the breed
$sql = "SELECT `b`.`breed_wk`, `b`.`pet_type_wk`, CONCAT(`p`.`name`,' - ',`b`.`name`) AS `name`, ";
$sql .= "`b`.`create_dt` FROM `breed` AS `b` INNER JOIN `pet_type` AS `p` ON `p`.`pet_type_wk` = `b`.`pet_type_wk` ";
$sql .= "WHERE `b`.`breed_wk` > 0 ORDER BY `p`.`name` ASC, `b`.`name` ASC";
$to_display = Breed::find_by_sql($sql);
コード例 #2
0
        $session->message(implode("<br />", $changes));
    }
    //lastly, redirect back to itself
    redirect_head(current_url());
}
//header template
require_once "../requires/template/header.php";
?>
	<section id="registration" class="container"><form class="center" role="form" action="<?php 
echo file_name_with_get();
?>
" method="post" ><fieldset class="registration-form">
		<?php 
//loop through all statuses, display them to the UI
for ($i = 0; $i < count($all_statuses); $i++) {
    echo "<div class=\"form-group\">";
    echo "<input type=\"text\" class=\"form-control\" name=\"" . $all_statuses[$i]->status_wk . "\" value=\"" . $all_statuses[$i]->name . "\">";
    echo "<a href=\"" . file_name_with_get() . "?delete_pet_status_wk=" . $all_statuses[$i]->status_wk . "\">Delete</a>";
    echo "</div>";
}
?>
		<br>
		<div class="form-group">New Status: <input type="text" name="new_status" class="form-control" value=""></div>
		
		<div class="form-group"><button type="submit" value="submit" name="submit" class="btn btn-success btn-md btn-block">Submit</button></div>
	</fieldset></form></section>
	
	
<?php 
//footer template
require_once "../requires/template/footer.php";
コード例 #3
0
/* Form */
// Loop through all of the breeds organized by pet type and create a form
// to update their names. No delete functionality yet. Admin must ensure
// no pets are associated to a particular breed or pet type before hard delete.
echo "<section class=\"container center\">";
foreach ($pet_types_array as $type) {
    // create an update form for each breed within this pet type
    echo "<div class=\"container center\" ><div class=\"row\" ><fieldset class=\"registration-form\"> <div class=\"col-xs-6\"><form class=\"center\" role=\"form\" action=\"" . file_name_with_get() . "\" method=\"post\"> ";
    echo "<label style=\"text-transform:capitalize; font-size:30px; font-weight:bold;\">{$type->name}</label><br>";
    echo "update to: <div class=\"form-group\"><input type=\"text\" class=\"form-control\" name=\"pet_type_name\" value=\"" . $type->name . "\" /></div>";
    echo "<div class=\"form-group\"><input type=\"submit\" class=\"btn btn-success btn-md btn-block\" value=\"Update Pet Type\" name=\"submit_" . $type->name . "_name\"/></div>";
    echo "<div class=\"form-group\"><input type=\"submit\" class=\"btn btn-success btn-md btn-block\" value=\"Delete Pet Type\" name=\"delete_" . $type->name . "_name\"/></div>";
    echo "</form></div>";
    $breeds_array = Breed::find_by_sql("SELECT * FROM `" . Breed::$table_name . "` WHERE `pet_type_wk` = " . $type->pet_type_wk . " ORDER BY `name` ASC;");
    // update/delete form
    echo "<div class=\"col-xs-6\" ><br><br><form action=\"" . file_name_with_get() . "\" method=\"post\"> <fieldset class=\"registration-form\">";
    $count = count($breeds_array);
    for ($i = 0; $i < $count; $i++) {
        echo "<div class=\"form-group row\"><input type=\"text\" class=\"form-control\" name=\"" . $breeds_array[$i]->breed_wk . "\" value=\"" . $breeds_array[$i]->name . "\">";
        echo "Delete:<input type=\"checkbox\" name=\"delete_" . $breeds_array[$i]->breed_wk . "\" value=\"delete\" /></div>";
    }
    echo "<div class=\"form-group\">Add new breed:<input type=\"text\" class=\"form-control\" name=\"new_breed\" value=\"\"></div>";
    echo "<div class=\"form-group\"><input type=\"submit\" class=\"btn btn-success btn-md btn-block\" value=\"save\" name=\"submit_" . $type->name . "_breeds\"/></div>";
    echo "</fieldset></form>";
    echo "</div></fieldset></div></div> <hr> ";
}
echo "</section>";
//this is a special instance, remove the message, if it's set since we set the messages in this form
$session->unset_variable('message');
//footer template
require_once "../requires/template/footer.php";
コード例 #4
0
ファイル: view_pet.php プロジェクト: onielmartinjr/cen4010
        ?>
/UI-links/images/blog/avatar3.png" alt=""></div>
			<div class="media-body"><div class="well"><div class="media-heading"><strong><?php 
        echo $value->user_wk->username;
        ?>
</strong>&nbsp; <small><?php 
        echo date('m/d/y - h:i:s A', strtotime($value->create_dt));
        ?>
 </small>
			<div class="pull-right">
			<?php 
        if ($session->is_logged_in) {
            echo "<a href=\"" . file_name_with_get() . "&flag_comment_wk=" . $value->comment_wk . "\"><img src=\"" . ROOT_URL . "requires/template/flag.png\" atl=\"Flag\"></a>";
        }
        ?>
			</div></div><p><?php 
        echo $value->body;
        ?>
</p></div></div></div>
		<?php 
    }
}
echo "</div>";
//now we're displaying the form to create new comments
//only display this form if the user is logged in
if ($session->is_logged_in) {
    echo "\n\t\t\n\t<!-- form -->\n\t<div id=\"comment-form\" ><form action=\"" . file_name_with_get() . "\" method=\"post\">\n\t\t<div width=\"100%\" ><div class=\"form-group\" ><textarea name=\"body\" style=\"resize: none; width:100%;\" class=\"form-control\" rows=\"5\" placeholder=\"enter a new comment\"/></textarea></div>\n\t\t<input type=\"submit\" class=\"btn btn-danger\" value=\"submit\" name=\"submit\"/>\n\t</form></div>";
}
echo '</div></div></div></section>';
//include the footer
require_once "requires/template/footer.php";
コード例 #5
0
    if (count($changes) != 0) {
        $session->message(implode("<br />", $changes));
    }
    //lastly, redirect back to itself
    redirect_head(current_url());
}
//header template
require_once "../requires/template/header.php";
?>
	<section id="registration" class="container"><form class="center" role="form" action="<?php 
echo file_name_with_get();
?>
" method="post" ><fieldset class="registration-form">
		<?php 
//loop through all vaccinations, display them to the UI
for ($i = 0; $i < count($all_vaccinations); $i++) {
    echo "<div class=\"form-group\"><input type=\"text\" class=\"form-control\" name=\"" . $all_vaccinations[$i]->vaccination_wk . "\" value=\"" . $all_vaccinations[$i]->vaccination_name . "\">";
    echo " <a href=\"" . file_name_with_get() . "?delete_vaccination_wk=" . $all_vaccinations[$i]->vaccination_wk . "\">Delete</a>";
    echo "</div>";
}
?>
		<br>
		<div class="form-group">New Vaccination: <input type="text" name="new_vaccination" value="" class="form-control"></div>
		
		<div class="form-group"><button type="submit" value="submit" name="submit" class="btn btn-success btn-md btn-block">Submit</button></div>
	</fieldset></form></section>
	
	
<?php 
//footer template
require_once "../requires/template/footer.php";