- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
$take_mod = mysql_query("select * from `cpdb`.`".$mod."`;");
$rows = mysql_num_rows($take_mod);
$fields = mysql_num_fields($take_mod);
### Вывод БД<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
echo '<td width="100%" height="26" valign="center">';
### Создание названия полей____________
echo "<table border=3px>";
echo "<tr>";
for ($b=0; $b<$fields; $b++)
{
echo "<td bgcolor='#CCFFFF'>".mysql_field_name ($take_mod, $b)."</td>";
}
echo "</tr>";
### Содержание БД____________
for ($c=0; $c<$rows; $c++) {
echo "<tr>";
echo "<td>".mysql_result($take_mod, $c, 0)."</td>";
for ($cc=1; $cc<$fields; $cc++) {
if($mod == 'img'){
echo "<td><img src='../images/100/".mysql_result($take_mod, $c, $cc)."' width='200'/></td>";
}
else{
echo "<td>".mysql_result($take_mod, $c, $cc)."</td>";
}
}
$edit_id = $c;
$drop_id = mysql_result($take_mod, $c, 0);
echo '<td width="25" bgcolor="#CCFFFF" align="center" valign="middle" >
<a href="?key=2&mod='.$mod.'&edit_id= '.$edit_id.'"><img src="img/b_edit.png" alt="Изменить" /></a></td>';
echo '<td width="25" bgcolor="#CCFFFF" align="center" valign="middle" >
<a href="?key=2&mod='.$mod.'&id_del='.$drop_id.'"><img src="img/b_drop.png" alt="Удалить" /></a></td>';
echo "</tr>";
}
echo "</table>";
echo '</td>';