<?php
include("test1/month_name.php");
include("test1/member_info.php");
include("test1/connect_db.php"); //เปิดฐานข้อมูล
$sql="select id from organize where upline1='0006965'";
$result1 = @mysql_query($sql,$connection) or die(mysql_error());
echo"<table width='1200' height='800' border='0'>";
echo" <tr>";
$sql = "SELECT COUNT(id) AS id from organize where upline1='0006965'";
$conunt1 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt1 = mysql_fetch_array($conunt1);
{
$allconunt1=$rowconunt1[id];
}
while ($row1 = mysql_fetch_array($result1)) {
echo" <td valign='top'>";
$downline1=$row1[id];
if ($allconunt1>1){
}
else {
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline1 1</td>";
echo"</tr>";
}
$sql="select id from organize where upline1='$downline1'";
$result2 = @mysql_query($sql,$connection) or die(mysql_error());
/////////////////////////////ชั้นที่2/////////////////
$sql = "SELECT COUNT(id) AS id from organize where upline1='$downline1'";
$conunt2 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt2 = mysql_fetch_array($conunt2);
{
$allconunt2=$rowconunt2[id];
}
while ($row2 = mysql_fetch_array($result2)) {
$downline2=$row2[id];
if ($allconunt2>1){
echo" <tr>";
echo" <td><div align='center'>";
echo" <table width='200' border='0'>";
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline2 2</td>";
echo" </tr>";
echo"</table>";
echo" </div></td>";
echo"</tr>";
}
else {
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline2 2</td>";
echo"</tr>";
}
$sql="select id from organize where upline1='$downline2'";
$result3 = @mysql_query($sql,$connection) or die(mysql_error());
///////////////////////////ชั้นที่3///////////////////////////
$sql = "SELECT COUNT(id) AS id from organize where upline1='$downline2'";
$conunt3 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt3 = mysql_fetch_array($conunt3);
{
$allconunt3=$rowconunt3[id];
}
while ($row3 = mysql_fetch_array($result3)) {
$downline3=$row3[id];
if ($allconunt3>1){
echo" <tr>";
echo" <td><div align='center'>";
echo" <table width='200' border='0'>";
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline3 3</td>";
echo" </tr>";
echo"</table>";
echo" </div></td>";
echo"</tr>";
}
else {
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline3 3</td>";
echo"</tr>";
}
$sql="select id from organize where upline1='$downline3'";
$result4 = @mysql_query($sql,$connection) or die(mysql_error());
///////////////////////////////ชั้นที่4//////////////
$sql = "SELECT COUNT(id) AS id from organize where upline1='$downline3'";
$conunt4 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt4 = mysql_fetch_array($conunt4);
{
$allconunt4=$rowconunt4[id];
}
while ($row4 = mysql_fetch_array($result4)) {
$downline4=$row4[id];
if ($allconunt4>1){
echo" <tr>";
echo" <td><div align='center'>";
echo" <table width='200' border='0'>";
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline4 4</td>";
echo" </tr>";
echo"</table>";
echo" </div></td>";
echo"</tr>";
}
else {
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline4 4</td>";
echo"</tr>";
}
$sql="select id from organize where upline1='$downline4'";
$result5 = @mysql_query($sql,$connection) or die(mysql_error());
///////////////////////////////ชั้นที่5//////////////
$sql = "SELECT COUNT(id) AS id from organize where upline1='$downline4'";
$conunt5 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt5 = mysql_fetch_array($conunt5);
{
$allconunt5=$rowconunt5[id];
}
while ($row5 = mysql_fetch_array($result5)) {
$downline5=$row5[id];
if ($allconunt5>1){
echo" <tr>";
echo" <td><div align='center'>";
echo" <table width='200' border='0'>";
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline5 5</td>";
echo" </tr>";
echo"</table>";
echo" </div></td>";
echo"</tr>";
}
else {
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline5 5</td>";
echo"</tr>";
}
$sql="select id from organize where upline1='$downline5'";
$result6 = @mysql_query($sql,$connection) or die(mysql_error());
///////////////////////////////ชั้นที่6//////////////
$sql = "SELECT COUNT(id) AS id from organize where upline1='$downline5'";
$conunt6 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt6 = mysql_fetch_array($conunt6);
{
$allconunt6=$rowconunt6[id];
}
while ($row6 = mysql_fetch_array($result6)) {
$downline6=$row6[id];
if ($allconunt6>1){
echo" <tr>";
echo" <td><div align='center'>";
echo" <table width='200' border='0'>";
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline6 6</td>";
echo" </tr>";
echo"</table>";
echo" </div></td>";
echo"</tr>";
}
else {
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline6 6</td>";
echo"</tr>";
}
$sql="select id from organize where upline1='$downline6'";
$result7 = @mysql_query($sql,$connection) or die(mysql_error());
///////////////////////////////ชั้นที่7//////////////
$sql = "SELECT COUNT(id) AS id from organize where upline1='$downline6'";
$conunt7 = @mysql_query($sql,$connection) or die(mysql_error());
$rowconunt7 = mysql_fetch_array($conunt7);
{
$allconunt7=$rowconunt7[id];
}
while ($row7 = mysql_fetch_array($result7)) {
$downline7=$row7[id];
if ($allconunt7>1){
echo" <td><div align='center'>";
echo" <table width='200' border='0'>";
echo" <tr>";
echo"<td width='14%'><img src='test1/images/RC_logo.jpg' width='72' height='77'>$downline7 7</td>";
echo" </tr>";
echo"</table>";