Esempio n. 1
0
     } else {
         $Name = $_POST['Name'];
     }
     if (empty($_POST['Name_Amharic'])) {
         $errors[] = "Amharic name should be filled";
     } else {
         $Name_Amharic = $_POST['Name_Amharic'];
     }
     if (empty($_POST['Sefer_ID'])) {
         $errors[] = "Sefer ID should be filled";
     } else {
         $Sefer_ID = $_POST['Sefer_ID'];
     }
     if (empty($errors)) {
         $Sefer = new Sefer($Name, $Name_Amharic);
         if ($encoder_con->Sefer_Exists_For_Edit($Sefer, $Sefer_ID)) {
             encoder_place_redirect(Error_Type::SAME_USER_NAME, $Sefer_ID);
         }
         $added = $encoder_con->Edit_Sefer($Sefer, $Sefer_ID);
         /**
          * inform the encoder about the result
          */
         if ($added) {
             encoder_redirect_success($Sefer);
         } else {
             encoder_place_redirect(Error_Type::DATA_BASE, $Sefer_ID);
         }
     } else {
         encoder_place_redirect(Error_Type::FORM, $Sefer_ID);
     }
 }