function encoder_redirect_success(Wereda $new_Wereda) { $new_Wereda_name = $new_Wereda->getWereda(); $dir = "VIEW/html/Encoder/Add_Place/Add_Place_Wereda_inc.php?success_edit=1"; $url = BASE_URL . $dir; header("Location:{$url}"); //redirect the encoder to the Weredas add place exit; }
/** * @param Wereda $wereda * @return bool * this function takes wereda object as a parameter to add it to the database * if the wereda is added it will return true * else it will return false */ function Add_Wereda(Wereda $wereda) { $Wereda_Name = $wereda->getWereda(); $Wereda_Name_Amharic = $wereda->getWeredaAmharic(); $query = "INSERT INTO wereda (Name,Name_Amharic) VALUES('{$Wereda_Name}','{$Wereda_Name_Amharic}')"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }
function Edit_Wereda(Wereda $Wereda, $Wereda_ID) { $Name = $Wereda->getWereda(); $Name_Amharic = $Wereda->getWeredaAmharic(); $query = "UPDATE Wereda set Name='{$Name}',Name_Amharic='{$Name_Amharic}' where ID='{$Wereda_ID}'"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }