init
This commit is contained in:
46
module/table/collection_table_line_listform.inc.php
Normal file
46
module/table/collection_table_line_listform.inc.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_field_table_list_" . $fieldSetup['id'];
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_collection_id = (isset($_REQUEST["input_collection_id"]) ? $_REQUEST["input_collection_id"] : "");
|
||||
|
||||
$query = "SELECT tb.* FROM main_collection_table_link as mctl INNER JOIN table_header as tb on mctl.table_id = tb.id WHERE mctl.main_collection_id = ".$collectionData['id']." AND field_id = ".$fieldSetup['id']." LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$input_tableform = @mysqli_fetch_array($result);
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input type="hidden" name="input_collection_id" value="<?php echo $input_collection_id; ?>" />
|
||||
<input type="hidden" name="collection_modul_input_<?php echo $fieldSetup['id']; ?>" value="table" />
|
||||
<input type="hidden" name="input_table_id_<?php echo $fieldSetup['id']; ?>" value="<?= (!empty($input_tableform)) ? $input_tableform['id'] : 0 ?>" />
|
||||
|
||||
<table style="height:550px;" class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_table_description_".$fieldSetup['id'], "text", $input_tableform["description"], 255) ?>
|
||||
<? input($translation->get("Code"), "input_table_code_".$fieldSetup['id'], "text", $input_tableform["code"], 255) ?>
|
||||
<? input($translation->get("rows"), "no_rows_".$fieldSetup['id'], "number", $input_tableform["no_rows"], 255) ?>
|
||||
<? input($translation->get("columns"), "no_columns_".$fieldSetup['id'], "number", $input_tableform["no_columns"], 255) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_tableform["id"] != "") {
|
||||
show_changed_on($input_tableform["id"], "table_header");
|
||||
show_changed_by($input_tableform["id"], "table_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($input_tableform["id"] != "") {
|
||||
create_collection_table_set($input_tableform, $collectionData['id'], $fieldSetup['id']);
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</form>
|
||||
216
module/table/edit_table.inc.php
Normal file
216
module/table/edit_table.inc.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?
|
||||
|
||||
$messages = array();
|
||||
$error = FALSE;
|
||||
|
||||
|
||||
if (isset($custom_action)) {
|
||||
$action = $custom_action;
|
||||
|
||||
} else {
|
||||
$action = $_REQUEST["action"];
|
||||
}
|
||||
switch ($action) {
|
||||
case 'edit_tableform':
|
||||
edit_tableform();
|
||||
break;
|
||||
|
||||
case 'delete_tableform':
|
||||
delete_tableform();
|
||||
break;
|
||||
case 'new_tableform':
|
||||
|
||||
require_once("edit_tableform_cardform.inc.php");
|
||||
break;
|
||||
|
||||
case 'save_tableform':
|
||||
save_tableform();
|
||||
break;
|
||||
|
||||
case 'moveup_line_tableform':
|
||||
moveup_line_tableform();
|
||||
require_once("edit_table_listform.inc.php");
|
||||
break;
|
||||
case 'movedown_line_tableform':
|
||||
movedown_line_tableform();
|
||||
require_once("edit_table_listform.inc.php");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
require_once("edit_table_listform.inc.php");
|
||||
|
||||
break;
|
||||
}
|
||||
function save_tableform() {
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$input_id = "";
|
||||
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "UPDATE table_header SET
|
||||
description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_description"]) . "',
|
||||
|
||||
modified_date = " . time() . ",
|
||||
modified_user = " . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
code = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"])."',
|
||||
no_rows = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["no_rows"])."',
|
||||
no_columns = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["no_columns"])."'
|
||||
|
||||
WHERE id = '" . $_REQUEST["input_id"] . "'
|
||||
LIMIT 1";
|
||||
$inserted = FALSE;
|
||||
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
|
||||
} else {
|
||||
|
||||
$query = "INSERT INTO table_header
|
||||
(main_language_id, description, modified_date, modified_user, code, no_rows, no_columns)
|
||||
VALUES (
|
||||
" . (int)$GLOBALS["language"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_description']) . "',
|
||||
" . time() . ",
|
||||
" . (int)$GLOBALS["admin_user"]['id'] . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['input_code']) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['no_rows']) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST['no_columns']) . "'
|
||||
)";
|
||||
|
||||
$inserted = TRUE;
|
||||
}
|
||||
|
||||
if (($_REQUEST["input_description"] == '')) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_description") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
if ($_REQUEST["input_code"] <> urlencode($_REQUEST["input_code"])) {
|
||||
$messages[] = "<div class=\"errorbox\">" . $translation->get("error_textkey_encoding") . "</div>\n";
|
||||
$error = TRUE;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if ($inserted == TRUE) {
|
||||
$input_id = mysqli_insert_id($GLOBALS['mysql_con']);
|
||||
$messages[] = '<div class="successbox">' . $translation->get("data_success_1") . '</div>';
|
||||
} else {
|
||||
$messages[] = '<div class="successbox">' . $translation->get("data_success_2") . '</div>';
|
||||
}
|
||||
|
||||
if ($inserted == FALSE) {
|
||||
for($row = 1; $row <= $_REQUEST['no_rows']; $row++){
|
||||
for($column = 1; $column <= $_REQUEST['no_columns']; $column++){
|
||||
if (array_key_exists("input_table_" . $input_id."_".$row."_".$column,$_POST) && $_POST["input_table_" . $input_id."_".$row."_".$column] != "" && $_POST["input_table_" . $input_id."_".$row."_".$column] != NULL) {
|
||||
add_to_line($row, $column, $input_id, $_POST["input_table_" . $input_id."_".$row."_".$column]);
|
||||
} else{
|
||||
$deleteData = @mysqli_query($GLOBALS["mysql_con"], "DELETE FROM table_line WHERE table_id='".$input_id."' AND row_no = '".$row."' AND column_no = '".$column."'" );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
edit_tableform($input_id, $messages);
|
||||
|
||||
|
||||
} else {
|
||||
header('EDIT_ERROR: 1');
|
||||
$input_tableform["description"] = $_REQUEST["input_description"];
|
||||
$input_tableform["code"] = $_REQUEST["input_code"];
|
||||
$input_tableform["no_rows"] = $_REQUEST["no_rows"];
|
||||
$input_tableform["no_columns"] = $_REQUEST["no_columns"];
|
||||
$input_tableform["id"] = $_REQUEST["input_id"];
|
||||
require_once("edit_tableform_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function edit_tableform( $_id = "", $messages = array() ) {
|
||||
|
||||
$input_id = '';
|
||||
|
||||
if ((int)$_id > 0) {
|
||||
$input_id = $_id;
|
||||
} if(isset($_REQUEST['input_id']) && $_id == ''){
|
||||
$input_id = $_REQUEST["input_id"];
|
||||
}
|
||||
|
||||
|
||||
if ($input_id <> '') {
|
||||
$query = "SELECT * FROM table_header WHERE id = '" . $input_id . "' LIMIT 1";
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
if (@mysqli_num_rows($result) == 1) {
|
||||
$input_tableform = @mysqli_fetch_array($result);
|
||||
|
||||
require_once("edit_tableform_cardform.inc.php");
|
||||
|
||||
}
|
||||
} else {
|
||||
$input_tableform = array();
|
||||
|
||||
require_once("edit_tableform_cardform.inc.php");
|
||||
}
|
||||
}
|
||||
function delete_tableform() {
|
||||
if ($_REQUEST["input_id"] <> '') {
|
||||
$query = "DELETE FROM table_header WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1";
|
||||
@mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
require_once("edit_table_listform.inc.php");
|
||||
}
|
||||
function create_table_set($input_tableform){
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
|
||||
for($i = 1; $i <= $input_tableform['no_rows']; $i++ ){
|
||||
echo '<tr style="outline: thin solid #d8dce3;padding:2px;">';
|
||||
for($j = 1; $j <= $input_tableform['no_columns']; $j++ ){
|
||||
echo '<td style="width:auto; float:none;">';
|
||||
$query = "SELECT * FROM table_line WHERE table_id = '" . $input_tableform['id'] . "' AND row_no = ".$i." AND column_no = ".$j." LIMIT 1";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$value = '';
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
$row = @mysqli_fetch_array($result);
|
||||
$value = $row['data'];
|
||||
}
|
||||
input($translation->get("description"), "input_table_".$input_tableform['id']."_".$i."_".$j, "text", $value, 255) ;
|
||||
echo '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
}
|
||||
function add_to_line($row, $column, $input_id, $data){
|
||||
$query = "SELECT * FROM table_line WHERE table_id = '" . $input_id . "' AND row_no = ".$row." AND column_no = ".$column." LIMIT 1";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$queryLine = '';
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
$tableData = @mysqli_fetch_array($result);
|
||||
$queryLine = "UPDATE table_line SET
|
||||
table_id = " . $input_id . ",
|
||||
row_no = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $row)."',
|
||||
column_no = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $column)."',
|
||||
data = '". mysqli_real_escape_string($GLOBALS['mysql_con'], $data)."'
|
||||
WHERE id = '" . $tableData["id"] . "'
|
||||
LIMIT 1";
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$queryLine = "INSERT INTO table_line
|
||||
(table_id, row_no, column_no, data)
|
||||
VALUES (
|
||||
|
||||
" . $input_id . ",
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $row) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $column) . "',
|
||||
'" . mysqli_real_escape_string($GLOBALS['mysql_con'], $data) . "'
|
||||
)";
|
||||
|
||||
}
|
||||
@mysqli_query($GLOBALS['mysql_con'], $queryLine);
|
||||
}
|
||||
?>
|
||||
35
module/table/edit_table_listform.inc.php
Normal file
35
module/table/edit_table_listform.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
|
||||
$formname = "form_process_list";
|
||||
$inputname = "input_id";
|
||||
|
||||
?>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("new", $translation->get("new"), $formname, "loadCard('new_tableform', true)"); ?>
|
||||
<?= button("edit", $translation->get("edit"), $formname, "loadCard('edit_tableform')"); ?>
|
||||
<?= button("delete", $translation->get("delete"), $formname, "sendRequest('delete_tableform', false, '{$translation->get('delete_data_confirm')}')"); ?>
|
||||
</ul>
|
||||
|
||||
<div id="mainContent">
|
||||
|
||||
<?php echo current_website_language($site, $language); ?>
|
||||
<h1><?php echo get_translation('table'); ?></h1>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
$query = "SELECT table_header.id, description AS '" . $translation->get("description") . "', code, from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from table_header left join main_admin_user ON table_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . ") ORDER BY sorting asc";
|
||||
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "edit_tableform", FALSE, 'update_sortorder_table', "sendRequest('delete_tableform', false, '{$translation->get('delete_data_confirm')}')");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
113
module/table/edit_tableform_cardform.inc.php
Normal file
113
module/table/edit_tableform_cardform.inc.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "bewerber_forms";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
$input_component_id = (isset($_REQUEST["input_component_id"]) ? $_REQUEST["input_component_id"] : "");
|
||||
$is_survey = 0;
|
||||
if(isset($_GET["level_2"]) && $_GET["level_2"] == 'survey_forms'){
|
||||
$is_survey = 1;
|
||||
}
|
||||
$query = 'SELECT * FROM google_recaptcha';
|
||||
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$grecaptcha = @mysqli_fetch_array($result);
|
||||
$reCaptchaDisabled = false;
|
||||
|
||||
if ($grecaptcha["secretkey"] == "" && $grecaptcha["websitekey"] == "") {
|
||||
$reCaptchaDisabled = true;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php if ($input_tableform["id"] == "") {
|
||||
|
||||
echo $translation->get("new_tableform");
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
echo $translation->get("edit_tableform");
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Speichern button
|
||||
button("save", $translation->get("save"), $formname, "loadCard('save_tableform', true)");
|
||||
|
||||
// Speichern und schliessen
|
||||
button("save", $translation->get("save_and_close"), $formname, "loadCard('save_tableform', true, '', true)");
|
||||
?>
|
||||
<li>
|
||||
<ul>
|
||||
<?php
|
||||
// Loeschen button
|
||||
if ($input_tableform["id"] != "" && is_page_edit() === FALSE && is_component_edit() === FALSE) {
|
||||
echo button("delete", $translation->get("delete"), $formname, "loadCard('delete_tableform', true, '{$translation->get('delete_data_confirm')}', true)", "", FALSE);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfixs"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input name="input_id" type="hidden" value="<?= $input_tableform["id"] ?>">
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
|
||||
|
||||
|
||||
<table class="cardform" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td>
|
||||
<? input($translation->get("description"), "input_description", "text", $input_tableform["description"], 255) ?>
|
||||
<? input($translation->get("Code"), "input_code", "text", $input_tableform["code"], 255) ?>
|
||||
<? input($translation->get("rows"), "no_rows", "number", $input_tableform["no_rows"], 255) ?>
|
||||
<? input($translation->get("columns"), "no_columns", "number", $input_tableform["no_columns"], 255) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_tableform["id"] != "") {
|
||||
show_changed_on($input_tableform["id"], "table_header");
|
||||
show_changed_by($input_tableform["id"], "table_header");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
if ($input_tableform["id"] != "") {
|
||||
create_table_set($input_tableform);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<?
|
||||
|
||||
?>
|
||||
42
module/table/page_table_listform.inc.php
Normal file
42
module/table/page_table_listform.inc.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$translation = \DynCom\mysyde\common\classes\Registry::get("translation");
|
||||
$formname = "form_contactform_list";
|
||||
$inputname = "input_id";
|
||||
$input_page_id = (isset($_REQUEST["input_page_id"]) ? $_REQUEST["input_page_id"] : "");
|
||||
?>
|
||||
|
||||
<div id="overlaycrumb">
|
||||
<?php echo $translation->get("assign_table"); ?>
|
||||
<div id="closeoverlay" onclick="disableOverlay();"></div>
|
||||
</div>
|
||||
|
||||
<ul class="toolbar_menu">
|
||||
<?= button("left", $translation->get("back"), $formname, "loadCard('edit_content_page', true)"); ?>
|
||||
<?= button("link", $translation->get("assoc_with_page"), $formname, "loadCard('assoc_line_page')"); ?>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?php
|
||||
if (count($messages)) {
|
||||
echo '<div id="overlayMessages">' . join("\r\n", $messages) . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<form id="<?= $formname ?>" name="<?= $formname ?>" method="post">
|
||||
<input type="hidden" class="selected_linklist_row" name="input_id" value="" />
|
||||
<input type="hidden" name="get_real_page_link_id" value="1" />
|
||||
<input type="hidden" name="input_page_id" value="<?php echo $input_page_id; ?>" />
|
||||
<input name="data-sitepartid" type="hidden" value="22">
|
||||
|
||||
<div class="requestLoader"></div>
|
||||
<?
|
||||
|
||||
$query = "SELECT table_header.id, description AS '" . $translation->get("description") . "', from_unixtime(modified_date, '%d.%m.%Y %H:%i:%s') AS '" . $translation->get("changed_on") . "', main_admin_user.name AS '" . $translation->get("changed_by") . "' from table_header left join main_admin_user ON table_header.modified_user = main_admin_user.id where (main_language_id = " . (int)$GLOBALS["language"]['id'] . " ) order by id asc";
|
||||
//echo $query;
|
||||
$format = array('option', 'text', 'text', 'text');
|
||||
if ($result = @mysqli_query($GLOBALS['mysql_con'], $query)) {
|
||||
linklist($result, $formname, $format, "input_id", "assoc_line_page");
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
66
module/table/show_collection_table.inc.php
Normal file
66
module/table/show_collection_table.inc.php
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
|
||||
<?
|
||||
|
||||
|
||||
$query = "SELECT tb.* FROM main_collection_table_link as mctl INNER JOIN table_header as tb on mctl.table_id = tb.id WHERE mctl.main_collection_id = ".$collectionData['id']." AND field_id = ".$fieldData['id']." LIMIT 1";
|
||||
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$value = '';
|
||||
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$countRows = mysqli_num_rows($result);
|
||||
$bodyDone = False;
|
||||
if ($countRows > 0) {
|
||||
$table = @mysqli_fetch_array($result);
|
||||
echo '<div class="table-wrapper table_'.$table['id'].'">';
|
||||
echo '<table class="sitepart_table table">';
|
||||
$count = 0;
|
||||
for($row = 1; $row <= $table['no_rows']; $row++){
|
||||
if($row == 1) {
|
||||
echo '<thead>';
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
for($column = 1; $column <= $table['no_columns']; $column++ ){
|
||||
|
||||
$query = "SELECT * FROM table_line WHERE table_id = '" . $table['id'] . "' AND row_no = ".$row." AND column_no = ".$column." LIMIT 1";
|
||||
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$value = '';
|
||||
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($rows = mysqli_fetch_array($result)) {
|
||||
|
||||
|
||||
if($row == 1) {
|
||||
echo '<th>';
|
||||
} else{
|
||||
echo '<td>';
|
||||
}
|
||||
echo $rows['data'];
|
||||
|
||||
if($row == 0) {
|
||||
echo '</th>';
|
||||
} else{
|
||||
echo '</td>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</tr>';
|
||||
if($row == 1) {
|
||||
echo '</thead>';
|
||||
}
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
62
module/table/show_table.inc.php
Normal file
62
module/table/show_table.inc.php
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
|
||||
<?
|
||||
|
||||
$query = "SELECT * FROM table_header WHERE id = '" . $sitepart_id . "' LIMIT 1";
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$value = '';
|
||||
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$countRows = mysqli_num_rows($result);
|
||||
|
||||
if ($countRows > 0) {
|
||||
$table = @mysqli_fetch_array($result);
|
||||
echo '<div class="table-wrapper table_'.$table['id'].'">';
|
||||
echo '<table class="sitepart_table table">';
|
||||
|
||||
for($row = 1; $row <= $table['no_rows']; $row++){
|
||||
if($row == 1) {
|
||||
echo '<thead>';
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
for($column = 1; $column <= $table['no_columns']; $column++ ){
|
||||
|
||||
$query = "SELECT * FROM table_line WHERE table_id = '" . $table['id'] . "' AND row_no = ".$row." AND column_no = ".$column." LIMIT 1";
|
||||
|
||||
$result = mysqli_query($GLOBALS['mysql_con'], $query);
|
||||
$value = '';
|
||||
$count = 0;
|
||||
if (@mysqli_num_rows($result) > 0) {
|
||||
while ($rows = mysqli_fetch_array($result)) {
|
||||
|
||||
|
||||
if($count == 0) {
|
||||
echo '<th>';
|
||||
} else{
|
||||
echo '<td>';
|
||||
}
|
||||
echo $rows['data'];
|
||||
|
||||
if($count == 0) {
|
||||
echo '</th>';
|
||||
} else{
|
||||
echo '</td>';
|
||||
}
|
||||
$count++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</tr>';
|
||||
if($row == 1) {
|
||||
echo '</thead>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
13
module/table/table.php
Normal file
13
module/table/table.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?
|
||||
|
||||
function table_show( $sitepart_id ) {
|
||||
require("show_table.inc.php");
|
||||
}
|
||||
|
||||
function table_edit() {
|
||||
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'edit_table.inc.php';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user