/** * @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 Ownership_Exist(Ownership $ownership) { $Name = $ownership->getName(); $query = "SELECT * FROM Ownership WHERE Name='{$Name}'"; $result = mysqli_query($this->getDbc(), $query); if (mysqli_num_rows($result) >= 1) { return TRUE; } else { if (mysqli_num_rows($result) == 0) { 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; } }