
<?php
   // session_start();
    include_once('../config/conn/db-connection.php');
    include_once('../config/class/sap_model.php');
    $SAP = new SAP_infosytem();

        if(ISSET($_POST)){

              $image = addslashes(file_get_contents($_FILES['image_profile']['tmp_name']));
              $images ="uploads/". addslashes($_FILES['image_profile']['name']);
              $image_size = getimagesize($_FILES['image_profile']['tmp_name']);
              move_uploaded_file($_FILES["image_profile"]["tmp_name"], $_SERVER['DOCUMENT_ROOT']."/SAP_Information_System/uploads/" .   addslashes($_FILES["image_profile"]["name"]));

               $beneficiaries_id = trim($_POST['beneficiaries_id']);

               $SAP->edit_beneficiariesimage($images, $beneficiaries_id);
                  echo '<script type="text/javascript">';
                  echo 'setTimeout(function () { swal("Edit Beneficiaries-Image Successfully!","Message!","success");';
                  echo '}, 1000);</script>';
                  echo '<script type="text/javascript">';
                  echo 'setTimeout(function(){';
                  echo 'window.location = "/SAP_Information_System/Dashboard/pages/Beneficiaries.php"';
                  echo '},1000)';
                  echo '</script>';
             
        }
?>