Created
April 26, 2009 18:32
-
-
Save anonymous/102125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include ("config.php"); | |
include ('db.php'); | |
$db = opendb(); | |
?> | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title> NAFTорг - Торговля и Склад</title> | |
<meta name="keywords" content=" | |
1с, | |
1С, | |
1c, | |
1C, | |
Торговля, | |
Склад | |
"> | |
<meta http-equiv="Cache-Control" content="no-cache" forua="true"> | |
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251"> | |
</head> | |
<body bgcolor="White" lang="ru" text="Grey" style="Tahoma"> | |
<? | |
// Номер формы; | |
$n_formy=1; | |
// Количество столбцов в зоне 1 (верхнее меню); | |
$result1=ExecSQL($db, "SELECT count(*) as count FROM menu WHERE okno_menu='$n_formy' and linia_menu='1'"); | |
$line1_count = $result1[0]["count"]; | |
echo $line1_count." столбцов вверху</br>"; | |
$line1_degree=(100-30)/$line1_count; | |
echo $line1_degree." процентов на каждый столбец вверху</br><br>"; | |
for ($i=1; $i<=$line1_count; $i++) { | |
$result = ExecSQL($db, "SELECT text FROM menu WHERE okno_menu='$n_formy' and linia_menu='1' and pozitia='$i'"); | |
echo $result[0]["text"]."</br>"; | |
} | |
echo "<hr>"; | |
// Количество столбцов в зоне 4 (нижнее меню); | |
$result4=ExecSQL($db, "SELECT count(*) as count FROM menu WHERE okno_menu='$n_formy' and linia_menu='4'"); | |
$line4_count=$result4[0]["count"]; | |
echo $line4_count." столбцов снизу</br>"; | |
$line4_degree=(100-30)/$line4_count; | |
echo $line4_degree." процентов на каждый столбец внизу</br><br>"; | |
for ($i=1; $i<=$line4_count; $i++) { | |
$result = ExecSQL($db, "SELECT text FROM menu WHERE okno_menu='$n_formy' and linia_menu='4' and pozitia='$i'"); | |
echo $result[0]["text"]."<br>"; | |
} | |
echo "<hr>"; | |
// Количество ячеек в левом меню ; | |
$result2=ExecSQL($db, "SELECT count(*) as count FROM menu WHERE okno_menu='$n_formy' and linia_menu='2'"); | |
$line2_count=$result2[0]["count"]; | |
echo $line2_count." ячеек в левом меню</br><br>"; | |
for ($i=1; $i<=$line2_count; $i++) { | |
$result = ExecSQL($db, "SELECT text FROM menu WHERE okno_menu='$n_formy' and linia_menu='2' and pozitia='$i'"); | |
echo $result[0]["text"]."<br>"; | |
} | |
echo "<hr>"; | |
// Количество ячеек в правом меню; | |
$result3=ExecSQL($db, "SELECT count(*) as count FROM menu WHERE okno_menu='$n_formy' and linia_menu='3'"); | |
$line3_count=$result3[0]["count"]; | |
echo $line3_count." ячеек в правом меню</br><br>"; | |
for ($i=1; $i<=$line3_count; $i++) { | |
$result = ExecSQL($db, "SELECT text FROM menu WHERE okno_menu='$n_formy' and linia_menu='3' and pozitia='$i'"); | |
echo $result[0]["text"]."<br>"; | |
} | |
echo "<hr>"; | |
$strok=max($line2_count, $line3_count)+2; | |
$sr=max($line2_count, $line3_count); | |
echo "Строк в таблице ". $strok."<br>"."<hr>"; | |
$stolb=max($line1_count, $line4_count)+2; | |
$st=max($line1_count, $line4_count); | |
echo "Столбцов в таблице ". $stolb."<br>"."<hr>"; | |
echo "<table bgcolor='White' width='100%' align='center' cellspacing='2' cellpadding='2' border='1' >"; | |
for ($i=0; $i<=$strok-1;$i++) { | |
echo "<tr align='center'>"; | |
for ($t=0; $t<=$stolb-1;$t++) { | |
if ($i=='1' & $t=='1') {$span="colspan=".$st." rowspan=".$sr; }else{$span="";} | |
echo "<td ".$span.">"; | |
echo "Ячейка"; | |
echo "</td>"; } | |
echo "</tr>"; } | |
echo "</table>"; | |
?> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment