Add title field
Change-Id: I17523cf62ef8dbc062eb5742f1c8dcf559c79028
diff --git a/User.php b/User.php
index aa7357c..1b459cf 100644
--- a/User.php
+++ b/User.php
@@ -6,6 +6,7 @@
{
public $id;
public $username;
+ public $title;
public $first_name;
public $last_name;
public $organization;
@@ -38,6 +39,7 @@
{
$this->id = "";
$this->username = "";
+ $this->title = "";
$this->first_name = "";
$this->last_name = "";
$this->email = "";
diff --git a/create_user_table.sql b/create_user_table.sql
index b9c59a4..480b623 100644
--- a/create_user_table.sql
+++ b/create_user_table.sql
@@ -1,6 +1,7 @@
create table `person` (
`id` int unsigned not null auto_increment,
username varchar(32),
+ title varchar(16) not null default '',
first_name varchar(32) not null default '',
last_name varchar(32) not null default '',
organization varchar(32) not null default '',
diff --git a/invoice.php b/invoice.php
index 3b73799..2892865 100644
--- a/invoice.php
+++ b/invoice.php
@@ -25,8 +25,8 @@
$invoice->setDate(date('Y-m-d', time()));
$invoice->lang['to'] = "billing from";
$invoice->lang['from'] = "billing to";
- $invoice->setTo(['ICLC-conference / Administration', 'Leibniz-Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']);
- $invoice->setFrom([$user->first_name . ' ' . $user->last_name, $user->organization, $user->street, $user->zip . ' ' . $user->city, $user->country]);
+ $invoice->setTo(['ICLC-conference / Administration', 'Leibniz Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']);
+ $invoice->setFrom([($user->title? $user->title . ' ' : ''). $user->first_name . ' ' . $user->last_name, $user->organization, $user->street, $user->zip . ' ' . $user->city, $user->country]);
$invoice->setDue(date('Y-m-d', strtotime('+2 weeks')));
// $invoice->hide_tofrom();
/* Adding Items in table */
@@ -89,7 +89,7 @@
If you have any questions about this invoice, please contact us via buchhaltung@ids-mannheim.de.
");
- $invoice->setFooterNote("Leibniz-Institute for the German Language, Civil Law Foundation, VAT ID: DE 143 845 359");
+ $invoice->setFooterNote("Leibniz Institute for the German Language, Civil Law Foundation, VAT ID: DE 143 845 359");
/* Render */
$ret = $invoice->render('example4.pdf', 'S'); /* I => Display on browser, D => Force Download, F => local path save, S => return document path */
diff --git a/templates/register.htm b/templates/register.htm
index 597d67a..bf1171c 100644
--- a/templates/register.htm
+++ b/templates/register.htm
@@ -30,14 +30,25 @@
<?php if(! $CONFERENCE_REGISTRATION ): ?>
<!-- Username input -->
<div class="col-md-4">
- <label class="form-label fw-bold" for="form3Example3">Username</label>
- <input pattern="[^\s]{<?php echo $VAL_USER->min_username.','.$VAL_USER->max_username;?>}" required title="At least 5 not whitespace characters" name="username" type="text" id="form3Example0" class="form-control fs-4 <?php if(isset($error) && $error && !isset($_POST['username'])){echo 'border-danger';}?>"
+ <label class="form-label fw-bold" for="username">Username</label>
+ <input pattern="[^\s]{<?php echo $VAL_USER->min_username.','.$VAL_USER->max_username;?>}" required title="At least 5 not whitespace characters" name="username" type="text" id="username" class="form-control fs-4 <?php if(isset($error) && $error && !isset($_POST['username'])){echo 'border-danger';}?>"
placeholder="johndoe" value="<?php echo isset($_POST['username']) ? htmlspecialchars($_POST['username']) : '' ?>" />
<div class="invalid-feedback">
Please choose a username with at least 5 not whitespace characters.
</div>
</div>
<?php endif; ?>
+ <?php if( $CONFERENCE_REGISTRATION ): ?>
+ <!-- title input -->
+ <div class="col-md-3">
+ <label class="form-label fs-4 fw-bold" for="title">Title</label>
+ <select class="form-select fs-4 " id="title" name="title" aria-label="Title">
+ <option selected value=""></option>
+ <option value="Dr.">Dr.</option>
+ <option value="Prof. Dr.">Prof. Dr.</option>
+ </select>
+ </div>
+ <?php endif; ?>
<!-- 2 column grid layout with text inputs for the first and last names -->
<div class="col-md-4">
<div class="form-outline">