<?php

namespace PHPMaker2023\Jack_Jill_school;

// Page object
$EventsAdd = &$Page;
?>
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { events: currentTable } });
var currentPageID = ew.PAGE_ID = "add";
var currentForm;
var feventsadd;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery;
    let fields = currentTable.fields;

    // Form object
    let form = new ew.FormBuilder()
        .setId("feventsadd")
        .setPageId("add")

        // Add fields
        .setFields([
            ["Event_Title", [fields.Event_Title.visible && fields.Event_Title.required ? ew.Validators.required(fields.Event_Title.caption) : null], fields.Event_Title.isInvalid],
            ["Event_Color", [fields.Event_Color.visible && fields.Event_Color.required ? ew.Validators.required(fields.Event_Color.caption) : null], fields.Event_Color.isInvalid],
            ["Event_Start", [fields.Event_Start.visible && fields.Event_Start.required ? ew.Validators.required(fields.Event_Start.caption) : null, ew.Validators.datetime(fields.Event_Start.clientFormatPattern)], fields.Event_Start.isInvalid],
            ["Event_End", [fields.Event_End.visible && fields.Event_End.required ? ew.Validators.required(fields.Event_End.caption) : null, ew.Validators.datetime(fields.Event_End.clientFormatPattern)], fields.Event_End.isInvalid],
            ["Event_Description", [fields.Event_Description.visible && fields.Event_Description.required ? ew.Validators.required(fields.Event_Description.caption) : null], fields.Event_Description.isInvalid],
            ["Event_User", [fields.Event_User.visible && fields.Event_User.required ? ew.Validators.required(fields.Event_User.caption) : null], fields.Event_User.isInvalid],
            ["Repeat_Type", [fields.Repeat_Type.visible && fields.Repeat_Type.required ? ew.Validators.required(fields.Repeat_Type.caption) : null], fields.Repeat_Type.isInvalid],
            ["Repeat_ID", [fields.Repeat_ID.visible && fields.Repeat_ID.required ? ew.Validators.required(fields.Repeat_ID.caption) : null, ew.Validators.integer], fields.Repeat_ID.isInvalid],
            ["Event_AllDay", [fields.Event_AllDay.visible && fields.Event_AllDay.required ? ew.Validators.required(fields.Event_AllDay.caption) : null], fields.Event_AllDay.isInvalid],
            ["Event_URL", [fields.Event_URL.visible && fields.Event_URL.required ? ew.Validators.required(fields.Event_URL.caption) : null], fields.Event_URL.isInvalid],
            ["Event_Category", [fields.Event_Category.visible && fields.Event_Category.required ? ew.Validators.required(fields.Event_Category.caption) : null], fields.Event_Category.isInvalid],
            ["Event_Timezone", [fields.Event_Timezone.visible && fields.Event_Timezone.required ? ew.Validators.required(fields.Event_Timezone.caption) : null], fields.Event_Timezone.isInvalid],
            ["Added_By", [fields.Added_By.visible && fields.Added_By.required ? ew.Validators.required(fields.Added_By.caption) : null], fields.Added_By.isInvalid],
            ["Date_Added", [fields.Date_Added.visible && fields.Date_Added.required ? ew.Validators.required(fields.Date_Added.caption) : null, ew.Validators.datetime(fields.Date_Added.clientFormatPattern)], fields.Date_Added.isInvalid],
            ["Updated_By", [fields.Updated_By.visible && fields.Updated_By.required ? ew.Validators.required(fields.Updated_By.caption) : null], fields.Updated_By.isInvalid],
            ["Date_Updated", [fields.Date_Updated.visible && fields.Date_Updated.required ? ew.Validators.required(fields.Date_Updated.caption) : null, ew.Validators.datetime(fields.Date_Updated.clientFormatPattern)], fields.Date_Updated.isInvalid]
        ])

        // Form_CustomValidate
        .setCustomValidate(
            function (fobj) { // DO NOT CHANGE THIS LINE! (except for adding "async" keyword)!
                    // Your custom validation code here, return false if invalid.
                    return true;
                }
        )

        // Use JavaScript validation or not
        .setValidateRequired(ew.CLIENT_VALIDATE)

        // Dynamic selection lists
        .setLists({
        })
        .build();
    window[form.id] = form;
    currentForm = form;
    loadjs.done(form.id);
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<?php if (!$Page->IsModal) { ?>
<div class="col-md-12">
  <div class="card shadow-sm">
    <div class="card-header">
	  <h4 class="card-title"><?php echo Language()->phrase("AddCaption"); ?></h4>
	  <div class="card-tools">
	  <button type="button" class="btn btn-tool" data-card-widget="maximize"><i class="fas fa-expand"></i>
	  </button>
	  </div>
	  <!-- /.card-tools -->
    </div>
    <!-- /.card-header -->
    <div class="card-body">
<?php } ?>
<form name="feventsadd" id="feventsadd" class="<?= $Page->FormClassName ?> form-wizard" action="<?= CurrentPageUrl(false) ?>" method="post" novalidate autocomplete="on" style="width:100% !important;">
<?php if (Config("CHECK_TOKEN")) { ?>
<input type="hidden" name="<?= $TokenNameKey ?>" value="<?= $TokenName ?>"><!-- CSRF token name -->
<input type="hidden" name="<?= $TokenValueKey ?>" value="<?= $TokenValue ?>"><!-- CSRF token value -->
<?php } ?>
<input type="hidden" name="t" value="events">
<input type="hidden" name="action" id="action" value="insert">
<input type="hidden" name="modal" value="<?= (int)$Page->IsModal ?>">
<?php if (IsJsonResponse()) { ?>
<input type="hidden" name="json" value="1">
<?php } ?>
<input type="hidden" name="<?= $Page->OldKeyName ?>" value="<?= $Page->OldKey ?>">
<div class="ew-add-div"><!-- page* -->
<?php if ($Page->Event_Title->Visible) { // Event_Title ?>
    <div id="r_Event_Title"<?= $Page->Event_Title->rowAttributes() ?>>
        <label id="elh_events_Event_Title" for="x_Event_Title" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_Title->caption() ?><?= $Page->Event_Title->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_Title->cellAttributes() ?>>
<span id="el_events_Event_Title">
<input type="<?= $Page->Event_Title->getInputTextType() ?>" name="x_Event_Title" id="x_Event_Title" data-table="events" data-field="x_Event_Title" value="<?= $Page->Event_Title->EditValue ?>" size="30" maxlength="255" placeholder="<?= HtmlEncode($Page->Event_Title->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_Title->formatPattern()) ?>"<?= $Page->Event_Title->editAttributes() ?> aria-describedby="x_Event_Title_help">
<?= $Page->Event_Title->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_Title->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_Color->Visible) { // Event_Color ?>
    <div id="r_Event_Color"<?= $Page->Event_Color->rowAttributes() ?>>
        <label id="elh_events_Event_Color" for="x_Event_Color" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_Color->caption() ?><?= $Page->Event_Color->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_Color->cellAttributes() ?>>
<span id="el_events_Event_Color">
<input type="<?= $Page->Event_Color->getInputTextType() ?>" name="x_Event_Color" id="x_Event_Color" data-table="events" data-field="x_Event_Color" value="<?= $Page->Event_Color->EditValue ?>" size="30" maxlength="7" placeholder="<?= HtmlEncode($Page->Event_Color->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_Color->formatPattern()) ?>"<?= $Page->Event_Color->editAttributes() ?> aria-describedby="x_Event_Color_help">
<?= $Page->Event_Color->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_Color->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_Start->Visible) { // Event_Start ?>
    <div id="r_Event_Start"<?= $Page->Event_Start->rowAttributes() ?>>
        <label id="elh_events_Event_Start" for="x_Event_Start" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_Start->caption() ?><?= $Page->Event_Start->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_Start->cellAttributes() ?>>
<span id="el_events_Event_Start">
<input type="<?= $Page->Event_Start->getInputTextType() ?>" name="x_Event_Start" id="x_Event_Start" data-table="events" data-field="x_Event_Start" value="<?= $Page->Event_Start->EditValue ?>" placeholder="<?= HtmlEncode($Page->Event_Start->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_Start->formatPattern()) ?>"<?= $Page->Event_Start->editAttributes() ?> aria-describedby="x_Event_Start_help">
<?= $Page->Event_Start->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_Start->getErrorMessage() ?></div>
<?php if (!$Page->Event_Start->ReadOnly && !$Page->Event_Start->Disabled && !isset($Page->Event_Start->EditAttrs["readonly"]) && !isset($Page->Event_Start->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["feventsadd", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.isDark() ? "dark" : "auto"
            }
        };
    ew.createDateTimePicker("feventsadd", "x_Event_Start", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_End->Visible) { // Event_End ?>
    <div id="r_Event_End"<?= $Page->Event_End->rowAttributes() ?>>
        <label id="elh_events_Event_End" for="x_Event_End" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_End->caption() ?><?= $Page->Event_End->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_End->cellAttributes() ?>>
<span id="el_events_Event_End">
<input type="<?= $Page->Event_End->getInputTextType() ?>" name="x_Event_End" id="x_Event_End" data-table="events" data-field="x_Event_End" value="<?= $Page->Event_End->EditValue ?>" placeholder="<?= HtmlEncode($Page->Event_End->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_End->formatPattern()) ?>"<?= $Page->Event_End->editAttributes() ?> aria-describedby="x_Event_End_help">
<?= $Page->Event_End->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_End->getErrorMessage() ?></div>
<?php if (!$Page->Event_End->ReadOnly && !$Page->Event_End->Disabled && !isset($Page->Event_End->EditAttrs["readonly"]) && !isset($Page->Event_End->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["feventsadd", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.isDark() ? "dark" : "auto"
            }
        };
    ew.createDateTimePicker("feventsadd", "x_Event_End", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_Description->Visible) { // Event_Description ?>
    <div id="r_Event_Description"<?= $Page->Event_Description->rowAttributes() ?>>
        <label id="elh_events_Event_Description" for="x_Event_Description" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_Description->caption() ?><?= $Page->Event_Description->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_Description->cellAttributes() ?>>
<span id="el_events_Event_Description">
<textarea data-table="events" data-field="x_Event_Description" name="x_Event_Description" id="x_Event_Description" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->Event_Description->getPlaceHolder()) ?>"<?= $Page->Event_Description->editAttributes() ?> aria-describedby="x_Event_Description_help"><?= $Page->Event_Description->EditValue ?></textarea>
<?= $Page->Event_Description->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_Description->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_User->Visible) { // Event_User ?>
    <div id="r_Event_User"<?= $Page->Event_User->rowAttributes() ?>>
        <label id="elh_events_Event_User" for="x_Event_User" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_User->caption() ?><?= $Page->Event_User->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_User->cellAttributes() ?>>
<span id="el_events_Event_User">
<input type="<?= $Page->Event_User->getInputTextType() ?>" name="x_Event_User" id="x_Event_User" data-table="events" data-field="x_Event_User" value="<?= $Page->Event_User->EditValue ?>" size="30" maxlength="20" placeholder="<?= HtmlEncode($Page->Event_User->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_User->formatPattern()) ?>"<?= $Page->Event_User->editAttributes() ?> aria-describedby="x_Event_User_help">
<?= $Page->Event_User->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_User->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Repeat_Type->Visible) { // Repeat_Type ?>
    <div id="r_Repeat_Type"<?= $Page->Repeat_Type->rowAttributes() ?>>
        <label id="elh_events_Repeat_Type" for="x_Repeat_Type" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Repeat_Type->caption() ?><?= $Page->Repeat_Type->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Repeat_Type->cellAttributes() ?>>
<span id="el_events_Repeat_Type">
<input type="<?= $Page->Repeat_Type->getInputTextType() ?>" name="x_Repeat_Type" id="x_Repeat_Type" data-table="events" data-field="x_Repeat_Type" value="<?= $Page->Repeat_Type->EditValue ?>" size="30" maxlength="20" placeholder="<?= HtmlEncode($Page->Repeat_Type->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Repeat_Type->formatPattern()) ?>"<?= $Page->Repeat_Type->editAttributes() ?> aria-describedby="x_Repeat_Type_help">
<?= $Page->Repeat_Type->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Repeat_Type->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Repeat_ID->Visible) { // Repeat_ID ?>
    <div id="r_Repeat_ID"<?= $Page->Repeat_ID->rowAttributes() ?>>
        <label id="elh_events_Repeat_ID" for="x_Repeat_ID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Repeat_ID->caption() ?><?= $Page->Repeat_ID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Repeat_ID->cellAttributes() ?>>
<span id="el_events_Repeat_ID">
<input type="<?= $Page->Repeat_ID->getInputTextType() ?>" name="x_Repeat_ID" id="x_Repeat_ID" data-table="events" data-field="x_Repeat_ID" value="<?= $Page->Repeat_ID->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->Repeat_ID->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Repeat_ID->formatPattern()) ?>"<?= $Page->Repeat_ID->editAttributes() ?> aria-describedby="x_Repeat_ID_help">
<?= $Page->Repeat_ID->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Repeat_ID->getErrorMessage() ?></div>
<script type="text/javascript">
loadjs.ready(["feventsadd", "jquerynumber"], function() {
	ew.createjQueryNumber("feventsadd", "x_Repeat_ID", {"number": true, "decimals": 0, "dec_point": "<?php echo $DECIMAL_SEPARATOR ?>", "thousands_sep" : "<?php echo $GROUPING_SEPARATOR ?>"});
});
</script>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_AllDay->Visible) { // Event_AllDay ?>
    <div id="r_Event_AllDay"<?= $Page->Event_AllDay->rowAttributes() ?>>
        <label id="elh_events_Event_AllDay" for="x_Event_AllDay" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_AllDay->caption() ?><?= $Page->Event_AllDay->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_AllDay->cellAttributes() ?>>
<span id="el_events_Event_AllDay">
<input type="<?= $Page->Event_AllDay->getInputTextType() ?>" name="x_Event_AllDay" id="x_Event_AllDay" data-table="events" data-field="x_Event_AllDay" value="<?= $Page->Event_AllDay->EditValue ?>" size="30" maxlength="5" placeholder="<?= HtmlEncode($Page->Event_AllDay->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_AllDay->formatPattern()) ?>"<?= $Page->Event_AllDay->editAttributes() ?> aria-describedby="x_Event_AllDay_help">
<?= $Page->Event_AllDay->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_AllDay->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_URL->Visible) { // Event_URL ?>
    <div id="r_Event_URL"<?= $Page->Event_URL->rowAttributes() ?>>
        <label id="elh_events_Event_URL" for="x_Event_URL" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_URL->caption() ?><?= $Page->Event_URL->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_URL->cellAttributes() ?>>
<span id="el_events_Event_URL">
<input type="<?= $Page->Event_URL->getInputTextType() ?>" name="x_Event_URL" id="x_Event_URL" data-table="events" data-field="x_Event_URL" value="<?= $Page->Event_URL->EditValue ?>" size="30" maxlength="255" placeholder="<?= HtmlEncode($Page->Event_URL->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_URL->formatPattern()) ?>"<?= $Page->Event_URL->editAttributes() ?> aria-describedby="x_Event_URL_help">
<?= $Page->Event_URL->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_URL->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_Category->Visible) { // Event_Category ?>
    <div id="r_Event_Category"<?= $Page->Event_Category->rowAttributes() ?>>
        <label id="elh_events_Event_Category" for="x_Event_Category" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_Category->caption() ?><?= $Page->Event_Category->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_Category->cellAttributes() ?>>
<span id="el_events_Event_Category">
<input type="<?= $Page->Event_Category->getInputTextType() ?>" name="x_Event_Category" id="x_Event_Category" data-table="events" data-field="x_Event_Category" value="<?= $Page->Event_Category->EditValue ?>" size="30" maxlength="50" placeholder="<?= HtmlEncode($Page->Event_Category->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_Category->formatPattern()) ?>"<?= $Page->Event_Category->editAttributes() ?> aria-describedby="x_Event_Category_help">
<?= $Page->Event_Category->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_Category->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Event_Timezone->Visible) { // Event_Timezone ?>
    <div id="r_Event_Timezone"<?= $Page->Event_Timezone->rowAttributes() ?>>
        <label id="elh_events_Event_Timezone" for="x_Event_Timezone" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Event_Timezone->caption() ?><?= $Page->Event_Timezone->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Event_Timezone->cellAttributes() ?>>
<span id="el_events_Event_Timezone">
<input type="<?= $Page->Event_Timezone->getInputTextType() ?>" name="x_Event_Timezone" id="x_Event_Timezone" data-table="events" data-field="x_Event_Timezone" value="<?= $Page->Event_Timezone->EditValue ?>" size="30" maxlength="64" placeholder="<?= HtmlEncode($Page->Event_Timezone->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Event_Timezone->formatPattern()) ?>"<?= $Page->Event_Timezone->editAttributes() ?> aria-describedby="x_Event_Timezone_help">
<?= $Page->Event_Timezone->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Event_Timezone->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Added_By->Visible) { // Added_By ?>
    <div id="r_Added_By"<?= $Page->Added_By->rowAttributes() ?>>
        <label id="elh_events_Added_By" for="x_Added_By" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Added_By->caption() ?><?= $Page->Added_By->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Added_By->cellAttributes() ?>>
<span id="el_events_Added_By">
<input type="<?= $Page->Added_By->getInputTextType() ?>" name="x_Added_By" id="x_Added_By" data-table="events" data-field="x_Added_By" value="<?= $Page->Added_By->EditValue ?>" size="30" maxlength="20" placeholder="<?= HtmlEncode($Page->Added_By->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Added_By->formatPattern()) ?>"<?= $Page->Added_By->editAttributes() ?> aria-describedby="x_Added_By_help">
<?= $Page->Added_By->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Added_By->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Date_Added->Visible) { // Date_Added ?>
    <div id="r_Date_Added"<?= $Page->Date_Added->rowAttributes() ?>>
        <label id="elh_events_Date_Added" for="x_Date_Added" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Date_Added->caption() ?><?= $Page->Date_Added->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Date_Added->cellAttributes() ?>>
<span id="el_events_Date_Added">
<input type="<?= $Page->Date_Added->getInputTextType() ?>" name="x_Date_Added" id="x_Date_Added" data-table="events" data-field="x_Date_Added" value="<?= $Page->Date_Added->EditValue ?>" placeholder="<?= HtmlEncode($Page->Date_Added->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Date_Added->formatPattern()) ?>"<?= $Page->Date_Added->editAttributes() ?> aria-describedby="x_Date_Added_help">
<?= $Page->Date_Added->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Date_Added->getErrorMessage() ?></div>
<?php if (!$Page->Date_Added->ReadOnly && !$Page->Date_Added->Disabled && !isset($Page->Date_Added->EditAttrs["readonly"]) && !isset($Page->Date_Added->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["feventsadd", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.isDark() ? "dark" : "auto"
            }
        };
    ew.createDateTimePicker("feventsadd", "x_Date_Added", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Updated_By->Visible) { // Updated_By ?>
    <div id="r_Updated_By"<?= $Page->Updated_By->rowAttributes() ?>>
        <label id="elh_events_Updated_By" for="x_Updated_By" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Updated_By->caption() ?><?= $Page->Updated_By->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Updated_By->cellAttributes() ?>>
<span id="el_events_Updated_By">
<input type="<?= $Page->Updated_By->getInputTextType() ?>" name="x_Updated_By" id="x_Updated_By" data-table="events" data-field="x_Updated_By" value="<?= $Page->Updated_By->EditValue ?>" size="30" maxlength="20" placeholder="<?= HtmlEncode($Page->Updated_By->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Updated_By->formatPattern()) ?>"<?= $Page->Updated_By->editAttributes() ?> aria-describedby="x_Updated_By_help">
<?= $Page->Updated_By->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Updated_By->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Date_Updated->Visible) { // Date_Updated ?>
    <div id="r_Date_Updated"<?= $Page->Date_Updated->rowAttributes() ?>>
        <label id="elh_events_Date_Updated" for="x_Date_Updated" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Date_Updated->caption() ?><?= $Page->Date_Updated->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Date_Updated->cellAttributes() ?>>
<span id="el_events_Date_Updated">
<input type="<?= $Page->Date_Updated->getInputTextType() ?>" name="x_Date_Updated" id="x_Date_Updated" data-table="events" data-field="x_Date_Updated" value="<?= $Page->Date_Updated->EditValue ?>" placeholder="<?= HtmlEncode($Page->Date_Updated->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Date_Updated->formatPattern()) ?>"<?= $Page->Date_Updated->editAttributes() ?> aria-describedby="x_Date_Updated_help">
<?= $Page->Date_Updated->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Date_Updated->getErrorMessage() ?></div>
<?php if (!$Page->Date_Updated->ReadOnly && !$Page->Date_Updated->Disabled && !isset($Page->Date_Updated->EditAttrs["readonly"]) && !isset($Page->Date_Updated->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["feventsadd", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.isDark() ? "dark" : "auto"
            }
        };
    ew.createDateTimePicker("feventsadd", "x_Date_Updated", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
<?= $Page->IsModal ? '<template class="ew-modal-buttons">' : '<div class="row ew-buttons">' ?><!-- buttons .row -->
    <div class="<?= $Page->OffsetColumnClass ?>"><!-- buttons offset -->
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit" form="feventsadd"><?= $Language->phrase("AddBtn") ?></button>
<?php if (IsJsonResponse()) { ?>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-bs-dismiss="modal"><?= $Language->phrase("CancelBtn") ?></button>
<?php } else { ?>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" form="feventsadd" data-href="<?= HtmlEncode(GetUrl($Page->getReturnUrl())) ?>"><?= $Language->phrase("CancelBtn") ?></button>
<?php } ?>
    </div><!-- /buttons offset -->
<?= $Page->IsModal ? "</template>" : "</div>" ?><!-- /buttons .row -->
</form>
<?php if (!$Page->IsModal) { ?>
		</div>
     <!-- /.card-body -->
     </div>
  <!-- /.card -->
</div>
<?php } ?>
<div class="clearfix">&nbsp;</div>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("events");
});
</script>
<?php if (Config("MS_ENTER_MOVING_CURSOR_TO_NEXT_FIELD")) { ?>
<script>
loadjs.ready("head", function() { $("#feventsadd:first *:input[type!=hidden]:first").focus(),$("input").keydown(function(i){if(13==i.which){var e=$(this).closest("form").find(":input:visible:enabled"),n=e.index(this);n==e.length-1||(e.eq(e.index(this)+1).focus(),i.preventDefault())}else 113==i.which&&$("#btn-action").click()}),$("select").keydown(function(i){if(13==i.which){var e=$(this).closest("form").find(":input:visible:enabled"),n=e.index(this);n==e.length-1||(e.eq(e.index(this)+1).focus(),i.preventDefault())}else 113==i.which&&$("#btn-action").click()}),$("radio").keydown(function(i){if(13==i.which){var e=$(this).closest("form").find(":input:visible:enabled"),n=e.index(this);n==e.length-1||(e.eq(e.index(this)+1).focus(),i.preventDefault())}else 113==i.which&&$("#btn-action").click()})});
</script>
<?php } ?>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
<?php if (!$Page->IsModal && !$Page->isExport()) { ?>
<script>
loadjs.ready(["wrapper", "head", "swal"],function(){$('#btn-action').on('click',function(){if(feventsadd.validateFields()){ew.prompt({title: ew.language.phrase("MessageAddConfirm"),icon:'question',showCancelButton:true},result=>{if(result)$("#feventsadd").submit();});return false;} else { ew.prompt({title: ew.language.phrase("MessageInvalidForm"), icon: 'warning', showCancelButton:false}); }});});
</script>
<?php } ?>
