Hi!
I've got the following code.
include(dirname(__FILE__)."/../Editor-PHP-1.9.2/lib/DataTables.php");
// Alias Editor classes so they are easy to use
use DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Validate,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\ValidateOptions;
$my_id=$_POST['my_id'];
$timepoolid=$_POST['timepool_id'];
//$yourQueryArray = join(',',$timepoolid);
// Build our Editor instance and process the data coming from _POST
$editor = Editor::inst($db, 'crapper_vulnerability', 'crapper_vulnerability.id')
// ->order('ip')
->fields(
Field::inst('crapper_vulnerability.outputtool'),
Field::inst('crapper_vulnerability.testtypeid'),
Field::inst( 'crapper_vulnerability.toolid' ),
Field::inst( 'crapper_vulnerability.scanid' ),
Field::inst( 'crapper_vulnerability.fp' )
->setFormatter( function ( $val, $data, $opts ) {
return ! $val ? 0 : 1;
} ),
Field::inst( 'crapper_vulnerability.cvss_temp' ),
Field::inst( 'crapper_vulnerability.cvss_env' ),
Field::inst( 'crapper_vulnerability.cvss_base_new' ),
Field::inst( 'crapper_vulnerability.not_in_report' )
->setFormatter( function ( $val, $data, $opts ) {
return ! $val ? 0 : 1;
} ),
Field::inst( 'crapper_vulnerability.ip' ),
Field::inst( 'crapper_vulnerability.mac' ),
Field::inst( 'crapper_vulnerability.netbiosname' ),
Field::inst( 'crapper_vulnerability.os' ),
Field::inst( 'crapper_vulnerability.start' ),
Field::inst( 'crapper_vulnerability.stop' ),
Field::inst( 'crapper_vulnerability.plugin_id' ),
Field::inst( 'crapper_vulnerability.plugin_name' ),
Field::inst( 'crapper_vulnerability.port' ),
Field::inst( 'crapper_vulnerability.protocol' ),
Field::inst( 'crapper_vulnerability.cve' ),
Field::inst( 'crapper_vulnerability.cvss_base_score' ),
Field::inst( 'crapper_vulnerability.service_name' ),
Field::inst( 'crapper_vulnerability.description' ),
Field::inst( 'crapper_vulnerability.solution' ),
Field::inst( 'crapper_vulnerability.kundenr' ),
Field::inst( 'crapper_vulnerability.rapport' ),
Field::inst( 'crapper_vulnerability.filename' ),
Field::inst( 'crapper_vulnerability.tp_key' ),
Field::inst( 'crapper_vulnerability.plugin_output' ),
Field::inst( 'crapper_vulnerability.timepool' ),
Field::inst( 'crapper_vulnerability.id' )
)
->where('crapper_vulnerability.kundenr', $my_id)
->where( function ( $q ) use ( $timepoolid) {
$q->where( 'crapper_vulnerability.timepool', '(SELECT crapper_vulnerability.timepool FROM crapper_vulnerability WHERE crapper_vulnerability.timepool LIKE :timepool)', 'IN', false);
$q->bind( ':timepool', '%'.$_POST['timepool_id'].'%' );}
)
->process($_POST)
->debug(true)
->json();
I'm trying to use an array $timepool in a where condition, but I'm getting the following error:
Notice: Array to string conversion
How do I resolve this?
Kind regards,
Svendber