24); $_result['visibility'] = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } require('../main/base.events.php'); $_morecolumns = ""; if( !isset($_id) and $id != '' ) $_id = rand(1, 100000000); $logline = sessionget('form_logline_logline' . $_id); //logToFile('logline: ' . print_r($logline, true)); if( empty($_x) or in('onopen', $_x) ) { if( $id != "" and $id != "0" ) { $logline = loadObject($Link, "install.logline", $id); } else { $logline = newObject($Link, "install.logline"); //fillobjectfromrequest($logline); } } if( isormObject($logline) ) updateObjectFromRequest($Link, $logline); //makeglobals($logline, array('id', 'logline')); if( isset($_x) ) $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); //$_initialvars['logline'] = objectToStructure($logline); if( isormObject($logline) ) $_initialvars = array_merge($_initialvars, objectToStructure($logline)); if( isormObject($logline) ) $logline->makeglobals(); //logToFile('logline after uofr: ' . print_r($logline, true)); // isbasewindow: // PHP Vars while( ($__action == "" or $__action == "executedonopen") and isset($_GET['_x']) and empty($_x) ) { $__row0 = array(); $__row0['__logline__1'] = ($id == "" ) ? 'listmode' : 'editmode' ; $__row0['__logline__2'] = $_id ; $__row0['__logline__3'] = $id == '0' ? 'Nuevo ' : '' ; $__row0['__logline__4'] = $id > 0 ? ('#' . $id) : '' ; $__row0['__logline__5'] = buildUrlQueryFromGet(array('id' => '0', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__logline__6'] = buildUrlQueryFromGet(array('id' => '_delete_', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__logline__7'] = buildUrlQueryFromGet(array('id' => '_delete_', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__moment__1'] = $logline->moment ; $__row0['__elapsed__1'] = $logline->elapsed ; $__row0['__user__1'] = $logline->user ; $__row0['__ip__1'] = $logline->ip ; $__row0['__project__1'] = $logline->project ; $__row0['__db__1'] = $logline->db ; $__row0['__module__1'] = $logline->module ; $__row0['__window__1'] = $logline->window ; $__row0['__details__1'] = encodehtml($logline->details) ; $_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 = "Log"; $_pdf->SetTopMargin(50); $_pdf->AliasNbPages(); $_pdf->AddPage(); } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->title = "Log"; //$_pdf->drawText("Log",'Arial','',14); } if( has($_x, 'logline_list') ) { if( $_reorder != '' ) { $_changes = split('/', $_reorder); foreach($_changes as $_change) { $_change0 = split('-', $_change); $_id = $_change0[0]; $_position = $_change0[1]; $_table = 'appflexa.inlog'; sqlexec($Link, "update $_table set position = $_position where id = $_id"); } } //logToFile('[logline_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('install.logline', 'procesos') ) $_morecolumns = ", status"; if( isset($my) and $my == 'mine' ) { if( isset($status) ) $_order = " and (select count(*) from emresp where form = 'install.logline' and objeto = appflexa.inlog.id and usuario = '$s_idusuario' and estado = '$status') > 0 " . $_order; else $_order = " and (select count(*) from emresp where form = 'install.logline' and objeto = appflexa.inlog.id and usuario = '$s_idusuario') > 0 " . $_order; } if( isset($status) ) $_result['data'] = sqltotablearray($Link, "select SQL_CALC_FOUND_ROWS appflexa.inlog.id, appflexa.inlog.moment, appflexa.inlog.user, appflexa.inlog.project, appflexa.inlog.module, appflexa.inlog.window, appflexa.inlog.details $_morecolumns from appflexa.inlog where ($_additionalfilter) and (appflexa.inlog.status = '" . mysql_escape($status) . "') and (appflexa.inlog.logtype like '%" . mysql_escape($logtype_filter) . "%' and appflexa.inlog.user like '%" . mysql_escape($user_filter) . "%' and appflexa.inlog.project like '%" . mysql_escape($project_filter) . "%' and appflexa.inlog.module like '%" . mysql_escape($module_filter) . "%' and appflexa.inlog.window like '%" . mysql_escape($window_filter) . "%') $_order limit $start, $length"); else $_result['data'] = sqltotablearray($Link, "select SQL_CALC_FOUND_ROWS appflexa.inlog.id, appflexa.inlog.moment, appflexa.inlog.user, appflexa.inlog.project, appflexa.inlog.module, appflexa.inlog.window, appflexa.inlog.details $_morecolumns from appflexa.inlog where ($_additionalfilter) and (appflexa.inlog.logtype like '%" . mysql_escape($logtype_filter) . "%' and appflexa.inlog.user like '%" . mysql_escape($user_filter) . "%' and appflexa.inlog.project like '%" . mysql_escape($project_filter) . "%' and appflexa.inlog.module like '%" . mysql_escape($module_filter) . "%' and appflexa.inlog.window like '%" . mysql_escape($window_filter) . "%') $_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, 'logline_init') ) { $_result['logline'] = $logline->toarray(false); break; } while( has($_x, 'logline') ) { $logline->saveChanges(); //if( $errors == "" ) // validatelogline(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($logline)); saveObject($Link, $logline); if( hasfeature('install.logline', 'procesos') ) { require_once('../include/easyflexa.php'); if( $id == 0 ) setresponsables($logline); controlstatus($logline); } $id = $logline->id; //logToFile(objectToText($logline)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_logline_logline' . $_id, $logline); if( $_result['redirect'] == '' ) redirect("?id=$id"); } break; } while( has($_x, 'logline__delete') ) { //if( $errors == "" ) // validatelogline(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($logline)); deleteObject($Link, $logline); //logToFile(objectToText($logline)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_logline_logline' . $_id, null); if( $_result['redirect'] == '' ) { $_result['redirect'] = "?message=Log eliminado"; } } break; } while( has($_x, 'logline_unload') ) { // Not used sessionclear('form_logline_logline' . $_id); break; } if( has($_x, 'logtype_select') ) { /** * Warning,Slow,Error,SQL,Notice,Log,ORM */ $_result['logtype_select'] = [["Warning","Warning"],["Slow","Slow"],["Error","Error"],["SQL","SQL"],["Notice","Notice"],["Log","Log"],["ORM","ORM"]]; } sessionset('form_logline_logline' . $_id, $logline); //$logline -> ['changes'] if( isormObject($logline) ) $logline->makeglobals(); if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->Output(); } ?> '); //echo(''); echo(''); ?> Log class="popup" >
data-toplural="yes" data-editable="title">Log