All pastes #2050620 Raw Edit

Anonymous

public text v1 · immutable
#2050620 ·published 2011-04-25 21:16 UTC
rendered paste body
<div class = "scroll-pane horizontal-only">
		<table style = "margin-bottom: 20px; width: auto; text-align: center;" cellspacing = "2">
			<tr>
				<?
					$time_zone = new DateTimeZone('Europe/Tallinn');
					$segment_first = new DateTime($tt_from, $time_zone);
					$segment_last = new DateTime($tt_to, $time_zone);

					$how_many = 0;
					$nums_array;
					$nums_array_count = 0;
					for($current = $segment_first, $interval_day = new DateInterval("P1D"); $current <= $segment_last; $current = $current->add($interval_day))
					{
						if($current->format("d") == 1 || $how_many == 0)
						{
							?>
								<td <? if(checkNum($current->format("d")) == false) { ?> style = "background: #DDDDDD; min-width: 120px; text-align: center;"<? } else { ?>style = "min-width: 120px; text-align: center;"<? } ?>><b><? echo $months_array[$current->format("n")].' '.$current->format("Y"); ?></b></td>
							<?
							$nums_array[$nums_array_count] = $how_many;
							$nums_array_count++;
							$how_many++;
						}
						?>
						<td <? if(checkNum($current->format("d")) == false) { ?> style = " background: #DDDDDD;" <? } ?>><? echo $current->format("d"); ?></td>
						<?
						//echo $current->format("Y-m-d\r\n");
						$how_many++;
					}
				?>
				<td style= "background: #DDDDDD; min-width: 100px;">Общий балл</td>
			</tr>
			<?

			$get_group_students = mysql_query('SELECT students.name_1, students.name_2 FROM pcp_school_students AS students 
												INNER JOIN pcp_school_student_groups AS pssg ON students.student_id = pssg.student_id 
												INNER JOIN pcp_school_groups AS groups ON pssg.group_id = groups.group_id
												WHERE groups.group_id = '.$_GET['group_id'].' AND groups.school_id = '.$_SESSION['school_id'].'');
			/*
		
*/
			
			for($i = 0; $i < mysql_num_rows($get_group_students); $i++)
			{
				$get_group_students_rows = mysql_fetch_array($get_group_students);
				?>
				<tr>
					
					<?
					for($j = 0; $j < $how_many; $j++)
					{
						if(in_array($j,$nums_array))
						{
						?>
							<td style= "background: #DDDDDD; text-align: left;"><? echo $get_group_students_rows['name_1'].' '.$get_group_students_rows['name_2'];?></td>
						<? } else { ?>
							<td <? if(checkNum($j) == false) { ?> style= "background: #DDDDDD;" <? } else { ?> <? } ?> onMouseOver = "this.style.backgroundColor = 'blue';">-</td>
						<?
						}
					}
					?>
					<td style= "background: #DDDDDD;"></td>
				</tr>
				<?
			}
			if(!mysql_num_rows($get_lessons))
			{
				echo '<tr><td colspan = "'.$how_many.'">В данном расписании пока что нет предметов.</td></tr>';
			}
			?>
		</table>
	</div>