Example #1
0
 function compute_formula($p_handle)
 {
     while (!feof($p_handle)) {
         $buffer = trim(fgets($p_handle));
         // $a=(Impress::check_formula($buffer)  == true)?"$buffer ok<br>":'<font color="red">'.'Pas ok '.$buffer."</font><br>";
         // echo $a;
         // blank line are skipped
         if (strlen(trim($buffer)) == 0) {
             continue;
         }
         // skip comment
         if (strpos($buffer, '#') === true) {
             continue;
         }
         // buffer contains a formula A$=....
         // We need to eval it
         $a = Impress::parse_formula($this->db, "{$buffer}", $buffer, $this->from, $this->to, false);
         $b = str_replace("\$", "\$this->", $a);
         if (eval("{$b};") === false) {
             echo_debug(__FILE__, __LINE__, "Code failed with {$b}");
         }
     }
     // end read form line per line
 }
Example #2
0
 function date_to_x($date)
 {
     echo_debug("Converting {$date}<br>");
     return $this->date_stamp_to_x(format_date("U", $date));
 }
    error('Magic found');
}
if ($index < 1) {
    $index = 1;
    dwrite('Index out of bound (less than 1)', S_ERROR);
}
if ($index > 9) {
    $index = 9;
    dwrite('Index out of bound (more than 9)', S_ERROR);
}
for ($i = 1; $i <= 9; $i++) {
    if ($i == $index) {
        echo "[{$i}]";
    } else {
        if (inGET('gimmedebug')) {
            echo '&nbsp;<a href="?index=' . $i . '&amp;gimmedebug=1">' . $i . '</a>&nbsp;';
        } else {
            echo '&nbsp;<a href="?index=' . $i . '">' . $i . '</a>&nbsp;';
        }
    }
}
?>
	:.</strong>
<?php 
dwrite('[End]');
if (DEBUG) {
    echo_debug();
}
?>
</body>
</html>