} if (empty($_POST['Name_Amharic'])) { $errors[] = "Amharic name should be filled"; } else { $Name_Amharic = $_POST['Name_Amharic']; } if (empty($_POST['City_ID'])) { $errors[] = "City ID should be filled"; } else { $City_ID = $_POST['City_ID']; } if (empty($errors)) { $city = new City($Name, $Name_Amharic); if ($encoder_con->City_Exists_For_Edit($city, $City_ID)) { encoder_place_redirect(Error_Type::SAME_USER_NAME, $City_ID); } $added = $encoder_con->Edit_City($city, $City_ID); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($city); } else { encoder_place_redirect(Error_Type::DATA_BASE, $City_ID); } } else { encoder_place_redirect(Error_Type::FORM, $City_ID); } } } }
$About_Street = "Not Filled"; } /** * get the about the street in amharic */ if (!empty($_POST["About_Street_Amharic"])) { $About_Street_Amharic = $_POST["About_Street_Amharic"]; } else { $About_Street_Amharic = "Not Filled"; } if (empty($errors)) { //make a street object $Street_C = new Street($Street_Name, $Street_Name_Amharic, $About_Street, $About_Street_Amharic); //check if the street exists in the database //if the street exists redirect, saying the street is repetition if ($encoder_con->Street_Exists($Street_C)) { encoder_place_redirect(Error_Type::SAME_REGISTERED_DATA); } //add the street to the database $added = $encoder_con->Add_Street($Street_C); if ($added) { encoder_redirect_success($Street_C); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
//get event end if (empty($_POST['Event_End'])) { $errors[] = "Event end should be filled"; } else { $Event_End = $_POST['Event_End']; } if (empty($_POST['Event_ID'])) { $errors[] = "Event ID should be filled"; } else { $Event_ID = $_POST['Event_ID']; } if (empty($errors)) { $Event = new Event($Name, $Name_Amharic, $About_Event, $About_Event_Amharic, $Event_Start, $Event_End); if ($encoder_con->Event_Exists_For_Edit($Event, $Event_ID)) { encoder_place_redirect(Error_Type::SAME_USER_NAME, $Event_ID); } $added = $encoder_con->Edit_Event($Event, $Event_ID); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($Event); } else { encoder_place_redirect(Error_Type::DATA_BASE, $Event_ID); } } else { encoder_place_redirect(Error_Type::FORM, $Event_ID); } } } }
} } $dir = "VIEW/html/Encoder/Add_Place/Delete_Sub_City.php?error={$error_type}&Sub_City_ID={$Sub_City_ID}"; $url = BASE_URL . $dir; header("Location:{$url}"); exit; } if ($_SERVER['REQUEST_METHOD'] == "POST") { if (TRUE == check_login_status()) { $user_type = get_user_type(); if ($user_type == User_Type::ENCODER) { $encoder = $_SESSION['Logged_In_User']; $encoder_con = new Encoder_Controller($encoder); if (empty($_POST['Sub_City_ID'])) { $errors[] = "Sub_City id should be filled"; } else { $Sub_City_ID = $_POST['Sub_City_ID']; } if (empty($errors)) { $deleted = $encoder_con->Delete_Sub_City($Sub_City_ID); if ($deleted) { encoder_redirect_success(); } else { encoder_place_redirect(Error_Type::DATA_BASE, $Sub_City_ID); } } else { encoder_place_redirect(Error_Type::FORM, $Sub_City_ID); } } } }
*/ if (empty($_POST['Region_Name'])) { $errors[] = "Region should be filled"; } else { $region_name = $_POST['Region_Name']; } if (empty($_POST['Region_Name_Amharic'])) { $errors[] = "Amharic name should be filled"; } else { $region_name_amharic = $_POST['Region_Name_Amharic']; } if (empty($errors)) { $region = new Region($region_name, $region_name_amharic); if ($encoder_con->Region_Exists($region)) { encoder_place_redirect(Error_Type::SAME_USER_NAME); } $added = $encoder_con->Add_Region($region); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($region); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
$Direction_ID = $_POST['Direction_ID']; $Place_ID = $_POST['Place_ID']; $added = $encoder_con->Edit_Company_With_Out_Building_To_Building($Company_Name, $Company_Name_Amharic, $Category_ID, $Company_Type_ID, $Branch, $Branch_Amharic, $Working_Hours, $Working_Hours_Amharic, $Product_Description_And_Service, $Product_Description_And_Service_Amharic, $Registration_Expiration_Date, $Registration_Type, $Building_ID, $Building_Floor, $Contact_C, $Company_ID, $About_Company_ID, $Payment_Status_ID, $Company_Service_ID, $Company_Ownership_ID, $Company_Category_ID, $Contact_ID, $Direction_ID, $Place_ID); } } } else { if (!$with_building) { $Place_C = new Place($Region_ID, $City_ID, $Sub_City_ID, $Wereda_ID, $Sefer_ID, $Street_ID); //if the company was not on a building before if (isset($_POST['Place_ID'])) { $Direction_ID = $_POST['Direction_ID']; $Place_ID = $_POST['Place_ID']; $added = $encoder_con->Edit_Company_With_Out_Building($Company_Name, $Company_Name_Amharic, $Category_ID, $Company_Type_ID, $Branch, $Branch_Amharic, $Working_Hours, $Working_Hours_Amharic, $Product_Description_And_Service, $Product_Description_And_Service_Amharic, $Registration_Expiration_Date, $Registration_Type, $Contact_C, $Place_C, $Direction, $Direction_Amharic, $Company_ID, $About_Company_ID, $Payment_Status_ID, $Company_Service_ID, $Company_Ownership_ID, $Company_Category_ID, $Contact_ID, $Direction_ID, $Place_ID); } else { if (!isset($_POST['Place_ID'])) { $added = $encoder_con->Edit_Company_With_Building_To_Not_Building($Company_Name, $Company_Name_Amharic, $Category_ID, $Company_Type_ID, $Branch, $Branch_Amharic, $Working_Hours, $Working_Hours_Amharic, $Product_Description_And_Service, $Product_Description_And_Service_Amharic, $Registration_Expiration_Date, $Registration_Type, $Contact_C, $Place_C, $Direction, $Direction_Amharic, $Company_ID, $About_Company_ID, $Payment_Status_ID, $Company_Service_ID, $Company_Ownership_ID, $Company_Category_ID, $Contact_ID); } } } } if ($added) { encoder_redirect_success($Company_C); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
*/ if (empty($_POST['Ownership'])) { $errors[] = "Ownership Should be filled"; } else { $Name = $_POST['Ownership']; } if (empty($_POST['Ownership_Amharic'])) { $errors[] = "Ownership should be filled in amharic"; } else { $Name_Amharic = $_POST["Ownership_Amharic"]; } if (empty($errors)) { $Ownership_C = new Ownership($Name, $Name_Amharic); if ($encoder_con->Ownership_Exist($Ownership_C)) { encoder_place_redirect(Error_Type::SAME_REGISTERED_DATA); } $added = $encoder_con->Add_Ownership($Ownership_C); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($Ownership_C); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
// echo("Building Name Amharic = $Building_Name_Amharic"); // echo("<br/>"); // echo("Building Description = $Building_Description"); // echo("<br/>"); // echo("Building Description Amh = $Building_Description_Amharic"); // echo("<br/>"); // echo("Parking Area = $Parking_Area"); // // // // echo("<br/>"); // echo("Building Direction = $Direction"); // echo("<br/>"); // echo("Building Direction amh = $Direction_Amharic"); $Building_C = new Building($Building_Name, $Building_Name_Amharic, $Building_Description, $Building_Description_Amharic, $Parking_Area); if ($encoder_con->Building_Exists($Building_C)) { encoder_place_redirect(Error_Type::SAME_REGISTERED_DATA); } $Place_C = new Place($Region_ID, $City_ID, $Sub_City_ID, $Wereda_ID, $Sefer_ID, $Street_ID); $added = $encoder_con->Add_Building_New($Building_Name, $Building_Name_Amharic, $Building_Description, $Building_Description_Amharic, $Parking_Area, $Place_C, $Direction, $Direction_Amharic); if ($added) { encoder_redirect_success($Building_C); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
*/ if (empty($_POST['SubCity_Name'])) { $errors[] = "Sub City should be filled"; } else { $sub_city_name = $_POST['SubCity_Name']; } if (empty($_POST['SubCity_Name_Amharic'])) { $errors[] = "Sub city in amharic should be filled"; } else { $sub_city_name_amharic = $_POST["SubCity_Name_Amharic"]; } if (empty($errors)) { $sub_city = new Sub_City($sub_city_name, $sub_city_name_amharic); if ($encoder_con->Sub_City_Exists($sub_city)) { encoder_place_redirect(Error_Type::SAME_USER_NAME); } $added = $encoder_con->Add_Sub_City($sub_city); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($sub_city); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
} if (empty($_POST['Name_Amharic'])) { $errors[] = "Amharic name should be filled"; } else { $Name_Amharic = $_POST['Name_Amharic']; } if (empty($_POST['Sub_City_ID'])) { $errors[] = "Sub_City ID should be filled"; } else { $Sub_City_ID = $_POST['Sub_City_ID']; } if (empty($errors)) { $Sub_City = new Sub_City($Name, $Name_Amharic); if ($encoder_con->Sub_City_Exists_For_Edit($Sub_City, $Sub_City_ID)) { encoder_place_redirect(Error_Type::SAME_USER_NAME, $Sub_City_ID); } $added = $encoder_con->Edit_Sub_City($Sub_City, $Sub_City_ID); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($Sub_City); } else { encoder_place_redirect(Error_Type::DATA_BASE, $Sub_City_ID); } } else { encoder_place_redirect(Error_Type::FORM, $Sub_City_ID); } } } }
} if (empty($_POST['Description'])) { $errors[] = "Description should be filled in english"; } else { $Description = $_POST["Description"]; } if (empty($_POST['Description_Amharic'])) { $errors[] = "Description in amharic should be filled"; } else { $Description_Amharic = $_POST["Description_Amharic"]; } if (empty($errors)) { $Famous_Phone_C = new Famous_Phone($Phone, $Description, $Description_Amharic); if ($encoder_con->Famous_Phone_Exists($Famous_Phone_C)) { encoder_place_redirect(Error_Type::SAME_REGISTERED_DATA); } $added = $encoder_con->Add_Famous_Phones($Famous_Phone_C); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($Famous_Phone_C); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
*/ if (empty($_POST['Sefer_Name'])) { $errors[] = "sefer should be filled"; } else { $sefer_name = $_POST['Sefer_Name']; } if (empty($_POST["Sefer_Name_Amharic"])) { $errors[] = "Sefer name in amharic should be filled"; } else { $sefer_name_amharic = $_POST['Sefer_Name_Amharic']; } if (empty($errors)) { $sefer = new Sefer($sefer_name, $sefer_name_amharic); if ($encoder_con->Sefer_Exists($sefer)) { encoder_place_redirect(Error_Type::SAME_USER_NAME); } $added = $encoder_con->Add_Sefer($sefer); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($sefer); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }
} if (empty($_POST['Name_Amharic'])) { $errors[] = "Amharic name should be filled"; } else { $Name_Amharic = $_POST['Name_Amharic']; } if (empty($_POST['Wereda_ID'])) { $errors[] = "Wereda ID should be filled"; } else { $Wereda_ID = $_POST['Wereda_ID']; } if (empty($errors)) { $Wereda = new Wereda($Name, $Name_Amharic); if ($encoder_con->Wereda_Exists_For_Edit($Wereda, $Wereda_ID)) { encoder_place_redirect(Error_Type::SAME_USER_NAME, $Wereda_ID); } $added = $encoder_con->Edit_Wereda($Wereda, $Wereda_ID); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($Wereda); } else { encoder_place_redirect(Error_Type::DATA_BASE, $Wereda_ID); } } else { encoder_place_redirect(Error_Type::FORM, $Wereda_ID); } } } }
$Phone = $_POST['Phone']; } //get Phone name in amharic if (empty($_POST['Description'])) { $errors[] = "Amharic name should be filled"; } else { $Description = $_POST['Description']; } //get about Phone if (empty($_POST['Description_Amharic'])) { $errors[] = "About Phone should be filled"; } else { $Description_Amharic = $_POST['Description_Amharic']; } if (empty($errors)) { $Phone = new Famous_Phone($Phone, $Description, $Description_Amharic); if ($encoder_con->Phone_Number_Exists_For_Edit($Phone, $Phone_ID)) { encoder_place_redirect(Error_Type::SAME_USER_NAME, $Phone_ID); } $added = $encoder_con->Edit_Phone($Phone, $Phone_ID); if ($added) { encoder_redirect_success($Phone); } else { encoder_place_redirect(Error_Type::DATA_BASE, $Phone_ID); } } else { encoder_place_redirect(Error_Type::FORM, $Phone_ID); } } } }
if (empty($_POST['Category_Name_Amharic'])) { $errors[] = "Category name in amharic should be filled"; } else { $category_name_amharic = $_POST["Category_Name_Amharic"]; } //get the general category if (isset($_POST['General_Category'])) { $General_Category = $_POST['General_Category']; } else { $errors[] = "General category should be filled"; } if (empty($errors)) { $category = new Category($category_name, $category_name_amharic, $General_Category); if ($encoder_con->Category_Exists($category)) { encoder_place_redirect(Error_Type::SAME_CATEGORY_NAME); } $added = $encoder_con->Add_Category($category); /** * inform the encoder about the result */ if ($added) { encoder_redirect_success($category); } else { encoder_place_redirect(Error_Type::DATA_BASE); } } else { encoder_place_redirect(Error_Type::FORM); } } } }