35); $_result['visibility'] = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } require('../include/base.events.php'); $_morecolumns = ""; if( !isset($_id) and $id != '' ) $_id = rand(1, 100000000); $robot = sessionget('form_index_robot' . $_id); //logToFile('robot: ' . print_r($robot, true)); if( empty($_x) or in('onopen', $_x) ) { if( $id != "" and $id != "0" ) { $robot = loadObject($Link, "robots.robot", $id); } else { $robot = newObject($Link, "robots.robot"); //fillobjectfromrequest($robot); } } if( isormObject($robot) ) updateObjectFromRequest($Link, $robot); //makeglobals($robot, array('id', 'robot')); if( isset($_x) ) $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); //$_initialvars['robot'] = objectToStructure($robot); if( isormObject($robot) ) $_initialvars = array_merge($_initialvars, objectToStructure($robot)); if( isormObject($robot) ) $robot->makeglobals(); //logToFile('robot after uofr: ' . print_r($robot, true)); // isbasewindow: // PHP Vars while( ($__action == "" or $__action == "executedonopen") and isset($_GET['_x']) and empty($_x) ) { $__row0 = array(); $__row0['__robot__1'] = ($id != "" and $id != "0" ) ? 'form-readonly readonly' : '' ; $__row0['__robot__2'] = ($id == "" ) ? 'listmode' : 'editmode' ; $__row0['__robot__3'] = $_id ; $__row0['__robot__4'] = $id == '0' ? 'Nuevo ' : '' ; $__row0['__robot__5'] = $id > 0 ? ('#' . $id) : '' ; $__row0['__robot__6'] = buildUrlQueryFromGet(array('id' => '0', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__robot__7'] = buildUrlQueryFromGet(array('id' => '_delete_', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__robot__8'] = $s_access['modificacion'] ; $__row0['__robot__9'] = buildUrlQueryFromGet(array('id' => '_delete_', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__nombre__1'] = $robot->nombre ; $__row0['__urls__1'] = encodehtml($robot->urls) ; $__row0['__parametros__1'] = encodehtml($robot->parametros) ; $__row0['__linkcontenido__1'] = $robot->linkcontenido ; $__row0['__linksiguientepagina__1'] = $robot->linksiguientepagina ; $__row0['__datos__1'] = encodehtml($robot->datos) ; $__row0['__tabla__1'] = $robot->tabla ; $__row0['__unnamed3__1'] = (1 == 0) ? 'display: inline !important;' : 'display: none !important;' ; $__row0['__sqlantes__1'] = encodehtml($robot->sqlantes) ; $__row0['__sqldespues__1'] = encodehtml($robot->sqldespues) ; $__row0['__ultimaejecucion__1'] = $robot->ultimaejecucion ; $__row0['__ultimaejecucion__2'] = $robot->ultimaejecucion ; $__row0['__ultimoresultado__1'] = encodehtml($robot->ultimoresultado) ; $_result['morevars'] = $__row0; break; } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { require_once('../include/fpdfreport.php'); $_pdf = new PDF((isset($_orientation) ? $_orientation : 'P'),'pt', (isset($_size) ? $_size : 'A4' )); $_pdf->initialPage = ($_page != '' ? $_page : 1); //$_pdf->SetAutoPageBreak(true); $_pdf->title = "Extractores"; $_pdf->SetTopMargin(50); $_pdf->AliasNbPages(); $_pdf->AddPage(); } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->title = "Robot"; //$_pdf->drawText("Robot",'Arial','',14); } if( has($_x, 'robot_list') ) { if( $_reorder != '' ) { $_changes = split('/', $_reorder); foreach($_changes as $_change) { $_change0 = split('-', $_change); $_id = $_change0[0]; $_position = $_change0[1]; $_table = 'rbextractors'; sqlexec($Link, "update $_table set position = $_position where id = $_id"); } } //logToFile('[robot_list] ' . print_r($_REQUEST, true) ); $q = $search['value']; $_order = "order by " . ($order[0]['column'] + 1) . " " . $order[0]['dir']; if( $order[0]['column'] == '' ) $_order = $orderby ; if( $start == '' ) $start = 0; if( $length == '' ) $length = 50; else if( $length == '-1' ) $length = 10000; $_additionalfilter = substr(getaccess(getSelfWindow(), 'buscar'), 14); if( trim($_additionalfilter) == '' ) $_additionalfilter = '1 = 1'; if( hasfeature('robots.robot', 'procesos') ) $_morecolumns = ", status"; if( isset($my) and $my == 'mine' ) { if( isset($status) ) $_order = " and (select count(*) from emresp where form = 'robots.robot' and objeto = rbextractors.id and usuario = '$s_idusuario' and estado = '$status') > 0 " . $_order; else $_order = " and (select count(*) from emresp where form = 'robots.robot' and objeto = rbextractors.id and usuario = '$s_idusuario') > 0 " . $_order; } if( isset($status) ) $_result['data'] = sqltotablearray($Link, "select SQL_CALC_FOUND_ROWS rbextractors.id, rbextractors.nombre, rbextractors.hora, rbextractors.ultimaejecucion, rbextractors.ultimoresultado $_morecolumns from rbextractors where ($_additionalfilter) and (rbextractors.status = '" . mysql_escape($status) . "') $_order limit $start, $length"); else $_result['data'] = sqltotablearray($Link, "select SQL_CALC_FOUND_ROWS rbextractors.id, rbextractors.nombre, rbextractors.hora, rbextractors.ultimaejecucion, rbextractors.ultimoresultado $_morecolumns from rbextractors where ($_additionalfilter) $_order limit $start, $length"); $_result['draw'] = 0; $_result['recordsTotal'] = sqlget($Link, "select found_rows()"); $_result['recordsFiltered'] = $_result['recordsTotal']; //sizeof($_result['data']); //$_result['recordsFiltered'] = 50; print(json_encode($_result)); disconnectDb($Link); exit(0); } // aca iba session get, uofr y load/saveobject while( has($_x, 'robot_init') ) { $_result['robot'] = $robot->toarray(false); break; } while( has($_x, 'robot') ) { $robot->saveChanges(); //if( $errors == "" ) // validaterobot(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($robot)); saveObject($Link, $robot); if( hasfeature('robots.robot', 'procesos') ) { require_once('../include/easyflexa.php'); if( $id == 0 ) setresponsables($robot); controlstatus($robot); } $id = $robot->id; //logToFile(objectToText($robot)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_index_robot' . $_id, $robot); if( $_result['redirect'] == '' ) redirect("?id=$id"); } break; } while( has($_x, 'robot__delete') ) { //if( $errors == "" ) // validaterobot(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($robot)); deleteObject($Link, $robot); //logToFile(objectToText($robot)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_index_robot' . $_id, null); if( $_result['redirect'] == '' ) { $_result['redirect'] = "?message=Robot eliminado"; } } break; } while( has($_x, 'robot_unload') ) { // Not used sessionclear('form_index_robot' . $_id); break; } if( has($_x, 'config') ) { } if( has($_x, 'metodo_select') ) { /** * GET,POST */ $_result['metodo_select'] = [["GET","GET"],["POST","POST"]]; } if( has($_x, 'extraccion') ) { } if( has($_x, 'textos') ) { } if( $textos__row != '' ) { $robot->textos->_selected = $textos__row; } if( has($_x, 'basededatos') ) { } if( has($_x, 'camposfijos') ) { } if( $camposfijos__row != '' ) { $robot->camposfijos->_selected = $camposfijos__row; } if( has($_x, 'sqlsaejecutar') ) { } if( has($_x, 'programacion') ) { } if( has($_x, 'hora_select') ) { /** * 00:00,01:00,02:00,03:00,04:00,05:00,06:00,07:00,08:00,09:00,10:00,11:00,12:00,13:00,14:00,15:00,16:00,17:00,18:00,19:00,20:00,21:00,22:00,23:00 */ $_result['hora_select'] = [["00:00","00:00"],["01:00","01:00"],["02:00","02:00"],["03:00","03:00"],["04:00","04:00"],["05:00","05:00"],["06:00","06:00"],["07:00","07:00"],["08:00","08:00"],["09:00","09:00"],["10:00","10:00"],["11:00","11:00"],["12:00","12:00"],["13:00","13:00"],["14:00","14:00"],["15:00","15:00"],["16:00","16:00"],["17:00","17:00"],["18:00","18:00"],["19:00","19:00"],["20:00","20:00"],["21:00","21:00"],["22:00","22:00"],["23:00","23:00"]]; } sessionset('form_index_robot' . $_id, $robot); //$robot -> ['changes'] if( isormObject($robot) ) $robot->makeglobals(); if( isset($_GET['_x']) and empty($_x) ) { $_result['visibility']['unnamed3'] = (1 == 0); } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->Output(); } ?> '); //echo(''); echo(''); ?> Extractores class="popup" >
data-toplural="yes" data-editable="title">Robot