/**
 * @name 导入参会人名单
 */
function importParticipants_cb($job)
{
    global $log;
    $log->log(PHP_EOL . '-----------------------------');
    $arg = $job->workload();
    $invest_info = json_decode($arg, true);
    $log->log('接收参数');
    if (!is_array($invest_info)) {
        $log->log("importParticipants 数据错误 " . json_encode($arg));
        return false;
    }
    $log->log($invest_info);
    $log->log('处理开始');
    $data = getExcelData($invest_info['fileDir']);
    if (is_array($data) && count($data) > 0) {
        $log->log('处理成功');
        foreach ($data as $val) {
            $val['fromId'] = -1;
            $val['activeId'] = $invest_info['activeId'];
            $val['applyTime'] = time();
            Sp_Account_Attendee::add($val);
            //Da_Wrapper::insert()->table("sp.huitong.ht_apply_data")->data($val)->execute();
        }
        $log->log('插入成功');
    } else {
        $log->log('处理失败');
    }
    return TRUE;
}
Пример #2
0
    $str .= mysql_result($result, $i, "name_in_bank") . '","';
    //$str .= mysql_result($result,$i,"teamLead").",";
    //$str .= mysql_result($result,$i,"comments").",";
    //$str .= mysql_result($result,$i,"lastlogin").",";
    $str .= mysql_result($result, $i, "DOL") . '"';
    $aData[] = explode('+', $str);
    //$allSum += $salSum;
    //}
}
//feed the final array to our formatting function...
/*$contents = ",".",".","."Format for Salary / Reimbursement Up-load \n";
$contents .=",".",". ","."Company Name : The Web Plant Pvt. Ltd".",".",". " $searchedDate \n" ;
$contents .= "\n";;
//$contents .= "Student ID , Name , Score ID, Profession , Course Name , Exam ID , Processed Date ,Entry Date , Credits Earned , State , License  \n";
$contents .= "S No. , Employee Name (40 Character),Employee Account No. (14 characters) ,Debit /Credit(Dr./CR 2 Character) , Narration (as required by company 40 character), Amount (in Rs.14 character last 2 character for  decimals)  \n";//, Score ID, Processed Date*/
$contents .= getExcelData($aData);
/*$contents .="\n";
$contents .="\n";

$contents .=",".",".",".","."Total Amount of Debit \n" ;

$contents .=",".",".",".","."Total Number of Credit Entries".","."$sno \n";

$contents .=",".",".",".","."Total Amount of Credit ".","."$allSum".".00"." \n";

$contents .="\n";

$contents .=",".",".",".","."Authorised Representative(s)"." ";*/
//output the contents
echo $contents;
exit;
}
if (!($result_floating = $link->query($results_floating_Stmt))) {
    DisplayErrMsg(sprintf("Error in executing %s stmt", $results_floating_Stmt));
    DisplayErrMsg(sprintf("error: %s", $link->error));
    exit;
}
if (!($result_selector = $link->query($selector_Stmt))) {
    DisplayErrMsg(sprintf("Error in executing %s stmt", $selector_Stmt));
    DisplayErrMsg(sprintf("error: %s", $link->error));
    exit;
}
while ($row = mysqli_fetch_array($result_floating, MYSQLI_ASSOC)) {
    $output[] = $row;
}
$result_floating->close();
$contents = getExcelData($output);
//echo $contents;
//exit;
$filename = sprintf("IQC-floating_data-%s.xls", $omschrijving);
//prepare to give the user a Save/Open dialog...
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=" . $filename);
//setting the cache expiration to 30 seconds ahead of current time. an IE 8 issue when opening the data directly in the browser without first saving it to a file
$expiredate = time() + 30;
$expireheader = "Expires: " . gmdate("D, d M Y G:i:s", $expiredate) . " GMT";
header($expireheader);
//output the contents
echo $contents;
//echo $retval;
exit;
?>