fx
This commit is contained in:
parent
41880102f5
commit
5dc6ab4875
@ -105,15 +105,17 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
$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['word']));
|
$trim_item = str_replace("\n", "", str_replace("'", "\'", $item['word']));
|
||||||
$groupcodeTrimmed = str_replace("\n", "", str_replace("'", "\'", $item['groupcode']));
|
$groupcodeTrimmed = str_replace("\n", "", str_replace("'", "\'", $item['groupcode']));
|
||||||
$arr_analysis_refdata->setQuery("SELECT * FROM analysisvocabulary where analysiscode like '%$groupcodeTrimmed%'");
|
$arr_analysis_refdata->setQuery("SELECT * FROM analysisvocabulary where analysiscode like '$groupcodeTrimmed'");
|
||||||
$arr_analysis_refdata->execute();
|
$arr_analysis_refdata->execute();
|
||||||
$arr_analysis_ref = $arr_analysis_refdata->Results;
|
$arr_analysis_ref = $arr_analysis_refdata->Results;
|
||||||
if($arr_analysis_ref > 0){
|
if(count($arr_analysis_ref) == 0){
|
||||||
$arr_analysis_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
$arr_analysis_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
$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);
|
||||||
@ -152,20 +154,30 @@ 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'];
|
||||||
$compund_cas = $item['cas'];
|
$compund_cas = $item['cas'];
|
||||||
|
$trimmed_cas = str_replace("\n", "", str_replace("'", "\'", $compund_cas));
|
||||||
|
$trimmed_cas = str_replace(" ", "", $trimmed_cas);
|
||||||
$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 cascompoundvocabulary like '%$compund_cas%'");
|
if($trimmed_cas == "" || $trimmed_cas == "-" || $trimmed_cas == " "){
|
||||||
$arr_compunds_refdata->execute();
|
$quantity = 0;
|
||||||
$arr_compunds_ref = $arr_compunds_refdata->Results;
|
}else{
|
||||||
if($arr_compunds_ref > 0 ){
|
$arr_compunds_refdata->setQuery("SELECT * FROM compundsvocabulary where cascompoundvocabulary like '%$trimmed_cas%'");
|
||||||
$arr_compunds_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
|
||||||
$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;
|
||||||
|
$quantity = count($arr_compunds_ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($quantity == 0 ){
|
||||||
|
$arr_compunds_refdata = new WA_MySQLi_RS("rsl", $repnew, 0);
|
||||||
|
$arr_compunds_refdata->setQuery("SELECT * FROM compundsvocabulary where namecompoundsvocabulary like '$trim_item'");
|
||||||
|
$arr_compunds_refdata->execute();
|
||||||
|
$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(statement: "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(
|
||||||
@ -177,11 +189,6 @@ if(isset($_FILES['f_csv'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// REMOVE DUPLICATE IN ARRAY $arr_anaysisvoc_words,
|
|
||||||
$arr_anaysisvoc_words = array_map("unserialize", array_unique(array_map("serialize", $arr_anaysisvoc_words)));
|
|
||||||
// REMOVE DUPLICATE IN ARRAY $arr_compundsvoc_words,
|
|
||||||
$arr_compundsvoc_words = array_map("unserialize", array_unique(array_map("serialize", $arr_compundsvoc_words)));
|
|
||||||
|
|
||||||
die(json_encode(array(
|
die(json_encode(array(
|
||||||
'code' => "success",
|
'code' => "success",
|
||||||
'arr_analysis_data' => $arr_anaysisvoc_words,
|
'arr_analysis_data' => $arr_anaysisvoc_words,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user