<?php
namespace PHPMaker2019\project_germanos;

// Session
if (session_status() !== PHP_SESSION_ACTIVE)
	session_start(); // Init session data

// Output buffering
ob_start(); 

// Autoload
include_once "autoload.php";
?>
<?php

// Write header
WriteHeader(FALSE);

// Create page object
$attachments_delete = new attachments_delete();

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

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

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

// Page Rendering event
$attachments_delete->Page_Render();
?>
<?php include_once "header.php" ?>
<script>

// Form object
currentPageID = ew.PAGE_ID = "delete";
var fattachmentsdelete = currentForm = new ew.Form("fattachmentsdelete", "delete");

// Form_CustomValidate event
fattachmentsdelete.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
fattachmentsdelete.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

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

// Form object for search
</script>
<script>

// Write your client script here, no need to add script tags.
</script>
<?php $attachments_delete->showPageHeader(); ?>
<?php
$attachments_delete->showMessage();
?>
<form name="fattachmentsdelete" id="fattachmentsdelete" class="form-inline ew-form ew-delete-form" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($attachments_delete->CheckToken) { ?>
<input type="hidden" name="<?php echo TOKEN_NAME ?>" value="<?php echo $attachments_delete->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="attachments">
<input type="hidden" name="action" id="action" value="delete">
<?php foreach ($attachments_delete->RecKeys as $key) { ?>
<?php $keyvalue = is_array($key) ? implode($COMPOSITE_KEY_SEPARATOR, $key) : $key; ?>
<input type="hidden" name="key_m[]" value="<?php echo HtmlEncode($keyvalue) ?>">
<?php } ?>
<div class="card ew-card ew-grid">
<div class="<?php if (IsResponsiveLayout()) { ?>table-responsive <?php } ?>card-body ew-grid-middle-panel">
<table class="table ew-table">
	<thead>
	<tr class="ew-table-header">
<?php if ($attachments->AttachmentID->Visible) { // AttachmentID ?>
		<th class="<?php echo $attachments->AttachmentID->headerCellClass() ?>"><span id="elh_attachments_AttachmentID" class="attachments_AttachmentID"><?php echo $attachments->AttachmentID->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachmentSource_ID->Visible) { // AttachmentSource_ID ?>
		<th class="<?php echo $attachments->AttachmentSource_ID->headerCellClass() ?>"><span id="elh_attachments_AttachmentSource_ID" class="attachments_AttachmentSource_ID"><?php echo $attachments->AttachmentSource_ID->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->CaseID->Visible) { // CaseID ?>
		<th class="<?php echo $attachments->CaseID->headerCellClass() ?>"><span id="elh_attachments_CaseID" class="attachments_CaseID"><?php echo $attachments->CaseID->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->EmployeeID->Visible) { // EmployeeID ?>
		<th class="<?php echo $attachments->EmployeeID->headerCellClass() ?>"><span id="elh_attachments_EmployeeID" class="attachments_EmployeeID"><?php echo $attachments->EmployeeID->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachID->Visible) { // AttachID ?>
		<th class="<?php echo $attachments->AttachID->headerCellClass() ?>"><span id="elh_attachments_AttachID" class="attachments_AttachID"><?php echo $attachments->AttachID->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachFilename->Visible) { // AttachFilename ?>
		<th class="<?php echo $attachments->AttachFilename->headerCellClass() ?>"><span id="elh_attachments_AttachFilename" class="attachments_AttachFilename"><?php echo $attachments->AttachFilename->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachFilenameInitial->Visible) { // AttachFilenameInitial ?>
		<th class="<?php echo $attachments->AttachFilenameInitial->headerCellClass() ?>"><span id="elh_attachments_AttachFilenameInitial" class="attachments_AttachFilenameInitial"><?php echo $attachments->AttachFilenameInitial->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachExtension->Visible) { // AttachExtension ?>
		<th class="<?php echo $attachments->AttachExtension->headerCellClass() ?>"><span id="elh_attachments_AttachExtension" class="attachments_AttachExtension"><?php echo $attachments->AttachExtension->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachDescription->Visible) { // AttachDescription ?>
		<th class="<?php echo $attachments->AttachDescription->headerCellClass() ?>"><span id="elh_attachments_AttachDescription" class="attachments_AttachDescription"><?php echo $attachments->AttachDescription->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachFilepath->Visible) { // AttachFilepath ?>
		<th class="<?php echo $attachments->AttachFilepath->headerCellClass() ?>"><span id="elh_attachments_AttachFilepath" class="attachments_AttachFilepath"><?php echo $attachments->AttachFilepath->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->AttachPath->Visible) { // AttachPath ?>
		<th class="<?php echo $attachments->AttachPath->headerCellClass() ?>"><span id="elh_attachments_AttachPath" class="attachments_AttachPath"><?php echo $attachments->AttachPath->caption() ?></span></th>
<?php } ?>
<?php if ($attachments->_Case->Visible) { // Case ?>
		<th class="<?php echo $attachments->_Case->headerCellClass() ?>"><span id="elh_attachments__Case" class="attachments__Case"><?php echo $attachments->_Case->caption() ?></span></th>
<?php } ?>
	</tr>
	</thead>
	<tbody>
<?php
$attachments_delete->RecCnt = 0;
$i = 0;
while (!$attachments_delete->Recordset->EOF) {
	$attachments_delete->RecCnt++;
	$attachments_delete->RowCnt++;

	// Set row properties
	$attachments->resetAttributes();
	$attachments->RowType = ROWTYPE_VIEW; // View

	// Get the field contents
	$attachments_delete->loadRowValues($attachments_delete->Recordset);

	// Render row
	$attachments_delete->renderRow();
?>
	<tr<?php echo $attachments->rowAttributes() ?>>
<?php if ($attachments->AttachmentID->Visible) { // AttachmentID ?>
		<td<?php echo $attachments->AttachmentID->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachmentID" class="attachments_AttachmentID">
<span<?php echo $attachments->AttachmentID->viewAttributes() ?>>
<?php echo $attachments->AttachmentID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachmentSource_ID->Visible) { // AttachmentSource_ID ?>
		<td<?php echo $attachments->AttachmentSource_ID->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachmentSource_ID" class="attachments_AttachmentSource_ID">
<span<?php echo $attachments->AttachmentSource_ID->viewAttributes() ?>>
<?php echo $attachments->AttachmentSource_ID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->CaseID->Visible) { // CaseID ?>
		<td<?php echo $attachments->CaseID->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_CaseID" class="attachments_CaseID">
<span<?php echo $attachments->CaseID->viewAttributes() ?>>
<?php echo $attachments->CaseID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->EmployeeID->Visible) { // EmployeeID ?>
		<td<?php echo $attachments->EmployeeID->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_EmployeeID" class="attachments_EmployeeID">
<span<?php echo $attachments->EmployeeID->viewAttributes() ?>>
<?php echo $attachments->EmployeeID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachID->Visible) { // AttachID ?>
		<td<?php echo $attachments->AttachID->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachID" class="attachments_AttachID">
<span<?php echo $attachments->AttachID->viewAttributes() ?>>
<?php echo $attachments->AttachID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachFilename->Visible) { // AttachFilename ?>
		<td<?php echo $attachments->AttachFilename->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachFilename" class="attachments_AttachFilename">
<span<?php echo $attachments->AttachFilename->viewAttributes() ?>>
<?php echo GetFileViewTag($attachments->AttachFilename, $attachments->AttachFilename->getViewValue()) ?>
</span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachFilenameInitial->Visible) { // AttachFilenameInitial ?>
		<td<?php echo $attachments->AttachFilenameInitial->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachFilenameInitial" class="attachments_AttachFilenameInitial">
<span<?php echo $attachments->AttachFilenameInitial->viewAttributes() ?>>
<?php echo $attachments->AttachFilenameInitial->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachExtension->Visible) { // AttachExtension ?>
		<td<?php echo $attachments->AttachExtension->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachExtension" class="attachments_AttachExtension">
<span<?php echo $attachments->AttachExtension->viewAttributes() ?>>
<?php echo $attachments->AttachExtension->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachDescription->Visible) { // AttachDescription ?>
		<td<?php echo $attachments->AttachDescription->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachDescription" class="attachments_AttachDescription">
<span<?php echo $attachments->AttachDescription->viewAttributes() ?>>
<?php echo $attachments->AttachDescription->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachFilepath->Visible) { // AttachFilepath ?>
		<td<?php echo $attachments->AttachFilepath->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachFilepath" class="attachments_AttachFilepath">
<span<?php echo $attachments->AttachFilepath->viewAttributes() ?>>
<?php echo $attachments->AttachFilepath->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->AttachPath->Visible) { // AttachPath ?>
		<td<?php echo $attachments->AttachPath->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments_AttachPath" class="attachments_AttachPath">
<span<?php echo $attachments->AttachPath->viewAttributes() ?>>
<?php echo $attachments->AttachPath->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($attachments->_Case->Visible) { // Case ?>
		<td<?php echo $attachments->_Case->cellAttributes() ?>>
<span id="el<?php echo $attachments_delete->RowCnt ?>_attachments__Case" class="attachments__Case">
<span<?php echo $attachments->_Case->viewAttributes() ?>>
<?php echo $attachments->_Case->getViewValue() ?></span>
</span>
</td>
<?php } ?>
	</tr>
<?php
	$attachments_delete->Recordset->moveNext();
}
$attachments_delete->Recordset->close();
?>
</tbody>
</table>
</div>
</div>
<div>
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit"><?php echo $Language->phrase("DeleteBtn") ?></button>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-href="<?php echo $attachments_delete->getReturnUrl() ?>"><?php echo $Language->phrase("CancelBtn") ?></button>
</div>
</form>
<?php
$attachments_delete->showPageFooter();
if (DEBUG_ENABLED)
	echo GetDebugMessage();
?>
<script>

// Write your table-specific startup script here
// document.write("page loaded");

</script>
<?php include_once "footer.php" ?>
<?php
$attachments_delete->terminate();
?>
