Beispiel #1
0
function reportHandler()
{
    $arr = getEmployees();
    for ($ctr = 0; $ctr < count($arr); $ctr++) {
        echo '<tr><td>' . $arr[$ctr][0] . '</td><td>' . $arr[$ctr][1] . '</td><td>' . $arr[$ctr][2] . '</td></tr>';
    }
}
Beispiel #2
0
<?php

if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
    function getEmployees()
    {
        include_once "employee.php";
        $employee = new employee();
        if ($employee->getEmployees) {
            $row = $employee->fetchArray();
            echo '{"results":1,"employees":[';
            while ($row) {
                echo json_encode($row);
                if ($row = $employee->fetchArray()) {
                    echo ',';
                }
            }
            echo ']}';
        }
    }
    switch ($cmd) {
        case 1:
            getEmployees();
            break;
        default:
            # code...
            break;
    }
}
Beispiel #3
0
switch (get_input('section')) {
    case 'department':
        $did = get_input('did');
        $total = companyTotal($did);
        if (get_input('add') == 'add') {
            $pdid = get_input('pdid', 0);
            include 'template/newdepartment.php';
        } else {
            $employees = getEmployees($did);
            $departmentInfo = getDepartment($did);
            $subDepartments = getDepartment($did, true);
            include 'template/department.php';
        }
        break;
    case 'employee':
        $eid = get_input('eid');
        $employeeInfo = getEmployees($eid, true);
        if (get_input('add') == 'add') {
            $employeeInfo = array();
            $eid = 0;
            $employeeInfo[0]['did'] = get_input('did');
        }
        include 'template/employee.php';
        break;
    default:
        $total = companyTotal();
        include 'template/company.php';
        break;
}
//include page header
include_once 'template/footer.php';
Beispiel #4
0
 
		  			</option>
		  		<?php 
}
?>
		  		</select>

			</div>
			<div>
				<label>Mitarbeiter:</label>
		  		<select name="Mitarbeiter" value="<?php 
echo $Mitarbeiter;
?>
">
		  		<?php 
$alleMitarbeiter = getEmployees();
foreach ($alleMitarbeiter as $mitarbeiter) {
    ?>
		  			 
		  			<option value="<?php 
    echo $mitarbeiter['employee_id'];
    ?>
">
		  			<?php 
    echo $mitarbeiter['first_name'];
    echo ' ';
    echo $mitarbeiter['last_name'];
    ?>
 
		  			</option>
		  		<?php 
Beispiel #5
0
<div class="dialog">
<p>Sorry, but no results were returned!</p>
</div>';
                    }
                    break;
            }
            break;
        case "teachers":
            $action = "list";
            if (isset($_REQUEST["action"])) {
                $action = $_REQUEST["action"];
            }
            switch ($action) {
                case "list":
                default:
                    $teachers = getEmployees("all", "teacher");
                    if (count($teachers) > 0) {
                        $pageBody .= '
<table class="fancy sortable searchable">
<thead>
	<tr>
		<th>#</th>
		<th>name</th>
		<th>action</th>
	</tr>
</thead>
<tbody>';
                        $count = 1;
                        foreach ($teachers as $teacherID) {
                            $teacher = new Teacher($teacherID);
                            $pageBody .= '