Ejemplo n.º 1
0
         $attributeCode[] = $rowData['AttributeCode'];
     }
 }
 //Query to update data
 //print_r($attributeValuePK);
 $indexCount = 0;
 for ($index = 0; $index < sizeof($attributeValuePK); $index++) {
     if (isset($dataList[$index]) && isset($attributeValuePK[$index])) {
         $updateQuery = "update attributeValue set attributeValue='{$dataList[$index]}' where AttributeValuePK='{$attributeValuePK[$index]}';";
         //echo $updateQuery;
         $updateResult = $db->setQuery($updateQuery);
         // $sql = "call updateData('$type','$artefactCode','$attributeCode[$index]','$dataList[$index]')";
         $sql1 = "call UpdateUserAndTime('{$attributeValuePK[$index]}','{$user}')";
         //echo $sql;
         //$db->setQuery($sql);
         $db->updateData($type, $artefactCode, $attributeCode[$index], $dataList[$index]);
         $db->setQuery($sql1);
     }
     // 		$acode = $db->getArtefactCode($attributeValuePK[$index]);
     // 		$atitle = $db->getTitle($attributeValuePK[$index]);
     // 		$result2 = $db->setQuery("call updateAttributeValues('$acode','$type','$atitle','$dataList[$index]')");
     if ($updateResult) {
         $indexCount++;
     }
 }
 //echo $index.' '.$indexCount.'</br>';
 if ($index == $indexCount) {
     echo "<div class='alert alert-success btn-success' role='alert'>Updated Succesfully</div>";
 } else {
     echo "<div class='alert alert-danger' role='alert'>Failed to update</div>";
 }