Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is what I have.
- <?PHP
- # OLYMPUS OFFICE MANAGEMENT SYSTEM - NEXT GENERATION GROUP PTY. LTD
- # This website was designed for the sole use of the Next Generation Group PTY. LTD.
- # All other uses for this website must be authorised by the creators.
- # All additions to the website must be completed by the creators.
- # START DATE: 1058 hours MON 23 AUG 2010
- # FILE: inc/pdf_view-client.php
- # This file contails all of the client pages and includes.
- ####################################### FUNCTIONS FOR THE PAGE #######################################
- function connect()
- {
- $database_server = "localhost";
- $database_user = "darcy_admin";
- $database_password = "password";
- $database_name = "darcy_nextgensys";
- $connection = mysql_connect($database_server, $database_user, $database_password);
- if (!$connection)
- {
- die('Connnection to '.$database_server.' as '.$database_user.' could not be established due to the following error: ' . mysql_error());
- }
- mysql_select_db($database_name, $connection) or die('The database could not be selected due to the following error:' . mysql_error());
- }
- function chooseQuery()
- {
- // If $_GET[query] is equal to 'view-allocation' perform the following:
- if($_GET['query'] == "view-allocation")
- {
- // If $_GET[sid] and $_GET['date'] are set perform the following:
- if(isset($_GET['sid']) & isset($_GET['date']))
- {
- $table = "`_CLIENTS`";
- $where_col_1 = "salesperson";
- $where_value_1 = $_GET['sid'];
- $where_col_2 = "dateassigned";
- $where_value_2 = $_GET['date'];
- $query = "SELECT * FROM ".$table." WHERE ".$where_col_1."='".$where_value_1."' AND ".$where_col_2."='".$where_value_2."'";
- $result = mysql_query($query) or die('Search for all records in '.$table.' where '.$where_col_1.' is equal to '.$where_value_1.' and '.$where_col_2.' is equal to '.$where_value_2.' was not completed. '.mysql_error());
- }
- // If $_GET[sid] is set perform the following:
- if(isset($_GET['sid']) & !isset($_GET['date']))
- {
- $table = "`_CLIENTS`";
- $where_col = "salesperson";
- $where_value = $_GET['sid'];
- $query = "SELECT * FROM ".$table." WHERE ".$where_col."='".$where_value."'";
- $result = mysql_query($query) or die('Search for all records in '.$table.' where '.$where_col.' is equal to '.$where_value.' was not completed. '.mysql_error());
- }
- // If $_GET['date'] is set perform the following:
- if(!isset($_GET['sid']) & isset($_GET['date']))
- {
- $table = "`_CLIENTS`";
- $where_col = "dateassigned";
- $where_value = $_GET['date'];
- $query = "SELECT * FROM ".$table." WHERE ".$where_col."='".$where_value."'";
- $result = mysql_query($query) or die('Search for all records in '.$table.' where '.$where_col.' is equal to '.$where_value.' was not completed. '.mysql_error());
- }
- // Count the number of results.
- $numrows = mysql_num_rows($result);
- // THIS IS WHAT I WANT TO REPEAT!!!!
- $multi = While ($date = mysql_fetch_array($result))
- {
- $name_full = $data['name_title'].' '.$data['name_first'].' '.$data['name_last'];
- $telemarketer = $data['telemarketer'];
- $salesperson = $data['salesperson'];
- $phone_personal = $data['phone_personal'];
- $phone_mobile = $data['phone_mobile'];
- $phone_business = $data['phone_business'];
- $phone_fax = $data['phone_fax'];
- $email_personal = $data['email_personal'];
- $dateassigned = $data['dateassigned'];
- // Query the Staff Table for the Clients Telemarketer
- $table = "`_STAFF`";
- $where_col = "sid";
- $where_value = $telemarketer;
- $query = "SELECT * FROM ".$table." WHERE ".$where_col."='".$where_value."'";
- $result = mysql_query($query) or die('Search for all records in '.$table.' where '.$where_col.' is equal to '.$where_value.' was not completed. '.mysql_error());
- $data = mysql_fetch_array($result);
- $telemarketer = $data['name_first'].' '.$data['name_last'];
- // Query the Staff Table for the Clients Salesperson
- $table = "`_STAFF`";
- $where_col = "sid";
- $where_value = $salesperson;
- $query = "SELECT * FROM ".$table." WHERE ".$where_col."='".$where_value."'";
- $result = mysql_query($query) or die('Search for all records in '.$table.' where '.$where_col.' is equal to '.$where_value.' was not completed. '.mysql_error());
- $data = mysql_fetch_array($result);
- $salesconsultant = $data['name_first'].' '.$data['name_last'];
- $table = 'blehnewss imagine there is a table printing info here';
- }
- }
- }
- }
- function choosePDF()
- {
- if($_GET['query'] == "view-client")
- {
- require('script_pdftable.php');
- class PDF extends PDFTable
- {
- // Page Header
- function Header()
- {
- parent::Header();
- // Display the Logo.
- $this->Image('../img/logo_medium.jpg',10,8,80);
- // Set the Font.
- $this->SetFont('Helvetica','B','24');
- // Display the Page Title.
- $this->Cell(0,5,'LEAD SHEET',0,1,'R');
- // Reset the Font.
- $this->SetFont('Helvetica','',10);
- // Line Break to Space
- $this->Ln(10);
- }
- }
- $client = new PDF();
- $client->AddPage();
- $client->SetFont('Helvetica','',10);
- $client->htmltable($single);
- $client->output('','I');
- }
- if($_GET['query'] == "view-allocation")
- {
- require('script_pdftable.php');
- class PDF extends PDFTable
- {
- // Page Header
- function Header()
- {
- parent::Header();
- // Display the Logo.
- $this->Image('../img/logo_medium.jpg',10,8,80);
- // Set the Font.
- $this->SetFont('Helvetica','B','24');
- // Display the Page Title.
- $this->Cell(0,5,'LEAD SHEET',0,1,'R');
- // Reset the Font.
- $this->SetFont('Helvetica','',10);
- // Line Break to Space
- $this->Ln(10);
- }
- }
- $client = new PDF();
- $client->AddPage();
- $client->SetFont('Helvetica','',10);
- $client->htmltable($multi,$numrows);
- $client->output('','I');
- }
- }
- #####################################################################################################
- connect ();
- chooseQuery();
- choosePDF();
- ?>
- <?php
- ob_start();
- $count=5;
- while (($count--)>0) echo "count is ".$count;
- $stuff=ob_get_clean();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement