edit source again

This commit is contained in:
starthomas610 2024-06-14 05:18:32 -04:00
parent 1973675854
commit afc4b10368

View File

@ -259,26 +259,26 @@ if(isset($_FILES['f_csv'])) {
//----------- result_project table ------------------ //----------- result_project table ------------------
foreach($part as $result_project) { foreach($part as $result_project) {
//check exist result_project item //check exist result_project item
$result_project_query = new WA_MySQLi_RS("getquery", $repnew, 0); // $result_project_query = new WA_MySQLi_RS("getquery", $repnew, 0);
$sql_result_project_query = "SELECT * FROM result_project WHERE idPart='$idparts' and idreports='$idreports' and idproducts='$idproducts'"; // $sql_result_project_query = "SELECT * FROM result_project WHERE idPart='$idparts' and idreports='$idreports' and idproducts='$idproducts'";
//
$arr_result_project_need_idx = array(); $arr_result_project_need_idx = array();
for ($i = 0; $i < count($arr_associate); $i++) { for ($i = 0; $i < count($arr_associate); $i++) {
if ($arr_associate[$i]['table_name'] == "result_project") { if ($arr_associate[$i]['table_name'] == "result_project") {
array_push($arr_result_project_need_idx, array($arr_associate[$i]['column_name'], array_search($arr_associate[$i]['headerfile'], $arr_excel_columns))); array_push($arr_result_project_need_idx, array($arr_associate[$i]['column_name'], array_search($arr_associate[$i]['headerfile'], $arr_excel_columns)));
} }
} }
//
foreach($arr_result_project_need_idx as $q) { // foreach($arr_result_project_need_idx as $q) {
$sql_result_project_query .= " and ".$q[0]."='".$q[1]."'"; // $sql_result_project_query .= " and ".$q[0]."='".$q[0]."'";
} // }
//
$result_project_query->setQuery($sql_result_project_query); // $result_project_query->setQuery($sql_result_project_query);
$result_project_query->execute(); // $result_project_query->execute();
//
$result_project_info = $result_project_query->Results; // $result_project_info = $result_project_query->Results;
//
if (count($result_project_info) == 0) { // if (count($result_project_info) == 0) {
$InsertQuery = new WA_MySQLi_Query($repnew); $InsertQuery = new WA_MySQLi_Query($repnew);
$InsertQuery->Action = "insert"; $InsertQuery->Action = "insert";
$InsertQuery->Table = "`result_project`"; $InsertQuery->Table = "`result_project`";
@ -291,7 +291,7 @@ if(isset($_FILES['f_csv'])) {
} }
$InsertQuery->saveInSession(""); $InsertQuery->saveInSession("");
$InsertQuery->execute(); $InsertQuery->execute();
} // }
} }
} }
} }