0) { $found = true; $project_number = mysql_result($result, 0, "project_number"); $project_name = mysql_result($result, 0, "project_name"); $alternative_names = mysql_result($result, 0, "alternative_names"); $book_name = mysql_result($result, 0, "book_name"); $client_number = mysql_result($result, 0, "client_number"); $current_stage = mysql_result($result, 0, "current_stage"); $flycatcher_number = mysql_result($result, 0, "flycatcher_number"); $sales_number = mysql_result($result, 0, "sales_number"); $contact_email = mysql_result($result, 0, "contact_email"); // Initially, there are four stages stored with a project: // 0 = flycatcher // 1 = sales // 2 = RESERVED (purchase) // 3 = quote if ( ($stage == "flycatcher") || ( ($current_stage == 0) && ($stage == "") ) ) { // FLYCATCHER // // Read the flycatcher data $link = mysql_connect("localhost","jeremy_webuser","w3bUS3r"); $query = "SELECT flycatcher_style, header_blurb, greeting, first_blurb, subject_blurb, subject_name, "; $query .= " signoff, signatory, signatory_profession, expected_price "; $query .= "FROM jeremy_ebooks.flycatcher flycatcher "; $query .= "WHERE flycatcher.flycatcher_name='" . $book . "';"; $result = mysql_query($query); if(!$result) { break; } mysql_close($link); if (mysql_num_rows($result) > 0) { $flycatcher_style = mysql_result($result, 0, "flycatcher_style"); $header_blurb = mysql_result($result, 0, "header_blurb"); $greeting = mysql_result($result, 0, "greeting"); $first_blurb = mysql_result($result, 0, "first_blurb"); $subject_blurb = mysql_result($result, 0, "subject_blurb"); $subject_name = mysql_result($result, 0, "subject_name"); $signoff = mysql_result($result, 0, "signoff"); $signatory = mysql_result($result, 0, "signatory"); $signatory_profession = mysql_result($result, 0, "signatory_profession"); $expected_price = mysql_result($result, 0, "expected_price"); echo "" . $subject_name; // // Special case // if (strtolower(substr($header_blurb,0,3)) == "car") { echo " DVD"; } else { echo " eBook"; } // display the flycatcher page // include("flycatcher.html"); } } else if ( ($stage == "sales") || ( ($current_stage == 1) && ($stage == "") ) ) { // SALES // // Read the sales data $link = mysql_connect("localhost","jeremy_webuser","w3bUS3r"); $query = "SELECT sales_number, background_colour, headline, body_html "; $query .= "FROM jeremy_ebooks.sales sales "; $query .= "WHERE sales.sales_number = " . $sales_number . ";"; $result = mysql_query($query); if(!$result) { break; } mysql_close($link); if (mysql_num_rows($result) > 0) { $sales_number = mysql_result($result, 0, "sales_number"); $background_colour = mysql_result($result, 0, "background_colour"); $headline = mysql_result($result, 0, "headline"); $body_html = mysql_result($result, 0, "body_html"); echo "" . $headline . ""; // display the sales page // include("sales.html"); } } else if ( ($stage == "quote") || ( ($current_stage == 3) && ($stage == "") ) ) { // QUOTE // // Read the quote data (check each of the product types) // Check books // $link = mysql_connect("localhost","jeremy_webuser","w3bUS3r"); $query = "SELECT book_number, project_number, book_title, binding, size,"; $query .=" intro_pages, main_pages, extra_pages, colour_pages,"; $query .=" page_weight, page_stock, cover_weight, cover_stock,"; $query .=" cover_treatment, cover_colours, extras, cost_1, cost_10, cost_25,"; $query .=" setup_cost, scan_cost, jacket_cost, foiling_cost, other_cost "; $query .= "FROM jeremy_ebooks.books books "; $query .= "WHERE books.project_number=" . $project_number; if ($title) { $query .= " AND book_title='" . $title . "'"; } $query .= ";"; $result = mysql_query($query); if(!$result) { exit; } mysql_close($link); if (mysql_num_rows($result) > 0) { $book_title = mysql_result($result, 0, "book_title"); $binding = mysql_result($result, 0, "binding"); $size = mysql_result($result, 0, "size"); $intro_pages = mysql_result($result, 0, "intro_pages"); $main_pages = mysql_result($result, 0, "main_pages"); $extra_pages = mysql_result($result, 0, "extra_pages"); $colour_pages = mysql_result($result, 0, "colour_pages"); $page_weight = mysql_result($result, 0, "page_weight"); $page_stock = mysql_result($result, 0, "page_stock"); $cover_weight = mysql_result($result, 0, "cover_weight"); $cover_stock = mysql_result($result, 0, "cover_stock"); $cover_treatment = mysql_result($result, 0, "cover_treatment"); $cover_colours = mysql_result($result, 0, "cover_colours"); $extras = mysql_result($result, 0, "extras"); $cost_1 = mysql_result($result, 0, "cost_1"); $cost_10 = mysql_result($result, 0, "cost_10"); $cost_25 = mysql_result($result, 0, "cost_25"); $setup_cost = mysql_result($result, 0, "setup_cost"); $scan_cost = mysql_result($result, 0, "scan_cost"); $jacket_cost = mysql_result($result, 0, "jacket_cost"); $foiling_cost = mysql_result($result, 0, "foiling_cost"); $other_cost = mysql_result($result, 0, "other_cost"); echo "" . $project_name . " Quotation Page"; // display the quote page // include("quotes.html"); } } } } // if project not found: create it // if (!$found) { echo "New Project Wizard: Step 1"; include("new_project.html"); } ?>