Browse Source

sql Content Element

master
Dom SP 3 years ago
parent
commit
a602eda084
1 changed files with 35 additions and 1 deletions
  1. +35
    -1
      app/modules/filesinfolders.php

+ 35
- 1
app/modules/filesinfolders.php View File

); );
} }
break; break;
case 'TOC': case 'TOC':
// throw away TOC part of request, we don't need it // throw away TOC part of request, we don't need it
array_shift($request); array_shift($request);
$toc); $toc);
break; 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': case 'form':
$token_db = $f3->get('TEMP') . "CEform/"; $token_db = $f3->get('TEMP') . "CEform/";
$form_config_file = sprintf("%s%s.cfg", $form_config_file = sprintf("%s%s.cfg",
$formcall->token = $token; $formcall->token = $token;
$formcall->timestamp = $timestamp; $formcall->timestamp = $timestamp;
$formcall->form = $form_config_file; $formcall->form = $form_config_file;
$formcall->path = ROOT.$this->folder;
$formcall->save(); $formcall->save();
$form_view = new \Template; $form_view = new \Template;

Loading…
Cancel
Save