コード例 #1
0
function is4cTestAndDie($dbConn2)
{
    global $dieMail;
    $selectIs4c = "SELECT CardNo, LastName from custdata LIMIT 5;";
    $customers = $dbConn2->query("{$selectIs4c}");
    if ($dbConn2->errno) {
        $message = sprintf("Select failed: %s\n", $dbConn->error);
        dieHere($message, $dieMail);
    }
    if (!$customers) {
        $msg = sprintf("Failed on: %s", $selectIs4c);
        dieHere("{$msg}", 0);
    }
    echo "IS4C Numbered\n";
    while ($row = $dbConn2->fetch_row($customers)) {
        $flds = getNameKeys($row);
        $lineOut = implode("\t", $flds) . "\n";
        echo $lineOut;
        $vals = getNameValues($row);
        $lineOut = implode("\t", $vals) . "\n";
        echo $lineOut;
        $lineOut = implode("\t", array($row[CardNo], $row[LastName])) . "\n";
        echo $lineOut;
    }
    dieHere("IS4C OK, bailing ...", 0);
    // is4cTestAndDie();
}
コード例 #2
0
            } else {
                // Compose the update statement.
                $updateMemberCards = "UPDATE memberCards SET\nupc = '{$memberCards['upc']}'\nWHERE card_no = {$memberCards['card_no']}\n;";
            }
            // memberCards, if anything to record.
        }
        /* stockpurchases
         */
        // Local monitor
        if ($uniqueCid % 10 == 0) {
            //echo "Done: $uniqueCid members.\n";
            1;
        }
        // Each unique Cid (member)
    }
    $vals = getNameValues($row);
    $lineOut = implode("\t", $vals) . "\n";
    $writeOK = fwrite($outer, $lineOut);
    if (!$writeOK) {
        //$dbConn->close();
        dieHere("Could not write to {$outFile}\n");
    }
    $outCount++;
    // each Civi $row
}
// Do the last Civi row.
if ($writeIS4C) {
    //echo "To DML is4cOp >${is4cOp}< CardNo >$custdata[CardNo]<\n";
    // Is the op for the just-finished member to be insert or update?
    if (True || $is4cOp1 == "insert") {
        // Insert the records for this Individual, Household or Organization.