added functionality which is checking cas code and analysiscode before checking names.
This commit is contained in:
parent
c2464eedcf
commit
171aa4e816
@ -52,6 +52,14 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
$result_testNameHeaderFile = $item['headerfile'];
|
$result_testNameHeaderFile = $item['headerfile'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($item['column_name'] == 'analysisgroupcode') {
|
||||||
|
$result_AnalytsGroupCodeHeaderFile = $item['headerfile'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($item['column_name'] == 'cas') {
|
||||||
|
$result_CASHeaderFile = $item['headerfile'];
|
||||||
|
}
|
||||||
|
|
||||||
if($item['column_name'] == 'result_AnalytsName') {
|
if($item['column_name'] == 'result_AnalytsName') {
|
||||||
$result_AnalytsNameHeaderFile = $item['headerfile'];
|
$result_AnalytsNameHeaderFile = $item['headerfile'];
|
||||||
}
|
}
|
||||||
@ -66,9 +74,34 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($verify_flag) {
|
$arr_analysis_code = array();
|
||||||
//check result_TestName field
|
|
||||||
$arr_anaysisvoc_words = array();
|
$arr_anaysisvoc_words = array();
|
||||||
|
if($verify_flag) {
|
||||||
|
// check analysis code
|
||||||
|
if($result_AnalytsGroupCodeHeaderFile != ""){
|
||||||
|
$arr_diff_analysis_code = array();
|
||||||
|
$idx_resultAnalytsGroupCode_po = array_search($result_AnalytsGroupCodeHeaderFile, $arr_excel_columns);
|
||||||
|
for($i=1; $i<count($arr_info); $i++) {
|
||||||
|
if(!in_array($arr_info[$i][$idx_resultAnalytsGroupCode_po], $arr_diff_analysis_code)) {
|
||||||
|
array_push($arr_diff_analysis_code, $arr_info[$i][$idx_resultAnalytsGroupCode_po]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($arr_diff_analysis_code as $item) {
|
||||||
|
$arr_analysis_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
|
$trim_item = str_replace("\n", "", str_replace("'", "\'", $item));
|
||||||
|
$arr_analysis_refdata->setQuery("SELECT * FROM analysisvocabulary where analysiscode like '%$trim_item%'");
|
||||||
|
$arr_analysis_refdata->execute();
|
||||||
|
$arr_analysis_ref = $arr_analysis_refdata->Results;
|
||||||
|
if(count($arr_analysis_ref) == 0) {
|
||||||
|
array_push($arr_analysis_code, $item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if array $arr_analysis_code is empty
|
||||||
|
if(count($arr_analysis_code) == 0 && $result_testNameHeaderFile != "") {
|
||||||
|
//check result_TestName field
|
||||||
if($result_testNameHeaderFile != "") {
|
if($result_testNameHeaderFile != "") {
|
||||||
$arr_diff_anaysisvoc_words = array();
|
$arr_diff_anaysisvoc_words = array();
|
||||||
$idx_resultTestName_po = array_search($result_testNameHeaderFile, $arr_excel_columns);
|
$idx_resultTestName_po = array_search($result_testNameHeaderFile, $arr_excel_columns);
|
||||||
@ -82,13 +115,13 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
foreach($arr_diff_anaysisvoc_words as $item) {
|
foreach($arr_diff_anaysisvoc_words as $item) {
|
||||||
$arr_analysis_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
$arr_analysis_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
$trim_item = str_replace("\n", "", str_replace("'", "\'", $item));
|
$trim_item = str_replace("\n", "", str_replace("'", "\'", $item));
|
||||||
$arr_analysis_refdata->setQuery("SELECT * FROM analysisvocabulary where nameanalysisvoc like '$trim_item'");
|
$arr_analysis_refdata->setQuery("SELECT * FROM analysisvocabulary where nameanalysisvoc like '%$trim_item%'");
|
||||||
$arr_analysis_refdata->execute();
|
$arr_analysis_refdata->execute();
|
||||||
$arr_analysis_ref = $arr_analysis_refdata->Results;
|
$arr_analysis_ref = $arr_analysis_refdata->Results;
|
||||||
if(count($arr_analysis_ref) == 0) {
|
if(count($arr_analysis_ref) == 0) {
|
||||||
//check kind
|
//check kind
|
||||||
$arr_analysiskind_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
$arr_analysiskind_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
$arr_analysiskind_refdata->setQuery("SELECT * FROM analysisvocabulary where preferred like 'Y'");
|
$arr_analysiskind_refdata->setQuery("SELECT * FROM analysisvocabulary where preferred like '%Y%'");
|
||||||
$arr_analysiskind_refdata->execute();
|
$arr_analysiskind_refdata->execute();
|
||||||
$arr_analysiskind_ref = $arr_analysiskind_refdata->Results;
|
$arr_analysiskind_ref = $arr_analysiskind_refdata->Results;
|
||||||
array_push($arr_anaysisvoc_words, array(
|
array_push($arr_anaysisvoc_words, array(
|
||||||
@ -98,7 +131,35 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// check cas code
|
||||||
|
$arr_cas_code = array();
|
||||||
|
if($result_CASHeaderFile != ""){
|
||||||
|
$arr_diff_cas_code = array();
|
||||||
|
$idx_resultCAS_po = array_search($result_CASHeaderFile, $arr_excel_columns);
|
||||||
|
for($i=1; $i<count($arr_info); $i++) {
|
||||||
|
if(!in_array($arr_info[$i][$idx_resultCAS_po], $arr_diff_cas_code)) {
|
||||||
|
array_push($arr_diff_cas_code, $arr_info[$i][$idx_resultCAS_po]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($arr_diff_cas_code as $item) {
|
||||||
|
$arr_cas_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
|
$trim_item = str_replace("\n", "", str_replace("'", "\'", $item));
|
||||||
|
$arr_cas_refdata->setQuery("SELECT * FROM compundsvocabulary where cascompoundvocabulary like '%$trim_item%'");
|
||||||
|
$arr_cas_refdata->execute();
|
||||||
|
$arr_cas_ref = $arr_cas_refdata->Results;
|
||||||
|
if(count($arr_cas_ref) == 0) {
|
||||||
|
array_push($arr_cas_code, $item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if array $arr_cas_code is empty
|
||||||
|
if(count($arr_cas_code) == 0 && $result_AnalytsNameHeaderFile != "") {
|
||||||
//check result_AnalytsName field
|
//check result_AnalytsName field
|
||||||
$arr_compundsvoc_words = array();
|
$arr_compundsvoc_words = array();
|
||||||
if($result_AnalytsNameHeaderFile != "") {
|
if($result_AnalytsNameHeaderFile != "") {
|
||||||
@ -121,13 +182,13 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
$arr_compunds_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
$arr_compunds_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
$compund_word = $item['word'];
|
$compund_word = $item['word'];
|
||||||
$trim_item = str_replace("\n", "", str_replace("'", "\'", $compund_word));
|
$trim_item = str_replace("\n", "", str_replace("'", "\'", $compund_word));
|
||||||
$arr_compunds_refdata->setQuery("SELECT * FROM compundsvocabulary where namecompoundsvocabulary like '$trim_item' or cascompoundvocabulary like '$trim_item'");
|
$arr_compunds_refdata->setQuery("SELECT * FROM compundsvocabulary where namecompoundsvocabulary like '%$trim_item%' or cascompoundvocabulary like '%$trim_item%'");
|
||||||
$arr_compunds_refdata->execute();
|
$arr_compunds_refdata->execute();
|
||||||
$arr_compunds_ref = $arr_compunds_refdata->Results;
|
$arr_compunds_ref = $arr_compunds_refdata->Results;
|
||||||
if(count($arr_compunds_ref) == 0) {
|
if(count($arr_compunds_ref) == 0) {
|
||||||
//check kind
|
//check kind
|
||||||
$arr_compundskind_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
$arr_compundskind_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
$arr_compundskind_refdata->setQuery("SELECT * FROM compundsvocabulary where preferred like 'Y'");
|
$arr_compundskind_refdata->setQuery("SELECT * FROM compundsvocabulary where preferred like '%Y%'");
|
||||||
$arr_compundskind_refdata->execute();
|
$arr_compundskind_refdata->execute();
|
||||||
$arr_compundskind_ref = $arr_compundskind_refdata->Results;
|
$arr_compundskind_ref = $arr_compundskind_refdata->Results;
|
||||||
array_push($arr_compundsvoc_words, array(
|
array_push($arr_compundsvoc_words, array(
|
||||||
@ -138,6 +199,9 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
die(json_encode(array(
|
die(json_encode(array(
|
||||||
'code' => "success",
|
'code' => "success",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user