Example #1
0
function encoder_redirect_success(Sefer $sefer)
{
    $new_sefer_name = $sefer->getSefer();
    $dir = "VIEW/html/Encoder/Add_Place/Add_Place_sefer_inc.php?success=1&Sefer_Name={$new_sefer_name}";
    $url = BASE_URL . $dir;
    header("Location:{$url}");
    //redirect the encoder to the regions add place
    exit;
}
Example #2
0
function encoder_redirect_success(Sefer $new_Sefer)
{
    $new_Sefer_name = $new_Sefer->getSefer();
    $dir = "VIEW/html/Encoder/Add_Place/Add_Place_Sefer_inc.php?success_edit=1";
    $url = BASE_URL . $dir;
    header("Location:{$url}");
    //redirect the encoder to the Sefers add place
    exit;
}
 /**
  * @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;
     }
 }