Články

Přehled klubových akcí

"; $ColumnCount=0; $UserCounter=0; while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { $catid = $row['aid']; echo ""; echo ""; echo $row['name']; echo ""; echo ""; $sqlUsers = "SELECT distinct id, username FROM `vfr_actions_attendance` where aid=$catid order by username"; $sqlUsersCount = "SELECT count(username) as users_count FROM `vfr_actions_attendance` where aid=$catid"; $retUsersCount = mysql_query( $sqlUsersCount, $conn ); while($rowUserCount = mysql_fetch_array($retUsersCount, MYSQL_ASSOC)) { $UsersCount = $rowUserCount['users_count']; } $EmptyCellsCount = $TableColumnsCount - $UsersCount % $TableColumnsCount; // echo "EmptyCellsCount: ".$EmptyCellsCount; $retuser = mysql_query( $sqlUsers, $conn ); while($rowuser = mysql_fetch_array($retuser, MYSQL_ASSOC)) { $ColumnCount++; $UserCounter++; if ($ColumnCount==1){echo "";} echo ""; $id=$rowuser['id']; echo "".$rowuser['username'].""; /* echo $rowuser['username']; */ echo ""; if ($UserCounter==$UsersCount){if ($EmptyCellsCount<$TableColumnsCount) {for ($i=1;$i<=$EmptyCellsCount;$i++){echo "";}}} if ($ColumnCount==$TableColumnsCount){ echo ""; $ColumnCount=0; } } $ColumnCount=0; $UserCounter=0; } echo ""; mysql_close($conn); ?>