예제 #1
0
include_once "../inc/UserLib.php";
//print_r($_POST);
if (isset($_GET['Q']) and $_GET['Q'] != '') {
    $Q = $_GET['Q'];
} else {
    if (isset($_POST['Q']) and $_POST['Q'] != '') {
        $Q = $_POST['Q'];
    } else {
        $Q = 'C';
    }
}
$Q_Array['Q'] = $Q;
$t = new Template($base);
//doHeader($t);
if (isset($_POST["felder"]) && $_POST["felder"] != '') {
    $rc = doReport($_POST, $Q);
    $t->set_file(array("fa1" => "companies1.tpl"));
    if ($rc) {
        $tmp = "<div style='width:300px'>[<a href='tmp/report_" . $_SESSION["login"] . ".csv'>download Report</a>]</div>";
    } else {
        $tmp = "Sorry, not found";
    }
    $t->set_var(array('report' => $tmp));
    leertpl($t, 1, $Q_Array, "", true, true);
} else {
    if ((isset($_POST["suche"]) and $_POST["suche"] != "") || isset($_POST["first"])) {
        if (isset($_POST["first"])) {
            $daten = getAllFirmen(array(1, $_POST["first"]), false, $Q);
        } else {
            $daten = suchFirma($_POST, $Q);
        }
$format = array_key_exists('mode', $_REQUEST) && $_REQUEST['mode'] == "js" ? "js" : "html";
if ($rps_ID == 0) {
    //regenerate all reports
    $res = mysql_query('select * from usrReportSchedule');
    while ($row = mysql_fetch_assoc($res)) {
        doReport($row);
    }
} else {
    //load one
    $res = mysql_query("select * from usrReportSchedule where rps_ID=" . $rps_ID);
    if (mysql_error()) {
        error_log("ERROR=" . mysql_error());
    } else {
        $row = mysql_fetch_assoc($res);
        if ($row) {
            doReport($row);
        }
    }
}
exit;
//
// generate report
//
function doReport($row)
{
    global $publish, $format;
    if ($row['rps_FilePath'] != null) {
        $dir = $row['rps_FilePath'];
        if (substr($dir, -1) != "/") {
            $dir = $dir . "/";
        }
예제 #3
0
function ProcessNote(&$notepitchTxt)
{
    global $PlayContext, $o, $OptName_Pos, $OptName_Dur, $isChanged, $regexList;
    static $accmap = array("v" => "bb", "b" => "b", "n" => "n", "#" => "#", "x" => "x");
    $notepitchObj = new NWC2NotePitchPos($notepitchTxt);
    $notename = $PlayContext->GetNotePitchName($notepitchObj);
    $noteacc = $accmap[$PlayContext->GetNotePitchAccidental($notepitchObj)];
    $noteoctave = $PlayContext->GetScientificPitchOctave($notepitchObj);
    $notemidipitch = $PlayContext->GetNoteMidiPitch($notepitchObj);
    $fullNotepitchTxt = $notepitchTxt;
    if (!strstr($notepitchTxt, '!')) {
        $fullNotepitchTxt .= '!0';
    }
    $durTxt = implode(',', array_keys($o->GetTaggedOptAsArray($OptName_Dur, array())));
    $notenameText = $notename . $noteacc . $noteoctave . "\tt:" . $fullNotepitchTxt . "\tk:" . $notemidipitch . "\td:{$durTxt},{$OptName_Pos}\to:" . $o->GetObjType();
    foreach ($regexList as $regex => $cmdlist) {
        if (preg_match($regex, $notenameText)) {
            doReport("MATCH: " . $notenameText . "\n");
            foreach ($cmdlist as $cmd) {
                ProcessCmd($cmd, $notepitchObj);
            }
            $notepitchTxt = $notepitchObj->ReconstructClipText();
            $isChanged = true;
            return true;
        }
    }
    doReport("NOMATCH: {$notenameText}\n");
    return false;
}