function clean_logstalgia($clean_number, $directory, $root_directory)
{
    global $conf;
    $filename = $directory . "logstalgia.txt";
    $file = new SplFileObject($filename);
    $line_0 = $file->current();
    $line_last = "";
    $i = 0;
    while ($file->valid() && $i < $conf['limit_logstalgia']) {
        $i++;
        if ($file->current() != "") {
            $line_last = $file->current();
        }
        $file->next();
    }
    if ($i = $conf['limit_logstalgia']) {
        $line_0_explode = explode('|', $line_0);
        $line_last_explode = explode('|', $line_last);
        exec("cp {$filename} {$root_directory}/backup/logstalgia-" . $line_0_explode[0] . "-" . $line_last_explode[0] . ".txt");
        exec("chown " . $conf['user_logstalgia'] . " {$root_directory}/backup/logstalgia-" . $line_0_explode[0] . "-" . $line_last_explode[0] . ".txt");
        $handle = fopen($filename, "w") or die("Can't create file");
        fclose($handle);
    }
}
clean_checker($clean_number);
clean_result($clean);
clean_all_result($clean_number);
if ($conf['active_logstalgia'] == 1) {
    date_movie($log_movie, $directory, $seuil, $time_min, $from_mail, $return_path, $to_mail, $go_to_summary, $img_header, $graph, $vocables, $lang, $conf);
    clean_logstalgia($clean_number, $directory, $root_directory);
}
 if ($report_config->useRemarks == 1) {
     echo "<td class='rstyle'>" . $test->getComments() . "</td>";
 }
 if ($report_config->useEnteredBy == 1) {
     echo "<td class='rstyle'>" . $test->getEnteredBy() . "</td>";
 }
 if ($report_config->useVerifiedBy == 1) {
     echo "<td>" . $test->getVerifiedBy() . " / " . $test->getVerifierPosition() . "</td>";
 }
 if ($report_config->useStatus == 1 && $all_tests_completed === false) {
     echo "<td class='rstyle'>" . $test->getStatus() . "</td>";
 }
 // Add visualization column
 if ($view_viz == 1) {
     echo "<td class='rstyle'>";
     $cleaned_result_array = clean_result($test, $report_config);
     $cleaned_range_array = clean_range($test, $report_config, $patient);
     for ($i = 0; $i < count($cleaned_result_array); $i++) {
         echo "<br>";
         $parsable_result = is_result_parsable($cleaned_result_array[$i]);
         if ($cleaned_result_array[$i] == "") {
             // pending test
             echo "Pending";
             echo "<br>";
         } else {
             if ($cleaned_range_array[$i] == "" || !$parsable_result) {
                 echo "Result cannot be visualized";
                 echo "<br>";
             } else {
                 // draw visualization
                 $visualized_results = draw_visualization($cleaned_result_array[$i], $cleaned_range_array[$i]);
Example #3
0
                                    $action[$loc]->meta['_attachments_pro'][$attachment_pro[1]][$attachment_pro[0]] = utf8_encode($meta_field->meta_value);
                                    unset($attachment_pro);
                                    // if the end of the meta_key is numeric, then its an attachments pro key.. this could bite me later..
                                    // step one filter the string to only show numeric
                                } else {
                                    $action[$loc]->meta[$meta_field->meta_key] = utf8_encode($meta_field->meta_value);
                                }
                            }
                            if ($tags) {
                                $action[$loc]->tags = clean_result($tags, 'tag');
                            }
                        }
                    }
                }
            } elseif ($action = get_results($query) && $directive[0] == 'categories') {
                $action = clean_result($action, 'slug');
            }
            if (isset($_GET['stats'])) {
                $action['stats'] = sprintf("%.4f", (double) array_sum(explode(' ', microtime())) - $start_time) * 1000 . "ms,  using " . round(memory_get_usage() / 1024) . " k  / and {$queries} queries ";
            }
            header('Content-type: application/json; charset=utf-8', true, 200);
            echo isset($_GET['embed']) ? 'var wp_api=' . json_encode($action) . ';' : json_encode($action);
        }
    }
}
function get_at_pro_index($string, $counter = 0)
{
    // this is finished when it returns an array with the 'index' and the 'fieldname' for the key value
    // give string .. could reduce this to a single tenery operator..
    if ($sub_string = substr($string, -1) && is_numeric($sub_string)) {
        // remove the value and use it to pass into itself