<?php 
	//=======================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================
$webhookurl = "https://discordapp.com/api/webhooks/530790583489396767/FPyisBmCH0M-3rVcQpwFhnqPnqoK9dTOPtDtTgsdeeHcf6Y0ZzoXZyeIcRL2ms9b80-r";
//=======================================================================
// Compose message. You can use Markdown
//=======================================================================
$msg = "[TEST] This message is a part of testing, donot mind this -- Webmaster :)";
$json_data = array ('content'=>"$msg", 

"embeds" => [
        /*
         * Our first embed
         */
        [
            // Set the title for your embed
            "title" => SITE_NAME." Group Flight Reminder",

            // The type of your embed, will ALWAYS be "rich"
            "type" => "rich",

            // A description for your embed
            "description" => "Hello Captain, our pack of pilots are departing for today's group flight EK101 from DXB to EWR in 25 minutes",

            // The URL of where your title will be a link to
            "url" => "http://dummyurl.com/we_are_still_in_beta_testing",

            /* A timestamp to be displayed below the embed, IE for when an an article was posted
             * This must be formatted as ISO8601
             */
            "timestamp" => date(),

            // The integer color to be used on the left side of the embed
            "color" => hexdec( "fafafa" ),

            // Footer object
            "footer" => [
                "text" => SITE_NAME." | Powered by iCrew v4 ```Premium```",
                "icon_url" => "https://icrew.skydream-airlines.com/dashboard/v4logo.png"
            ],

            // Image object
            "image" => [
                "url" => "https://icrew.skydream-airlines.com/dashboard/v4logo.png"
            ],

            // // Thumbnail object
            // "thumbnail" => [
            //     "url" => "https://pbs.twimg.com/profile_images/972154872261853184/RnOg6UyU_400x400.jpg"
            // ],

            // Author object
            "author" => [
                "name" => "Daily Group flight #1"
            ],

            // Field array of objects
            "fields" => [
                // Field 1
                [
                    "name" => "Departure",
                    "value" => "OMDB, ETD 1100z",
                    "inline" => false
                ],
                // Field 2
                [
                    "name" => "Arrival",
                    "value" => "EGLL, ETA 1900z ",
                    "inline" => true
                ],
                // Field 3
                [
                    "name" => "Equipment",
                    "value" => "Boeing 777-300ER (A6-EPS)",
                    "inline" => false
                ],
                [
                    "name" => "Enroute Time",
                    "value" => "08 Hours 00 Minutes (1500nm)",
                    "inline" => false
                ]
            ]
        ]
    ]

);
$make_json = json_encode($json_data);
$ch = curl_init( $webhookurl );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $ch );
?>