ฟอร์มข้อมูล
Code
ผลลัพธ์
Code
<?php
require_once('public/generate-form-v2.php');
$form=new Form();
$field['f1']=[
'label'=>'List',
'type'=>'list_table',
'command'=>"SELECT `changwatcode`, `changwatname` FROM `cchangwat`",
'value'=>'90',
'next'=>'f2',
'next_command'=>"SELECT `ampurcode`, `ampurname`, `changwatcode` FROM `campur` WHERE changwatcode='{f1}'",
];
$field['f2']=[
'label'=>'List',
'type'=>'list_table',
'value'=>'09',
'next'=>'f3',
'next_command'=>"SELECT `tamboncode`, `tambonname` FROM `ctambon` WHERE changwatcode='{f1}' and ampurcode='{f2}';",
];
$field['f3']=[
'label'=>'List',
'type'=>'list_table',
'value'=>'09',
];
$form->addField($field);
$form->addObject(['type'=>'submit','value'=>'เพิ่มข้อมูล'],['type'=>'back']);
echo $form->create();