635 lines
22 KiB
PHP
635 lines
22 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
// if (array_key_exists('language_cookie', $_COOKIE) && strlen($_COOKIE['language_cookie']) > 0) $currLanguage = $_COOKIE['language_cookie'];
|
|
|
|
if (!isset($CurrentTable)) { echo("CurrentTable not set"); exit(); }
|
|
if (!isset($action)) { echo("action not set"); exit(); }
|
|
if (!isset($SequenceFlag)) { echo("SequenceFlag not set"); exit(); }
|
|
if (!isset($FormFile)) { echo("FormFile not set"); exit(); }
|
|
if (!isset($DialogWidth)) { echo("DialogWidth not set"); exit(); }
|
|
|
|
if (!is_file($FormFile)) { echo("$FormFile not found"); exit(); }
|
|
|
|
if (!isset($DialogHeight)) $DialogHeight = 350;
|
|
|
|
if (!isset($InsertButtonText)) $InsertButtonText = getLanguageText('TEXT-INSERT-NEW');
|
|
|
|
|
|
$JStable = new Table($CurrentTable);
|
|
|
|
$JSclearForm = "";
|
|
$JSclearCSS = "";
|
|
$JSsetForm = "";
|
|
$JSrequired = "";
|
|
$JSvalidation = "";
|
|
|
|
if (!isset($CustomValidation)) $CustomValidation = '';
|
|
if (!isset($JSinitForm)) $JSinitForm = '';
|
|
if (!isset($JSeditData)) $JSeditData = '';
|
|
if (!isset($JSafterUploadCode)) $JSafterUploadCode = '';
|
|
if (!isset($JSeditValidation)) $JSeditValidation = '';
|
|
if (!isset($JScustomVariables)) $JScustomVariables = '';
|
|
if (!isset($JSafterDeleteCode)) $JSafterDeleteCode = '';
|
|
|
|
if (isset($RequiredFields) && is_array($RequiredFields) && count($RequiredFields) > 0) {
|
|
$JSrequired = " // JSrequired: Validate form data\n" .
|
|
" var form_error_message = '';\n" .
|
|
" var form_error = false;\n\n";
|
|
$JSclearCSS = "\n";
|
|
}
|
|
|
|
$MissingData = getLanguageText('ERRORMSG-MISSING-FORM-DATA');
|
|
|
|
$DialogFields = array();
|
|
for ($i = 0; $i < count($JStable->column_names); $i++) {
|
|
$field_name = $JStable->column_names[$i];
|
|
if ($field_name == 'school_num') continue;
|
|
|
|
$default = $JStable->column_defaults[$field_name];
|
|
if (isset($FieldDefaultValues) && array_key_exists($field_name, $FieldDefaultValues)) $default = $FieldDefaultValues[$field_name];
|
|
$default = $JStable->FieldData($field_name, $default);
|
|
if ($default == 'NULL') $default = "''";
|
|
|
|
$entry = array();
|
|
$entry['field_name'] = $field_name;
|
|
$entry['default'] = $default;
|
|
$entry['ftype'] = 'form-data';
|
|
|
|
$DialogFields[] = $entry;
|
|
}
|
|
|
|
if (isset($CustomDialogFields)) {
|
|
$merged = array_merge($DialogFields, $CustomDialogFields);
|
|
$DialogFields = $merged;
|
|
}
|
|
|
|
for ($i = 0; $i < count($DialogFields); $i++) {
|
|
extract($DialogFields[$i]);
|
|
|
|
if ($ftype == 'form-data') {
|
|
if (isset($SummerNoteFields) && in_array($field_name, $SummerNoteFields)) {
|
|
$JSclearForm .= " if (\$(\"#dialog_$field_name\")) \$(\"#dialog_$field_name\").summernote('code', '');\n";
|
|
$JSsetForm .= " if (\$(\"#dialog_$field_name\")) \$(\"#dialog_$field_name\").summernote('code', results.$field_name);\n";
|
|
}
|
|
else {
|
|
$JSclearForm .= " if (\$(\"#dialog_$field_name\")) \$(\"#dialog_$field_name\").val($default);\n";
|
|
$JSsetForm .= " if (\$(\"#dialog_$field_name\")) \$(\"#dialog_$field_name\").val(results.$field_name);\n";
|
|
}
|
|
|
|
if (isset($RequiredFields) && count($RequiredFields)) {
|
|
if (in_array($field_name, $RequiredFields)) {
|
|
$JSrequired .= " var $field_name = \$(\"#dialog_$field_name\").val();\n" .
|
|
" if ($field_name == null) {\n" .
|
|
" var mtext = \$(\"label[for=dialog_$field_name]\").text();\n" .
|
|
" form_error_message += '$MissingData: '+mtext+'\\n';\n" .
|
|
" form_error = true;\n" .
|
|
" \$(\"#dialog_$field_name\").addClass('missing-data');\n" .
|
|
" }\n" .
|
|
" else {\n" .
|
|
" $field_name = $field_name.trim();\n" .
|
|
" if ($field_name != null && $field_name.length == 0) {\n" .
|
|
" var mtext = \$(\"label[for=dialog_$field_name]\").text();\n" .
|
|
" form_error_message += '$MissingData: '+mtext+'\\n';\n" .
|
|
" form_error = true;\n" .
|
|
" \$(\"#dialog_$field_name\").addClass('missing-data');\n" .
|
|
" }\n" .
|
|
" }\n\n";
|
|
|
|
$JSclearCSS .= " \$(\"#dialog_$field_name\").removeClass('missing-data');\n";
|
|
}
|
|
}
|
|
}
|
|
|
|
if ($ftype == 'form-span') {
|
|
if ($default == '') $default = "''";
|
|
$JSclearForm .= " if (\$(\"#$field_name\")) \$(\"#$field_name\").html($default);\n";
|
|
$JSsetForm .= " if (\$(\"#$field_name\")) \$(\"#$field_name\").html(results.$field_name);\n";
|
|
}
|
|
|
|
if ($ftype == 'original-value-field') {
|
|
if ($default == '') $default = "''";
|
|
$JSclearForm .= " if (\$(\"#$field_name\")) \$(\"#$field_name\").val($default);\n";
|
|
$JSsetForm .= " if (\$(\"#$field_name\")) \$(\"#$field_name\").val(results.$source);\n";
|
|
|
|
$JSvalidation .= " \$(\"#dialog_$source\").change(function() {\n";
|
|
$JSvalidation .= " var $field_name = \$(\"#$field_name\").val();\n";
|
|
$JSvalidation .= " var dialog_$source = \$(\"#dialog_$source\").val();\n";
|
|
$JSvalidation .= " var msg = \"".getLanguageText($message)."\";\n";
|
|
$JSvalidation .= " if ($field_name != dialog_$source) {\n";
|
|
$JSvalidation .= " var ans = confirm(msg);\n";
|
|
$JSvalidation .= " if (!ans) \$(\"#dialog_$source\").val($field_name);\n";
|
|
$JSvalidation .= " }\n";
|
|
$JSvalidation .= " });\n\n";
|
|
}
|
|
}
|
|
|
|
if (isset($LockedEditFields) && count($LockedEditFields) > 0) {
|
|
for ($i = 0; $i < count($LockedEditFields); $i++) {
|
|
$field_name = $LockedEditFields[$i];
|
|
$JSclearForm .= " if (\$(\"#dialog_$field_name\")) \$(\"#dialog_$field_name\").prop('disabled', false);\n";
|
|
$JSsetForm .= " if (\$(\"#dialog_$field_name\")) \$(\"#dialog_$field_name\").prop('disabled', true);\n";
|
|
}
|
|
}
|
|
|
|
|
|
if (!isset($tableAction)) $tableAction = $action;
|
|
if (!isset($CustomData)) $CustomData = '';
|
|
if (!isset($JScustomInsertCode)) $JScustomInsertCode = '';
|
|
|
|
if (!isset($templatePageTitle)) $templatePageTitle = "$TitleText " . getLanguageText('TEXT-ADMINISTRATION');
|
|
|
|
if (strlen($JSclearForm)) $JSclearForm = "\n // JSclearForm\n" . $JSclearForm;
|
|
if (strlen($JSsetForm)) $JSsetForm = "\n // JSsetForm\n" . $JSsetForm;
|
|
if (strlen($JSvalidation)) $JSvalidation = "\n // JSvalidation\n" . $JSvalidation;
|
|
|
|
// startLog("form.js.php");
|
|
// writeLog("CurrentTable: $CurrentTable");
|
|
// writeLog("tableAction: $tableAction");
|
|
|
|
?>
|
|
|
|
<!-- form.js -->
|
|
<style type="text/css">
|
|
#data-dialog-body {
|
|
width: <?php echo(intval($DialogWidth) - 20) ?>px !important;
|
|
height: <?php echo(intval($DialogHeight) - 50) ?>px !important;
|
|
overflow-x: hidden;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
function loadRecords(custom_data) {
|
|
$.jquery_loadData(custom_data);
|
|
}
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
<?php include "include/ajax.Setup.php" ?>
|
|
|
|
var tableName = "<?php echo($CurrentTable) ?>";
|
|
var tableAction = "<?php echo($tableAction) ?>";
|
|
var sequenceFlag = '<?php echo($SequenceFlag) ?>';
|
|
var tableID = "<?php echo($CurrentTable) ?>-table";
|
|
var custom_data = '<?php echo($CustomData) ?>';
|
|
<?php echo($JScustomVariables) ?>
|
|
|
|
$.ajaxSetup({ cache: false });
|
|
|
|
if ($("#dialog-tabs")) $("#dialog-tabs").tabs();
|
|
|
|
// Summernote dialogs (Insert Link / Image / Video) are attached to document.body.
|
|
// A modal jQuery UI dialog otherwise steals focus from those inputs and deadlocks
|
|
// the page. Patch the widget BEFORE creating #data-dialog so this instance gets it.
|
|
if ($.ui && $.ui.dialog && !window._noteDialogAllowInteraction) {
|
|
window._noteDialogAllowInteraction = true;
|
|
$.widget("ui.dialog", $.ui.dialog, {
|
|
_allowInteraction: function (event) {
|
|
return !!$(event.target).closest(".note-modal, .note-popover, .note-editor").length ||
|
|
this._super(event);
|
|
}
|
|
});
|
|
}
|
|
|
|
$("#data-dialog").dialog({
|
|
autoOpen: false,
|
|
minWidth: <?php echo($DialogWidth) ?>,
|
|
minHeight: <?php echo($DialogHeight) ?>,
|
|
modal: true,
|
|
position: { my: 'top center', at: 'top center' }
|
|
});
|
|
|
|
$("#image-upload-dialog").dialog({
|
|
autoOpen: false,
|
|
minWidth: 500,
|
|
minHeight: 400,
|
|
modal: true,
|
|
position: { my: 'center', at: 'center' }
|
|
});
|
|
|
|
$("#view-all").hide();
|
|
$(".top-insert-button").hide();
|
|
<?php if (isset($MaxRecords) && $MaxRecords > 0) { ?>
|
|
$(".bottom-insert-button").hide();
|
|
<?php } ?>
|
|
|
|
$("#current_data_view").val('');
|
|
|
|
<?php if (!isset($LoadInitialData) || $LoadInitialData != 'N') { ?>
|
|
// Load initial data set
|
|
loadData(custom_data);
|
|
<?php } ?>
|
|
|
|
<?php if (!isset($CustomLoadData) || $CustomLoadData == 'N') { ?>
|
|
function loadData(custom_data) {
|
|
loadDynamicData(tableName, tableAction, sequenceFlag, tableID, '', custom_data);
|
|
}
|
|
<?php } ?>
|
|
|
|
function loadDynamicData(table_name,action,sequence_flag,table_id,data_div,custom_data) {
|
|
var screenDiv = "dynamic-table-div";
|
|
if (data_div.length > 0) screenDiv = data_div;
|
|
|
|
$("#"+screenDiv).html("<p><b>Loading...</b></p>");
|
|
$("#"+screenDiv).html("<p><img src='images/spinner2.gif' height=84 width=84></p>");
|
|
|
|
$(".top-insert-button").hide();
|
|
<?php if (isset($MaxRecords) && $MaxRecords > 0) { ?>
|
|
$(".bottom-insert-button").hide();
|
|
<?php } ?>
|
|
|
|
// Format parameters
|
|
var data = "table_name="+table_name+
|
|
"&sequence_flag="+sequence_flag+
|
|
"&action="+action+
|
|
"&table_id="+table_id+
|
|
custom_data;
|
|
|
|
// Get data table
|
|
$.getJSON( "ajax.DataTable.Fetch.php",data,
|
|
function(results) {
|
|
$("#"+screenDiv).html(results.content);
|
|
<?php if (isset($MaxRecords) && $MaxRecords > 0) { ?>
|
|
if (results.num_records < <?php echo($MaxRecords); ?>) {
|
|
if (results.num_records > 5) $(".top-insert-button").show();
|
|
$(".bottom-insert-button").show();
|
|
}
|
|
<?php } else { ?>
|
|
if (results.num_records > 5) $(".top-insert-button").show();
|
|
<?php } ?>
|
|
|
|
if (sequence_flag == 'Y') {
|
|
$("#"+table_id).tableDnD({
|
|
onDrop: function(table, row) {
|
|
var rows = table.tBodies[0].rows;
|
|
var data = "&table="+table_name+"&school_num=<?php echo($school_num) ?>";
|
|
for (var i=0; i<rows.length; i++) {
|
|
var rowid = rows[i].id;
|
|
data += "&row_ids[]="+rowid;
|
|
|
|
// Update row classes
|
|
$("#"+rowid).removeClass("data-even");
|
|
$("#"+rowid).removeClass("data-odd");
|
|
if (i % 2) $("#"+rowid).addClass("data-even");
|
|
else $("#"+rowid).addClass("data-odd");
|
|
}
|
|
$.ajax({
|
|
url: "ajax.SequenceRecords.php",
|
|
data: data
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
);
|
|
}
|
|
|
|
$.jquery_loadData = function() {
|
|
loadData(custom_data);
|
|
};
|
|
|
|
|
|
//
|
|
// Form actions
|
|
//
|
|
$(".insert-new").click(function(e) {
|
|
e.preventDefault();
|
|
insertNew();
|
|
});
|
|
|
|
function insertNew() {
|
|
// Clear dialog
|
|
$(".form-field").val('');
|
|
$(".form-span").html('');
|
|
<?php
|
|
echo($JSclearForm);
|
|
echo($JSinitForm);
|
|
echo($JSclearCSS);
|
|
echo($JScustomInsertCode);
|
|
?>
|
|
$(".dialog-icons-table").hide();
|
|
$("#dialog-form-title").html("<b>-- <?php displayLanguageText('TEXT-ADD-NEW'); ?> --</b>");
|
|
if ($("#dialog-tabs")) $("#dialog-tabs").tabs({ active: 0 });
|
|
$(window).scrollTop(20);
|
|
$("#data-dialog").dialog('open');
|
|
}
|
|
|
|
$(document).on("click", ".edit-data", function(e) {
|
|
e.preventDefault();
|
|
|
|
var record_num = $(this).attr('rnum');
|
|
if ($("#match")) $("#match").val('');
|
|
<?php
|
|
echo($JSeditValidation);
|
|
?>
|
|
|
|
editData(record_num);
|
|
});
|
|
|
|
function editData(record_num) {
|
|
$.getJSON("ajax.DataRecord.Fetch.php",
|
|
{
|
|
table_name: tableName,
|
|
record_num: record_num
|
|
},
|
|
function(results) {
|
|
// Check for errors
|
|
if (results.ajax_return_code == 0) {
|
|
alert("<?php displayLanguageText('RECORD-NOT-FOUND-MSG'); ?>");
|
|
return;
|
|
}
|
|
|
|
// Display data
|
|
<?php
|
|
echo($JSclearCSS);
|
|
echo($JSsetForm);
|
|
echo($JSinitForm);
|
|
echo($JSeditData);
|
|
?>
|
|
$(".dialog-icons").each(function(index, el) {
|
|
$(this).attr('rnum', results.record_num);
|
|
});
|
|
|
|
$(".dialog-icons-table").show();
|
|
$("#dialog-form-title").html("<b>-- <?php displayLanguageText('TEXT-EDIT-RECORD'); ?> --</b>");
|
|
if ($("#dialog-tabs")) $("#dialog-tabs").tabs({ active: 0 });
|
|
$(window).scrollTop(20);
|
|
$("#data-dialog").dialog('open');
|
|
$(".form-search-field").val('');
|
|
<?php if ($_SESSION['UserInfo']['type'] == 'SuperUser' && $CurrentTable == 'people') { ?>
|
|
// alert(results.class_num+' - '+results.meal_location);
|
|
<?php } ?>
|
|
}
|
|
);
|
|
}
|
|
|
|
$(document).on("click", ".delete-data", function(e) {
|
|
e.preventDefault();
|
|
|
|
var record_num = $(this).attr('rnum');
|
|
var msg = "<?php displayLanguageText('TEXT-UNABLE-TO-DELETE-ENTRY'); ?>";
|
|
var dflag = $(this).attr('dflag');
|
|
|
|
if ($("#msg-"+record_num).length) {
|
|
msg = $("#msg-"+record_num).val();
|
|
if (msg == undefined) msg = "<?php displayLanguageText('TEXT-UNABLE-TO-DELETE-ENTRY'); ?>";
|
|
}
|
|
|
|
if (dflag == 'N') {
|
|
alert(msg);
|
|
return;
|
|
}
|
|
|
|
msg = "<?php displayLanguageText('TEXT-CONFIRM-DELETE'); ?>";
|
|
if ($("#warning-msg-"+record_num).length) {
|
|
msg += "\n\n"+$("#warning-msg-"+record_num).val();
|
|
}
|
|
|
|
var title1 = $("#delete-title1-"+record_num).html();
|
|
var title2 = $("#delete-title2-"+record_num).html();
|
|
if (title1 != undefined) msg += "\n - "+title1;
|
|
if (title2 != undefined) msg += "\n - "+title2;
|
|
var ans = confirm(msg);
|
|
|
|
if (ans) {
|
|
// Delete entry
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: "ajax.DataRecord.Delete.php",
|
|
data: { table_name: tableName, record_num: record_num }
|
|
}).done(function(data) {
|
|
// Display new data
|
|
$("#data-dialog").dialog('close');
|
|
loadData(custom_data);
|
|
<?php echo($JSafterDeleteCode) ?>
|
|
});
|
|
}
|
|
});
|
|
|
|
$("#view-all").click(function(e) {
|
|
e.preventDefault();
|
|
$("#insert-record").show();
|
|
$("#view-all").hide();
|
|
loadData("");
|
|
});
|
|
|
|
$("#cancelBtn").click(function(e) {
|
|
e.preventDefault();
|
|
|
|
$(".form-field").val('');
|
|
$(".form-span").html('');
|
|
<?php
|
|
echo($JSclearForm);
|
|
?>
|
|
|
|
$("#data-dialog").dialog('close');
|
|
});
|
|
|
|
$("#saveBtn").click(function(e) {
|
|
e.preventDefault();
|
|
saveFormData();
|
|
});
|
|
|
|
$("#dialogForm").submit(function(e) {
|
|
e.preventDefault();
|
|
saveFormData();
|
|
});
|
|
|
|
<?php echo($JSvalidation) ?>
|
|
|
|
function saveFormData() {
|
|
<?php echo($JSrequired) ?>
|
|
<?php echo($CustomValidation) ?>
|
|
<?php if (strlen($JSrequired)) { ?>
|
|
|
|
if (form_error) {
|
|
alert(form_error_message);
|
|
return;
|
|
}
|
|
|
|
<?php } ?>
|
|
|
|
// Save the form data
|
|
var record_num = $("#dialog_record_num").val();
|
|
var formdata = $("#dialogForm").serialize();
|
|
<?php if ($_SESSION['UserInfo']['type'] == 'SuperUser') { ?>
|
|
// alert(formdata);
|
|
<?php } ?>
|
|
var data = formdata+"&table_name="+tableName+"&sequence_flag="+sequenceFlag+"&record_num="+record_num;
|
|
$.ajax({
|
|
url: "ajax.DataRecord.Update.php",
|
|
data: data,
|
|
type: 'POST',
|
|
dataType: "json"
|
|
}).done(
|
|
function(results) {
|
|
if (results.ajax_return_code != 0) {
|
|
alert(results.ajax_return_msg);
|
|
return;
|
|
}
|
|
|
|
$("#data-dialog").dialog('close');
|
|
|
|
// Display new data
|
|
if ($("#match")) {
|
|
var match = $("#match").val();
|
|
if (match == 'display-current') {
|
|
$("#match").val('');
|
|
loadData("&record_num="+record_num);
|
|
}
|
|
else loadData(custom_data);
|
|
}
|
|
else loadData(custom_data);
|
|
}
|
|
);
|
|
}
|
|
<?php
|
|
if (isset($JQueryFile) && is_file($JQueryFile)) {
|
|
echo("\n\n");
|
|
echo(" // $JQueryFile\n");
|
|
include $JQueryFile;
|
|
}
|
|
?>
|
|
|
|
$("#upload-image").click(function(e) {
|
|
e.preventDefault();
|
|
$(".upload-field").show();
|
|
$("#image-upload-dialog").dialog('open');
|
|
});
|
|
|
|
$("#close-image-upload").click(function(e) {
|
|
e.preventDefault();
|
|
$("#image-upload-dialog").dialog('close');
|
|
});
|
|
|
|
|
|
$("#submit-upload-form").on('click', function(e) {
|
|
e.preventDefault();
|
|
|
|
$("#uploaded_file_name").val('');
|
|
|
|
var file_name = $("#dialog_myfile").val();
|
|
if (file_name.length == 0) {
|
|
alert("<?php displayLanguageText('ERRORMSG-IMAGE-FILE-NOT-SPECIFIED'); ?>");
|
|
return(false);
|
|
}
|
|
|
|
var fileExtension = ['jpeg', 'jpg', 'png', 'gif', 'bmp'];
|
|
if ($.inArray(file_name.split('.').pop().toLowerCase(), fileExtension) == -1) {
|
|
alert("<?php displayLanguageText('ERRORMSG-IMAGE-FORMATS-ACCEPTED'); ?>: "+fileExtension.join(', '));
|
|
return(false);
|
|
}
|
|
|
|
var fileToUpload = new FormData();
|
|
fileToUpload.append('fileToSave', $("#dialog_myfile")[0].files[0]);
|
|
|
|
$.ajax({
|
|
url: "upload.product-image.php",
|
|
data: fileToUpload,
|
|
processData: false,
|
|
contentType: false,
|
|
type: 'POST',
|
|
dataType: "json",
|
|
success: function(data) {
|
|
$("#uploaded_file_name").val(data.image_file);
|
|
$("#message").html("<?php displayLanguageText('TEXT-IMAGE-UPLOADED'); ?>:<br><br> - "+data.image_file+"<br><br>");
|
|
$("#dialog_myfile").val('');
|
|
$(".upload-field").hide();
|
|
<?php echo($JSafterUploadCode) ?>
|
|
},
|
|
error: function(jqXHR, textStatus, errorThrown) {
|
|
$("#message").html("<?php displayLanguageText('TEXT-IMAGE-UPLOADED'); ?>");
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$(".top-link").click(function(e) {
|
|
e.preventDefault();
|
|
$(".dialog-top").focus();
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<?php if (!isset($InsertNewRecord) || $InsertNewRecord == 'Y') { ?>
|
|
<p><button id='insert-data' class='insert-new top-insert-button btn btn--primary btn--small'> <?php echo($InsertButtonText) ?> </button></p>
|
|
<?php } ?>
|
|
|
|
<div id='dynamic-table-div'></div>
|
|
|
|
<input type='hidden' id='uploaded_file_name'>
|
|
|
|
<br>
|
|
<?php if (!isset($InsertNewRecord) || $InsertNewRecord == 'Y') { ?>
|
|
<p><button id='insert-data' class='insert-new bottom-insert-button btn btn--primary btn--small'> <?php echo($InsertButtonText) ?> </button></p>
|
|
<?php } ?>
|
|
|
|
<div id='data-dialog' title='<?php echo($templatePageTitle); ?>' class='dialog-div'>
|
|
<form id='dialogForm' method='post'>
|
|
<div id='dialog-top'></div>
|
|
<div id='data-dialog-body'>
|
|
<center>
|
|
<span id='dialog-form-title'></span>
|
|
<?php include "$FormFile"; ?>
|
|
</center>
|
|
<br>
|
|
</div>
|
|
<br>
|
|
<table width='100%'>
|
|
<tr>
|
|
<td align='center' style='background-color: #e0e0e0; height: 25px; padding: 10px 0;'>
|
|
<button id='cancelBtn' class='btn btn--outline btn--small'> <?php displayLanguageText('TEXT-CLOSE-WINDOW'); ?> </button>
|
|
|
|
<button id='saveBtn' class='btn btn--primary btn--small'> <?php displayLanguageText('TEXT-INSERT'); ?> </button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<input type='hidden' name='record_num' id='dialog_record_num'>
|
|
<input type='hidden' name='current_data_view' id='current_data_view'>
|
|
</form>
|
|
</div>
|
|
|
|
<div id='image-upload-dialog' title='<?php echo($templatePageTitle); ?>' class='dialog-div'>
|
|
<center>
|
|
<table width=450>
|
|
<tr>
|
|
<td align='left'>
|
|
<form id='uploadForm' action='upload.product-image.php' method='post' enctype="multipart/form-data">
|
|
<p class='align-left upload-field'><b><label for='dialog_myfile'><?php displayLanguageText('TEXT-FILE'); ?>:</label><br>
|
|
<input type="file" size="80" name="myfile" id="dialog_myfile" class="text ui-widget-content ui-corner-all" style='width: 400px;' /></p>
|
|
<br>
|
|
<button id='submit-upload-form' type='submit' class='upload-field btn btn--primary btn--small'> <?php displayLanguageText('TEXT-UPLOAD'); ?> </button>
|
|
<input type='hidden' name='csrf_token' id='csrf_token' value='<?php echo($_SESSION['csrf_token']) ?>'>
|
|
</form>
|
|
|
|
<span class='upload-field'>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
</span>
|
|
|
|
<div id="message"></div>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<p>
|
|
<button id='close-image-upload' class='btn btn--primary btn--small'> <?php displayLanguageText('TEXT-CLOSE-WINDOW'); ?> </button>
|
|
</p>
|
|
</center>
|
|
</div>
|
|
|
|
|