|
|
|
|
|
|
|
|
$v['template'] |
|
|
$v['template'] |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
if (array_key_exists('db',$v)) { |
|
|
|
|
|
switch ($v['db']['type']) { |
|
|
|
|
|
case 'sqlite': |
|
|
|
|
|
$array = []; |
|
|
|
|
|
$db = new \DB\SQL('sqlite:' . $this->folder . $v['db']['file']); |
|
|
|
|
|
$sql = $v['db']['sql']; |
|
|
|
|
|
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 2: |
|
|
|
|
|
$keys=array_keys($res); |
|
|
|
|
|
$array[$res[$keys[0]]] = $res[$keys[1]]; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
$fields[$k]['el'] = $array; |
|
|
|
|
|
unset($array); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$f3->set('fields', |
|
|
$f3->set('fields', |