$sPR = $wo->db->query('select * from ' . $tableName . ' where ' . $remoteIdColumn . '=\'' . $_POST['itemId'] . '\' and objectId=\'' . $_POST['table'] . '\' order by ord'); while ($sP = $wo->db->fetchAssoc($sPR)) { $fileInfo = pathinfo($sP['picture']); if ($fileInfo['extension'] == 'pdf' || $fileInfo['extension'] == 'PDF') { echo '<br/><div><a href="' . $siteBaseURL . $imagesRelativePath . $sP['picture'] . '" style="font-family: verdana; font-size: 12px; color: #000000;"><img src="../assets/pdfIcon.jpg" width="22" height="22"/>' . substr($sP['picture'], 20) . '</a> <br/>'; } else { echo '<div><img src="' . $siteBaseURL . $imagesRelativePath . $sP['picture'] . '" width="88" height="62"> '; } $extraURLBit = '&table=' . $table->getTableId() . '&' . $remoteIdColumn . '=' . $_POST['itemId']; $template = ''; /* if ($row['active']=='1') { $template.='<a href="'. $_SERVER['PHP_SELF'] .'?action=deactivate&__address=1_'. $pictureTable->getTableName() .'_'. $sP['id'] .'" class="on">Active</a> '; }else { $template.='<a href="'. $_SERVER['PHP_SELF'] .'?action=activate&__address=1_'. $pictureTable->getTableName() .'_'. $sP['id'] .'" class="off">Inctive</a> '; } */ $template .= '<a href="administration.php?&__address=1_' . $pictureTable->getTableId() . '_' . $sP['id'] . '&action=edit' . $extraURLBit . '" target="_parent"><img src="images/edit.png" border="0" alt="Edit this item."></a> '; $template .= '<a href="' . $_SERVER['PHP_SELF'] . '?action=moveUp&__address=1_' . $pictureTable->getTableId() . '_' . $sP['id'] . $extraURLBit . '"><img src="images/arrowUp.png" border="0" alt="Up this item in order"></a><a href="' . $_SERVER['PHP_SELF'] . '?action=moveDown&__address=1_' . $pictureTable->getTableName() . '_' . $sP['id'] . $extraURLBit . '"><img src="images/arrowDown.png" border="0" alt="Down this item in order"></a> '; $template .= ' <a href="javascript:confirmDelete(\'' . $_SERVER['PHP_SELF'] . '?__address=1_' . $pictureTable->getTableId() . '_' . $sP['id'] . $extraURLBit . '&action=deleteItem\');"><img src="images/delete.png" border="0" alt="Delete this item"></a> </div> '; echo $template . ' </div><br/>'; } echo '</div></body></html>';
<?php $__isSiteBuilderPage = true; $__actualPath = dirname($_SERVER['SCRIPT_FILENAME']); $__actualPath = dirname($__actualPath); require_once $__actualPath . '/setup.inc.php'; $requestedAction = 'edit'; $pageLocation = '1'; $wo = new WOOOF(); $table = new WOOOF_dataBaseTable($wo->db, $_GET['table']); if (isset($_GET['submit']) && $_GET['submit'] == 'Submit') { for ($du = 0; $du < count($_GET['chk']); $du++) { $desr = $wo->db->query('select * from __columnMetaData where tableId=\'' . $table->getTableId() . '\' and id=\'' . $wo->cleanUserInput($_GET['chk'][$du]) . '\''); $de = $wo->db->fetchAssoc($desr); $c = ''; //print_r($de); //echo 'INSERT INTO __columnMetaData set $wo->db->query('INSERT INTO __columnMetaData set id=\'' . $wo->db->getNewId('__columnMetaData') . '\', tableId=\'' . $table->getTableId() . '\', name=\'' . $wo->db->escape(trim($de['name' . $c] . $_GET['suplec'])) . '\', description=\'' . $wo->db->escape(trim($de['description' . $c] . $_GET['suple'])) . '\', type=\'' . $wo->db->escape(trim($de['type' . $c])) . '\', length=\'' . $wo->db->escape(trim($de['length' . $c])) . '\', notNull=\'' . $wo->db->escape(trim($de['notNull' . $c])) . '\', presentationType=\'' . $wo->db->escape(trim($de['presentationType' . $c])) . '\', isReadOnly=\'' . $wo->db->escape(trim($de['isReadOnly' . $c])) . '\', isInvisible=\'' . $wo->db->escape(trim($de['isInvisible' . $c])) . '\', appearsInLists=\'' . $wo->db->escape(trim($de['appearsInLists' . $c])) . '\', isASearchableProperty=\'' . $wo->db->escape(trim($de['isASearchableProperty' . $c])) . '\', isReadOnlyAfterFirstUpdate=\'' . $wo->db->escape(trim($de['isReadOnlyAfterFirstUpdate' . $c])) . '\',
} if ($header != '') { header($header); } else { header('Location: administration.php?action=read&__address=1_' . $table->getTableId() . $extraURLBit); } doTheExit(); } else { if ($action == 'moveDown' && count($addressItems) == 3) { $targetRow = $wo->db->getRow($table->getTableName(), $addressItems[2]); $ordering = $table->getOrderingColumnForListings(); if ($table->getGroupedByTable() != '') { $table2 = new WOOOF_dataBaseTable($wo->db, $table->getGroupedByTable()); if ($table2->getAdminPresentation() == WOOOF_tablePresentationTypes::CompositeTree) { if ($targetRow[$table->getLocalGroupColumn()] != '-1') { $header = 'Location: administration.php?action=edit&__address=1_' . $table2->getTableId() . '_' . $targetRow[$table->getLocalGroupColumn()] . '&parentNode=' . $targetRow[$table->getLocalGroupColumn()]; } else { $header = 'Location: improvedTree.php?action=read&__address=1_' . $table2->getTableId() . '&parentNode=' . $targetRow[$table->getLocalGroupColumn()]; } } else { if (stripos($table2->getTablesGroupedByThis(), $table->getTableName()) !== null && $_GET['from'] == 'edit') { $header = 'Location: administration.php?action=edit&__address=1_' . $table2->getTableId() . '_' . $targetRow[$table->getLocalGroupColumn()]; } else { $header = ''; } } $extraURLBit = '&wooofParent=' . $targetRow[$table->getLocalGroupColumn()] . '&' . $table->getLocalGroupColumn() . '=' . $targetRow[$table->getLocalGroupColumn()]; $extraQueryBit = ' and ' . $table->getLocalGroupColumn() . '=\'' . $targetRow[$table->getLocalGroupColumn()] . '\' '; } else { $extraURLBit = ''; $extraQueryBit = '';
/** * * @param array $row * @param string $subtableName * @param string $optionsTable * @return boolean */ public function updateSubtableFromPostCheckBoxes($row, $subtableName, $optionsTable) { $sT = new WOOOF_dataBaseTable($this->dataBase, $subtableName); if ($sT->constructedOk === FALSE) { return FALSE; } $sTId = $sT->getTableId(); $res = $this->dataBase->query('delete from ' . $sT->getTableName() . ' where ' . $sT->getLocalGroupColumn() . '=\'' . $row[$sT->getRemoteGroupColumn()] . '\''); if ($res === FALSE) { return FALSE; } if (isset($_POST[$sTId])) { $oT = new WOOOF_dataBaseTable($this->dataBase, $optionsTable); $oT->getResult(''); for ($n = 0; $n < count($sT->columns) / 2; $n++) { $columnMetaData = $sT->columns[$n]->getColumnMetaData(); if ($columnMetaData['valuesTable'] == $oT->getTableName()) { $presentationColumn = $columnMetaData['name']; } } while (list($key, $val) = each($_POST[$sTId])) { $res = $this->dataBase->query('insert into ' . WOOOF::$instance->cleanUserInput($sT->getTableName()) . ' (id,' . WOOOF::$instance->cleanUserInput($sT->getLocalGroupColumn()) . ',' . WOOOF::$instance->cleanUserInput($presentationColumn) . ') values (\'' . $this->dataBase->getNewId($sT->getTableName()) . '\',\'' . WOOOF::$instance->cleanUserInput($row[$sT->getRemoteGroupColumn()]) . '\',\'' . WOOOF::$instance->cleanUserInput($val) . '\')'); if ($res === FALSE) { return FALSE; } } } return TRUE; }
while ($table->columns[$counter]->getAppearsInLists() != '1') { $counter++; } $path = ''; foreach ($table->columns as $key => $value) { $column = $value->getColumnMetaData(); if ($column['appearsInLists']) { $columnsToShow = $column['name']; } } if (count($addressItems) == 2 || $addressItems[2] == '') { $whereClauses['parent_id'] = '-1'; $table->getResult($whereClauses, 'ord'); //$innerStuff ='<div id="listTitle"><a href="administration.php?action=edit&__address=1_'. $table->getTableId() .'_&wooofParent=-1">Προσθήκη '. $table->getTableDescription() .'</a></div>'; $actualRow['name'] = 'Μενού'; $additionLabel = '<a href="administration.php?action=edit&__address=1_' . $table->getTableId() . '_&wooofParent=-1">Προσθήκη ' . $table->getTableDescription() . '</a>'; } else { $actualRow = $wo->db->getRow($table->getTableName(), $addressItems[2]); $whereClauses['parent_id'] = $addressItems[2]; $table->getResult($whereClauses, $table->getOrderingColumnForListings()); $current_row['parent_id'] = $addressItems[2]; $treeLevel = 0; do { $treeLevel++; $current_row = $wo->db->getRow($table->getTableName(), $current_row['parent_id']); if ($addressItems[2] == $current_row['id']) { $path = ' > ' . $current_row[$table->columns[$counter]->getName()] . $path; } else { $path = ' > <a href="improvedTree.php?__address=1_' . $table->getTableId() . '_' . $current_row['id'] . '&action=read">' . $current_row[$table->columns[$counter]->getName()] . '</a>' . $path; } } while ($current_row['parent_id'] != '-1');
<?php $__isAdminPage = true; $__isSiteBuilderPage = true; $__actualPath = dirname($_SERVER['SCRIPT_FILENAME']); $__actualPath = dirname($__actualPath); require_once $__actualPath . '/setup.inc.php'; $requestedAction = 'read'; $pageLocation = '1'; $pageTitle = 'Administration Back End'; $wo = new WOOOF(); $table = new WOOOF_dataBaseTable($wo->db, $_GET['table']); $fragment = $table->constructAdministrationFragment(); echo '<div class="itemEditForm"><form method="POST" action="administration.php" enc-type="multipart/form-data"><input type="hidden" name="__address" value="1_' . $table->getTableId() . '_@@@id@@@"><input type="hidden" name="action" value="insert">'; echo $fragment[0]; echo '<section class="formFields"> <div class="adminButton"><input type="submit" name="submit" value="Εισαγωγή"></div> </section></form></div>'; echo '<a href="buildTblCode.php?table=' . $_GET['table'] . '&class=">Get Tbl Code (fill-in class name first)...</a>'; exit;
$_POST['isInvisible' . $c] = '0'; } if (!isset($_POST['isASearchableProperty' . $c]) || $_POST['isASearchableProperty' . $c] != '1') { $_POST['isASearchableProperty' . $c] = '0'; } if (!isset($_POST['isReadOnlyAfterFirstUpdate' . $c]) || $_POST['isReadOnlyAfterFirstUpdate' . $c] != '1') { $_POST['isReadOnlyAfterFirstUpdate' . $c] = '0'; } if (!isset($_POST['isForeignKey' . $c]) || $_POST['isForeignKey' . $c] != '1') { $_POST['isForeignKey' . $c] = '0'; } if (!isset($_POST['appearsInLists' . $c]) || $_POST['appearsInLists' . $c] != '1') { $_POST['appearsInLists' . $c] = '0'; } if ($_POST['ordering' . $c] == '' || $_POST['ordering' . $c] == '0') { $oR = $wo->db->query('select max(ordering) from __columnMetaData where tableId=\'' . $t->getTableId() . '\''); $o = mysqli_fetch_row($oR); $_POST['ordering' . $c] = (int) $o[0] + 10; } $succ = $wo->db->query('INSERT INTO __columnMetaData set id=\'' . $wo->db->getNewId('__columnMetaData') . '\', tableId=\'' . $t->getTableId() . '\', name=\'' . $wo->db->escape(trim($_POST['name' . $c])) . '\', description=\'' . $wo->db->escape(trim($_POST['description' . $c])) . '\', type=\'' . $wo->db->escape(trim($_POST['type' . $c])) . '\', length=\'' . $wo->db->escape(trim($_POST['length' . $c])) . '\', notNull=\'' . $wo->db->escape(trim($_POST['notNull' . $c])) . '\', presentationType=\'' . $wo->db->escape(trim($_POST['presentationType' . $c])) . '\', isReadOnly=\'' . $wo->db->escape(trim($_POST['isReadOnly' . $c])) . '\', isInvisible=\'' . $wo->db->escape(trim($_POST['isInvisible' . $c])) . '\', appearsInLists=\'' . $wo->db->escape(trim($_POST['appearsInLists' . $c])) . '\',