瀏覽代碼

sql Content Element

master
Dom SP 3 年之前
父節點
當前提交
a602eda084
共有 1 個檔案被更改,包括 35 行新增1 行删除
  1. +35
    -1
      app/modules/filesinfolders.php

+ 35
- 1
app/modules/filesinfolders.php 查看文件

@@ -391,7 +391,7 @@ class FilesInFolders {
);
}
break;
case 'TOC':
// throw away TOC part of request, we don't need it
array_shift($request);
@@ -402,6 +402,39 @@ class FilesInFolders {
$toc);
break;

case 'sql':
//array_shift($request);
switch ($request[1]) {
case 'sqlite':
$array = [];
$db = new \DB\SQL('sqlite:' . $this->folder . $request[2]);
$sql = implode(" ", $body);
if ( strpos($sql,'insert')===false &&
strpos($sql,'update')===false &&
strpos($sql,'drop')===false) {
$rows = $db->exec($sql);
foreach ($rows as $res) {
switch (count($res)) {
case 1:
$keys=array_keys($res);
$array[] = $res[$keys[0]];
break;
case 2:
$keys=array_keys($res);
$array[$res[$keys[0]]] = $res[$keys[1]];
break;
}
}
}
$new = sprintf("<ul><li>%s</li></ul>",
implode("</li><li>",$array));
unset($array);
break;
}
break;
case 'form':
$token_db = $f3->get('TEMP') . "CEform/";
$form_config_file = sprintf("%s%s.cfg",
@@ -462,6 +495,7 @@ class FilesInFolders {
$formcall->token = $token;
$formcall->timestamp = $timestamp;
$formcall->form = $form_config_file;
$formcall->path = ROOT.$this->folder;
$formcall->save();
$form_view = new \Template;

Loading…
取消
儲存