Beispiel #1
0
<?php

session_start();
include_once "basic.php";
if (checkClearanceLevel(ORGANIZER)) {
    include_once "DBInterface.php";
    $dbConn = new DBInterface();
    $typeName = $dbConn->getTypeName($_POST['typeID']);
    if ($typeName['name'] == "Semester") {
        $data = array("id_person" => $_POST['personID'], "year" => $_POST['year'], "id_type_name" => $_POST['typeID'], "display_area" => "UpperField");
    } else {
        $data = array("id_person" => $_POST['personID'], "year" => $_POST['year'], "id_type_name" => $_POST['typeID'], "display_area" => $_POST['display']);
    }
    $dbConn->createHoursExtra($data);
    echo $typeName['name'];
}
Beispiel #2
0
 echo "<div id='bgDiv'><img id='background-img' class='bg' src='./images/Sven_Logo_192.png' alt=''></div>";
 echo "<a href='index.php' title='Start' class='logoLink'></a>";
 echo '<div id="username">Inloggad som <strong>' . $user_name . '</strong><br />';
 echo '<a href="logoff.php">Logga ut</a></div>';
 include "savelogin.php";
 echo "<nav id='mainNav'><ul>";
 //Different tabs depending of user type
 if (checkClearanceLevel(CLIENT)) {
     menuheading("Om Sven", "Main", $tabname);
     menuheading("Kursbudgetvy", "ViewCoursebudgets", $tabname);
     menuheading("Personlig vy", "personalView", $tabname);
 }
 if (checkClearanceLevel(ORGANIZER)) {
     menuheading("Hantera användare", "ManageUsers", $tabname);
 }
 if (checkClearanceLevel(ADMIN)) {
     menuheading("Hantera kurser", "ManageCourses", $tabname);
     menuheading("Hantera kurstillfällen", "ManageCoursesPerPeriod", $tabname);
     menuheading("Ladok", "ladokView", $tabname);
 }
 echo '<div class="clearfix"></div>';
 echo "</ul></nav>";
 echo "</header>";
 echo "<div id='content'>";
 echo "<div id='helpboxbutton'><a href=\"#\">Hjälp</a></div>";
 include "tab_main.php";
 include "tab_viewcoursebudgets.php";
 include "tab_personalview.php";
 include "tab_manageusers.php";
 include "tab_managecourses.php";
 include "tab_managecoursesperperiod.php";
Beispiel #3
0
 public function getAvailableTypes($personId, $year)
 {
     if (!checkClearanceLevel(ORGANIZER)) {
         return false;
     }
     // Sanitize input data
     $personId = sanitizeInput($personId);
     $year = sanitizeInput($year);
     $query = "SELECT * FROM type AS t WHERE NOT EXISTS (SELECT * FROM hours_extra AS he WHERE he.id_type_name=t.id && he.year={$year} && he.id_person={$personId} && NOT (t.name='Projekt' || t.name='Övrigt'))";
     $result = mysql_query($query, $this->dbConn);
     if (!$result) {
         ErrorLog(mysql_error($this->dbConn));
         return false;
     }
     $availableTypes = array();
     while ($row = mysql_fetch_assoc($result)) {
         $availableTypes[$row['id']] = $row;
     }
     return $availableTypes;
 }
Beispiel #4
0
 echo "<legend>Efternamn</legend>";
 echo "<input type='text' name='lastname' value='" . $userData['lastname'] . "' class='textfield' title='Skriv in användarens efternamn.' />";
 echo "</fieldset>";
 echo "<fieldset>";
 echo "<legend>Signatur</legend>";
 echo "<input type='text' id='sign' name='sign' value='" . $userData['sign'] . "' class='textfield' title='Skriv användarens signatur.' />";
 echo "</fieldset>";
 echo "<fieldset>";
 echo "<legend>Lösenord</legend>";
 echo "<input type='password' name='password' value='' class='textfield' title='Skriv in användarens lösenord.' />";
 echo "</fieldset>";
 echo "<fieldset>";
 echo "<legend>Bekräfta lösenord</legend>";
 echo "<input type='password' name='confirmPassword' value='' class='textfield' title='Upprepa användarens lösenord.' />";
 echo "</fieldset>";
 if (checkClearanceLevel(ADMIN) && $userData['sign'] != $_SESSION['user_name']) {
     echo "<fieldset>";
     echo "<legend>Användartyp</legend>";
     echo "<select name='type' id='type'>";
     echo "<option value='superadmin'";
     if ($userData['type'] == ADMIN) {
         echo " selected='selected'";
     }
     echo ">Administratör</option>";
     echo "<option value='organizer'";
     echo "<option value='organizer'";
     if ($userData['type'] == ORGANIZER) {
         echo " selected='selected'";
     }
     echo ">Organisatör</option>";
     echo "<option value='user'";