/** * @param Sefer $sefer * @return bool * this function takes sefer object * if the sefer is added to the data base it will return true * else it will return false */ function Add_Sefer(Sefer $sefer) { $Sefer_Name = $sefer->getSefer(); $Sefer_Name_Amharic = $sefer->getSeferAmharic(); $query = "INSERT INTO sefer (Name,Name_Amharic) VALUES('{$Sefer_Name}','{$Sefer_Name_Amharic}')"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }
function Edit_Sefer(Sefer $Sefer, $Sefer_ID) { $Name = $Sefer->getSefer(); $Name_Amharic = $Sefer->getSeferAmharic(); $query = "UPDATE Wereda set Name='{$Name}',Name_Amharic='{$Name_Amharic}' where ID='{$Sefer_ID}'"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }