php js css php js css

Scripts

Save Script Run
Attached Artifacts
Title
PHP Code
<?php $disabledBefore = \Components\Marketing\Automation\Progress::getDisabledIds(); \Components\Marketing\Automation\Progress::setDisabledIds(array_column(\Components\Marketing\Automation::getAll(), 'automation_id')); try { foreach ([3 => '2026-11-10 23:00:00', 4 => '2026-11-10 23:00:00', 5 => '2026-11-18 23:00:00'] as $examId => $registrationEnd) { \Components\AF\Exams::save(['exam_id' => $examId, 'exam_registration_start_datetime' => date('Y-m-d H:i:s', strtotime('2026-10-01 00:00:00')), 'exam_registration_end_datetime' => date('Y-m-d H:i:s', strtotime($registrationEnd))]); } $categoryId = \Components\AF\Memberships\Products::getProductCategoryId(); if (!$categoryId) throw new \RuntimeException('Membership product category is not configured.'); \Components\Commerce\Products\Categories::addProductToCategory(519, $categoryId); \Components\AF\Memberships\Products::save(['product_id' => 519, 'membership_products_type' => 'Individual', 'membership_products_duration' => '1 year', 'membership_products_hidden_in_course_selector' => 0]); \Components\AF\Courses\Assignments::save(['assignment_id' => 12, 'assignment_deadline' => date('Y-m-d H:i:s', strtotime('2026-10-16 23:00:00'))]); $borrowingItems = \Components\AF\Libraries\Documents\Borrowings\Items::getAll(['filter' => ['borrowing_id', 'IN', [17, 18]]]); foreach ($borrowingItems as $item) { \Components\AF\Libraries\Documents\Borrowings\Items::save(['borrowing_item_id' => $item['borrowing_item_id'], 'borrowing_item_expected_return_datetime' => date('Y-m-d H:i:s', strtotime('2026-10-27 00:00:00'))]); } $out = []; foreach ([3, 4, 5] as $id) { $out['exam_' . $id . '_registration_end'] = \Components\AF\Exams::getColumn($id, 'exam_registration_end_datetime'); } $out['membership_categories'] = \Components\Commerce\Products\Categories::getAllIdsForProduct(519); $out['assignment_deadline'] = \Components\AF\Courses\Assignments::getColumn(12, 'assignment_deadline'); $out['borrowing_items'] = \Components\AF\Libraries\Documents\Borrowings\Items::getAll(['filter' => ['borrowing_id', 'IN', [17, 18]]]); $out['membership_card_html_ready'] = (bool) \Components\AF\Memberships::generateMembershipCardHTML(1394); echo json_encode($out, JSON_PRETTY_PRINT); } finally { \Components\Marketing\Automation\Progress::setDisabledIds($disabledBefore); }

Run Log

â–¼ Today 4:33am ✓ Completed 0.2s
{
    "exam_3_registration_end": "2026-11-10 23:00:00",
    "exam_4_registration_end": "2026-11-10 23:00:00",
    "exam_5_registration_end": "2026-11-18 23:00:00",
    "membership_categories": [
        "5"
    ],
    "assignment_deadline": "2026-10-16 23:00:00",
    "borrowing_items": [
        {
            "contact_id": "1395",
            "sale_item_id": null,
            "document_id": "17",
            "document_item_id": "18",
            "borrowing_id": "18",
            "borrowing_item_id": "20",
            "borrowing_item_status": "borrowed",
            "borrowing_item_expected_return_datetime": "2026-10-27 00:00:00",
            "borrowing_item_return_method": null,
            "borrowing_item_return_datetime": null,
            "borrowing_item_renewal_id": null,
            "borrowing_item_renewed_by": null,
            "borrowing_datetime": "2026-10-06 00:59:57",
            "document_item_code": "PRESENTATION-BOOK-2-1",
            "document_item_call_number": null,
            "document_item_title": null,
            "document_item_acquisition_date": null,
            "document_item_status": "borrowed",
            "library_id": "1",
            "document_isbn": "9782090381031",
            "document_issn": null,
            "document_number": null,
            "document_part_number": null,
            "document_title": "Grammaire progressive - Presentation Demo",
            "document_subtitle": null,
            "document_synopsis": "Prepared for title \/ ISBN lookup, bulk renewal, merging and library reporting.",
            "document_comments": null,
            "document_date": null,
            "document_year": "2023",
            "document_physical_description_pages": null,
            "document_physical_description_dimensions": null,
            "document_censorship_rating": null,
            "document_is_invisible": "0",
            "document_not_borrowable": "0",
            "document_picture": null,
            "document_online_views": "0",
            "country_id": "AUS",
            "document_tags": "Book 2023 9782090381031 Maia Gregoire PRESENTATION-BOOK-2-1  Grammaire progressive - Presentation Demo",
            "document_type_id": "1",
            "librarything_import_id": null,
            "sale_item_code": null,
            "sale_item_title": null,
            "sale_item_description": null,
            "sale_item_quantity": null,
            "sale_item_price": null,
            "sale_item_price_overridden": null,
            "sale_item_tax_percent": null,
            "sale_item_total": null,
            "sale_item_total_tax": null,
            "sale_item_order_options": null,
            "sale_id": null,
            "product_id": null,
            "discount_id": null,
            "shipping_method_id": null,
            "sale_item_is_surcharge": null,
            "adjustment_sale_id": null,
            "adjustment_item_uses_credit": null,
            "sale_item_parent_id": null,
            "bought_for_contact_id": null,
            "sale_item_order_form_data": null,
            "sale_item_qbo_id": null,
            "contact_global_id": null,
            "contact_created_datetime": "2026-10-08 01:06:02",
            "contact_updated_datetime": "2026-10-08 01:19:49",
            "contact_last_online": "2026-10-08 01:06:02",
            "contact_username": null,
            "contact_email": "sophie.martin@example.invalid",
            "contact_email_secondary": null,
            "contact_email_secondary_cc": "0",
            "contact_email_marketing_status": "unsubscribed",
            "contact_email_bounce_count_soft": "0",
            "contact_email_bounce_count_hard": "0",
            "contact_general_communication_unsubscribe": null,
            "contact_cookie_token": "",
            "contact_cookie_seed": null,
            "contact_cookie_token_tracking": null,
            "contact_password_lost": null,
            "contact_password_url": null,
            "contact_password_requires_change": "0",
            "contact_password_active_datetime": null,
            "contact_type": "Individual",
            "contact_gender": null,
            "contact_title": null,
            "contact_first_name": "Sophie",
            "contact_last_name": "Martin",
            "contact_address": null,
            "contact_suburb_city": null,
            "contact_postcode": null,
            "contact_state": null,
            "contact_timezone": null,
            "contact_dob": "1995-06-15",
            "contact_company": null,
            "contact_company_number_type": null,
            "contact_company_number": null,
            "contact_company_tax_registered": "1",
            "contact_phone_home": null,
            "contact_phone_work": null,
            "contact_phone_mobile": null,
            "contact_phone_mobile_e164": null,
            "contact_phone_mobile_verification_code": null,
            "contact_phone_mobile_verification_code_datetime": null,
            "contact_phone_mobile_sms_optout": "0",
            "contact_phone_mobile_sms_bounce_count": "0",
            "contact_fax": null,
            "contact_social_facebook_url": null,
            "contact_social_twitter_url": null,
            "contact_social_linkedin_url": null,
            "contact_social_youtube": null,
            "contact_social_instagram": null,
            "contact_website": null,
            "contact_picture": null,
            "contact_profile": "0",
            "contact_profile_about": null,
            "contact_signature": null,
            "contact_page_registered": "",
            "contact_referrer_type_id": null,
            "contact_referrer_type_detail_id": null,
            "contact_referrer_url": null,
            "contact_referrer_text": null,
            "contact_screen_width": null,
            "contact_screen_height": null,
            "contact_privacy_email_unsubscribed": "0",
            "contact_privacy_no_online_status": "0",
            "contact_privacy_no_contact_messages": "0",
            "language_id": null,
            "affiliate_id": null,
            "affiliate_date": null,
            "contact_sale_balance": null,
            "contact_library_permission": "Active",
            "contact_nric": null,
            "contact_mother_tongue": null,
            "contact_age": null,
            "contact_interest": null,
            "contact_parent_phone_number_": null,
            "contact_name_of_dog": null,
            "contact_gives_presents_to_the_teacher": null,
            "contact_nationality": null,
            "contact_af_settings": "{\"theme\":\"default\",\"general_settings\":{\"show_teacher_email_in_student_portal\":false},\"notification_settings\":{\"email_student_on_new_post\":true,\"email_student_on_updated_post\":true,\"email_student_on_post_comments_and_replies\":true,\"email_student_on_new_document\":true,\"email_student_on_new_assignment\":true,\"email_student_on_assignment_graded\":true,\"email_teacher_on_new_post\":true,\"email_teacher_on_updated_post\":true,\"email_teacher_on_post_comments_and_replies\":true,\"email_teacher_on_new_assignment_submission\":true}}",
            "contact_qbo_id": null,
            "contact_cdp": null,
            "contact_photo_consent": null,
            "contact_gael_candidate_number": null,
            "contact_gael_language_id": null,
            "contact_gael_nationality_id": null,
            "contact_gael_country_of_birth_code": null,
            "contact_city_of_birth": null,
            "contact_has_disability": null,
            "contact_qbo_sync_token": null,
            "contact_file_upload": null
        },
        {
            "contact_id": "1394",
            "sale_item_id": null,
            "document_id": "16",
            "document_item_id": "16",
            "borrowing_id": "17",
            "borrowing_item_id": "19",
            "borrowing_item_status": "borrowed",
            "borrowing_item_expected_return_datetime": "2026-10-27 00:00:00",
            "borrowing_item_return_method": null,
            "borrowing_item_return_datetime": null,
            "borrowing_item_renewal_id": null,
            "borrowing_item_renewed_by": null,
            "borrowing_datetime": "2026-10-06 00:59:57",
            "document_item_code": "PRESENTATION-BOOK-1-1",
            "document_item_call_number": null,
            "document_item_title": null,
            "document_item_acquisition_date": null,
            "document_item_status": "borrowed",
            "library_id": "1",
            "document_isbn": "9782070612758",
            "document_issn": null,
            "document_number": null,
            "document_part_number": null,
            "document_title": "Le Petit Prince - Presentation Demo",
            "document_subtitle": null,
            "document_synopsis": "Prepared for title \/ ISBN lookup, bulk renewal, merging and library reporting.",
            "document_comments": null,
            "document_date": null,
            "document_year": "2023",
            "document_physical_description_pages": null,
            "document_physical_description_dimensions": null,
            "document_censorship_rating": null,
            "document_is_invisible": "0",
            "document_not_borrowable": "0",
            "document_picture": null,
            "document_online_views": "0",
            "country_id": "AUS",
            "document_tags": "Book 2023 9782070612758 Antoine de Saint-Exupery PRESENTATION-BOOK-1-1  PRESENTATION-BOOK-1-2 Le Petit Prince - Presentation Demo",
            "document_type_id": "1",
            "librarything_import_id": null,
            "sale_item_code": null,
            "sale_item_title": null,
            "sale_item_description": null,
            "sale_item_quantity": null,
            "sale_item_price": null,
            "sale_item_price_overridden": null,
            "sale_item_tax_percent": null,
            "sale_item_total": null,
            "sale_item_total_tax": null,
            "sale_item_order_options": null,
            "sale_id": null,
            "product_id": null,
            "discount_id": null,
            "shipping_method_id": null,
            "sale_item_is_surcharge": null,
            "adjustment_sale_id": null,
            "adjustment_item_uses_credit": null,
            "sale_item_parent_id": null,
            "bought_for_contact_id": null,
            "sale_item_order_form_data": null,
            "sale_item_qbo_id": null,
            "contact_global_id": null,
            "contact_created_datetime": "2026-10-08 01:06:02",
            "contact_updated_datetime": "2026-10-08 01:19:48",
            "contact_last_online": "2026-10-08 01:06:02",
            "contact_username": null,
            "contact_email": "alex.bennett@example.invalid",
            "contact_email_secondary": null,
            "contact_email_secondary_cc": "0",
            "contact_email_marketing_status": "unsubscribed",
            "contact_email_bounce_count_soft": "0",
            "contact_email_bounce_count_hard": "0",
            "contact_general_communication_unsubscribe": null,
            "contact_cookie_token": "",
            "contact_cookie_seed": null,
            "contact_cookie_token_tracking": null,
            "contact_password_lost": null,
            "contact_password_url": null,
            "contact_password_requires_change": "0",
            "contact_password_active_datetime": null,
            "contact_type": "Individual",
            "contact_gender": "m",
            "contact_title": null,
            "contact_first_name": "Alex",
            "contact_last_name": "Bennett",
            "contact_address": "1 Demo Street",
            "contact_suburb_city": "Brisbane",
            "contact_postcode": "4000",
            "contact_state": "QLD",
            "contact_timezone": null,
            "contact_dob": "1995-06-15",
            "contact_company": null,
            "contact_company_number_type": null,
            "contact_company_number": null,
            "contact_company_tax_registered": "1",
            "contact_phone_home": null,
            "contact_phone_work": null,
            "contact_phone_mobile": null,
            "contact_phone_mobile_e164": null,
            "contact_phone_mobile_verification_code": null,
            "contact_phone_mobile_verification_code_datetime": null,
            "contact_phone_mobile_sms_optout": "0",
            "contact_phone_mobile_sms_bounce_count": "0",
            "contact_fax": null,
            "contact_social_facebook_url": null,
            "contact_social_twitter_url": null,
            "contact_social_linkedin_url": null,
            "contact_social_youtube": null,
            "contact_social_instagram": null,
            "contact_website": null,
            "contact_picture": null,
            "contact_profile": "0",
            "contact_profile_about": null,
            "contact_signature": null,
            "contact_page_registered": "",
            "contact_referrer_type_id": null,
            "contact_referrer_type_detail_id": null,
            "contact_referrer_url": null,
            "contact_referrer_text": null,
            "contact_screen_width": null,
            "contact_screen_height": null,
            "contact_privacy_email_unsubscribed": "0",
            "contact_privacy_no_online_status": "0",
            "contact_privacy_no_contact_messages": "0",
            "language_id": null,
            "affiliate_id": null,
            "affiliate_date": null,
            "contact_sale_balance": "65.0000",
            "contact_library_permission": "Active",
            "contact_nric": null,
            "contact_mother_tongue": null,
            "contact_age": null,
            "contact_interest": null,
            "contact_parent_phone_number_": null,
            "contact_name_of_dog": null,
            "contact_gives_presents_to_the_teacher": null,
            "contact_nationality": "AUS",
            "contact_af_settings": "{\"theme\":\"default\",\"general_settings\":{\"show_teacher_email_in_student_portal\":false},\"notification_settings\":{\"email_student_on_new_post\":true,\"email_student_on_updated_post\":true,\"email_student_on_post_comments_and_replies\":true,\"email_student_on_new_document\":true,\"email_student_on_new_assignment\":true,\"email_student_on_assignment_graded\":true,\"email_teacher_on_new_post\":true,\"email_teacher_on_updated_post\":true,\"email_teacher_on_post_comments_and_replies\":true,\"email_teacher_on_new_assignment_submission\":true}}",
            "contact_qbo_id": null,
            "contact_cdp": null,
            "contact_photo_consent": null,
            "contact_gael_candidate_number": null,
            "contact_gael_language_id": null,
            "contact_gael_nationality_id": "34",
            "contact_gael_country_of_birth_code": "061",
            "contact_city_of_birth": "Brisbane",
            "contact_has_disability": null,
            "contact_qbo_sync_token": null,
            "contact_file_upload": null
        }
    ],
    "membership_card_html_ready": true
}