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/file/report.php
<?php

// client list
	$database = DB_PREFIX . 'system';
		
	
	
	// process request
	if ($sid != '')
	{
	   	// open db connection
		require "includes/db.php";
		
		
		// validate session	/ die if necessary
		$sid = $db->real_escape_string($sid);

		$query = "UPDATE sessions SET ses_refresh = NOW() WHERE ses_id = '" . $sid . "' AND ISNULL(ses_end)";

		if ($result = $db->query($query)) 
		{
			if ($db->affected_rows != 1)
			{
				die();
			}
		}
		else
		{
			die();
		}
        
        // get client list
		$active = -1;
        $data = array();
		
        $status = getvar($db, 'stat', 'string');
        
        if ( $status == 'active' )
		{
			$active = 1;
		}
		elseif ( $status == 'inactive' )
		{
			$active = 0;
		}
		
		if ($status != '')
		{
			$query = "SELECT cln_sort FROM clients WHERE cln_active = " . $active . " ORDER BY cln_sort ASC";
			
	
			if ($result = $db->query($query))
			{
				while ($row = $result->fetch_assoc() )
				{
					$data[] = array(
                        'sort'      => $row['cln_sort']
                    );
				}
			}
		}
	

	}
	
    $ct = count($data);
    
    require "ReportClass.php";
        
    $pdf = new PDF($active);
    $pdf->AliasNbPages();
    $pdf->SetDrawColor(150, 150, 150);
    $pdf->SetFillColor(242, 242, 242);
    $pdf->SetFont('Arial', '', '9');
    $pdf->AddPage();
    
    $fill = false;
    
    if ($ct > 0)
    {
        $pdf->SetFont('Arial', '', '9');
        foreach ($data as $d)
        {
            $pdf->SetX(30);
            
            $pdf->Cell(75, 5, $d['sort'], 0, 1, 'L', $fill);
            $fill = !$fill;
        }
        
        $pdf->Ln(3);    
    }
        
    $pdf->SetFont('Arial', 'B', '8');
    $pdf->SetFillColor(230, 230, 230);
    $pdf->SetX(30);
    
    $pdf->Cell(75, 5, $ct . ' ' . ucfirst($status) . ' Clients found', 1, 0, 'C', true);
    
    $pdf->Output();
?>