Welcome

The Church in Cape Town

The church in Cape Town, South Africa, warmly welcomes you. We are believers in the Lord Jesus Christ who have personally received Him as our Savior. He is the most excellent and enjoyable Person. We love Him and endeavor to give Him the first place in all things. We rejoice to be cleansed by the blood of Jesus, God’s Son, born again of the Father’s divine life, and filled with the Holy Spirit.

About Us

The church in Cape Town isn't our name - it's our description. As such, it's an inclusive title, not an exclusive one. We gather together simply as believers of the Lord in this city, and we receive as our brothers and sisters all who believe in Jesus Christ. Likewise, we warmly welcome guests and visitors who are not Christians.In the 1980s, a group of believers in Christ began to meet as "the church in Cape Town," a local expression of the Body of Christ according to the New Testament principle of "one city, one church"—Rev 1:11; Acts 14:23; Titus 1:5.

As individual believers in Christ, we seek to live a life that glorifies our Savior and Lord Jesus Christ, denying ungodliness and putting off the "old man" to live according to the life and nature of Christ who indwells us.

As members of the Body of Christ, we seek to live a corporate life by laying aside all distinctions and divisive practices, expressing the one, universal Body of Christ in a practical, local way but in fellowship with all the local churches on the earth. We have been especially helped, both individually and collectively, by the ministry of Watchman Nee and Witness Lee, and wholeheartedly recommend their ministry to all seekers of the Lord.For further information on meeting times and places, please visit our contact page.

Our Belief

We hold the faith which is common to all believers.—Titus 1:4, Jude 3

The Bible
The Bible is the complete divine revelation inspired word by word by God through the Holy Spirit.—2 Peter 1:21, 2 Timothy 3:16
The Triune God
God is uniquely one, yet a Trinity - the Father, the Son, and the Spirit.—1 Timothy 2:5, Matthew 28:19
Jesus Christ
The Son of God, even God Himself, was incarnated to be a man by the name of Jesus Christ.—John 1:1, John 1:14
Christ's crucifixion
Christ died on the cross for our sins, shedding His blood for our redemption.—1 Peter 2:24, Ephesians 1:7

Christ's ascension
Christ ascended to the right hand of God to be Lord of all.—Acts 1:9, Acts 2:33, Acts 2:36
Regeneration
Whenever any person repents to God and believes in the Lord Jesus Christ, he or she is regenerated (born again) and becomes a living member of the one Body of Christ.—Acts 20:21, John 3:3, Ephesians 1.22-23, Romans 12:5
Christ's return
Christ is coming again to receive His believers to Himself.—1 Thessalonians 2:19
Christ's resurrection
Christ resurrected from among the dead on the third day.—1 Corinthians 15:4

Children's service
Our toddlers and children are very precious to us. That's why we seek to help the little ones among us develop into young men and women who love Jesus Christ, know the Bible, and seek God's kingdom first.
The Lord's supper and teaching
As believers in Christ who love and serve Him, we enjoy the Lord's supper each Lord's Day. Following our worship of the Father, we share with one another what we have enjoyed in the Scriptures in an open session of mutual teaching and encouragement.
Spiritual companionship
Prayerful spiritual relationships of two or three believers fuel our Christian life and enable us to be Christ's witnesses. We value these companionships highly and take every opportunity to encourage,strengthen, and sustain them.
Young people's gatherings
We are stongly commited to the spiritual development of our next generation. We keep our high school students' lives meaningful by providing an atmosphere rich with God's Word, healthy companionships, and young people's bible camps.

Our Life

We maintain a vibrant and active life. Whether you're a growing family or a student, single or retired, we give you a place to live, grow, and serve as an indispensable member of Christ's Body.

Small-group life
Gather with believers in your neighborhood for dinner, singing, mutual Bible study, prayer, and daily fellowship.

Student groups
We desire young men and women to be useful to the Master (2 Tim 2:21). For this we have Bible studies at the campuses of University of Cape Town, University of the Western Cape, and Stellenbosch University and also family-hosted groups near these universities.
Special events
We hold retreats, conferences, and special trainings that are aimed at knowing and experiencing Christ and building His church.

Get in touch

We would love to get in contact with you. We gladly fellowship with all believers and are open to any questions.
You can contact us directly or fill in the form below:

Jandries: 27 82 766 3883 | jandries14@gmail.com

Events

var calendarInitialized = false; var events = []; var calendar; const icons = { block: "#icon-382a61b3b78069a2923fa7feb2cf6bba", checked: "#icon-be848c9691a8e3f7630e3908e426bf9f", calendar: "#icon-59c45c646c93a770c2b114cf72c44f8e", location: "#icon-4c36dea559df9f4384b432ac3c2dbf36", info: "#icon-5df67a211ae41c4e5f96b6e0ea004ca3" }; /** * Carrd loads the script by adding new elements with only the src elements, so we can't trace when the onload event fires. */ function waitForScript(onLoadFunction){ if(typeof(FullCalendar) == 'undefined'){ console.log("FullCalendar is undefined. Waiting..."); window.setTimeout(function(){ waitForScript(onLoadFunction); }, 100); }else{ console.log("FullCalendar is defined"); onLoadFunction(); } } /** * Check if the correct page is in view */ function checkHashForCalendar(){ return window.location.hash == "#calendar"; } /** * This will fire if the document was already loaded */ if(checkHashForCalendar()) waitForScript(init); function init(){ setupTabs(); setupFullCalendar(); document.querySelector("ul.buttons:has(a[href='#myIcons'])").style.display = "none"; } function setupFullCalendar(){ if(calendarInitialized) return; console.log("Initializing calendar"); var calendarEl = document.getElementById('calendar'); calendar = new FullCalendar.Calendar(calendarEl, { initialView: 'dayGridYear', customButtons: { myToday: { text: 'Today', click: function() { calendar.today(); } } }, headerToolbar: { left: 'prev,next myToday', center: 'title', right: 'dayGridYear' }, height: 650, events: getCalendarEvents, eventOverlap: false, eventDidMount: function (info) { info.el.setAttribute('data-bs-html', 'true'); var popover = new bootstrap.Popover(info.el, { content: generatePopoverContent(info.event), html: true, placement: 'top', trigger: 'manual', customClass: 'custom-tooltip', sanitize: false }); info.el.addEventListener('mouseenter', function () { popover.show(); popover._popper.state.elements.popper.addEventListener("mouseleave", () => popover.hide()); }); info.el.addEventListener('mouseleave', function () { setTimeout(function () { if (!info.el.matches(':hover') && !document.querySelector('.popover:hover')) { popover.hide(); } }, 100); }); document.addEventListener('click', function (e) { if (!info.el.contains(e.target)){ var pop = document.querySelector('.popover'); if(pop && !pop.contains(e.target)) popover.hide(); } }); }, eventContent: function (info) { if (info.view.type === 'dayGridYear') { return { html: ` <${"div"} class="fc-month-event"><${"strong"}>${info.event.title} ` }; } } }); calendar.render(); calendarInitialized = true; } function generatePopoverContent(event) { /* Carrd filters out html tags, so we need to do this for a workaround*/ var end = event.end == null ? "" : ` <${'div'}><${'div class="detail_name"'}><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.calendar}"><${"/use"}><${"/svg"}><${"/div"}> Until: <${"/div"}><${'div class="detail_value"'}>${formatDate(event.end)}<${"/div"}><${"/div"}> `; var loc = !event.extendedProps.location ? "" : ` <${'div'}><${'div class="detail_name"'}><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.location}"><${"/use"}><${"/svg"}><${"/div"}> Location: <${"/div"}><${'div class="detail_value"'}>${event.extendedProps.location}<${"/div"}><${"/div"}> `; var details = !event.extendedProps.details ? "" : ` <${'div'}><${'div class="detail_name"'}><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.info}"><${"/use"}><${"/svg"}><${"/div"}> Details: <${"/div"}><${'div class="detail_value"'}>${event.extendedProps.details}<${"/div"}><${"/div"}> `; var startDate = new Date(event.start); var btn_startDate = 'startDate="' + startDate.getFullYear() + "-" + String(startDate.getMonth()+1).padStart(2, '0') + "-" + String(startDate.getDate()).padStart(2, '0') + '"'; var btn_startTime = startDate.getHours() == 0 ? "" : 'startTime="' + String(startDate.getHours()).padStart(2, '0') + ":" + String(startDate.getMinutes()).padStart(2, '0') + '"'; var endDate = event.end == null ? new Date(event.start) : new Date(event.end); var btn_endDate = 'endDate="' + endDate.getFullYear() + "-" + String(endDate.getMonth()+1).padStart(2, '0') + "-" + String(endDate.getDate()).padStart(2, '0') + '"'; var btn_endTime = endDate.getHours() == 0 ? "" : 'endTime="' + String(endDate.getHours()).padStart(2, '0') + ":" + String(endDate.getMinutes()).padStart(2, '0') + '"'; var html = ` <${'div class="title"'}>${event.title}<${"/div"}><${'div'}><${'div class="detail_name"'}><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.calendar}"><${"/use"}><${"/svg"}><${"/div"}> Date: <${"/div"}><${'div class="detail_value"'}>${formatDate(event.start)}<${"/div"}><${"/div"}> ${end} ${loc} ${details} <${"div"} class="add_cal_btn"><${"add-to-calendar-button"} name="${event.title}" options="'Apple','Google','iCal','Outlook.com','Yahoo'" size="2" inline="true" location="${event.extendedProps.location_raw}" ${btn_startDate} ${btn_startTime} ${btn_endDate} ${btn_endTime} timeZone="Africa/Johannesburg" ><${"/add-to-calendar-button"}><${"/div"}> `; return html; } async function getCalendarEvents(){ if(events.length > 0){ return events; } const url = "https://christiansoncampus.co.za/php/getCalendar.php"; try { const response = await fetch(url); if (!response.ok) { console.log("Invalid response", response); throw new Error(`Response status: ${response.status}`); } const jsonEvents = (await response.json()).events; parseEvents(jsonEvents); events = jsonEvents; } catch (error) { console.error(error.message); } updateEventsList(); return events; } function parseEvents(events){ for(evt of events){ evt.allDay = evt[2] == evt[3]; evt.start = parseEventDate(evt[2].value); evt.end = parseEventDate(evt[3].value); evt.title = parseFormatRuns(evt[4]); evt.extendedProps = { location: parseFormatRuns(evt[5]), location_raw: evt[5].link ? evt[5].link : evt[5].value, details: parseFormatRuns(evt[6]) }; } } function parseEventDate(dateStr){ if(dateStr) return new Date(dateStr); return null; } function parseFormatRuns(valueWithFormatRuns){ var value = ""; if(valueWithFormatRuns.link){ value = `<${"a"} class="link_in_text" target="_blank" href="${valueWithFormatRuns.link}">${valueWithFormatRuns.value}<${"/a"}>`; }else if(valueWithFormatRuns.formatRuns.length > 0){ var prevStart = valueWithFormatRuns.value.length; for(var i = valueWithFormatRuns.formatRuns.length-1; i >= 0; i--){ var run = valueWithFormatRuns.formatRuns[i]; var start = run.start || 0; var runVal = valueWithFormatRuns.value.substring(start, prevStart); if(run.link){ runVal = `<${"a"} class="link_in_text" target="_blank" href="${run.link}">${runVal}<${"/a"}>`; } value = runVal + value; prevStart = start; } }else{ value = valueWithFormatRuns.value || ""; } return value; } function setupTabs(){ const tabs = { list: document.querySelector(`a[href="#calTabList"]`), month: document.querySelector(`a[href="#calTabMonth"]`) }; const tabPages = { list: document.querySelector(`#calListTabPage`), month: document.querySelector(`#calMonthTabPage`) }; tabs.list.addEventListener("click", (e) => { e.preventDefault(); if(tabs.list.dataset.active == "true") return; setBtnActive(tabs.list); setBtnInactive(tabs.month); tabPages.list.classList.add("active"); tabPages.month.classList.remove("active"); }); tabs.month.addEventListener("click", (e) => { e.preventDefault(); if(tabs.month.dataset.active == "true") return; setBtnInactive(tabs.list); setBtnActive(tabs.month); tabPages.list.classList.remove("active"); tabPages.month.classList.add("active"); calendar.today(); }); setBtnActive(tabs.list); setBtnInactive(tabs.month); } function setBtnActive(ele){ ele.dataset.active = "true"; ele.classList.add("active"); ele.querySelector("use").setAttribute("xlink:href", icons.checked); } function setBtnInactive(ele){ ele.dataset.active = "false"; ele.classList.remove("active"); ele.querySelector("use").setAttribute("xlink:href", icons.block); } function updateEventsList(){ const eventsList = document.querySelector(`#cal_events_list`); var html = ""; if(events.length == 0){ html += `<${"div"} class="message">No events to display<${"/div"}>`; }else{ for (var event of events) { var end = ""; if(event.end) end = `<${"div"} >Until ${formatDate(event.end)}<${"/div"}>`; var loc = ""; if(event.extendedProps.location != null && event.extendedProps.location.length > 0) loc = `<${"div"} class="location flex"><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.location}"><${"/use"}><${"/svg"}><${"/div"}><${"div"} class="normal_line_height"> ${event.extendedProps.location} <${"/div"}><${"/div"}>`; var details = ""; if(event.extendedProps.details != null && event.extendedProps.details.length > 0) details = `<${"div"} class="details flex"><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.info}"><${"/use"}><${"/svg"}><${"/div"}><${"div"} class="normal_line_height"> ${event.extendedProps.details} <${"/div"}><${"/div"}>`; var startDate = new Date(event.start); var btn_startDate = 'startDate="' + startDate.getFullYear() + "-" + String(startDate.getMonth()+1).padStart(2, '0') + "-" + String(startDate.getDate()).padStart(2, '0') + '"'; var btn_startTime = startDate.getHours() == 0 ? "" : 'startTime="' + String(startDate.getHours()).padStart(2, '0') + ":" + String(startDate.getMinutes()).padStart(2, '0') + '"'; var endDate = event.end == null ? new Date(event.start) : new Date(event.end); var btn_endDate = 'endDate="' + endDate.getFullYear() + "-" + String(endDate.getMonth()+1).padStart(2, '0') + "-" + String(endDate.getDate()).padStart(2, '0') + '"'; var btn_endTime = endDate.getHours() == 0 ? "" : 'endTime="' + String(endDate.getHours()).padStart(2, '0') + ":" + String(endDate.getMinutes()).padStart(2, '0') + '"'; html += `<${"div"} class="event"><${"div"} class="date"><${"div"}>${new Date(event.start).toLocaleDateString('en-GB', { month:"short", day:"numeric"})}<${"/div"}><${"/div"}><${"div"} class="content"><${"div"} class="name">${event.title}<${"/div"}><${"div"} class="full-date flex"><${"div"} class="my_icon"><${"svg"} aria-labelledby="icon-title"><${"title"} id="icon-title">calendar<${"/title"}><${"use"} xlink:href="${icons.calendar}"><${"/use"}><${"/svg"}><${"/div"}><${"div"} class="normal_line_height"><${"div"}>Date: ${formatDate(event.start)}<${"/div"}> ${end} <${"/div"}><${"/div"}> ${loc} ${details} <${"div"} class="add_cal_btn"><${"add-to-calendar-button"} name="${event.title}" options="'Apple','Google','iCal','Outlook.com','Yahoo'" size="2" inline="true" location="${event.extendedProps.location_raw}" ${btn_startDate} ${btn_startTime} ${btn_endDate} ${btn_endTime} timeZone="Africa/Johannesburg" ><${"/add-to-calendar-button"}><${"/div"}><${"/div"}><${"/div"}>`; } } eventsList.innerHTML = html; } function formatDate(date){ if(date.getHours() == 0) return date.toLocaleDateString('en-GB', { weekday: "short", day:"numeric", month:"short", year:"numeric"}); return date.toLocaleDateString('en-GB', { weekday: "short", day:"numeric", month:"short", year:"numeric", hour: "numeric", minute: "numeric"}); }

Announcements

Holy Word for Morning Revival Book OrdersAll book orders must go through the order form. Each new HWMR requires you to fill in the form again and attach the proof of payment.
Porch MeetingsPorch meeting will run from 16 Feb to 23 March. Please pray for these meetings. For more information, speak to Jandries
Stellenbosch Bible DistributionBibles are being distributed. Please pray for the Word to bear fruit in the hearts of the receivers. For more information, speak to Gustav
National Blending ConferenceThe conference held in Midrand it amarvelous ooppertunity to blend with saints from all over southern Africa. 8-9 March (See Calendar)
Cape Town ConferenceConference Registration is now open. (See details here)

Monday Fellowship Zoom

You will be redirected to the Zoom meeting.If you have any difficulty, the meeting details are below:ID: 977 0826 2252
Passcode: 497101

Lord's Day Zoom

You will be redirected to the Zoom meeting.If you have any difficulty, the meeting details are below:ID: 990 7993 0336
Passcode: 923241

Students Zoom

You will be redirected to the Zoom meeting.If you have any difficulty, the meeting details are below:ID: 923 8314 6279
Passcode: 009131

Prayer Zoom

You will be redirected to the Zoom meeting.If you have any difficulty, the meeting details are below:ID: 978 3495 5846
Passcode: 756531

HWMR Book Orders

HWMR orders has been closed

HWMR Book Orders

Title:
Chapters 5 through 8 of Romans—the Kernel of the Bible
(from International Chinese Speaking Conference)
Cut off date: TBACOST:
HMWR: R50 (Includes 1 volumes)

const orderObj = {}; const hwmrCost = 50; const mmCost = 120; const payBtnHTML = "Pay R0"; const payBtnLoadingHTML = "
.
Please wait..."; var loading = false; var loader; function updateDetails(){ if(!loading){ orderObj.name = document.getElementById("name").value; orderObj.surname = document.getElementById("surname").value; orderObj.email = document.getElementById("email").value; orderObj.hwmr = document.getElementById("hwmr").value; orderObj.mm = document.getElementById("mm").value; orderObj.location = document.querySelector("#location option:checked").value; calcCost(); } } function calcCost(){ if(!isNaN(orderObj.hwmr) && typeof !isNaN(orderObj.mm)){ orderObj.cost = (orderObj.hwmr * hwmrCost) + (orderObj.mm * mmCost); document.getElementById("amount").innerHTML = orderObj.cost; } } function toggleLoading(){ loading = !loading; document.getElementById("formContainer").classList.toggle("disabled"); if(!loader) initiateLoader(); loader.classList.toggle("hidden"); return; if(loading){ document.getElementById("payBtn").innerHTML = payBtnLoadingHTML; }else{ document.getElementById("payBtn").innerHTML = payBtnHTML; } } function initiateLoader(){ var x = document.createElement("div"); x.innerHTML = "Loading... Please wait"; x.classList.add("loader"); x.classList.add("hidden"); document.body.append(x); loader = x; } async function payment(){ if(!loading && validate()){ toggleLoading(); let uuid = await saveAndGetUUID(); window.payfast_do_onsite_payment({"uuid":uuid}, function (result) { toggleLoading(); if (result === true) { paymentResultSuccess(); } else { paymentResultCancelled(); } }); setTimeout(function(){ document.querySelector(".payfast_compact_payment_modal").style.zIndex = "10"; }, 100); } } function validate(){ var valid = true; var nameValid = orderObj.name && orderObj.name.length > 2; setFieldValidity("name", nameValid); var surnameValid = orderObj.surname && orderObj.surname.length > 2; setFieldValidity("surname", surnameValid); var emailValid = orderObj.email && orderObj.email.length > 2 && orderObj.email.indexOf("@") > -1 && orderObj.email.split("@")[0].length > 0 && orderObj.email.split("@")[1].length > 0; setFieldValidity("email", emailValid); var hwmrValid = orderObj.hwmr && !isNaN(orderObj.hwmr) && orderObj.hwmr > 0; setFieldValidity("hwmr", hwmrValid); return nameValid && surnameValid && emailValid && hwmrValid; } function setFieldValidity(fieldId, valid){ var error = document.getElementById(fieldId).parentNode.querySelector(".error-message"); if(valid){ error.innerHTML = ""; } else{ error.innerHTML = "This field is required"; } } async function saveAndGetUUID(){ orderObj.amount = orderObj.cost; orderObj.item_name = "HWMR Order"; console.log(orderObj); let result = await http("POST", "https://christiansoncampus.co.za/php/cictn/SaveRecordAndGetIdentifier.php", orderObj); console.log(result); const json = JSON.parse(result); orderObj.id = json.recordID; return json.identifier; } function http(method, url, jsonBody) { return new Promise(function (resolve, reject) { let xhr = new XMLHttpRequest(); xhr.open(method, url, true); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onload = function () { if (this.status >= 200 && this.status < 300) { resolve(xhr.response); } else { reject({ status: this.status, statusText: xhr.statusText }); } }; xhr.onerror = function () { reject({ status: this.status, statusText: xhr.statusText }); }; xhr.send(JSON.stringify(jsonBody)); }); } function paymentResultSuccess(){ console.log("success"); displaySuccess(); } function displaySuccess(){ const payment_table_id_tds= document.querySelectorAll(".payment_table_id td"); payment_table_id_tds[0].innerHTML = "Order ID: "; payment_table_id_tds[1].innerHTML = orderObj.id; const payment_table_hwmr_tds= document.querySelectorAll(".payment_table_hwmr td"); payment_table_hwmr_tds[0].innerHTML = "HWMR (R" + hwmrCost + "): "; payment_table_hwmr_tds[1].innerHTML = orderObj.hwmr + " sets"; const payment_table_mm_tds= document.querySelectorAll(".payment_table_mm td"); payment_table_mm_tds[0].innerHTML = "Ministry Mag (R" + mmCost + "): "; payment_table_mm_tds[1].innerHTML = orderObj.mm + " books"; const payment_table_total_tds= document.querySelectorAll(".payment_table_total td"); payment_table_total_tds[0].innerHTML = "Total Payment: "; payment_table_total_tds[1].innerHTML = "R" + orderObj.cost + " Paid"; toggleDialog(null, 'paymentSuccessDialog'); } function paymentResultCancelled(){ console.log("cancelled"); toggleDialog(null, 'paymentCancelledDialog'); } function dismissSuccesDialog(event){ toggleDialog(event, 'paymentSuccessDialog'); toggleLoading(); location.reload(); } function toggleDialog(event, id){ if(event){ if(event.target != event.currentTarget){ return; } event.preventDefault(); event.stopPropagation(); } document.getElementById(id).classList.toggle("show"); }
Each set contains 1 volume. R50 per set.
Pay R0

Video Training Registration

Title:
Experiencing, Enjoying, and Expressing Christ (3)
Cut off date: 29 AprilCOST:
R100 per person

const pricePerPerson = 100; const maxParticipants = 10; let participants = 1; let recordIDs; var loading = false; var loader; const formContainer = document.getElementById("vt_formContainer"); function addParticipant() { console.log("addParticipant"); if (participants.length >= maxParticipants) { alert("You cannot add more than 20 participants."); return; } const template = document.getElementById("additionalParticipantTemplate").content.firstElementChild.cloneNode(true); console.log("formContainer", formContainer); console.log("template", template); formContainer.appendChild(template); participants++; updateTotalCost(); } function removeParticipant(button) { const participantDiv = button.parentNode; const index = Array.from(formContainer.children).indexOf(participantDiv); participants--; participantDiv.remove(); updateTotalCost(); } function updateTotalCost() { totalCost = participants * pricePerPerson; document.getElementById("totalCost").innerText = totalCost; } updateTotalCost(); function submitRegistration() { const inputBlocks = formContainer.querySelectorAll(".participant"); let isValid = true; const participants = []; inputBlocks.forEach((block, i) => { const inputs = block.querySelectorAll("input, select"); const values = {}; for(var input of inputs){ if (!input.checkValidity()) { isValid = false; input.reportValidity(); break; } values[input.name] = input.value; } participants.push(values); }); if (!isValid) { return; } console.log("Registration Data:", participants); payment(participants); } function toggleLoading(){ loading = !loading; formContainer.classList.toggle("disabled"); if(!loader) initiateLoader(); loader.classList.toggle("hidden"); } function initiateLoader(){ var x = document.createElement("div"); x.innerHTML = "Loading... Please wait"; x.classList.add("loader"); x.classList.add("hidden"); document.body.append(x); loader = x; } async function payment(participants){ if(!loading){ toggleLoading(); let uuid = await saveAndGetUUID(participants); console.log(uuid); window.payfast_do_onsite_payment({"uuid":uuid}, function (result) { toggleLoading(); if (result === true) { paymentResultSuccess(participants); } else { paymentResultCancelled(); } }); setTimeout(function(){ document.querySelector(".payfast_compact_payment_modal").style.zIndex = "10"; }, 100); } } async function saveAndGetUUID(participants){ const order = {}; order.participants = participants; order.amount = totalCost; order.item_name = "VT Registration"; const url = "https://christiansoncampus.co.za/php/cictn/vt/SaveRecordAndGetIdentifier.php"; const testUrl = "http://localhost/lsmvideo/SaveRecordAndGetIdentifier.php"; let result = await http("POST", url, order); console.log(result); const json = JSON.parse(result); recordIDs = json.recordIDs; return json.identifier; } async function deleteDeclinedRecords(){ const url = "https://christiansoncampus.co.za/php/cictn/vt/DeleteDeclinedRecords.php"; const testUrl = "http://localhost/lsmvideo/DeleteDeclinedRecords.php"; let result = await http("POST", url, {ids: recordIDs}); console.log(result); } function http(method, url, jsonBody) { return new Promise(function (resolve, reject) { let xhr = new XMLHttpRequest(); xhr.open(method, url, true); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onload = function () { if (this.status >= 200 && this.status < 300) { resolve(xhr.response); } else { reject({ status: this.status, statusText: xhr.statusText }); } }; xhr.onerror = function () { reject({ status: this.status, statusText: xhr.statusText }); }; xhr.send(JSON.stringify(jsonBody)); }); } function paymentResultSuccess(participants){ console.log("success"); const payment_table_total_tds= document.querySelectorAll("#vt_paymentSuccessDialog .payment_table_total td"); payment_table_total_tds[0].innerHTML = "Total Payment: "; payment_table_total_tds[1].innerHTML = "R" + totalCost + " Paid"; const existing = document.querySelectorAll("#vt_paymentSuccessDialog .payment_table_participant"); for(var div of existing){ div.parentNode().removeChild(div); } const parentElement = document.querySelector("#vt_paymentSuccessDialog .payment-success-table tbody"); for(var p of participants){ const template = document.getElementById("successDialogParticipant").content.firstElementChild.cloneNode(true); const participant_tds= template.querySelectorAll("td"); participant_tds[0].innerHTML = p.Name + " " + p.Surname; participant_tds[1].innerHTML = "R" + pricePerPerson; parentElement.insertBefore(template, payment_table_total_tds[0].parentNode); } toggleDialog(null, 'vt_paymentSuccessDialog'); } function paymentResultCancelled(){ console.log("cancelled"); deleteDeclinedRecords(); toggleDialog(null, 'vt_paymentCancelledDialog'); } function dismissSuccesDialog(event){ toggleDialog(event, 'vt_paymentSuccessDialog'); toggleLoading(); location.reload(); } function toggleDialog(event, id){ if(event){ if(event.target != event.currentTarget){ return; } event.preventDefault(); event.stopPropagation(); } document.getElementById(id).classList.toggle("show"); }

Video Training Registration

Title:
Experiencing, Enjoying, and Expressing Christ (3)
Cape Town Training Date: 4-13 July
Cut off date: 29 April
COST:
R100 per person

Registration is now closed