<p class="pp">Документы на контроле</p>
<?php
require "dbconnect.php";
$sod1=mysql_query("SELECT count( idd )
FROM dokument
WHERE status=2 and archiv=0");
while($sod_mas1=mysql_fetch_row($sod1))
{
$kolvo=$sod_mas1[0];
}
if ($kolvo>0)
{
echo "<table border='0' align='center' width='900'><tr><td class='table1'> Всего загружено
документов <b>$kolvo</b></td></tr> </table>\n";
echo "<table border='0' align='center'>\n";
echo "<tr class='tr'><th> № </th>
<th> Дата </th>
<th> Наименование </th>
<th> Дата резолюции </th>
<th> Резолюция </th>
<th> Исполнитель </th>
<th> Снять </th>
</tr>\n";
$sod=mysql_query("SELECT idisp, idd, datepod, named, link, datern, resn, namedolgN,
KrNameOtd ,namen
FROM dokument, resnach, dolgN, nach, otdel
WHERE archiv=0 and idnach=idisp and iddr=idd and iddn=dolgn and idotdn=idotd and status=2
and idisp!=0");
while($sod_mas=mysql_fetch_row($sod))
{
echo "<tr class='table'>
<td><center>$sod_mas[1]</td>
<td><center>$sod_mas[2]</td>
<td><center><a href='$sod_mas[4]'> $sod_mas[3]</a></td>