SELECT LIVE INPUT
In the table View page add a column for your input. For example NOTES, in this case 300 is a with of 300px
array_push($td_titles, "300-CATEGORY");
Then we need to create an array with the following values, some of them are optional.
"type" is required, this tells that we are going to a live input
"col" is also required to specify the database column name where the content will be fetched from and saved into
"inputType" is also required and it is one of he list above, in this case "text"
"options" is also required and contains an array of all the options and values of the select field
We can create the options manually or dynamically from the database:
Manual Select Options:
$sel_options = [ 'Cat 1'=>'val1', 'Cat 2'=>'val2', 'Cat 3'=>'val3', ];
$tdvalue = [ 'type'=>'live', 'inputType' => 'select', 'col'=>'notes', 'options'=>$sel_options 'privilege'=> 4, //optional, 4 will show the field only to High and Admin privileges, default is 1 'class'=>'', //optional, class name selector default: none (empty) 'attributes'=>'' //optional, can be any attribute(s) with value(s) default: none (empty) ];
Select Options fetched from the database:
$optionsdb = [ 'table' => 'TABLE NAME', //required 'op_name' => 'COL_NAME', //required 'op_val' => 'COL_NAME', //required 'where' => 'WHERE STATEMENT', //optional 'order' => 'ORDER STATEMENT' //optional ]
$tdvalue = [ 'type'=>'live', 'inputType' => 'select', 'col'=>'notes', 'optionsdb' => $optionsdb 'privilege'=> 4, //optional, 4 will show the field only to High and Admin privileges, default is 1 'class'=>'', //optional, class name selector default: none (empty) 'attributes'=>'' //optional, can be any attribute(s) with value(s) default: none (empty) ];
Finally the array is added to the $td_fields array.
array_push($td_fields,$tdvalue);