Add: New Fields for the form
This commit is contained in:
@@ -15,57 +15,120 @@
|
||||
<form method="POST" action="{{ route('faculty.submitResponse') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="px-4 py-5 sm:px-6">
|
||||
<div class="space-y-4">
|
||||
<!-- Title of Activity -->
|
||||
<div class="flex items-center">
|
||||
<label for="title" class="block text-sm font-medium text-gray-700">Title of Activity</label>
|
||||
<div class="mt-1">
|
||||
<input type="text" name="title" id="title" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<div class="space-y-6">
|
||||
|
||||
<!-- Other Fields -->
|
||||
<div>
|
||||
<label for="title" class="block text-sm font-medium text-gray-700">Title/Description</label>
|
||||
<input type="text" name="title" id="title" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="organising_institute" class="block text-sm font-medium text-gray-700">Organising Institute/Company</label>
|
||||
<input type="text" name="organising_institute" id="organising_institute" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label for="address" class="block text-sm font-medium text-gray-700">Brief Address (City/State/Country)</label>
|
||||
<textarea name="address" id="address" rows="2" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required></textarea>
|
||||
</div>
|
||||
<!-- Department and Faculty Name -->
|
||||
<div class="grid grid-cols-2 sm:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="department" class="block text-sm font-medium text-gray-700">Department</label>
|
||||
<input type="text" name="department" id="department" value="{{ auth()->user()->department->name }}" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm bg-gray-100" disabled>
|
||||
</div>
|
||||
<div>
|
||||
<label for="faculty_name" class="block text-sm font-medium text-gray-700">Faculty Name</label>
|
||||
<input type="text" name="faculty_name" id="faculty_name" value="{{ auth()->user()->name }}" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm bg-gray-100" disabled>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Type of Activity -->
|
||||
<div class="flex items-center">
|
||||
<label for="activity_type" class="block text-sm font-medium text-gray-700">Type of Activity</label>
|
||||
<div class="mt-1">
|
||||
<input type="text" name="activity_type" id="activity_type" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<!-- Start Date, End Date, Number of Days, Time -->
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
||||
<input type="date" name="start_date" id="start_date" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required onchange="calculateDays()">
|
||||
</div>
|
||||
<div>
|
||||
<label for="end_date" class="block text-sm font-medium text-gray-700">End Date</label>
|
||||
<input type="date" name="end_date" id="end_date" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required onchange="calculateDays()">
|
||||
</div>
|
||||
<div>
|
||||
<label for="num_days" class="block text-sm font-medium text-gray-700">Number of Days</label>
|
||||
<input type="text" name="num_days" id="num_days" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm bg-gray-100" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="time" class="block text-sm font-medium text-gray-700">Time from</label>
|
||||
<input type="time" name="start_time" id="start_time" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
</div>
|
||||
<div>
|
||||
<label for="time" class="block text-sm font-medium text-gray-700">Time to</label>
|
||||
<input type="time" name="end_time" id="end_time" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Start Date -->
|
||||
<div class="flex items-center">
|
||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
||||
<div class="mt-1">
|
||||
<input type="date" name="start_date" id="start_date" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<!-- Activity Type, Category, Level -->
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label for="activity_type" class="block text-sm font-medium text-gray-700">Select Activity Type</label>
|
||||
<select name="activity_type" id="activity_type" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<option value="">Select</option>
|
||||
<option value="GL">GL</option>
|
||||
<option value="IC">IC</option>
|
||||
<option value="STTP">STTP</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- End Date -->
|
||||
<div class="flex items-center">
|
||||
<label for="end_date" class="block text-sm font-medium text-gray-700">End Date</label>
|
||||
<div class="mt-1">
|
||||
<input type="date" name="end_date" id="end_date" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<div>
|
||||
<label for="category" class="block text-sm font-medium text-gray-700">Select Category</label>
|
||||
<select name="category" id="category" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<option value="">Select</option>
|
||||
<option value="Technical">Technical</option>
|
||||
<option value="Social">Social</option>
|
||||
<option value="Entrepreneurial">Entrepreneurial</option>
|
||||
<option value="Life Skill">Life Skill</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Proof of Activity -->
|
||||
<div class="flex items-center">
|
||||
<label for="proof" class="block text-sm font-medium text-gray-700">Proof of Activity</label>
|
||||
<div class="mt-1">
|
||||
<input type="file" name="proof" id="proof" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" accept=".jpg,.jpeg,.png,.pdf,.doc,.docx">
|
||||
<div>
|
||||
<label for="level" class="block text-sm font-medium text-gray-700">Select Level</label>
|
||||
<select name="level" id="level" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
|
||||
<option value="">Select</option>
|
||||
<option value="College">College</option>
|
||||
<option value="State">State</option>
|
||||
<option value="National">National</option>
|
||||
<option value="International">International</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="proof" class="block text-sm font-medium text-gray-700">Upload Proof/Document</label>
|
||||
<input type="file" name="proof" id="proof" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" accept=".jpg,.jpeg,.png,.pdf,.doc,.docx,.zip" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="px-4 py-3 sm:px-6 text-right">
|
||||
<button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
<div class="px-4 py-3 sm:px-6 text-center mt-4">
|
||||
<button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-black">
|
||||
Submit Response
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
<script>
|
||||
function calculateDays() {
|
||||
const startDate = new Date(document.getElementById('start_date').value);
|
||||
const endDate = new Date(document.getElementById('end_date').value);
|
||||
if (startDate && endDate) {
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const numDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) || 1;
|
||||
document.getElementById('num_days').value = numDays;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user