MOON
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 PHP/5.4.10
System: Linux vps.presagepowered.net 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: mckernan (512)
PHP: 5.4.10
Disabled: NONE
Upload Files
File: /home/mckernan/public_html/iJournal/includes/notes/rptinternal.php
<?php

// fixed asset report

	// init database name
	$database = DB_PREFIX;	
	
	
	// process request
	if ($sid != '')
	{
	    // sid check
		require "includes/session/sidck.php";
        
	
		// fetch database name / open db
		$dbn = '';
        if ( isset($_POST['db']) ) $dbn = $_POST['db'];
		if ( isset($_GET['db']) ) $dbn = $_GET['db'];
		
		if ($dbn == '') die();
		
		$database .= $dbn;
		
		require "includes/db.php";
        
        
        // get params
        $per = getvar($db, 'per', 'string');
		
        
		// fetch client name
        $client = '';
        
        $query = "SELECT cli_sortname FROM client";
        
        if ($result = $db->query($query))
        {
            $row = $result->fetch_assoc();
            
            $client = $row['cli_sortname'];    
        }
		 
               
        
		// fetch assets
        $data = array();
        
		$query = "SELECT inot_note FROM notes_internal WHERE inot_active = 1" ;
		
		if ($result = $db->query($query))
		{
			if ($db->affected_rows > 0)
			{
				while ($row = $result->fetch_assoc())
				{
					$data[] = array(
                        'note'      => $row['inot_note']
                    );
				}
			}
		}
        
        require "ReportClass.php";
        
        $pdf = new PDF($client, true, $per);
        $pdf->AliasNbPages();
        $pdf->SetDrawColor(150, 150, 150);
        $pdf->SetFillColor(242, 242, 242);
        $pdf->SetFont('Arial', '', '9');
        $pdf->AddPage();
        
        $fill = false;
        foreach ($data as $d)
        {
            $pdf->SetX(30);
            
            $pdf->MultiCell(175, 5, $d['note'], "B", "L", $fill);
            
            $fill = !$fill;
        }
        
            
        $pdf->Output();
    }

?>