Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 119 additions & 22 deletions admin/card/createCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
checkRoleAccess(['officeAdmin', 'cardAdmin', 'superAdmin']);
</script>

<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down Expand Up @@ -31,8 +31,9 @@
<div class="container">
<div class="logout">
<a href="javascript:void(0);" onclick="history.back()">Back</a>
&nbsp; | &nbsp; <a href="javascript:void(0);" onclick="goToHome()">Home</a>
&nbsp; | &nbsp; <a href="javascript:void(0);" onclick="logout()">Logout</a>
&nbsp; | &nbsp;
<a href="javascript:void(0);" onclick="goToHome()">Home</a> &nbsp; |
&nbsp; <a href="javascript:void(0);" onclick="logout()">Logout</a>
</div>
</div>
</div>
Expand All @@ -45,14 +46,26 @@
<div class="form">
<form id="cardForm" onsubmit="assignCard(event)">
<div class="row">

<div class="form-group">
<label for="cardno">Card Number:</label>
<input type="text" id="cardno" name="cardno" class="form-control" pattern="[0-9]{10}" required />
<input
type="text"
id="cardno"
name="cardno"
class="form-control"
placeholder="Auto-generated"
readonly
Comment on lines +56 to +57

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cardno is now readonly / auto-generated and lost its previous required + pattern="[0-9]{10}". Nothing in createCard.js populates this field, so the submit handler sends cardno: form.cardno.value as an empty string (createCard.js:231).

Please confirm the /card/create backend treats an empty cardno as "generate one". If it still validates the format, "" will be rejected; if it auto-generates, consider dropping cardno from the request payload entirely to make the intent explicit.

/>
</div>
<div class="form-group">
<label for="issuedto">Card Issued To:</label>
<input type="text" id="issuedto" name="issuedto" class="form-control" required />
<input
type="text"
id="issuedto"
name="issuedto"
class="form-control"
required
/>
</div>
<div class="form-group">
<label for="gender">Gender:</label>
Expand All @@ -63,15 +76,35 @@
</div>
<div class="form-group">
<label for="dob">Date of Birth:</label>
<input type="date" id="dob" name="dob" class="form-control" required />
<input
type="date"
id="dob"
name="dob"
class="form-control"
required
/>
</div>
<div class="form-group">
<label for="mobno">Phone No:</label>
<input type="text" id="mobno" name="mobno" class="form-control" maxlength="10" pattern="\d{10}" title="Please enter exactly 10 digits" required />
<input
type="text"
id="mobno"
name="mobno"
class="form-control"
maxlength="10"
pattern="\d{10}"
title="Please enter exactly 10 digits"
required
/>
</div>
<div class="form-group">
<label for="email">E-mail address:</label>
<input type="text" id="email" name="email" class="form-control" />
<input
type="text"
id="email"
name="email"
class="form-control"
/>
</div>
<div class="form-group">
<label for="idType">ID Type:</label>
Expand All @@ -83,17 +116,33 @@
</div>
<div class="form-group">
<label for="idNo">ID No:</label>
<input type="text" id="idNo" name="idNo" class="form-control" required />
<input
type="text"
id="idNo"
name="idNo"
class="form-control"
required
/>
</div>
<div class="form-group">
<label for="country">Country:</label>
<select id="country" name="country" class="form-control" required>
<select
id="country"
name="country"
class="form-control"
required
>
<option value="">Select Country</option>
</select>
</div>
<div class="form-group">
<label for="state">State:</label>
<select id="state" name="state" class="form-control" required>
<select
id="state"
name="state"
class="form-control"
required
>
<option value="">Select State</option>
</select>
</div>
Expand All @@ -105,15 +154,32 @@
</div>
<div class="form-group">
<label for="address">Address:</label>
<input type="text" id="address" name="address" class="form-control" required />
<input
type="text"
id="address"
name="address"
class="form-control"
required
/>
</div>
<div class="form-group">
<label for="pin">PIN:</label>
<input type="text" id="pin" name="pin" class="form-control" required />
<input
type="text"
id="pin"
name="pin"
class="form-control"
required
/>
</div>
<div class="form-group">
<label for="centre">Centre:</label>
<select id="centre" name="centre" class="form-control" required>
<select
id="centre"
name="centre"
class="form-control"
required
>
<option value="">Select Centre</option>
<option value="Ahmedabad">Ahmedabad</option>
<option value="Anand">Anand</option>
Expand Down Expand Up @@ -169,23 +235,53 @@

<div class="form-group">
<label for="res_status">Residential Status:</label>
<select id="res_status" name="res_status" class="form-control">
<select
id="res_status"
name="res_status"
class="form-control"
>
<option value="MUMUKSHU">MUMUKSHU</option>
<option value="PR">PR</option>
<option value="SEVA KUTIR">SEVA KUTIR</option>
<option value="GUEST">GUEST</option>
</select>
</div>

<!-- Seva Kutir-specific fields -->
<div id="sevaKutirFields" style="display: none">
<div class="form-group">
<label for="department">Department:</label>
<select
id="department"
name="department"
class="form-control"
>
<option value="">Select Department</option>
</select>
</div>
</div>

<!-- Guest-specific fields -->
<div id="guestFields" style="display: none;">
<div id="guestFields" style="display: none">
<div class="form-group">
<label for="reference_cardno">Reference Card Number:</label>
<input type="text" id="reference_cardno" name="reference_cardno" class="form-control" />
<label for="reference_phone"
>Reference Phone Number:</label
>
<input
type="text"
id="reference_phone"
name="reference_phone"
class="form-control"
/>
<small id="refPhoneName" style="display: block; margin-top: 5px; font-weight: bold; color: #2e7d32;"></small>
</div>
<div class="form-group">
<label for="guest_type">Guest Type:</label>
<select id="guest_type" name="guest_type" class="form-control">
<select
id="guest_type"
name="guest_type"
class="form-control"
>
<option value="">Select Type</option>
<option value="Family">Family</option>
<option value="Friend">Friend</option>
Expand All @@ -196,9 +292,10 @@
</div>

<div class="form-group form-submit">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="submit" class="btn btn-primary">
Submit
</button>
</div>

</div>
</form>
</div>
Expand Down
Loading
Loading