$limit = mysql_num_rows($rs); if ($limit > 0) { for ($i = 0; $i < $limit; $i++) { $row = mysql_fetch_assoc($rs); $metatags_selected[] = $row['name'] . ': <i>' . $row['tagvalue'] . '</i>'; } } /** * "View Children" tab setup */ $maxpageSize = $modx->config['number_of_results']; define('MAX_DISPLAY_RECORDS_NUM', $maxpageSize); if (!class_exists('makeTable')) { include_once $modx->config['base_path'] . 'manager/includes/extenders/maketable.class.php'; } $childsTable = new makeTable(); // Get child document count $sql = 'SELECT DISTINCT sc.id ' . 'FROM ' . $tbl_site_content . ' AS sc ' . 'LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document = sc.id ' . 'WHERE sc.parent=\'' . $content['id'] . '\' ' . 'AND (' . $access . ')'; $rs = $modx->db->query($sql); $numRecords = $modx->db->getRecordCount($rs); // Get child documents (with paging) $sql = 'SELECT DISTINCT sc.* ' . 'FROM ' . $tbl_site_content . ' AS sc ' . 'LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document = sc.id ' . 'WHERE sc.parent=\'' . $content['id'] . '\' ' . 'AND (' . $access . ') ' . $childsTable->handlePaging(); // add limit clause if ($numRecords > 0) { if (!($rs = $modx->db->query($sql))) { // sql error $e->setError(1); $e->dumpError(); include $modx->config['base_path'] . 'manager/includes/footer.inc.php'; exit; } else {
$rs = $modx->db->select('username', $tbl_manager_users, "id='{$content['editedby']}'"); $editedbyname = $modx->db->getValue($rs); // Get Template name $rs = $modx->db->select('templatename', $tbl_site_templates, "id='{$content['template']}'"); $templatename = $modx->db->getValue($rs); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; /** * "View Children" tab setup */ $maxpageSize = $modx->config['number_of_results']; define('MAX_DISPLAY_RECORDS_NUM', $maxpageSize); if (!class_exists('makeTable')) { include_once $modx->config['site_manager_path'] . 'includes/extenders/maketable.class.php'; } $childsTable = new makeTable(); // Get child document count $rs = $modx->db->select('count(DISTINCT sc.id)', "{$tbl_site_content} AS sc\n\t\tLEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.parent='{$content['id']}' AND ({$access})"); $numRecords = $modx->db->getValue($rs); $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'DESC'; // Get child documents (with paging) $rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc\n\t\tLEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.parent='{$content['id']}' AND ({$access})", "{$sort} {$dir}", $childsTable->handlePaging()); $filter_sort = ''; $filter_dir = ''; if ($numRecords > 0) { $filter_sort = '<p><select size="1" name="sort" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . ($sort == 'createdon' ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . ($sort == 'pub_date' ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . ($sort == 'pagetitle' ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . ($sort == 'menuindex' ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . '<option value="published"' . ($sort == 'published' ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . '</select>'; $filter_dir = '<select size="1" name="dir" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . ($dir == 'DESC' ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . ($dir == 'ASC' ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select></p>'; $resource = $modx->db->makeArray($rs); // CSS style for table $tableClass = 'grid';
$password = $_POST["password"]; $database = $_POST["database"]; // Create connection $conn = new mysqli($servername, $username, $password, $database); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Start examining directories and create an array with the classes $classes = examinate('models'); $results = array(); // Make the table with their attributes foreach ($classes as $class) { $tabla = $class->id; $key = $class->id . "_id"; $makeTable = new makeTable($tabla); $makeTable->addKey($key, "number"); $makeTable->addColumn("updated_at", "timestamp"); $makeTable->addColumn("created_at", "timestamp"); foreach ($class->columns as $key => $value) { $makeTable->addColumn($key, $value); } foreach ($class->features as $feature => $data) { $class = getFeature($feature); $addColumns = $class->addColumns(); foreach ($addColumns as $key => $value) { $makeTable->addColumn($key, $value); } } $sql = $makeTable->execute(); if ($conn->query($sql) === TRUE) {