PHP Classes

File: fwphp/01mater/fw_popel/b1b2tree_B1_profile.php

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/01mater/fw_popel/b1b2tree_B1_profile.php  >  Download  
File: fwphp/01mater/fw_popel/b1b2tree_B1_profile.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 3 months ago
Size: 1,684 bytes


Class file image Download
// J:\awww\www\fwphp\01mater\fw_popel\b1b2tree_B1_profile.php
* Page shows B1 profile (f o r m)
// Get the author
         //$id = (int)$_REQUEST['id'];
$author = Model::getAuthor($idfromurl);
// see if the author is valid - if it's not, we have an invalid ID
if(!$author) {
"Invalid Author ID supplied";

// we have no error
showHdr("Author: $author->firstName $author->lastName");
// Now get the number and fetch all his books
$books = $author->getDetails();
$totalBooks = $author->getDetailsCount();

// display details
<table width="100%" border="1" cellpadding="3">
<tr style="font-weight: bold">
// Now iterate over every book and display it
while($b = $books->fetch())

<!-- display master -->
<a href="B1_cre_upd.php?author=<?=$author->id?>">Edit author</a>
<table width="60%" border="1" cellpadding="3">
<td><b>First Name</b></td>
<td><b>Last Name</b></td>
<td><b>Total books</td>

// Display footer

For more information send a message to info at phpclasses dot org.