Add member CRUD functionality
This commit is contained in:
parent
494e5b16ce
commit
9e2c9e890c
174
src/Controller/MemberController.php
Normal file
174
src/Controller/MemberController.php
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Entity\Member;
|
||||||
|
use App\Entity\User;
|
||||||
|
use App\Entity\MemberCase;
|
||||||
|
use App\Form\MemberFormType;
|
||||||
|
use App\Libs\NavList;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
||||||
|
|
||||||
|
class MemberController extends AbstractController
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private EntityManagerInterface $entityManager,
|
||||||
|
private array $navLinks = [],
|
||||||
|
) {
|
||||||
|
$this->navLinks = NavList::LIST;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/list-members/{id}', name: 'app_case_members')]
|
||||||
|
public function listMembers(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||||
|
{
|
||||||
|
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||||
|
$members = $this->entityManager->getRepository(Member::class)->getCaseMembersByName($case);
|
||||||
|
|
||||||
|
return $this->render(
|
||||||
|
'internal/cases/members/list-members.html.twig',
|
||||||
|
array_merge(
|
||||||
|
$this->navLinks,
|
||||||
|
[
|
||||||
|
'breadcrumbs' => [
|
||||||
|
'Case',
|
||||||
|
'Members'
|
||||||
|
],
|
||||||
|
'notifications' => $user->retrieveUnreadNotifications(),
|
||||||
|
'case' => $case,
|
||||||
|
'members' => $members,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/add-member/{id}', name: 'app_case_add_member')]
|
||||||
|
public function addMember(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||||
|
{
|
||||||
|
/** @var MemberCase $case */
|
||||||
|
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||||
|
|
||||||
|
$member = new Member();
|
||||||
|
$form = $this->createForm(MemberFormType::class, $member);
|
||||||
|
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$member->setCaseId($case)
|
||||||
|
->setFirstName($form->get('firstName')->getData())
|
||||||
|
->setLastName($form->get('lastName')->getData())
|
||||||
|
->setDob($form->get('dob')->getData())
|
||||||
|
->setGender($form->get('gender')->getData())
|
||||||
|
->setRace($form->get('race')->getData())
|
||||||
|
->setLanguage($form->get('language')->getData())
|
||||||
|
->setPersonalId($form->get('personalId')->getData())
|
||||||
|
->setEmergencyContact($form->get('emergencyContact')->getData())
|
||||||
|
->setEmail($form->get('email')->getData())
|
||||||
|
->setAddress($form->get('address')->getData())
|
||||||
|
->setCity($form->get('city')->getData())
|
||||||
|
->setState($form->get('state')->getData())
|
||||||
|
->setZip($form->get('zip')->getData())
|
||||||
|
->setPhone($form->get('phone')->getData())
|
||||||
|
->setRelationship($form->get('relationship')->getData())
|
||||||
|
->setDayPhone($form->get('dayPhone')->getData())
|
||||||
|
->setEveningPhone($form->get('eveningPhone')->getData())
|
||||||
|
->setCellPhone($form->get('cellPhone')->getData())
|
||||||
|
->setSchool($form->get('school')->getData())
|
||||||
|
->setMaritalStatus($form->get('maritalStatus')->getData())
|
||||||
|
->setChild($form->get('isChild')->getData())
|
||||||
|
->setParent($form->get('isParent')->getData())
|
||||||
|
->setAdultChild($form->get('isAdultChild')->getData())
|
||||||
|
->setLegalGuardian($form->get('isLegalGuardian')->getData())
|
||||||
|
->setParentsLiveTogether($form->get('parentsLiveTogether')->getData())
|
||||||
|
->setDcsApproved($form->get('dcsApproved')->getData())
|
||||||
|
;
|
||||||
|
|
||||||
|
$this->entityManager->persist($member);
|
||||||
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_case_members', ['id' => $case->getId()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render(
|
||||||
|
'internal/cases/members/add-member.html.twig',
|
||||||
|
array_merge(
|
||||||
|
$this->navLinks,
|
||||||
|
[
|
||||||
|
'breadcrumbs' => [
|
||||||
|
'Case',
|
||||||
|
'Members',
|
||||||
|
'Add Member'
|
||||||
|
],
|
||||||
|
'notifications' => $user->retrieveUnreadNotifications(),
|
||||||
|
'case' => $case,
|
||||||
|
'form' => $form->createView(),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/case/{caseId}/edit-member/{memberId}', name: 'app_case_edit_member')]
|
||||||
|
public function editMember(Request $request, #[CurrentUser()] User $user, string $caseId, string $memberId): Response
|
||||||
|
{
|
||||||
|
$member = $this->entityManager->getRepository(Member::class)->find($memberId);
|
||||||
|
|
||||||
|
$form = $this->createForm(MemberFormType::class, $member);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$member->setFirstName($form->get('firstName')->getData())
|
||||||
|
->setLastName($form->get('lastName')->getData())
|
||||||
|
->setDob($form->get('dob')->getData())
|
||||||
|
->setGender($form->get('gender')->getData())
|
||||||
|
->setRace($form->get('race')->getData())
|
||||||
|
->setLanguage($form->get('language')->getData())
|
||||||
|
->setPersonalId($form->get('personalId')->getData())
|
||||||
|
->setEmergencyContact($form->get('emergencyContact')->getData())
|
||||||
|
->setEmail($form->get('email')->getData())
|
||||||
|
->setAddress($form->get('address')->getData())
|
||||||
|
->setCity($form->get('city')->getData())
|
||||||
|
->setState($form->get('state')->getData())
|
||||||
|
->setZip($form->get('zip')->getData())
|
||||||
|
->setPhone($form->get('phone')->getData())
|
||||||
|
->setRelationship($form->get('relationship')->getData())
|
||||||
|
->setDayPhone($form->get('dayPhone')->getData())
|
||||||
|
->setEveningPhone($form->get('eveningPhone')->getData())
|
||||||
|
->setCellPhone($form->get('cellPhone')->getData())
|
||||||
|
->setSchool($form->get('school')->getData())
|
||||||
|
->setMaritalStatus($form->get('maritalStatus')->getData())
|
||||||
|
->setChild($form->get('isChild')->getData())
|
||||||
|
->setParent($form->get('isParent')->getData())
|
||||||
|
->setAdultChild($form->get('isAdultChild')->getData())
|
||||||
|
->setLegalGuardian($form->get('isLegalGuardian')->getData())
|
||||||
|
->setParentsLiveTogether($form->get('parentsLiveTogether')->getData())
|
||||||
|
->setDcsApproved($form->get('dcsApproved')->getData())
|
||||||
|
;
|
||||||
|
|
||||||
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_case_members', ['id' => $caseId]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render(
|
||||||
|
'internal/cases/members/edit-member.html.twig',
|
||||||
|
array_merge(
|
||||||
|
$this->navLinks,
|
||||||
|
[
|
||||||
|
'breadcrumbs' => [
|
||||||
|
'Case',
|
||||||
|
'Members',
|
||||||
|
'Edit Member'
|
||||||
|
],
|
||||||
|
'notifications' => $user->retrieveUnreadNotifications(),
|
||||||
|
'member' => $member,
|
||||||
|
'form' => $form->createView(),
|
||||||
|
'caseId' => $caseId,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
184
templates/internal/cases/members/add-member.html.twig
Normal file
184
templates/internal/cases/members/add-member.html.twig
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||||
|
|
||||||
|
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||||
|
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<div class="card card-plain">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="font-weight-bolder">Add Case Member</h4>
|
||||||
|
<p class="mb-0">{{ case.caseName }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="container">
|
||||||
|
{{ form_errors(form) }}
|
||||||
|
|
||||||
|
{{ form_start(form) }}
|
||||||
|
<div class="row">
|
||||||
|
<div class='col'>
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_lastName' class='form-label'>Last Name</label>
|
||||||
|
<input type='text' name='{{ field_name(form.lastName) }}' id='member_form_lastName' class='form-control' required='required'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_firstName' class='form-label'>First Name</label>
|
||||||
|
<input type='text' name='{{ field_name(form.firstName) }}' id='member_form_firstName' class='form-control' required='required'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_personalId' class='form-label'>ID</label>
|
||||||
|
<input type='text' name='{{ field_name(form.personalId) }}' id='member_form_personalId' class='form-control' required="required"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_dob' class='form-label'></label>
|
||||||
|
<input type='date' name='{{ field_name(form.dob) }}' id='member_form_dob' class='form-control' required="required"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_emergencyContact' class='form-label'>Emergency Contact</label>
|
||||||
|
<input type='text' name='{{ field_name(form.emergencyContact) }}' id='member_form_emergencyContact' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_phone' class='form-label'>Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.phone) }}' id='member_form_phone' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_dayPhone' class='form-label'>Day Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.dayPhone) }}' id='member_form_dayPhone' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_eveningPhone' class='form-label'>Evening Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.eveningPhone) }}' id='member_form_eveningPhone' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_cellPhone' class='form-label'>Cell Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.cellPhone) }}' id='member_form_cellPhone' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_email' class='form-label'>Email</label>
|
||||||
|
<input type='email' name='{{ field_name(form.email) }}' id='member_form_email' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_school' class='form-label'>School</label>
|
||||||
|
<input type='text' name='{{ field_name(form.school) }}' id='member_form_school' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='col'>
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_address' class='form-label'>Address</label>
|
||||||
|
<input type='text' name='{{ field_name(form.address) }}' id='member_form_address' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_city' class='form-label'>City</label>
|
||||||
|
<input type='text' name='{{ field_name(form.city) }}' id='member_form_city' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_state' class='form-label'>State</label>
|
||||||
|
<input type='text' name='{{ field_name(form.state) }}' id='member_form_state' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_zip' class='form-label'>Zip</label>
|
||||||
|
<input type='text' name='{{ field_name(form.zip) }}' id='member_form_zip' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_maritalStatus' class='form-label'>Marital Status</label>
|
||||||
|
<input type='text' name='{{ field_name(form.maritalStatus) }}' id='member_form_maritalStatus' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_relationship' class='form-label'>Relationship</label>
|
||||||
|
<select name="{{ field_name(form.relationship) }}" id='member_form_relationship' class='form-control' required="required">
|
||||||
|
<option value=''></option>
|
||||||
|
|
||||||
|
{% for rel in enum('App\\Enums\\RelationshipType').cases() %}
|
||||||
|
<option value='{{ rel.value }}'>{{ rel.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_genderType' class='form-label'>Gender Type</label>
|
||||||
|
<select name="{{ field_name(form.gender) }}" id='member_form_gender' class='form-control' required="required">
|
||||||
|
<option value=''></option>
|
||||||
|
|
||||||
|
{% for gen in enum('App\\Enums\\GenderType').cases() %}
|
||||||
|
<option value='{{ gen.value }}'>{{ gen.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_race' class='form-label'>Race</label>
|
||||||
|
<select name="{{ field_name(form.race) }}" id='member_form_race' class='form-control'>
|
||||||
|
<option value=''></option>
|
||||||
|
|
||||||
|
{% for r in enum('App\\Enums\\RaceType').cases() %}
|
||||||
|
<option value='{{ r.value }}'>{{ r.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<label for='member_form_language' class='form-label'>Language</label>
|
||||||
|
<input type='text' name='{{ field_name(form.language) }}' id='member_form_language' class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isChild) }}' id='member_form_isChild'/>
|
||||||
|
<label for='member_form_isChild'>Child?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isParent) }}' id='member_form_isParent'/>
|
||||||
|
<label for='member_form_isParent'>Parent?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isAdultChild) }}' id='member_form_isAdultChild'/>
|
||||||
|
<label for='member_form_isAdultChild'>Adult Child?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isLegalGuardian) }}' id='member_form_isLegalGuardian'/>
|
||||||
|
<label for='member_form_isLegalGuardian'>Legal Guardian?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.parentsLiveTogether) }}' id='member_form_parentsLiveTogether'/>
|
||||||
|
<label for='member_form_parentsLiveTogether'>Parents Living Together?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.dcsApproved) }}' id='member_form_dcsApproved'/>
|
||||||
|
<label for='member_form_dcsApproved'>DCS Approved?</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='row'>
|
||||||
|
<div class="text-center">
|
||||||
|
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Member</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ form_end(form) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
185
templates/internal/cases/members/edit-member.html.twig
Normal file
185
templates/internal/cases/members/edit-member.html.twig
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||||
|
|
||||||
|
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||||
|
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<div class="card card-plain">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="font-weight-bolder">Edit Case Member</h4>
|
||||||
|
<p class="mb-0">
|
||||||
|
{{ member.firstName }}
|
||||||
|
{{ member.lastName }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="container">
|
||||||
|
{{ form_errors(form) }}
|
||||||
|
|
||||||
|
{{ form_start(form) }}
|
||||||
|
<input type='hidden' name='member_form_case_id' value='{{ caseId }}'/>
|
||||||
|
<div class="row">
|
||||||
|
<div class='col'>
|
||||||
|
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||||
|
<label for='member_form_lastName' class='form-label'>Last Name</label>
|
||||||
|
<input type='text' name='{{ field_name(form.lastName) }}' id='member_form_lastName' value='{{ member.lastName }}' class='form-control' required='required'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||||
|
<label for='member_form_firstName' class='form-label'>First Name</label>
|
||||||
|
<input type='text' name='{{ field_name(form.firstName) }}' id='member_form_firstName' value='{{ member.firstName }}' class='form-control' required='required'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||||
|
<label for='member_form_personalId' class='form-label'>ID</label>
|
||||||
|
<input type='text' name='{{ field_name(form.personalId) }}' id='member_form_personalId' value='{{ member.personalId }}' class='form-control' required="required"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.dob %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_dob' class='form-label'></label>
|
||||||
|
<input type='date' name='{{ field_name(form.dob) }}' id='member_form_dob' {% if member.dob %} value='{{ member.dob|date('Y-m-d') }}{% endif %}' class='form-control' required="required"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.emergencyContact %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_emergencyContact' class='form-label'>Emergency Contact</label>
|
||||||
|
<input type='text' name='{{ field_name(form.emergencyContact) }}' id='member_form_emergencyContact' {% if member.emergencyContact %} value='{{ member.emergencyContact }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.phone %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_phone' class='form-label'>Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.phone) }}' id='member_form_phone' {% if member.phone %} value='{{ member.phone }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.dayPhone %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_dayPhone' class='form-label'>Day Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.dayPhone) }}' id='member_form_dayPhone' {% if member.dayPhone %} value='{{ member.dayPhone }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.eveningPhone %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_eveningPhone' class='form-label'>Evening Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.eveningPhone) }}' id='member_form_eveningPhone' {% if member.eveningPhone %} value='{{ member.eveningPhone }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.cellPhone %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_cellPhone' class='form-label'>Cell Phone</label>
|
||||||
|
<input type='text' name='{{ field_name(form.cellPhone) }}' id='member_form_cellPhone' {% if member.cellPhone %} value='{{ member.cellPhone }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.email %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_email' class='form-label'>Email</label>
|
||||||
|
<input type='email' name='{{ field_name(form.email) }}' id='member_form_email' {% if member.email %} value='{{ member.email }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.school %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_school' class='form-label'>School</label>
|
||||||
|
<input type='text' name='{{ field_name(form.school) }}' id='member_form_school' {% if member.school %} value='{{ member.school }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='col'>
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.address %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_address' class='form-label'>Address</label>
|
||||||
|
<input type='text' name='{{ field_name(form.address) }}' id='member_form_address' {% if member.address %} value='{{ member.address }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.city %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_city' class='form-label'>City</label>
|
||||||
|
<input type='text' name='{{ field_name(form.city) }}' id='member_form_city' {% if member.city %} value='{{ member.city }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.state %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_state' class='form-label'>State</label>
|
||||||
|
<input type='text' name='{{ field_name(form.state) }}' id='member_form_state' {% if member.state %} value='{{ member.state }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.zip %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_zip' class='form-label'>Zip</label>
|
||||||
|
<input type='text' name='{{ field_name(form.zip) }}' id='member_form_zip' {% if member.zip %} value='{{ member.zip }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.maritalStatus %} is-filled{% endif %}'>
|
||||||
|
<label for='member_form_maritalStatus' class='form-label'>Marital Status</label>
|
||||||
|
<input type='text' name='{{ field_name(form.maritalStatus) }}' id='member_form_maritalStatus' {% if member.maritalStatus %} value='{{ member.maritalStatus }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.relationship %} is-filled{% endif %}'>
|
||||||
|
<select name="{{ field_name(form.relationship) }}" id='member_form_relationship' class='form-control' required="required">
|
||||||
|
<option value=''>-- Select Ralationship --</option>
|
||||||
|
|
||||||
|
{% for rel in enum('App\\Enums\\RelationshipType').cases() %}
|
||||||
|
<option value='{{ rel.value }}' {% if rel.name == member.relationship.name %} selected='selected' {% endif %}>{{ rel.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<select name="{{ field_name(form.gender) }}" id='member_form_gender' class='form-control' required="required">
|
||||||
|
<option value=''>-- Select Gender --</option>
|
||||||
|
|
||||||
|
{% for gen in enum('App\\Enums\\GenderType').cases() %}
|
||||||
|
<option value='{{ gen.value }}' {% if gen.name == member.gender.name %} selected='selected' {% endif %}>{{ gen.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<select name="{{ field_name(form.race) }}" id='member_form_race' class='form-control'>
|
||||||
|
<option value=''>-- Select Race --</option>
|
||||||
|
|
||||||
|
{% for r in enum('App\\Enums\\RaceType').cases() %}
|
||||||
|
<option value='{{ r.value }}' {% if r.name == member.race.name %} selected='selected' {% endif %}>{{ r.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3{% if member.language %} is-filled {% endif %}'>
|
||||||
|
<label for='member_form_language' class='form-label'>Language</label>
|
||||||
|
<input type='text' name='{{ field_name(form.language) }}' id='member_form_language' {% if member.language %} value='{{ member.language }}' {% endif %} class='form-control'/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isChild) }}' id='member_form_isChild' {% if member.isChild %} checked='checked' {% endif %}/>
|
||||||
|
<label for='member_form_isChild'>Child?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isParent) }}' id='member_form_isParent' {% if member.isParent %} checked='checked' {% endif %}/>
|
||||||
|
<label for='member_form_isParent'>Parent?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isAdultChild) }}' id='member_form_isAdultChild' {% if member.isAdultChild %} checked='checked' {% endif %}/>
|
||||||
|
<label for='member_form_isAdultChild'>Adult Child?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.isLegalGuardian) }}' id='member_form_isLegalGuardian' {% if member.isLegalGuardian %} checked='checked' {% endif %}/>
|
||||||
|
<label for='member_form_isLegalGuardian'>Legal Guardian?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.parentsLiveTogether) }}' id='member_form_parentsLiveTogether' {% if member.parentsLiveTogether %} checked='checked' {% endif %}/>
|
||||||
|
<label for='member_form_parentsLiveTogether'>Parents Living Together?</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='input-group input-group-outline mb-3'>
|
||||||
|
<input type='checkbox' name='{{ field_name(form.dcsApproved) }}' id='member_form_dcsApproved' {% if member.dcsApproved %} checked='checked' {% endif %}/>
|
||||||
|
<label for='member_form_dcsApproved'>DCS Approved?</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='row'>
|
||||||
|
<div class="text-center">
|
||||||
|
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Member</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ form_end(form) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
92
templates/internal/cases/members/list-members.html.twig
Normal file
92
templates/internal/cases/members/list-members.html.twig
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Case Member List
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||||
|
|
||||||
|
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||||
|
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||||
|
|
||||||
|
<div class="container-fluid py-2">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card my-4">
|
||||||
|
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
|
||||||
|
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
|
||||||
|
<div>
|
||||||
|
<h6 class="text-white text-capitalize ps-3">Member List</h6>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-member/{{ case.id }}', '_self')">Add Member</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body px-0 pb-2">
|
||||||
|
<div class="table-responsive p-0">
|
||||||
|
<table class="table align-items-center mb-0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Name</th>
|
||||||
|
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">DOB</th>
|
||||||
|
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Relationship</th>
|
||||||
|
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Phone</th>
|
||||||
|
<th class="text-secondary opacity-7"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for member in members %}
|
||||||
|
{% set age = '' %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class='d-flex px-2 py-1'>
|
||||||
|
<div class='d-flex flex-column justify-content-center'>
|
||||||
|
<h6 class='mb-0 text-small'>
|
||||||
|
<i class="material-symbols-rounded opacity-5">
|
||||||
|
{% if not member.isChild %}
|
||||||
|
{% if member.dcsApproved %}thumb_up{% else %}thumb_down
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</i>
|
||||||
|
{{ member.firstName }}
|
||||||
|
{{ member.lastName }}
|
||||||
|
({{ date().diff(date(member.dob)).y }})
|
||||||
|
</h6>
|
||||||
|
<p class='text-xs text-secondary mb-0'>
|
||||||
|
<a href='mailto:{{ member.email }}'>{{ member.email }}</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td title=''>
|
||||||
|
<p class='text-xs font-weight-bold mb-0'>
|
||||||
|
{{ member.dob|date("F j, Y") }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p class='text-xs font-weight-bold mb-0'>{{ member.relationship.value }}</p>
|
||||||
|
</td>
|
||||||
|
<td class='align-middle text-center text-xs'>
|
||||||
|
{% if member.phone %}
|
||||||
|
<a href='tel:{{ member.phone }}'>{{ member.getFormattedPhone() }}</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td class='align-middle'>
|
||||||
|
<a href='/index.php/case/{{ case.id }}/edit-member/{{ member.id }}' class='text-secondary font-weight-bold text-xs' data-toggle='tooltip' data-original-title='Edit Source'>
|
||||||
|
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user