/** * @param Company_Type $company_type * will redirect the user to the company type place */ function encoder_redirect_success(Ownership $ownership) { $Name = $ownership->getName(); $Name_Amharic = $ownership->getNameAmharic(); $dir = "VIEW/html/Encoder/Add_Ownership/Add_Ownership.php?success=1&Name={$Name}&Name_Amharic={$Name_Amharic}"; $url = BASE_URL . $dir; header("Location:{$url}"); //redirect the encoder to the regions add place exit; }
function Add_Ownership(Ownership $ownership) { $Name = $ownership->getName(); $Name_Amharic = $ownership->getNameAmharic(); $query = "INSERT INTO Ownership (Name,Name_Amharic) VALUES ('{$Name}','{$Name_Amharic}')"; $result = mysqli_query($this->getDbc(), $query); if ($result) { return TRUE; } else { return FALSE; } }
function Edit_Ownership(Ownership $Ownership, $Ownership_ID) { $Name = $Ownership->getName(); $Name_Amharic = $Ownership->getNameAmharic(); $query = "UPDATE Ownership set Name='{$Name}',Name_Amharic='{$Name_Amharic}' where ID='{$Ownership_ID}'"; $result = mysqli_query($this->getDbc(), $query); //if the company is deleted return true if ($result) { return TRUE; } else { return FALSE; } }