<?php
namespace PHPMaker2019\project_germanos;

// Write header
WriteHeader(FALSE);

// Create page object
if (!isset($attachments_grid))
	$attachments_grid = new attachments_grid();

// Run the page
$attachments_grid->run();

// Setup login status
SetupLoginStatus();
SetClientVar("login", LoginStatus());

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$attachments_grid->Page_Render();
?>
<?php if (!$attachments->isExport()) { ?>
<script>

// Form object
var fattachmentsgrid = new ew.Form("fattachmentsgrid", "grid");
fattachmentsgrid.formKeyCountName = '<?php echo $attachments_grid->FormKeyCountName ?>';

// Validate form
fattachmentsgrid.validate = function() {
	if (!this.validateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.getForm(), $fobj = $(fobj);
	if ($fobj.find("#confirm").val() == "F")
		return true;
	var elm, felm, uelm, addcnt = 0;
	var $k = $fobj.find("#" + this.formKeyCountName); // Get key_count
	var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
	var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
	var gridinsert = ["insert", "gridinsert"].includes($fobj.find("#action").val()) && $k[0];
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
		var checkrow = (gridinsert) ? !this.emptyRow(infix) : true;
		if (checkrow) {
			addcnt++;
		<?php if ($attachments_grid->AttachmentID->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachmentID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachmentID->caption(), $attachments->AttachmentID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->AttachmentSource_ID->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachmentSource_ID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachmentSource_ID->caption(), $attachments->AttachmentSource_ID->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_AttachmentSource_ID");
			if (elm && !ew.checkInteger(elm.value))
				return this.onError(elm, "<?php echo JsEncode($attachments->AttachmentSource_ID->errorMessage()) ?>");
		<?php if ($attachments_grid->CaseID->Required) { ?>
			elm = this.getElements("x" + infix + "_CaseID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->CaseID->caption(), $attachments->CaseID->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_CaseID");
			if (elm && !ew.checkInteger(elm.value))
				return this.onError(elm, "<?php echo JsEncode($attachments->CaseID->errorMessage()) ?>");
		<?php if ($attachments_grid->EmployeeID->Required) { ?>
			elm = this.getElements("x" + infix + "_EmployeeID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->EmployeeID->caption(), $attachments->EmployeeID->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_EmployeeID");
			if (elm && !ew.checkInteger(elm.value))
				return this.onError(elm, "<?php echo JsEncode($attachments->EmployeeID->errorMessage()) ?>");
		<?php if ($attachments_grid->AttachID->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachID->caption(), $attachments->AttachID->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_AttachID");
			if (elm && !ew.checkInteger(elm.value))
				return this.onError(elm, "<?php echo JsEncode($attachments->AttachID->errorMessage()) ?>");
		<?php if ($attachments_grid->AttachFilename->Required) { ?>
			felm = this.getElements("x" + infix + "_AttachFilename");
			elm = this.getElements("fn_x" + infix + "_AttachFilename");
			if (felm && elm && !ew.hasValue(elm))
				return this.onError(felm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachFilename->caption(), $attachments->AttachFilename->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->AttachFilenameInitial->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachFilenameInitial");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachFilenameInitial->caption(), $attachments->AttachFilenameInitial->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->AttachExtension->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachExtension");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachExtension->caption(), $attachments->AttachExtension->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->AttachDescription->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachDescription");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachDescription->caption(), $attachments->AttachDescription->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->AttachFilepath->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachFilepath");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachFilepath->caption(), $attachments->AttachFilepath->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->AttachPath->Required) { ?>
			elm = this.getElements("x" + infix + "_AttachPath");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->AttachPath->caption(), $attachments->AttachPath->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($attachments_grid->_Case->Required) { ?>
			elm = this.getElements("x" + infix + "__Case");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $attachments->_Case->caption(), $attachments->_Case->RequiredErrorMessage)) ?>");
		<?php } ?>

			// Fire Form_CustomValidate event
			if (!this.Form_CustomValidate(fobj))
				return false;
		} // End Grid Add checking
	}
	return true;
}

// Check empty row
fattachmentsgrid.emptyRow = function(infix) {
	var fobj = this._form;
	if (ew.valueChanged(fobj, infix, "AttachmentSource_ID", false)) return false;
	if (ew.valueChanged(fobj, infix, "CaseID", false)) return false;
	if (ew.valueChanged(fobj, infix, "EmployeeID", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachID", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachFilename", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachFilenameInitial", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachExtension", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachDescription", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachFilepath", false)) return false;
	if (ew.valueChanged(fobj, infix, "AttachPath", false)) return false;
	if (ew.valueChanged(fobj, infix, "_Case", false)) return false;
	return true;
}

// Form_CustomValidate event
fattachmentsgrid.Form_CustomValidate = function(fobj) { // DO NOT CHANGE THIS LINE!

	// Your custom validation code here, return false if invalid.
	return true;
}

// Use JavaScript validation or not
fattachmentsgrid.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

// Dynamic selection lists
fattachmentsgrid.lists["x_AttachmentSource_ID"] = <?php echo $attachments_grid->AttachmentSource_ID->Lookup->toClientList() ?>;
fattachmentsgrid.lists["x_AttachmentSource_ID"].options = <?php echo JsonEncode($attachments_grid->AttachmentSource_ID->lookupOptions()) ?>;
fattachmentsgrid.autoSuggests["x_AttachmentSource_ID"] = <?php echo json_encode(["data" => "ajax=autosuggest"]) ?>;

// Form object for search
</script>
<script src="phpjs/ewscrolltable.js"></script>
<?php } ?>
<?php
$attachments_grid->renderOtherOptions();
?>
<?php $attachments_grid->showPageHeader(); ?>
<?php
$attachments_grid->showMessage();
?>
<?php if ($attachments_grid->TotalRecs > 0 || $attachments->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($attachments_grid->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> attachments">
<?php if ($attachments_grid->ShowOtherOptions) { ?>
<div class="card-header ew-grid-upper-panel">
<?php $attachments_grid->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<div id="fattachmentsgrid" class="ew-form ew-list-form form-inline">
<div id="gmp_attachments" class="<?php if (IsResponsiveLayout()) { ?>table-responsive <?php } ?>card-body ew-grid-middle-panel">
<table id="tbl_attachmentsgrid" class="table ew-table"><!-- .ew-table ##-->
<thead>
	<tr class="ew-table-header">
<?php

// Header row
$attachments_grid->RowType = ROWTYPE_HEADER;

// Render list options
$attachments_grid->renderListOptions();

// Render list options (header, left)
$attachments_grid->ListOptions->render("header", "left");
?>
<?php if ($attachments->AttachmentID->Visible) { // AttachmentID ?>
	<?php if ($attachments->sortUrl($attachments->AttachmentID) == "") { ?>
		<th data-name="AttachmentID" class="<?php echo $attachments->AttachmentID->headerCellClass() ?>"><div id="elh_attachments_AttachmentID" class="attachments_AttachmentID"><div class="ew-table-header-caption"><?php echo $attachments->AttachmentID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachmentID" class="<?php echo $attachments->AttachmentID->headerCellClass() ?>"><div><div id="elh_attachments_AttachmentID" class="attachments_AttachmentID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachmentID->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachmentID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachmentID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachmentSource_ID->Visible) { // AttachmentSource_ID ?>
	<?php if ($attachments->sortUrl($attachments->AttachmentSource_ID) == "") { ?>
		<th data-name="AttachmentSource_ID" class="<?php echo $attachments->AttachmentSource_ID->headerCellClass() ?>"><div id="elh_attachments_AttachmentSource_ID" class="attachments_AttachmentSource_ID"><div class="ew-table-header-caption"><?php echo $attachments->AttachmentSource_ID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachmentSource_ID" class="<?php echo $attachments->AttachmentSource_ID->headerCellClass() ?>"><div><div id="elh_attachments_AttachmentSource_ID" class="attachments_AttachmentSource_ID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachmentSource_ID->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachmentSource_ID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachmentSource_ID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->CaseID->Visible) { // CaseID ?>
	<?php if ($attachments->sortUrl($attachments->CaseID) == "") { ?>
		<th data-name="CaseID" class="<?php echo $attachments->CaseID->headerCellClass() ?>"><div id="elh_attachments_CaseID" class="attachments_CaseID"><div class="ew-table-header-caption"><?php echo $attachments->CaseID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="CaseID" class="<?php echo $attachments->CaseID->headerCellClass() ?>"><div><div id="elh_attachments_CaseID" class="attachments_CaseID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->CaseID->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->CaseID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->CaseID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->EmployeeID->Visible) { // EmployeeID ?>
	<?php if ($attachments->sortUrl($attachments->EmployeeID) == "") { ?>
		<th data-name="EmployeeID" class="<?php echo $attachments->EmployeeID->headerCellClass() ?>"><div id="elh_attachments_EmployeeID" class="attachments_EmployeeID"><div class="ew-table-header-caption"><?php echo $attachments->EmployeeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="EmployeeID" class="<?php echo $attachments->EmployeeID->headerCellClass() ?>"><div><div id="elh_attachments_EmployeeID" class="attachments_EmployeeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->EmployeeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->EmployeeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->EmployeeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachID->Visible) { // AttachID ?>
	<?php if ($attachments->sortUrl($attachments->AttachID) == "") { ?>
		<th data-name="AttachID" class="<?php echo $attachments->AttachID->headerCellClass() ?>"><div id="elh_attachments_AttachID" class="attachments_AttachID"><div class="ew-table-header-caption"><?php echo $attachments->AttachID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachID" class="<?php echo $attachments->AttachID->headerCellClass() ?>"><div><div id="elh_attachments_AttachID" class="attachments_AttachID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachID->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachFilename->Visible) { // AttachFilename ?>
	<?php if ($attachments->sortUrl($attachments->AttachFilename) == "") { ?>
		<th data-name="AttachFilename" class="<?php echo $attachments->AttachFilename->headerCellClass() ?>"><div id="elh_attachments_AttachFilename" class="attachments_AttachFilename"><div class="ew-table-header-caption"><?php echo $attachments->AttachFilename->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachFilename" class="<?php echo $attachments->AttachFilename->headerCellClass() ?>"><div><div id="elh_attachments_AttachFilename" class="attachments_AttachFilename">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachFilename->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachFilename->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachFilename->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachFilenameInitial->Visible) { // AttachFilenameInitial ?>
	<?php if ($attachments->sortUrl($attachments->AttachFilenameInitial) == "") { ?>
		<th data-name="AttachFilenameInitial" class="<?php echo $attachments->AttachFilenameInitial->headerCellClass() ?>"><div id="elh_attachments_AttachFilenameInitial" class="attachments_AttachFilenameInitial"><div class="ew-table-header-caption"><?php echo $attachments->AttachFilenameInitial->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachFilenameInitial" class="<?php echo $attachments->AttachFilenameInitial->headerCellClass() ?>"><div><div id="elh_attachments_AttachFilenameInitial" class="attachments_AttachFilenameInitial">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachFilenameInitial->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachFilenameInitial->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachFilenameInitial->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachExtension->Visible) { // AttachExtension ?>
	<?php if ($attachments->sortUrl($attachments->AttachExtension) == "") { ?>
		<th data-name="AttachExtension" class="<?php echo $attachments->AttachExtension->headerCellClass() ?>"><div id="elh_attachments_AttachExtension" class="attachments_AttachExtension"><div class="ew-table-header-caption"><?php echo $attachments->AttachExtension->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachExtension" class="<?php echo $attachments->AttachExtension->headerCellClass() ?>"><div><div id="elh_attachments_AttachExtension" class="attachments_AttachExtension">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachExtension->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachExtension->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachExtension->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachDescription->Visible) { // AttachDescription ?>
	<?php if ($attachments->sortUrl($attachments->AttachDescription) == "") { ?>
		<th data-name="AttachDescription" class="<?php echo $attachments->AttachDescription->headerCellClass() ?>"><div id="elh_attachments_AttachDescription" class="attachments_AttachDescription"><div class="ew-table-header-caption"><?php echo $attachments->AttachDescription->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachDescription" class="<?php echo $attachments->AttachDescription->headerCellClass() ?>"><div><div id="elh_attachments_AttachDescription" class="attachments_AttachDescription">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachDescription->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachDescription->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachDescription->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachFilepath->Visible) { // AttachFilepath ?>
	<?php if ($attachments->sortUrl($attachments->AttachFilepath) == "") { ?>
		<th data-name="AttachFilepath" class="<?php echo $attachments->AttachFilepath->headerCellClass() ?>"><div id="elh_attachments_AttachFilepath" class="attachments_AttachFilepath"><div class="ew-table-header-caption"><?php echo $attachments->AttachFilepath->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachFilepath" class="<?php echo $attachments->AttachFilepath->headerCellClass() ?>"><div><div id="elh_attachments_AttachFilepath" class="attachments_AttachFilepath">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachFilepath->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachFilepath->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachFilepath->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->AttachPath->Visible) { // AttachPath ?>
	<?php if ($attachments->sortUrl($attachments->AttachPath) == "") { ?>
		<th data-name="AttachPath" class="<?php echo $attachments->AttachPath->headerCellClass() ?>"><div id="elh_attachments_AttachPath" class="attachments_AttachPath"><div class="ew-table-header-caption"><?php echo $attachments->AttachPath->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AttachPath" class="<?php echo $attachments->AttachPath->headerCellClass() ?>"><div><div id="elh_attachments_AttachPath" class="attachments_AttachPath">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->AttachPath->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->AttachPath->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->AttachPath->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($attachments->_Case->Visible) { // Case ?>
	<?php if ($attachments->sortUrl($attachments->_Case) == "") { ?>
		<th data-name="_Case" class="<?php echo $attachments->_Case->headerCellClass() ?>"><div id="elh_attachments__Case" class="attachments__Case"><div class="ew-table-header-caption"><?php echo $attachments->_Case->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="_Case" class="<?php echo $attachments->_Case->headerCellClass() ?>"><div><div id="elh_attachments__Case" class="attachments__Case">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $attachments->_Case->caption() ?></span><span class="ew-table-header-sort"><?php if ($attachments->_Case->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($attachments->_Case->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

// Render list options (header, right)
$attachments_grid->ListOptions->render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
$attachments_grid->StartRec = 1;
$attachments_grid->StopRec = $attachments_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($CurrentForm && $attachments_grid->EventCancelled) {
	$CurrentForm->Index = -1;
	if ($CurrentForm->hasValue($attachments_grid->FormKeyCountName) && ($attachments->isGridAdd() || $attachments->isGridEdit() || $attachments->isConfirm())) {
		$attachments_grid->KeyCount = $CurrentForm->getValue($attachments_grid->FormKeyCountName);
		$attachments_grid->StopRec = $attachments_grid->StartRec + $attachments_grid->KeyCount - 1;
	}
}
$attachments_grid->RecCnt = $attachments_grid->StartRec - 1;
if ($attachments_grid->Recordset && !$attachments_grid->Recordset->EOF) {
	$attachments_grid->Recordset->moveFirst();
	$selectLimit = $attachments_grid->UseSelectLimit;
	if (!$selectLimit && $attachments_grid->StartRec > 1)
		$attachments_grid->Recordset->move($attachments_grid->StartRec - 1);
} elseif (!$attachments->AllowAddDeleteRow && $attachments_grid->StopRec == 0) {
	$attachments_grid->StopRec = $attachments->GridAddRowCount;
}

// Initialize aggregate
$attachments->RowType = ROWTYPE_AGGREGATEINIT;
$attachments->resetAttributes();
$attachments_grid->renderRow();
if ($attachments->isGridAdd())
	$attachments_grid->RowIndex = 0;
if ($attachments->isGridEdit())
	$attachments_grid->RowIndex = 0;
while ($attachments_grid->RecCnt < $attachments_grid->StopRec) {
	$attachments_grid->RecCnt++;
	if ($attachments_grid->RecCnt >= $attachments_grid->StartRec) {
		$attachments_grid->RowCnt++;
		if ($attachments->isGridAdd() || $attachments->isGridEdit() || $attachments->isConfirm()) {
			$attachments_grid->RowIndex++;
			$CurrentForm->Index = $attachments_grid->RowIndex;
			if ($CurrentForm->hasValue($attachments_grid->FormActionName) && $attachments_grid->EventCancelled)
				$attachments_grid->RowAction = strval($CurrentForm->getValue($attachments_grid->FormActionName));
			elseif ($attachments->isGridAdd())
				$attachments_grid->RowAction = "insert";
			else
				$attachments_grid->RowAction = "";
		}

		// Set up key count
		$attachments_grid->KeyCount = $attachments_grid->RowIndex;

		// Init row class and style
		$attachments->resetAttributes();
		$attachments->CssClass = "";
		if ($attachments->isGridAdd()) {
			if ($attachments->CurrentMode == "copy") {
				$attachments_grid->loadRowValues($attachments_grid->Recordset); // Load row values
				$attachments_grid->setRecordKey($attachments_grid->RowOldKey, $attachments_grid->Recordset); // Set old record key
			} else {
				$attachments_grid->loadRowValues(); // Load default values
				$attachments_grid->RowOldKey = ""; // Clear old key value
			}
		} else {
			$attachments_grid->loadRowValues($attachments_grid->Recordset); // Load row values
		}
		$attachments->RowType = ROWTYPE_VIEW; // Render view
		if ($attachments->isGridAdd()) // Grid add
			$attachments->RowType = ROWTYPE_ADD; // Render add
		if ($attachments->isGridAdd() && $attachments->EventCancelled && !$CurrentForm->hasValue("k_blankrow")) // Insert failed
			$attachments_grid->restoreCurrentRowFormValues($attachments_grid->RowIndex); // Restore form values
		if ($attachments->isGridEdit()) { // Grid edit
			if ($attachments->EventCancelled)
				$attachments_grid->restoreCurrentRowFormValues($attachments_grid->RowIndex); // Restore form values
			if ($attachments_grid->RowAction == "insert")
				$attachments->RowType = ROWTYPE_ADD; // Render add
			else
				$attachments->RowType = ROWTYPE_EDIT; // Render edit
		}
		if ($attachments->isGridEdit() && ($attachments->RowType == ROWTYPE_EDIT || $attachments->RowType == ROWTYPE_ADD) && $attachments->EventCancelled) // Update failed
			$attachments_grid->restoreCurrentRowFormValues($attachments_grid->RowIndex); // Restore form values
		if ($attachments->RowType == ROWTYPE_EDIT) // Edit row
			$attachments_grid->EditRowCnt++;
		if ($attachments->isConfirm()) // Confirm row
			$attachments_grid->restoreCurrentRowFormValues($attachments_grid->RowIndex); // Restore form values

		// Set up row id / data-rowindex
		$attachments->RowAttrs = array_merge($attachments->RowAttrs, array('data-rowindex'=>$attachments_grid->RowCnt, 'id'=>'r' . $attachments_grid->RowCnt . '_attachments', 'data-rowtype'=>$attachments->RowType));

		// Render row
		$attachments_grid->renderRow();

		// Render list options
		$attachments_grid->renderListOptions();

		// Skip delete row / empty row for confirm page
		if ($attachments_grid->RowAction <> "delete" && $attachments_grid->RowAction <> "insertdelete" && !($attachments_grid->RowAction == "insert" && $attachments->isConfirm() && $attachments_grid->emptyRow())) {
?>
	<tr<?php echo $attachments->rowAttributes() ?>>
<?php

// Render list options (body, left)
$attachments_grid->ListOptions->render("body", "left", $attachments_grid->RowCnt);
?>
	<?php if ($attachments->AttachmentID->Visible) { // AttachmentID ?>
		<td data-name="AttachmentID"<?php echo $attachments->AttachmentID->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachmentID" class="form-group attachments_AttachmentID">
<span<?php echo $attachments->AttachmentID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachmentID->EditValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->CurrentValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachmentID" class="attachments_AttachmentID">
<span<?php echo $attachments->AttachmentID->viewAttributes() ?>>
<?php echo $attachments->AttachmentID->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachmentSource_ID->Visible) { // AttachmentSource_ID ?>
		<td data-name="AttachmentSource_ID"<?php echo $attachments->AttachmentSource_ID->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachmentSource_ID" class="form-group attachments_AttachmentSource_ID">
<?php
$wrkonchange = "" . trim(@$attachments->AttachmentSource_ID->EditAttrs["onchange"]);
if (trim($wrkonchange) <> "") $wrkonchange = " onchange=\"" . JsEncode($wrkonchange) . "\"";
$attachments->AttachmentSource_ID->EditAttrs["onchange"] = "";
?>
<span id="as_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" class="text-nowrap" style="z-index: <?php echo (9000 - $attachments_grid->RowCnt * 10) ?>">
	<input type="text" class="form-control" name="sv_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="sv_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo RemoveHtml($attachments->AttachmentSource_ID->EditValue) ?>" size="30" placeholder="<?php echo HtmlEncode($attachments->AttachmentSource_ID->getPlaceHolder()) ?>" data-placeholder="<?php echo HtmlEncode($attachments->AttachmentSource_ID->getPlaceHolder()) ?>"<?php echo $attachments->AttachmentSource_ID->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" data-value-separator="<?php echo $attachments->AttachmentSource_ID->displayValueSeparatorAttribute() ?>" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->CurrentValue) ?>"<?php echo $wrkonchange ?>>
<script>
fattachmentsgrid.createAutoSuggest({"id":"x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID","forceSelect":false});
</script>
<?php echo $attachments->AttachmentSource_ID->Lookup->getParamTag("p_x" . $attachments_grid->RowIndex . "_AttachmentSource_ID") ?>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachmentSource_ID" class="form-group attachments_AttachmentSource_ID">
<?php
$wrkonchange = "" . trim(@$attachments->AttachmentSource_ID->EditAttrs["onchange"]);
if (trim($wrkonchange) <> "") $wrkonchange = " onchange=\"" . JsEncode($wrkonchange) . "\"";
$attachments->AttachmentSource_ID->EditAttrs["onchange"] = "";
?>
<span id="as_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" class="text-nowrap" style="z-index: <?php echo (9000 - $attachments_grid->RowCnt * 10) ?>">
	<input type="text" class="form-control" name="sv_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="sv_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo RemoveHtml($attachments->AttachmentSource_ID->EditValue) ?>" size="30" placeholder="<?php echo HtmlEncode($attachments->AttachmentSource_ID->getPlaceHolder()) ?>" data-placeholder="<?php echo HtmlEncode($attachments->AttachmentSource_ID->getPlaceHolder()) ?>"<?php echo $attachments->AttachmentSource_ID->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" data-value-separator="<?php echo $attachments->AttachmentSource_ID->displayValueSeparatorAttribute() ?>" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->CurrentValue) ?>"<?php echo $wrkonchange ?>>
<script>
fattachmentsgrid.createAutoSuggest({"id":"x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID","forceSelect":false});
</script>
<?php echo $attachments->AttachmentSource_ID->Lookup->getParamTag("p_x" . $attachments_grid->RowIndex . "_AttachmentSource_ID") ?>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachmentSource_ID" class="attachments_AttachmentSource_ID">
<span<?php echo $attachments->AttachmentSource_ID->viewAttributes() ?>>
<?php echo $attachments->AttachmentSource_ID->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->CaseID->Visible) { // CaseID ?>
		<td data-name="CaseID"<?php echo $attachments->CaseID->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<?php if ($attachments->CaseID->getSessionValue() <> "") { ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_CaseID" class="form-group attachments_CaseID">
<span<?php echo $attachments->CaseID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->CaseID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_CaseID" class="form-group attachments_CaseID">
<input type="text" data-table="attachments" data-field="x_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" size="30" placeholder="<?php echo HtmlEncode($attachments->CaseID->getPlaceHolder()) ?>" value="<?php echo $attachments->CaseID->EditValue ?>"<?php echo $attachments->CaseID->editAttributes() ?>>
</span>
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="o<?php echo $attachments_grid->RowIndex ?>_CaseID" id="o<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<?php if ($attachments->CaseID->getSessionValue() <> "") { ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_CaseID" class="form-group attachments_CaseID">
<span<?php echo $attachments->CaseID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->CaseID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_CaseID" class="form-group attachments_CaseID">
<input type="text" data-table="attachments" data-field="x_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" size="30" placeholder="<?php echo HtmlEncode($attachments->CaseID->getPlaceHolder()) ?>" value="<?php echo $attachments->CaseID->EditValue ?>"<?php echo $attachments->CaseID->editAttributes() ?>>
</span>
<?php } ?>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_CaseID" class="attachments_CaseID">
<span<?php echo $attachments->CaseID->viewAttributes() ?>>
<?php echo $attachments->CaseID->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="o<?php echo $attachments_grid->RowIndex ?>_CaseID" id="o<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_CaseID" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_CaseID" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->EmployeeID->Visible) { // EmployeeID ?>
		<td data-name="EmployeeID"<?php echo $attachments->EmployeeID->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_EmployeeID" class="form-group attachments_EmployeeID">
<input type="text" data-table="attachments" data-field="x_EmployeeID" name="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" size="30" placeholder="<?php echo HtmlEncode($attachments->EmployeeID->getPlaceHolder()) ?>" value="<?php echo $attachments->EmployeeID->EditValue ?>"<?php echo $attachments->EmployeeID->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_EmployeeID" class="form-group attachments_EmployeeID">
<input type="text" data-table="attachments" data-field="x_EmployeeID" name="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" size="30" placeholder="<?php echo HtmlEncode($attachments->EmployeeID->getPlaceHolder()) ?>" value="<?php echo $attachments->EmployeeID->EditValue ?>"<?php echo $attachments->EmployeeID->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_EmployeeID" class="attachments_EmployeeID">
<span<?php echo $attachments->EmployeeID->viewAttributes() ?>>
<?php echo $attachments->EmployeeID->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachID->Visible) { // AttachID ?>
		<td data-name="AttachID"<?php echo $attachments->AttachID->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachID" class="form-group attachments_AttachID">
<input type="text" data-table="attachments" data-field="x_AttachID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachID" size="30" placeholder="<?php echo HtmlEncode($attachments->AttachID->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachID->EditValue ?>"<?php echo $attachments->AttachID->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachID" class="form-group attachments_AttachID">
<input type="text" data-table="attachments" data-field="x_AttachID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachID" size="30" placeholder="<?php echo HtmlEncode($attachments->AttachID->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachID->EditValue ?>"<?php echo $attachments->AttachID->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachID" class="attachments_AttachID">
<span<?php echo $attachments->AttachID->viewAttributes() ?>>
<?php echo $attachments->AttachID->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachID" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachID" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachFilename->Visible) { // AttachFilename ?>
		<td data-name="AttachFilename"<?php echo $attachments->AttachFilename->cellAttributes() ?>>
<?php if ($attachments_grid->RowAction == "insert") { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilename" class="form-group attachments_AttachFilename">
<div id="fd_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename">
<span title="<?php echo $attachments->AttachFilename->title() ? $attachments->AttachFilename->title() : $Language->phrase("ChooseFiles") ?>" class="btn btn-default btn-sm fileinput-button ew-tooltip<?php if ($attachments->AttachFilename->ReadOnly || $attachments->AttachFilename->Disabled) echo " d-none"; ?>">
	<span><?php echo $Language->phrase("ChooseFileBtn") ?></span>
	<input type="file" title=" " data-table="attachments" data-field="x_AttachFilename" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" multiple="multiple"<?php echo $attachments->AttachFilename->editAttributes() ?>>
</span>
<input type="hidden" name="fn_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fn_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->Upload->FileName ?>">
<input type="hidden" name="fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="0">
<input type="hidden" name="fs_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fs_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="100">
<input type="hidden" name="fx_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fx_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadAllowedFileExt ?>">
<input type="hidden" name="fm_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fm_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadMaxFileSize ?>">
<input type="hidden" name="fc_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fc_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadMaxFileCount ?>">
</div>
<table id="ft_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" class="table table-sm float-left ew-upload-table"><tbody class="files"></tbody></table>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachFilename" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo HtmlEncode($attachments->AttachFilename->OldValue) ?>">
<?php } elseif ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilename" class="attachments_AttachFilename">
<span<?php echo $attachments->AttachFilename->viewAttributes() ?>>
<?php echo GetFileViewTag($attachments->AttachFilename, $attachments->AttachFilename->getViewValue()) ?>
</span>
</span>
<?php } else  { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilename" class="form-group attachments_AttachFilename">
<div id="fd_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename">
<span title="<?php echo $attachments->AttachFilename->title() ? $attachments->AttachFilename->title() : $Language->phrase("ChooseFiles") ?>" class="btn btn-default btn-sm fileinput-button ew-tooltip<?php if ($attachments->AttachFilename->ReadOnly || $attachments->AttachFilename->Disabled) echo " d-none"; ?>">
	<span><?php echo $Language->phrase("ChooseFileBtn") ?></span>
	<input type="file" title=" " data-table="attachments" data-field="x_AttachFilename" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" multiple="multiple"<?php echo $attachments->AttachFilename->editAttributes() ?>>
</span>
<input type="hidden" name="fn_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fn_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->Upload->FileName ?>">
<?php if (Post("fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename") == "0") { ?>
<input type="hidden" name="fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="0">
<?php } else { ?>
<input type="hidden" name="fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="1">
<?php } ?>
<input type="hidden" name="fs_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fs_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="100">
<input type="hidden" name="fx_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fx_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadAllowedFileExt ?>">
<input type="hidden" name="fm_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fm_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadMaxFileSize ?>">
<input type="hidden" name="fc_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fc_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadMaxFileCount ?>">
</div>
<table id="ft_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" class="table table-sm float-left ew-upload-table"><tbody class="files"></tbody></table>
</span>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachFilenameInitial->Visible) { // AttachFilenameInitial ?>
		<td data-name="AttachFilenameInitial"<?php echo $attachments->AttachFilenameInitial->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilenameInitial" class="form-group attachments_AttachFilenameInitial">
<input type="text" data-table="attachments" data-field="x_AttachFilenameInitial" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($attachments->AttachFilenameInitial->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachFilenameInitial->EditValue ?>"<?php echo $attachments->AttachFilenameInitial->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilenameInitial" class="form-group attachments_AttachFilenameInitial">
<input type="text" data-table="attachments" data-field="x_AttachFilenameInitial" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($attachments->AttachFilenameInitial->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachFilenameInitial->EditValue ?>"<?php echo $attachments->AttachFilenameInitial->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilenameInitial" class="attachments_AttachFilenameInitial">
<span<?php echo $attachments->AttachFilenameInitial->viewAttributes() ?>>
<?php echo $attachments->AttachFilenameInitial->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachExtension->Visible) { // AttachExtension ?>
		<td data-name="AttachExtension"<?php echo $attachments->AttachExtension->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachExtension" class="form-group attachments_AttachExtension">
<input type="text" data-table="attachments" data-field="x_AttachExtension" name="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($attachments->AttachExtension->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachExtension->EditValue ?>"<?php echo $attachments->AttachExtension->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachExtension" class="form-group attachments_AttachExtension">
<input type="text" data-table="attachments" data-field="x_AttachExtension" name="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($attachments->AttachExtension->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachExtension->EditValue ?>"<?php echo $attachments->AttachExtension->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachExtension" class="attachments_AttachExtension">
<span<?php echo $attachments->AttachExtension->viewAttributes() ?>>
<?php echo $attachments->AttachExtension->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachDescription->Visible) { // AttachDescription ?>
		<td data-name="AttachDescription"<?php echo $attachments->AttachDescription->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachDescription" class="form-group attachments_AttachDescription">
<input type="text" data-table="attachments" data-field="x_AttachDescription" name="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($attachments->AttachDescription->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachDescription->EditValue ?>"<?php echo $attachments->AttachDescription->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachDescription" class="form-group attachments_AttachDescription">
<input type="text" data-table="attachments" data-field="x_AttachDescription" name="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($attachments->AttachDescription->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachDescription->EditValue ?>"<?php echo $attachments->AttachDescription->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachDescription" class="attachments_AttachDescription">
<span<?php echo $attachments->AttachDescription->viewAttributes() ?>>
<?php echo $attachments->AttachDescription->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachFilepath->Visible) { // AttachFilepath ?>
		<td data-name="AttachFilepath"<?php echo $attachments->AttachFilepath->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilepath" class="form-group attachments_AttachFilepath">
<input type="text" data-table="attachments" data-field="x_AttachFilepath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->AttachFilepath->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachFilepath->EditValue ?>"<?php echo $attachments->AttachFilepath->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilepath" class="form-group attachments_AttachFilepath">
<input type="text" data-table="attachments" data-field="x_AttachFilepath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->AttachFilepath->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachFilepath->EditValue ?>"<?php echo $attachments->AttachFilepath->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachFilepath" class="attachments_AttachFilepath">
<span<?php echo $attachments->AttachFilepath->viewAttributes() ?>>
<?php echo $attachments->AttachFilepath->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->AttachPath->Visible) { // AttachPath ?>
		<td data-name="AttachPath"<?php echo $attachments->AttachPath->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachPath" class="form-group attachments_AttachPath">
<input type="text" data-table="attachments" data-field="x_AttachPath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->AttachPath->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachPath->EditValue ?>"<?php echo $attachments->AttachPath->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="o<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="o<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachPath" class="form-group attachments_AttachPath">
<input type="text" data-table="attachments" data-field="x_AttachPath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->AttachPath->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachPath->EditValue ?>"<?php echo $attachments->AttachPath->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments_AttachPath" class="attachments_AttachPath">
<span<?php echo $attachments->AttachPath->viewAttributes() ?>>
<?php echo $attachments->AttachPath->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="o<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="o<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($attachments->_Case->Visible) { // Case ?>
		<td data-name="_Case"<?php echo $attachments->_Case->cellAttributes() ?>>
<?php if ($attachments->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments__Case" class="form-group attachments__Case">
<input type="text" data-table="attachments" data-field="x__Case" name="x<?php echo $attachments_grid->RowIndex ?>__Case" id="x<?php echo $attachments_grid->RowIndex ?>__Case" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->_Case->getPlaceHolder()) ?>" value="<?php echo $attachments->_Case->EditValue ?>"<?php echo $attachments->_Case->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x__Case" name="o<?php echo $attachments_grid->RowIndex ?>__Case" id="o<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->OldValue) ?>">
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments__Case" class="form-group attachments__Case">
<input type="text" data-table="attachments" data-field="x__Case" name="x<?php echo $attachments_grid->RowIndex ?>__Case" id="x<?php echo $attachments_grid->RowIndex ?>__Case" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->_Case->getPlaceHolder()) ?>" value="<?php echo $attachments->_Case->EditValue ?>"<?php echo $attachments->_Case->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($attachments->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $attachments_grid->RowCnt ?>_attachments__Case" class="attachments__Case">
<span<?php echo $attachments->_Case->viewAttributes() ?>>
<?php echo $attachments->_Case->getViewValue() ?></span>
</span>
<?php if (!$attachments->isConfirm()) { ?>
<input type="hidden" data-table="attachments" data-field="x__Case" name="x<?php echo $attachments_grid->RowIndex ?>__Case" id="x<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x__Case" name="o<?php echo $attachments_grid->RowIndex ?>__Case" id="o<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="attachments" data-field="x__Case" name="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>__Case" id="fattachmentsgrid$x<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->FormValue) ?>">
<input type="hidden" data-table="attachments" data-field="x__Case" name="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>__Case" id="fattachmentsgrid$o<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$attachments_grid->ListOptions->render("body", "right", $attachments_grid->RowCnt);
?>
	</tr>
<?php if ($attachments->RowType == ROWTYPE_ADD || $attachments->RowType == ROWTYPE_EDIT) { ?>
<script>
fattachmentsgrid.updateLists(<?php echo $attachments_grid->RowIndex ?>);
</script>
<?php } ?>
<?php
	}
	} // End delete row checking
	if (!$attachments->isGridAdd() || $attachments->CurrentMode == "copy")
		if (!$attachments_grid->Recordset->EOF)
			$attachments_grid->Recordset->moveNext();
}
?>
<?php
	if ($attachments->CurrentMode == "add" || $attachments->CurrentMode == "copy" || $attachments->CurrentMode == "edit") {
		$attachments_grid->RowIndex = '$rowindex$';
		$attachments_grid->loadRowValues();

		// Set row properties
		$attachments->resetAttributes();
		$attachments->RowAttrs = array_merge($attachments->RowAttrs, array('data-rowindex'=>$attachments_grid->RowIndex, 'id'=>'r0_attachments', 'data-rowtype'=>ROWTYPE_ADD));
		AppendClass($attachments->RowAttrs["class"], "ew-template");
		$attachments->RowType = ROWTYPE_ADD;

		// Render row
		$attachments_grid->renderRow();

		// Render list options
		$attachments_grid->renderListOptions();
		$attachments_grid->StartRowCnt = 0;
?>
	<tr<?php echo $attachments->rowAttributes() ?>>
<?php

// Render list options (body, left)
$attachments_grid->ListOptions->render("body", "left", $attachments_grid->RowIndex);
?>
	<?php if ($attachments->AttachmentID->Visible) { // AttachmentID ?>
		<td data-name="AttachmentID">
<?php if (!$attachments->isConfirm()) { ?>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachmentID" class="form-group attachments_AttachmentID">
<span<?php echo $attachments->AttachmentID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachmentID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachmentID" value="<?php echo HtmlEncode($attachments->AttachmentID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachmentSource_ID->Visible) { // AttachmentSource_ID ?>
		<td data-name="AttachmentSource_ID">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachmentSource_ID" class="form-group attachments_AttachmentSource_ID">
<?php
$wrkonchange = "" . trim(@$attachments->AttachmentSource_ID->EditAttrs["onchange"]);
if (trim($wrkonchange) <> "") $wrkonchange = " onchange=\"" . JsEncode($wrkonchange) . "\"";
$attachments->AttachmentSource_ID->EditAttrs["onchange"] = "";
?>
<span id="as_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" class="text-nowrap" style="z-index: <?php echo (9000 - $attachments_grid->RowCnt * 10) ?>">
	<input type="text" class="form-control" name="sv_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="sv_x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo RemoveHtml($attachments->AttachmentSource_ID->EditValue) ?>" size="30" placeholder="<?php echo HtmlEncode($attachments->AttachmentSource_ID->getPlaceHolder()) ?>" data-placeholder="<?php echo HtmlEncode($attachments->AttachmentSource_ID->getPlaceHolder()) ?>"<?php echo $attachments->AttachmentSource_ID->editAttributes() ?>>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" data-value-separator="<?php echo $attachments->AttachmentSource_ID->displayValueSeparatorAttribute() ?>" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->CurrentValue) ?>"<?php echo $wrkonchange ?>>
<script>
fattachmentsgrid.createAutoSuggest({"id":"x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID","forceSelect":false});
</script>
<?php echo $attachments->AttachmentSource_ID->Lookup->getParamTag("p_x" . $attachments_grid->RowIndex . "_AttachmentSource_ID") ?>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachmentSource_ID" class="form-group attachments_AttachmentSource_ID">
<span<?php echo $attachments->AttachmentSource_ID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachmentSource_ID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachmentSource_ID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachmentSource_ID" value="<?php echo HtmlEncode($attachments->AttachmentSource_ID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->CaseID->Visible) { // CaseID ?>
		<td data-name="CaseID">
<?php if (!$attachments->isConfirm()) { ?>
<?php if ($attachments->CaseID->getSessionValue() <> "") { ?>
<span id="el$rowindex$_attachments_CaseID" class="form-group attachments_CaseID">
<span<?php echo $attachments->CaseID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->CaseID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->CurrentValue) ?>">
<?php } else { ?>
<span id="el$rowindex$_attachments_CaseID" class="form-group attachments_CaseID">
<input type="text" data-table="attachments" data-field="x_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" size="30" placeholder="<?php echo HtmlEncode($attachments->CaseID->getPlaceHolder()) ?>" value="<?php echo $attachments->CaseID->EditValue ?>"<?php echo $attachments->CaseID->editAttributes() ?>>
</span>
<?php } ?>
<?php } else { ?>
<span id="el$rowindex$_attachments_CaseID" class="form-group attachments_CaseID">
<span<?php echo $attachments->CaseID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->CaseID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="x<?php echo $attachments_grid->RowIndex ?>_CaseID" id="x<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_CaseID" name="o<?php echo $attachments_grid->RowIndex ?>_CaseID" id="o<?php echo $attachments_grid->RowIndex ?>_CaseID" value="<?php echo HtmlEncode($attachments->CaseID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->EmployeeID->Visible) { // EmployeeID ?>
		<td data-name="EmployeeID">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_EmployeeID" class="form-group attachments_EmployeeID">
<input type="text" data-table="attachments" data-field="x_EmployeeID" name="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" size="30" placeholder="<?php echo HtmlEncode($attachments->EmployeeID->getPlaceHolder()) ?>" value="<?php echo $attachments->EmployeeID->EditValue ?>"<?php echo $attachments->EmployeeID->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_EmployeeID" class="form-group attachments_EmployeeID">
<span<?php echo $attachments->EmployeeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->EmployeeID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="x<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_EmployeeID" name="o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" id="o<?php echo $attachments_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($attachments->EmployeeID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachID->Visible) { // AttachID ?>
		<td data-name="AttachID">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachID" class="form-group attachments_AttachID">
<input type="text" data-table="attachments" data-field="x_AttachID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachID" size="30" placeholder="<?php echo HtmlEncode($attachments->AttachID->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachID->EditValue ?>"<?php echo $attachments->AttachID->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachID" class="form-group attachments_AttachID">
<span<?php echo $attachments->AttachID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="x<?php echo $attachments_grid->RowIndex ?>_AttachID" id="x<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachID" name="o<?php echo $attachments_grid->RowIndex ?>_AttachID" id="o<?php echo $attachments_grid->RowIndex ?>_AttachID" value="<?php echo HtmlEncode($attachments->AttachID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachFilename->Visible) { // AttachFilename ?>
		<td data-name="AttachFilename">
<span id="el$rowindex$_attachments_AttachFilename" class="form-group attachments_AttachFilename">
<div id="fd_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename">
<span title="<?php echo $attachments->AttachFilename->title() ? $attachments->AttachFilename->title() : $Language->phrase("ChooseFiles") ?>" class="btn btn-default btn-sm fileinput-button ew-tooltip<?php if ($attachments->AttachFilename->ReadOnly || $attachments->AttachFilename->Disabled) echo " d-none"; ?>">
	<span><?php echo $Language->phrase("ChooseFileBtn") ?></span>
	<input type="file" title=" " data-table="attachments" data-field="x_AttachFilename" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" multiple="multiple"<?php echo $attachments->AttachFilename->editAttributes() ?>>
</span>
<input type="hidden" name="fn_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fn_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->Upload->FileName ?>">
<input type="hidden" name="fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fa_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="0">
<input type="hidden" name="fs_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fs_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="100">
<input type="hidden" name="fx_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fx_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadAllowedFileExt ?>">
<input type="hidden" name="fm_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fm_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadMaxFileSize ?>">
<input type="hidden" name="fc_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id= "fc_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo $attachments->AttachFilename->UploadMaxFileCount ?>">
</div>
<table id="ft_x<?php echo $attachments_grid->RowIndex ?>_AttachFilename" class="table table-sm float-left ew-upload-table"><tbody class="files"></tbody></table>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachFilename" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilename" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilename" value="<?php echo HtmlEncode($attachments->AttachFilename->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachFilenameInitial->Visible) { // AttachFilenameInitial ?>
		<td data-name="AttachFilenameInitial">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachFilenameInitial" class="form-group attachments_AttachFilenameInitial">
<input type="text" data-table="attachments" data-field="x_AttachFilenameInitial" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($attachments->AttachFilenameInitial->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachFilenameInitial->EditValue ?>"<?php echo $attachments->AttachFilenameInitial->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachFilenameInitial" class="form-group attachments_AttachFilenameInitial">
<span<?php echo $attachments->AttachFilenameInitial->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachFilenameInitial->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachFilenameInitial" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilenameInitial" value="<?php echo HtmlEncode($attachments->AttachFilenameInitial->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachExtension->Visible) { // AttachExtension ?>
		<td data-name="AttachExtension">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachExtension" class="form-group attachments_AttachExtension">
<input type="text" data-table="attachments" data-field="x_AttachExtension" name="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($attachments->AttachExtension->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachExtension->EditValue ?>"<?php echo $attachments->AttachExtension->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachExtension" class="form-group attachments_AttachExtension">
<span<?php echo $attachments->AttachExtension->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachExtension->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="x<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachExtension" name="o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" id="o<?php echo $attachments_grid->RowIndex ?>_AttachExtension" value="<?php echo HtmlEncode($attachments->AttachExtension->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachDescription->Visible) { // AttachDescription ?>
		<td data-name="AttachDescription">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachDescription" class="form-group attachments_AttachDescription">
<input type="text" data-table="attachments" data-field="x_AttachDescription" name="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($attachments->AttachDescription->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachDescription->EditValue ?>"<?php echo $attachments->AttachDescription->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachDescription" class="form-group attachments_AttachDescription">
<span<?php echo $attachments->AttachDescription->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachDescription->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="x<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachDescription" name="o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" id="o<?php echo $attachments_grid->RowIndex ?>_AttachDescription" value="<?php echo HtmlEncode($attachments->AttachDescription->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachFilepath->Visible) { // AttachFilepath ?>
		<td data-name="AttachFilepath">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachFilepath" class="form-group attachments_AttachFilepath">
<input type="text" data-table="attachments" data-field="x_AttachFilepath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->AttachFilepath->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachFilepath->EditValue ?>"<?php echo $attachments->AttachFilepath->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachFilepath" class="form-group attachments_AttachFilepath">
<span<?php echo $attachments->AttachFilepath->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachFilepath->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachFilepath" name="o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" id="o<?php echo $attachments_grid->RowIndex ?>_AttachFilepath" value="<?php echo HtmlEncode($attachments->AttachFilepath->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->AttachPath->Visible) { // AttachPath ?>
		<td data-name="AttachPath">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments_AttachPath" class="form-group attachments_AttachPath">
<input type="text" data-table="attachments" data-field="x_AttachPath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->AttachPath->getPlaceHolder()) ?>" value="<?php echo $attachments->AttachPath->EditValue ?>"<?php echo $attachments->AttachPath->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments_AttachPath" class="form-group attachments_AttachPath">
<span<?php echo $attachments->AttachPath->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->AttachPath->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="x<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x_AttachPath" name="o<?php echo $attachments_grid->RowIndex ?>_AttachPath" id="o<?php echo $attachments_grid->RowIndex ?>_AttachPath" value="<?php echo HtmlEncode($attachments->AttachPath->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($attachments->_Case->Visible) { // Case ?>
		<td data-name="_Case">
<?php if (!$attachments->isConfirm()) { ?>
<span id="el$rowindex$_attachments__Case" class="form-group attachments__Case">
<input type="text" data-table="attachments" data-field="x__Case" name="x<?php echo $attachments_grid->RowIndex ?>__Case" id="x<?php echo $attachments_grid->RowIndex ?>__Case" size="30" maxlength="200" placeholder="<?php echo HtmlEncode($attachments->_Case->getPlaceHolder()) ?>" value="<?php echo $attachments->_Case->EditValue ?>"<?php echo $attachments->_Case->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_attachments__Case" class="form-group attachments__Case">
<span<?php echo $attachments->_Case->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($attachments->_Case->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="attachments" data-field="x__Case" name="x<?php echo $attachments_grid->RowIndex ?>__Case" id="x<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="attachments" data-field="x__Case" name="o<?php echo $attachments_grid->RowIndex ?>__Case" id="o<?php echo $attachments_grid->RowIndex ?>__Case" value="<?php echo HtmlEncode($attachments->_Case->OldValue) ?>">
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$attachments_grid->ListOptions->render("body", "right", $attachments_grid->RowIndex);
?>
<script>
fattachmentsgrid.updateLists(<?php echo $attachments_grid->RowIndex ?>);
</script>
	</tr>
<?php
}
?>
</tbody>
</table><!-- /.ew-table -->
<?php if ($attachments->CurrentMode == "add" || $attachments->CurrentMode == "copy") { ?>
<input type="hidden" name="<?php echo $attachments_grid->FormKeyCountName ?>" id="<?php echo $attachments_grid->FormKeyCountName ?>" value="<?php echo $attachments_grid->KeyCount ?>">
<?php echo $attachments_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($attachments->CurrentMode == "edit") { ?>
<input type="hidden" name="<?php echo $attachments_grid->FormKeyCountName ?>" id="<?php echo $attachments_grid->FormKeyCountName ?>" value="<?php echo $attachments_grid->KeyCount ?>">
<?php echo $attachments_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($attachments->CurrentMode == "") { ?>
<input type="hidden" name="action" id="action" value="">
<?php } ?>
<input type="hidden" name="detailpage" value="fattachmentsgrid">
</div><!-- /.ew-grid-middle-panel -->
<?php

// Close recordset
if ($attachments_grid->Recordset)
	$attachments_grid->Recordset->Close();
?>
</div>
<?php if ($attachments_grid->ShowOtherOptions) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php $attachments_grid->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($attachments_grid->TotalRecs == 0 && !$attachments->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $attachments_grid->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$attachments_grid->terminate();
?>
<?php if (!$attachments->isExport()) { ?>
<script>
ew.scrollableTable("gmp_attachments", "1250px", "");
</script>
<?php } ?>
