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

// fetch client notes list
	// init database name
	$database = DB_PREFIX;	
	
	
	// process request
	if ($sid != '')
	{
		// sid check
		require "includes/session/sidck.php";
		
		
		// init return value
		$rv = '<root>' . PHP_EOL;
		$rv .= '<notes>' . PHP_EOL;
	
	
		// fetch database name / open db
		$db = '';
		if ( isset($_POST['db']) ) $db = $_POST['db'];
		if ( isset($_GET['db']) ) $db = $_GET['db'];
		
		if ($db == '') die();
		
		$database .= $db;
		
		require "includes/db.php";
        
        $per = getvar($db, 'per', 'int');
        		
		
		// fetch notes
		$query = "SELECT cnot_id, cnot_note FROM notes_client WHERE cnot_per = " . $per;
			
		
		if ($result = $db->query($query))
		{
			while ($row = $result->fetch_assoc())
			{
				$rv .= '<note>';
				$rv .= '<id>' . $row['cnot_id'] . '</id>' . PHP_EOL;
				$rv .= '<text>' . $row['cnot_note'] . '</text>' . PHP_EOL;
				$rv .= '</note>';
			}
		}
		
		
		// finish output
		$rv .= '</notes>' . PHP_EOL;
		$rv .= '</root>' . PHP_EOL;
				
		
		// return data
		echo $rv;
		
		die;
	}
	else
	{
		header('Server: ');
		header('X-Powered-By: ');
		header("HTTP/1.0 404 Not Found");
	}

?>