Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <FORM NAME ="ATT_REG" METHOD ="Get" ACTION = "book_student">
- <tr>
- <td>
- <?php
- $array_holder = 0;
- ?>
- <tr>
- <td>
- <?php
- while($nt=mysql_fetch_array($result4)){
- $INPUTID[$array_holder] = $nt['ID'];
- ?>
- <tr>
- <td align="right"><input type="checkbox" name="<?php echo $array_holder ?>" value="<?php echo $nt['ID']; ?>" checked="checked"></td>
- <td width="150"> <font size="2" face="bmwtyperegular"><?php echo $nt['ID']; ?></font></td>
- <td width="150"> <font size="2" face="bmwtyperegular"><?php echo $nt[Surname]; ?></font></td>
- <td width="150"> <font size="2" face="bmwtyperegular"><?php echo $nt['Name']; ?></font></td>
- </tr>
- <?php
- $array_holder++;
- }
- ?>
- </td>
- </tr>
- <tr>
- <td> <font size="2" face="bmwtyperegular">Leave Type:</font></td>
- <td>
- <select name="Booking">
- <option value="Offsite">Offsite Work</option>
- <option value="Leave">Leave</option>
- <option value="Sick">Sick Leave</option>
- <option value="NO_SPEC">Change Time</option>
- </select>
- </td>
- </tr>
- <tr>
- <td> <font size="2" face="bmwtyperegular">Leave Date:</font></td>
- <td>
- <?php
- require_once('classes/tc_calendar.php');
- //instantiate class and set properties
- $myDate = date("d/m/Y");
- $myDateY = date("Y");
- $myDateM = date("m");
- $myDateD = date("d");
- $myCalendar = new tc_calendar("date1", true);
- $myCalendar->setIcon("iconCalendar.gif");
- $myCalendar->setDate($myDateD, $myDateM, $myDateY);
- $myCalendar->writeScript();
- $theDate = isset($_REQUEST['date1']) ? $_REQUEST['date1'] : "";
- ?>
- </td>
- </tr>
- <tr>
- <td> <font size="2" face="bmwtyperegular">Assessor ID:</font></td>
- <td>
- <select name="AID">
- <?php
- while($nt=mysql_fetch_array($result3)){
- echo '<option value='. $nt['ID'].'">'. $nt['Name'].' '.$nt['Surname'] .'</option>';
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td> <font size="2" face="bmwtyperegular">PIN Code:</font></td>
- <td><input type="password" name="PIN" value="" size ="4"></td>
- </tr>
- </td>
- </tr>
- </table>
- <input type="submit" name="SUB1" value="Book Learner">
- </form>
- <?php
- $ID = $_GET['ID'];
- $Booking = $_GET['Booking'];
- $Date = $_GET['Date'];
- $Date = $theDate[8].$theDate[9].'/'.$theDate[5].$theDate[6].'/'.$theDate[0].$theDate[1].$theDate[2].$theDate[3];
- $AID = $_GET['AID'];
- $PIN = $_GET['PIN'];
- $Time = "06:59:59am";
- $query1 = "select ID,PIN from assessors where ID='$AID'";
- $result1=mysql_query($query1);
- $num=mysql_numrows($result1);
- $PIN_STATUS = "NOT_OK";
- while($r=mysql_fetch_array($result1)){
- $TAID =$r["ID"];
- $TPIN =$r["PIN"];
- if($TAID == $AID){
- if($TPIN == $PIN){
- $PIN_STATUS = "OK";
- }
- }
- }
- if ($PIN_STATUS == "OK"){
- $true_array++;
- $query1 = "DELETE FROM attendance WHERE ID='$ID' and Date='$Date'";
- $result1=mysql_query($query1);
- $query1 = "Insert into attendance(ID,UnitStandardID,Date,Time,AssessorID) VALUES ('$ID','$Booking','$Date','$Time','$AID')";
- $result1=mysql_query($query1);
- $s = $ID.' was booked successfully for Leave type '.$Booking.' on the following Date: '.$Date;
- $in = mysql_affected_rows();
- // echo $s;
- ?>
- <table width="1000">
- <tr>
- <?php
- if($in == 1){
- ?>
- <td width="60"><img src="./images/success.jpg"></td>
- <td> <font size="2" face="bmwtyperegular"><?php echo $s; ?>;</font></td>
- </tr>
- <?php
- }
- if($in <> 1){
- ?>
- <td width="60"><img src="./images/error.jpg"></td>
- <td> <font size="2" face="bmwtyperegular">Register was not Signed!</font></td>
- </tr>
- <?php
- }
- ?>
- </table>
- <?php
- }
- mysql_close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement