Exemple #1
0
                $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);
            }
        }
    }
}