$response->ini = $data[0]['rf_dig_ini']; $response->fin = $data[0]['rf_dig_fin']; $response->inter = $data[0]['rf_interventor']; $response->persona = $data[0]['rf_persona_entrega']; } else { $res = false; $response->mes = $msg->get_msg("e034"); } } $response->res = $res; echo json_encode($response); $con->disconnect(); } //validamos si es una petición ajax if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; switch ($action) { case 'save': add_pack(); break; case 'change': change_pack(); break; case 'get_row': load_row(); break; case 'update': edit_row(); break; } }
$series[$s] = array(); /* Common attributes for each serie */ $series[$s]['words'] = $words; $series[$s]['objects'] = array(); $series[$s]['sort'] = $sort; $sql .= "select yearmonth(date) as yymm, {$sort}, date, count(*) as _count from {$indices} where match('\"{$words}\"') group by yymm within group order by {$sort} desc limit 1000;"; $s++; } $s = 0; if ($sp->multi_query($sql)) { do { /* For each query/serie */ if ($result = $sp->store_result()) { while ($row = $result->fetch_array()) { /* We load the data in objets appended to an array for each serie */ load_row($series[$s], $row); } } $s++; } while ($sp->next_result()); } $sp->close(); /* Sort data and complete with information needed for Flotchart and the tooltip */ $data = array(); foreach ($series as $s) { $started = false; $o = new stdClass(); $o->label = $s['words']; $o->sort = $s['sort']; $o->data = array(); $o->count = array();