<?php
if (isset($_REQUEST['klient_type'])) {$client_type=$_REQUEST['klient_type'];} else {$client_type=1;}
include('../config.php');
$zapicey=0;
$sql = "SELECT * FROM klients WHERE type_client=".$client_type." ORDER BY organization, fio;";

echo ' <table class="nice_table" cellspacing=1 cellpadding=2>
	<TR>
        <Th bgcolor="#C4D9F7">id</Th>
        <Th bgcolor="#C4D9F7">ФИО</Th>
        <Th bgcolor="#C4D9F7">Телефон</Th>
        <Th bgcolor="#C4D9F7">Организация</Th>
	</TR>';
foreach ($db->query($sql) as $row) {
	$mcolor='FBFCE8';
	echo '<tr bgcolor=#'.$mcolor.' onclick="LoadClient(this)">'.
	'<td>'.$row['id'].'</td>'.
	'<td>'.$row['fio'].'</td>'.
	'<td>'.$row['phone'].'</td>'.
	'<td>'.$row['organization'].'</td>'.
	'</tr>';
	$zapicey++;
	}
echo '</TABLE>';
echo '<div id="container" align="left">&nbsp;Записей: '.$zapicey.' </div>';

?>
