recreate project
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?= $this->extend('layout/management_layout') ?>
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<div class="container mt-4">
|
||||
<h2>Add Staff Member</h2>
|
||||
<form action="<?= site_url('staff/store') ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="mb-3">
|
||||
<label>First Name</label>
|
||||
<input type="text" name="firstname" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Last Name</label>
|
||||
<input type="text" name="lastname" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Email</label>
|
||||
<input type="email" name="email" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Password</label>
|
||||
<input type="password" name="password" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Role</label>
|
||||
<select name="role_id" class="form-control" required>
|
||||
<?php foreach ($roles as $role): ?>
|
||||
<option value="<?= $role['id'] ?>"><?= esc($role['name']) ?></option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Create</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?= $this->extend('layout/management_layout') ?>
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<div class="container mt-4">
|
||||
<h2>Edit Staff Member</h2>
|
||||
<form action="<?= site_url('staff/update/' . $user['id']) ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="mb-3">
|
||||
<label>First Name</label>
|
||||
<input type="text" name="firstname" class="form-control" value="<?= esc($user['firstname']) ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Last Name</label>
|
||||
<input type="text" name="lastname" class="form-control" value="<?= esc($user['lastname']) ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Email</label>
|
||||
<input type="email" name="email" class="form-control" value="<?= esc($user['email']) ?>" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>Phone Number</label>
|
||||
<input type="tel" name="phone" class="form-control" value="<?= esc($user['phone'] ?? '') ?>" placeholder="Enter phone number">
|
||||
</div>
|
||||
|
||||
<!--div class="mb-3">
|
||||
<label>Role</label>
|
||||
<select name="role_id" class="form-control" required>
|
||||
<--?php foreach ($roles as $role): ?>
|
||||
<option value="<--?= $role['id'] ?>" <--?= $roleId == $role['id'] ? 'selected' : '' ?>>
|
||||
<--?= esc($role['name']) ?>
|
||||
</option>
|
||||
<--?php endforeach ?>
|
||||
</select>
|
||||
</div-->
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?= $this->extend('layout/management_layout') ?>
|
||||
<?= $this->section('content') ?>
|
||||
|
||||
<div class="container-fluid mt-4">
|
||||
<h2 class="text-center mt-4 mb-3">Staff List</h2>
|
||||
<?= $this->include('partials/academic_filter') ?>
|
||||
|
||||
<?php if (!empty($issues_count) && (int)$issues_count > 0): ?>
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<?= esc($issues_count) ?> teacher/assistant <?= ((int)$issues_count === 1) ? 'has' : 'have' ?> no class assignment for <?= esc($school_year) ?>.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!--a href="<--?= site_url('staff/create') ?>" class="btn btn-primary mb-3">Add Staff</a-->
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="myTable" class="display table table-striped table-bordered table-hover w-100" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>School ID</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>School Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Position</th>
|
||||
<th>Class-Section</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $order = 1; ?>
|
||||
<?php foreach ($staff as $s): ?>
|
||||
<tr class="<?= !empty($s['verification_issue']) ? 'table-warning' : '' ?>">
|
||||
<td style="text-align: center;"><?= esc($order++); ?></td>
|
||||
<td><?= esc($s['school_id']) ?></td>
|
||||
<td><?= esc($s['firstname']) ?></td>
|
||||
<td><?= esc($s['lastname']) ?></td>
|
||||
<td><?= esc($s['email']) ?></td>
|
||||
<td><?= esc($s['phone'] ?? '') ?></td>
|
||||
<td><?= esc($s['active_role']) ?></td>
|
||||
<td><?= esc($s['class_section']) ?></td>
|
||||
<td>
|
||||
<a href="<?= site_url('staff/edit/' . $s['id']) ?>" class="btn btn-sm btn-warning">Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
<?= $this->section('scripts') ?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#myTable').DataTable({
|
||||
autoWidth: false,
|
||||
scrollX: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user