示例#1
1
							<?php 
timetable('11:00', 4);
?>
							<?php 
timetable('12:00', 5);
?>
							<tr>
								<td class="redips-mark dark">13:00</td>
								<td class="redips-mark lunch" colspan="5">Lunch</td>
							</tr>
							<?php 
timetable('14:00', 7);
?>
							<?php 
timetable('15:00', 8);
?>
							<?php 
timetable('16:00', 9);
?>
						</tbody>
					</table>
				</div><!-- right container -->
			</div><!-- drag container -->
			<br/>
			<div id="message">Drag school subjects to the timetable (clone subjects with SHIFT key)</div>
			<div class="button_container">
				<input type="button" value="Save" class="button" onclick="save()" title="Save timetable"/>
			</div>
		</div><!-- main container -->
	</body>
</html>
示例#2
0
timetable('18:00', 17);
?>
                            <?php 
timetable('18:45', 18);
?>
                            <?php 
timetable('19:30', 19);
?>
                            <?php 
timetable('20:15', 20);
?>
                            <?php 
timetable('21:00', 21);
?>
                            <?php 
timetable('21:45', 22);
?>
							<tr>
								<td class="redips-mark dark">22:30</td>
								<td class="redips-mark lunch" colspan="5">Fin</td>
							</tr>                            
						</tbody>
					</table>
				</div><!-- right container -->
			</div><!-- drag container -->
			<br/>
			<div id="message">Drag school subjects to the timetable (clone subjects with SHIFT key)</div>
			<div class="button_container">
				<input type="button" value="Save" class="button" onclick="save()" title="Save timetable"/>
			</div>
		</div><!-- main container -->
if ($_POST['submit'] == 'Back to Login') {
    header('Location:index.php');
}
if ($_POST['submit'] == 'Register') {
    //echo 'asdasdasd';
    $username = $_POST['uname'];
    $_SESSION['uname'] = $username;
    $password = $_POST['pass'];
    $_SESSION['pass'] = $password;
    $repass = $_POST['repass'];
    if ($username == "" || $password == "" || $repass == "") {
        ?>
<script type="text/javascript">confirm("All fields are mandatory!");</script>
		<?php 
        header("location:register.php");
    } else {
        if ($password == $repass) {
            $result = mysql_query('select username from login where username="******"');
            if (mysql_num_rows($result)) {
                session_destroy();
                echo '<script>alert("Username already exists!!");</script>';
                header('location:register.php');
            } else {
                $query = 'insert into login (username, password) values ("' . $username . '","' . $password . '")';
                mysql_query($query, $db) or die(mysql_error($db));
                timetable();
                die;
            }
        }
    }
}