function DisplayCompanyRolesTableBody() { $roles = RetrieveCompanyRoles(); if ($roles != NULL) { foreach ($roles as $role) { echo "<tr>"; echo "<td>" . $role[COMP_ROLE_NAME] . "</td>"; echo "<td>" . $role[COMP_ROLE_MIN_STAFF] . "</td>"; echo "<td>"; echo '<button class="btn btn-success" type="submit"' . 'name="amend"' . 'value="' . $role[COMP_ROLE_ID] . '">' . 'Amend</button></td>'; echo '<td> <button class="btn btn-danger" type="submit"' . 'name="delete"' . 'value="' . $role[COMP_ROLE_ID] . '">' . 'Delete</button></td>'; echo '</tr>'; } } }
function GenerateCompanyRoleSelect() { $roles = RetrieveCompanyRoles(); if ($roles != NULL) { echo '<select class="form-control" name="companyRole">'; foreach ($roles as $role) { if ($role[COMP_ROLE_ID] == $Employee[EMP_COMPANY_ROLE]) { echo '<option selected="selected" value="' . $role[COMP_ROLE_ID] . '">' . $role[COMP_ROLE_NAME] . '</option>'; } else { echo '<option value="' . $role[COMP_ROLE_ID] . '">' . $role[COMP_ROLE_NAME] . '</option>'; } } } echo '</select>'; }
<input type="password" class="form-control" placeholder="Password" name="password" id="password"> </div> <div class="input-group" for=dateJoin"> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> <input type="date" class="form-control" name="dateJoin" id="dateJoin" placeholder="Date Joined"> </div> <br/> <label for="companyRole">Company Role</label> <?php $roles = RetrieveCompanyRoles(); if ($roles != NULL) { echo '<select class= "form-control" name="companyRole">'; foreach ($roles as $role) { echo '<option value="' . $role[COMP_ROLE_ID] . '">' . $role[COMP_ROLE_NAME] . '</option>'; } } echo '</select>'; ?> <br/> <label for="annualLeave">Annual Leave Entitlement</label> <input type="range" class= "form-control" name="annualLeave" min="10" max="28" value="19" step="1" oninput="updateAnnualLeave(value)" id="annualLeave" /> <output for="minStaff" id="Leave">19</output>
function CreateNewDatabase($destroyExistingDB = false, $createWithTestData = false) { if ($destroyExistingDB) { DropDB(); } CreateDB(); UseDB(); CreateDateTable(); CreatePublicHolidayTable(); CreateAbsenceTypeTable(); CreateCompanyRoleTable(); CreateEmployeeTable(); CreateApprovedAbsenceBookingTable(); CreateApprovedAbsenceDateTable(); CreateAdHocAbsenceRequestTable(); CreateMainVacationRequestTable(); // CreateDefaultRecords("admin", "*****@*****.**","Zaq12wsx","2015-01-01", 19); if ($createWithTestData) { $annualLeave = CreateAbsenceType("Annual Leave", 1, 1); $training = CreateAbsenceType("Training", 0, 1); $sickness = CreateAbsenceType("Sickness", 0, 0); $compasionate = CreateAbsenceType("Compasionate Leave", 0, 1); $cashier = CreateCompanyRole("Cashier", 3); $customerAdvisor = CreateCompanyRole("Customer Advisor", 2); $manager = CreateCompanyRole("Manager", 1); $filter[COMP_ROLE_NAME] = "Admin"; $results = RetrieveCompanyRoles($filter); $admin = $results[0]; $steveBrookstein = CreateEmployee("Steve Brookstein", "*****@*****.**", "Zaq12wsx", "2005-01-01", 20, NULL, $cashier[COMP_ROLE_ID], 0, 0); $shayneWard = CreateEmployee("Shane Ward", "*****@*****.**", "Zaq12wsx", "2006-01-01", 20, NULL, $cashier[COMP_ROLE_ID], 0, 0); $leonJackson = CreateEmployee("Leon Jackson", "*****@*****.**", "Zaq12wsx", "2008-01-01", 20, NULL, $manager[COMP_ROLE_ID], 0, 0); $alexandraBurke = CreateEmployee("Alexandra Burke", "*****@*****.**", "Zaq12wsx", "2009-01-01", 20, NULL, $cashier[COMP_ROLE_ID], 0, 0); $joeMcElderry = CreateEmployee("Joe McElderry", "*****@*****.**", "Zaq12wsx", "2010-01-01", 20, NULL, $customerAdvisor[COMP_ROLE_ID], 0, 0); $mattCardle = CreateEmployee("Matt Cardle", "*****@*****.**", "Zaq12wsx", "2011-01-01", 20, NULL, $customerAdvisor[COMP_ROLE_ID], 0, 0); $jamesArthur = CreateEmployee("James Arthur", "*****@*****.**", "Zaq12wsx", "2012-01-01", 20, NULL, $customerAdvisor[COMP_ROLE_ID], 0, 0); $samBailey = CreateEmployee("Sam Bailey", "*****@*****.**", "Zaq12wsx", "2013-01-01", 20, NULL, $customerAdvisor[COMP_ROLE_ID], 0, 0); $benHaenow = CreateEmployee("Ben Haenow", "*****@*****.**", "Zaq12wsx", "2014-01-01", 20, NULL, $manager[COMP_ROLE_ID], 0, 1); $dates = RetrieveDates(); if (count($dates) == 0) { date_default_timezone_set('UTC'); // Start date $date = '2015-01-01'; // End date $end_date = '2055-12-31'; while (strtotime($date) <= strtotime($end_date)) { CreateDate($date, NULL); $date = date("Y-m-d", strtotime("+1 day", strtotime($date))); } } $dateID = RetrieveDateIDByDate("2015-04-03"); $goodFriday = CreatePublicHoliday("Good Friday", $dateID); $dateID = RetrieveDateIDByDate("2015-04-06"); $easterMonday = CreatePublicHoliday("Easter Monday", $dateID); $dateID = RetrieveDateIDByDate("2015-05-04"); $earlyMay = CreatePublicHoliday("Early May Bank Holiday", $dateID); $dateID = RetrieveDateIDByDate("2015-05-25"); $springHoliday = CreatePublicHoliday("Spring Bank Holiday", $dateID); $dateID = RetrieveDateIDByDate("2015-08-31"); $summerHoliday = CreatePublicHoliday("Summer Bank Holiday", $dateID); $dateID = RetrieveDateIDByDate("2015-12-25"); $christmasDay = CreatePublicHoliday("Christmas Day", $dateID); $dateID = RetrieveDateIDByDate("2015-12-28"); $boxingDay = CreatePublicHoliday("Boxing Day (substitute day)", $dateID); $request = CreateMainVactionRequest($steveBrookstein[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($shayneWard[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($leonJackson[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($alexandraBurke[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($joeMcElderry[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($jamesArthur[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($mattCardle[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($samBailey[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateMainVactionRequest($benHaenow[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateAdHocAbsenceRequest($steveBrookstein[EMP_ID], "2015-03-10", "2015-03-15", $annualLeave[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($shayneWard[EMP_ID], "2015-03-10", "2015-03-15", $annualLeave[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($leonJackson[EMP_ID], "2015-03-10", "2015-03-15", $sickness[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($alexandraBurke[EMP_ID], "2015-03-10", "2015-03-15", $training[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($joeMcElderry[EMP_ID], "2015-03-10", "2015-03-15", $training[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($mattCardle[EMP_ID], "2015-03-10", "2015-03-15", $training[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($jamesArthur[EMP_ID], "2015-03-10", "2015-03-15", $training[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($samBailey[EMP_ID], "2015-03-10", "2015-03-15", $compasionate[ABS_TYPE_ID]); $request = CreateAdHocAbsenceRequest($benHaenow[EMP_ID], "2015-03-10", "2015-03-15", $compasionate[ABS_TYPE_ID]); $leonaLewis = CreateEmployee("Leona Lewis", "*****@*****.**", "Zaq12wsx", "2007-01-01", 20, NULL, $admin[COMP_ROLE_ID], 1, 1); $request = CreateAdHocAbsenceRequest($leonaLewis[EMP_ID], "2015-03-10", "2015-03-15", $sickness[ABS_TYPE_ID]); $request = CreateMainVactionRequest($leonaLewis[EMP_ID], "2015-01-10", "2015-01-15", "2015-02-10", "2015-02-15"); $request = CreateApprovedAbsenceBooking($leonaLewis[EMP_ID], "2015-04-01", "2015-04-10", $training[ABS_TYPE_ID]); } }