Exemplo n.º 1
0
/**
 * @param Category $new_category
 * this will redirect the user to the add street
 */
function encoder_redirect_success(Street $street)
{
    $street_name = $street->getStreetName();
    $street_name_amharic = $street->getStreetNameAmharic();
    $dir = "VIEW/html/Encoder/Add_Place/Add_Place_Street_inc.php?success=1&street_name={$street_name}&street_name_amharic={$street_name_amharic}";
    $url = BASE_URL . $dir;
    header("Location:{$url}");
    //redirect the encoder to the regions add place
    exit;
}
 /**
  * @param Street $street
  * @return bool
  * this function takes a street object
  * parameter and adds it to the database
  */
 function Add_Street(Street $street)
 {
     $street_name = $street->getStreetName();
     $street_name_amharic = $street->getStreetNameAmharic();
     $about_street = $street->getAboutStreet();
     $about_street_amharic = $street->getAboutStreetAmharic();
     $query = "INSERT INTO Street (Name,Name_Amharic,About_Street,About_Street_Amharic) VALUE ('{$street_name}','{$street_name_amharic}','{$about_street}','{$about_street_amharic}')";
     $result = mysqli_query($this->getDbc(), $query);
     if ($result) {
         return TRUE;
     } else {
         return False;
     }
 }
Exemplo n.º 3
0
 function Edit_Street(Street $Street, $Street_ID)
 {
     $Street_Name = $Street->getStreetName();
     $Street_Name_Amharic = $Street->getStreetNameAmharic();
     $About_Street = $Street->getStreetName();
     $About_Street_Amharic = $Street->getStreetNameAmharic();
     $query = "UPDATE street\n\t\t\t\t\tset Name='{$Street_Name}',Name_Amharic='{$Street_Name_Amharic}',\n\t\t\t\t\tAbout_Street='{$About_Street}',About_Street_Amharic='{$About_Street_Amharic}'\n\t\t\t\t\twhere ID='{$Street_ID}'";
     $result = mysqli_query($this->getDbc(), $query);
     if ($result) {
         return TRUE;
     } else {
         return FALSE;
     }
 }