首頁 > 後端開發 > php教程 > 後台隔5分鐘發送email,email內容為html

後台隔5分鐘發送email,email內容為html

WBOY
發布: 2016-07-25 08:50:14
原創
1182 人瀏覽過
";
$temp = $Modelhandle;
}



//取消名稱重要性結果
//var_dump(Integer.parseInt('c'));
//取得成功數
$sql="SELECT TK.id,TK.send_email, TK .user_id,TK.case_ids,TK.testplan_id,TK.flag,TK.total,TK.user_id 來自任務AS TK WHERE current=total and flag='2'";

$controlrInfo = $db - >get_recordset($sql);

//設定通過/失敗訊息
//var_dump($case['status']);
$pass = 'p';
$ finish ='c';

if(($case['status'])== $finish)//$TotalCaseNum
{
//設定案例資訊
$Modelhandle = $溫度。 "
{$case['name']}
{$case['重要性']}
完成

";
}
else if($case['status'] == $pass)//$TotalCaseNum
{
$successNum ; //設定個案資訊
$Modelhandle = $temp. "




";
}
else
{
$
$ Modelhandle = $temp."
{$case['名稱']}
{$case['重要性']}
失敗

";
}

$temp = $Modelhandle;
$BeforSuiteNam = $case['tsuite_name']; }

//設定成功數
//var_dump($TotalCaseNum);
//$TotalCaseNum
$temp = str_replace("MODEL_SUCCESS","{$successNum}/{$successNum}/{$successNum}/{$successNum} TotalCaseNum} ",$Modelhandle);
$Modelhandle = $temp;

$temp = str_replace("MODEL_FAIL",($TotalCaseNum-$successNum)."/".$ModetalCaseNum,11] ;
$Modelhandle = $temp;

//新增html 結束符號
$Modelhandle = $temp "
1.5分鐘發送郵件,且郵件內容為由html範本產生的表格
while(1)
{
//十分鐘
var_dump("檢查任務,請勿關閉");

//發送電子郵件
processDBData($db);

//處理庫存狀態
processInventoryState($db,$tasks);

sleep( 55 *60);
}

//從資料庫讀取表格資料
function processDBData($db) {
$testplan_id = '';
$temp = = '';
$TotalCaseNum = 0;
$projectName = '';

//檢查完成的測試計畫表->tasks
$sql="SELECT TK.id,TK .send_email ,TK.user_id,TK.build_id,TK.case_ids,TK.testplan_id,TK.flag,TK.total
來自任務AS TK WHERE current=total and flag='2' and ISNULL(send_email)";
$controlInfor = $db->get_recordset($sql);

if(null== $controlInfor)
{
return;
}


foreach($controlInfor as $key =>$item)
{
//開啟模型html
$fModel = fopen("report.model","r");
if( null = = $fModel)
{
var_dump("無模型");
}

$Modelhandle = fread($fModel,filesize("report.model"));

$test_cases = $item['case_ids'];

//取得總數
$TotalCaseNum = (int)$item['total'];

/ / testplan table->testplan
//$sql = "從測試計劃選擇notes,testproject_id WHERE id='{$item['testplan_id']}'";
$sql = "從nodes_hierarchy中選擇名稱WHERE id= '{$item['testplan_id']}'";
$result = $db->get_recordset($sql);
$temp = str_replace("MODEL_TESLPLANE",$result[0] ['name' ],$Modelhandle);
$Modelhandle = $temp;

//產品表->testprojects
$sql = "SELECT Notes FROM testprojects WHERE id='{$result [0][ 'testproject_id']}'";
var_dump($sql);
$result = $db->get_recordset($sql);

$temp = str_replace("MODEL_ProductN ",$result [0]['notes'],$Modelhandle);
$Modelhandle = $temp;

//build table->builds
$sql = "SELECT DB.name FROM builds AS DB WHERE testplan_id='{$item['testplan_id']}' and id='{$item['build_id']}'";
$result = $db->get_recordset($sql);
var_dump ($sql);
$temp = str_replace("MODEL_BUILD",$result[0]['name'],$Modelhandle);
$projectName = $result[0]['name '];
$Modelhandle = $temp;

//測試結果表->執行
$cases =explode(',',$test_cases);
$case_infor = get_ts_name_details( $db,$ case);

//var_dump(sizeof($case_infor));
//處理html測試案例內容
nl2br()
//新增內容後(table, body,html 結束標誌)
var_dump($case_infor);

$BeforSuiteNam = "";
$successNum = 0;
$TESTNUM = 00;
/ /var_dump($case_infor);
//var_dump($case_infor);
foreach($case_infor as $k=>$case)
{
$Modelhandle = $;

if($case['tsuite_name'] != $BeforSuiteNam)
{
$Modelhandle = $temp 。 "
{$case['tsuite_name']}
{$case['name']} {$case['重要性']} PASS

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板