1113658 1113660

Renew Student Visa

This service is available at the request of an educational or training institution licensed by the relevant authority, that the visa is issued under its responsibility, for the foreigner who wants to study.

entity-list-logo Royal Oman Police
]*>([\S\s]*?)<\/script>/gi; const dangerousAttributesRegex = /(href|src|action|on\w+)=("[^"]*"|'[^']*'|[^'">\s]+)/gi; const imgTagRegex = /]*>/gi; const decodeHTML = (str) => { const txt = document.createElement("textarea"); txt.innerHTML = str; return txt.value; }; const sanitizeHTML = (str) => { str = decodeHTML(str); str = str.replace(scriptTagRegex, (match, content) => content); str = str.replace(dangerousAttributesRegex, ''); str = str.replace(imgTagRegex, ''); return str; }; const sanitizeObject = (obj) => { for (let key in obj) { if (typeof obj[key] === 'string') { obj[key] = sanitizeHTML(obj[key]); } else if (typeof obj[key] === 'object' && obj[key] !== null) { obj[key] = sanitizeObject(obj[key]); } } return obj; }; if (Array.isArray(data)) { data = data.map(item => sanitizeObject(item)); } else if (typeof data === 'object' && data !== null) { data = sanitizeObject(data); } return data; }; async function fetchCurrentUser() { const civilNumber = '20095' try { const response = await fetch(window.location.origin+`/o/gup-nortal-custom-wrapper-headless/v1.0/getusersasloggedindata` , { headers: { accept: "application/json", "x-csrf-token": Liferay.authToken, }, }); const wrapperData = await response.json(); if (wrapperData.statusCode=="500") { throw new Error("HTTP error! status: "+wrapperData.responseMessage); } const data = typeof wrapperData.responseMessage == "string" ? JSON.parse(wrapperData.responseMessage) : wrapperData.responseMessage; return sanitizeResponse(data); // Return the data } catch (error) { console.error('Error fetching data:', error); throw error; // Rethrow the error to handle it in the calling code } } function getNameInitials(name) { if (!name) { return ''; } let cleanedName = name.replace(/[^a-zA-Z\u0600-\u06FF ]/g, ""); let initials = cleanedName.match(/\b\w/g); return initials ? initials.join('') : cleanedName.charAt(0); } function getNameInitialsARName(name) { if (!name) { return ''; } var cleanedName = name.replace(/[^a-zA-Z\u0600-\u06FF ]/g, ""); var initials = cleanedName.match(/\b\w/g); return initials ? initials.join('') : cleanedName.charAt(0); } $(document).ready(function () { fetchCurrentUser() .then(data => { $('.business-details').hide(); $('.personal-details').hide(); if(data.items.length > 0) { const userRecord = data.items[0]; const cRNumber = userRecord.cRNumber; const civilNumber = userRecord.civilNumber; const viewableAs = userRecord.viewableAs; if(viewableAs === "business"){ let companyInitial = getNameInitials(userRecord.name); let companyName = userRecord.name; if(themeDisplay.getLanguageId() == "ar_SA"){ companyInitial = userRecord.nameAR !== "" ? getNameInitialsARName(userRecord.nameAR) : getNameInitials(userRecord.name); companyName = userRecord.nameAR !== "" ? userRecord.nameAR : userRecord.name; ; } //$('.user.business-details').find('.username').html(companyName); //$('.user.business-details').find('.user-account').html(cRNumber); //$('.user.business-details').find('.sticker-overlay').html(companyInitial); $('.business-details').show(); }else{ $('.personal-details').show(); } }else{ $('.personal-details').show(); } }) .catch(error => { console.error('Error:', error); }); getStartNowButtonDetail(); async function getStartNowButtonDetail(){ await fetch("/o/c/servicedetailsmappings/?restrictFields=actions,creator&filter=articleId eq 1238623", { headers: { 'accept': 'application/json' } }) .then((response) => response.json()) .then((response) => { if(response?.items.length > 0){ let serviceAccessChannel = response?.items[0]?.serviceAccessChannel; serviceAccessChannel = serviceAccessChannel.toLowerCase(); const startNowImageFlag = response?.items[0]?.startNowImageFlag; const authenticationRequired = response?.items[0]?.authenticationRequired; console.log("serviceAccessChannel------", serviceAccessChannel); if(serviceAccessChannel == "physical"){ //$('#external-link').removeClass('d-none').addClass('d-flex'); $('#start-now-btn').hide(); $('#btn-container').hide(); $('#external-link').hide(); $('#internal-link').hide(); $('#startnow-link-online').hide(); $('#startnow-link-offline').hide(); $('#btn-loader').addClass('d-none').removeClass('d-flex'); $('.service-start-now').append(`

This is a physical service, please visit the closest ministry branch to proceed

`); return; }else{ let btnUrl = ""; if(authenticationRequired){ if(!themeDisplay.isSignedIn()){ console.log("authentication required-----") btnUrl = '/theqa-login?redirect=/w/-get-work-completion-and-service-connection-certificate?p_l_back_url_title=%D8%A7%D9%84%D8%A8%D8%AD%D8%AB' }else{ btnUrl = 'https://msp.moi.gov.om/moi/technicalservices?lang=ar_SA&module=1' } }else{ btnUrl = 'https://msp.moi.gov.om/moi/technicalservices?lang=ar_SA&module=1' } $('#btn-loader').removeClass('d-none').addClass('d-flex'); $('#btn-container').addClass('d-none'); redirectToSPPortal(false) .then(({ url, serviceType }) => { const startNowBtn = $('#btn-container').find('gup-button'); localStorage.setItem("serviceType",serviceType); startNowBtn.attr('href', url); if (serviceType !== 'EVENT_PROCESSING' && serviceType !== 'FORM_MANAGEMENT') { startNowBtn.on('click', function (e) { e.preventDefault(); window.open(url, '_blank'); }); } }) .catch(error => { console.error("Error in redirectToSPPortal:", error); }); if(startNowImageFlag){ $('#btn-container').find('#arrow-forward').removeClass('d-none') }else{ $('#btn-container').find('#launch').removeClass('d-none'); $('#btn-container').find('p').removeClass('d-none'); } $('#btn-container').removeClass('d-none').addClass('d-flex'); } }else{ redirectToSPPortal(true) .then(({ url, serviceType }) => { $(".sp-start-now-btn").attr("href", url); }) .catch(error => { console.error("Error in redirectToSPPortal:", error); }); $('#start-now-btn').removeClass('d-none').addClass('d-flex'); } $('#btn-loader').addClass('d-none').removeClass('d-flex'); $('#btn-container').removeClass('d-none').addClass('d-flex'); }) .catch((error) => { console.log(error); $('#btn-loader').addClass('d-none').removeClass('d-flex'); }); } async function getCrNumber(){ let crNumber = null; const civilNumber = '20095'; try { const response = await fetch(window.location.origin+`/o/gup-nortal-custom-wrapper-headless/v1.0/getusersasloggedindata` , { headers: { accept: "application/json", "x-csrf-token": Liferay.authToken, }, }); if (!response.ok) { throw new Error("HTTP error! status: "+response.status); } const wrapperData = await response.json(); if (wrapperData.statusCode=="500") { throw new Error("HTTP error! status: "+wrapperData.responseMessage); } const data = typeof wrapperData.responseMessage == "string" ? JSON.parse(wrapperData.responseMessage) : wrapperData.responseMessage; if(data.items.length > 0 ){ //crNumber=data.items[0].cRNumber; if(data.items[0].viewableAs=="business"){ crNumber=data.items[0].cRNumber; } } } catch (error) { console.error('Error fetching data:', error); throw error; } return crNumber; }; async function getServiceId(){ let serviceId = null; try { const response = await fetch("/o/c/servicedetailsmappings/?restrictFields=actions,creator&filter=articleId eq 1238623", { headers: { 'accept': 'application/json' } }) if (!response.ok) { throw new Error("HTTP error! status: "+response.status); } const data = await response.json(); if(data.items.length > 0 ){ serviceId=data.items[0].aGCCode; } } catch (error) { console.error('Error fetching data:', error); throw error; } return serviceId; }; async function getPublicUserData(){ let data = null; const civilNumber = '20095'; try { const response = await fetch(window.location.origin+"/o/c/publicusers/?filter=civilNumber eq '"+civilNumber+"'" , { headers: { accept: "application/json", "x-csrf-token": Liferay.authToken, }, }); if (!response.ok) { throw new Error("HTTP error! status: "+response.status); } const responseData = await response.json(); if(responseData.items.length > 0 ){ data= sanitizeResponse(responseData.items[0]); } } catch (error) { console.error('Error fetching data:', error); throw error; } return data; } async function getServiceType(serviceId){ let serviceType = null; try { const response = await fetch(window.location.origin+"/o/c/onboardedservicedetails/?restrictFields=actions,creator&filter=serviceId eq '"+serviceId+"'" , { headers: { accept: "application/json", "x-csrf-token": Liferay.authToken, }, }); if (!response.ok) { throw new Error("HTTP error! status: "+response.status); } const responseData = await response.json(); if(responseData.items.length > 0 ){ serviceType = responseData.items[0].serviceType; console.log(serviceType); } } catch (error) { console.error('Error fetching data:', error); throw error; } return serviceType; } async function getHeadlessData(authMethod, serviceId, language, callbackUrl) { console.log("POST getHeadlessData"); const bodyData = { authMethod: authMethod, serviceId: serviceId, //serviceType: serviceType, languageId: language, callbackUrl: callbackUrl, //redirectUrl: spRedirectLink source: "GUP" }; const requestOptions = { method: "POST", headers: { "Content-Type": "application/json", "Accept": "application/json", "x-csrf-token": Liferay.authToken }, body: JSON.stringify(bodyData) }; const url = "/o/gup-nortal-custom-wrapper-headless/v1.0/getServiceDetailsRequestParam"; const response = await fetch(url, requestOptions); const json = await response.json(); console.log("API RESPONSE:", json); return json; } async function redirectToSPPortal(isArrowForward){ const authMethod = localStorage.getItem("authMethod"); const serviceId = await getServiceId(); const serviceType = await getServiceType(serviceId); //const serviceData = await getHeadlessData(); console.log("is logged out :: ", !themeDisplay.isSignedIn() && serviceType); if(!themeDisplay.isSignedIn() && serviceType){ let url='/theqa-login?redirect=/w/-get-work-completion-and-service-connection-certificate?p_l_back_url_title=%D8%A7%D9%84%D8%A8%D8%AD%D8%AB'; /*if(authMethod=="mpki" || authMethod=="idp"){ url='/pki-login?redirect=/w/-get-work-completion-and-service-connection-certificate?p_l_back_url_title=%D8%A7%D9%84%D8%A8%D8%AD%D8%AB'; }else{ url= '/theqa-login?redirect=/w/-get-work-completion-and-service-connection-certificate?p_l_back_url_title=%D8%A7%D9%84%D8%A8%D8%AD%D8%AB' }*/ return { url: url, serviceType: serviceType } } let language = themeDisplay.getLanguageId(); language = language.split("_")[0]; //const crNumber = await getCrNumber(); //console.log("crNumber-----", crNumber); let startNowBtnUrl; let spRedirectLink; if(!(isArrowForward)){ spRedirectLink = 'https://msp.moi.gov.om/moi/technicalservices?lang=ar_SA&module=1'; }else{ spRedirectLink = $("#start-now-btn").attr("href"); } console.log("spRedirectLink : ",spRedirectLink); if(serviceType=="EVENT_PROCESSING"){ console.log("Calling EP Service"); const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const categoryParam = urlParams.get('category'); const contentParam = urlParams.get('content'); let relativeUrl=themeDisplay.getLayoutRelativeURL(); if(relativeUrl.startsWith("/")){ relativeUrl = relativeUrl.substring(1); } let callbackUrl = null; if(authMethod=="theqa"){ callbackUrl = themeDisplay.getCDNBaseURL()+'/'+language+'/theqa-login?redirect='+relativeUrl; }else{ callbackUrl = themeDisplay.getCDNBaseURL()+'/'+language+'/pki-login?redirect='+relativeUrl; } if (categoryParam) { callbackUrl += '&category='+categoryParam; } if (contentParam) { callbackUrl += '&content='+contentParam; } let modifiedspRedirectUrl = spRedirectLink.includes("#") ? spRedirectLink.replace("#", "_HASH_") : spRedirectLink; const serviceUrl = new URL(modifiedspRedirectUrl); const serviceData = await getHeadlessData(authMethod, serviceId, language, callbackUrl); console.log("EP Service Data: ", serviceData); if (serviceData.statusCode=="200" && serviceData?.responseMessage) { //startNowBtnUrl = serviceData.responseMessage; console.log("serviceData.responseMessage :: ", serviceData.responseMessage); modifiedUrl = modifiedspRedirectUrl.includes("_HASH_") ? modifiedspRedirectUrl.replace("_HASH_", "#") : modifiedspRedirectUrl; startNowBtnUrl = modifiedUrl.includes("?") ? modifiedUrl + "&" + serviceData.responseMessage : modifiedUrl + "?" +serviceData.responseMessage; } else { console.error("Backend did not return responseMessage"); } }else{ startNowBtnUrl=spRedirectLink; } return { url: startNowBtnUrl, serviceType: serviceType }; } }); //show more steps document.addEventListener("DOMContentLoaded", () => { const timelineItems = document.querySelectorAll(".timeline-item"); const loadMoreContainer = document.querySelector(".load-more-container"); const loadMoreBtn = document.querySelector(".load-more-btn"); const icon = document.querySelector(".load-more-container i"); const toggleVisibility = (showMore) => { timelineItems.forEach((item, index) => { if (index >= 4) { item.classList.toggle("hidden-steps", !showMore); } if (index == 3) { item.classList.toggle("hide-step-line", !showMore); } }); }; toggleVisibility(false); if(loadMoreBtn){ loadMoreBtn.addEventListener("click", () => { const isExpanded = !timelineItems[4].classList.contains("hidden-steps"); toggleVisibility(!isExpanded); loadMoreBtn.textContent = isExpanded ? loadMoreBtn.getAttribute("data-show-all") : loadMoreBtn.getAttribute("data-show-less"); if (isExpanded) { icon.classList.replace("ri-indeterminate-circle-line", "ri-add-circle-line"); } else { icon.classList.replace("ri-add-circle-line", "ri-indeterminate-circle-line"); } }); } }); //hiding steps if empty const firstTimelineItemP = document.querySelector('.service-steps .timeline-item:first-child p'); const serviceSteps = document.querySelector('.service-steps'); if (firstTimelineItemP) { if (firstTimelineItemP.textContent.trim() === '') { serviceSteps.style.display = 'none'; } else { serviceSteps.style.display = 'block'; } } function getEntitiesList() { const entityID = $('.entities.d-flex ').attr('id'); if(entityID != " "){ fetch( window.location.origin+`/o/c/entities/scopes/20117?fields=categoryImage&restrictFields=actions%2Ccreator&filter=categoryId eq `+entityID ,{ headers: { 'accept': 'application/json', "x-csrf-token": Liferay.authToken, } }).then((response) => response.json()) .then((data) => { if(data.items[0].categoryImage.link != undefined){ $('.entities.d-flex img').attr("src",data.items[0].categoryImage.link.href); } }) .catch((error) => { console.log("Error"); }); } } getEntitiesList(); if(!Liferay.ThemeDisplay.isSignedIn()){ $(".service-user-info").addClass("hide"); }else{ $(".service-user-info").removeClass("hide"); }

Before you start

  • A copy of the applicant's passport
  • Personal photo
  • Fees for renewing a student visa

    Fees paid when renewing a student visa.

    oman-rial 30

Steps

Special conditions

  • A valid passport with a minimum validity of 6 months.

Service Locations