<?php

//Include the common file
require_once 'common.php';

$meta = $db->fetchRowAssoc("SELECT * FROM " . cfg('base', 'table_pages') . " p, " . cfg('base', 'table_page_translations') . " t  WHERE p.page_id = 4 AND t.language_code = '" . $site_lang . "' AND p.page_id = t.page_id LIMIT 1");

$og_type ='website';
$og_image = cfg('base', 'site_url').'templates/assets/img/og_logo.png';
$og_video_url = '';
$og_video_type = '';
$og_video_width = '';
$og_video_height = '';

$tw_card = 'summary';
$tw_video_url = '';
$tw_video_width = '';
$tw_video_height= '';

$sql = "SELECT * FROM " . cfg('base', 'table_partners') . " WHERE partner_status = 1 ORDER BY partner_name ASC";

//Partners
$partners = array();

foreach ($db->query($sql) as $row) {

    $partners[] = array(
        'partner_image'     => $row['partner_image'],
        'partner_url'       => $row['partner_url'],
        'partner_name'      => $row['partner_name']
    );

}

//Navigation class
$current_extra = 'class="current"';
$current_partners = 'class="current"';

//Template values
$tpl->set('title', $meta['page_title']);
$tpl->set('keywords', $meta['page_meta_keywords']);
$tpl->set('description', $meta['page_meta_description']);
$tpl->set('content', $meta['page_content']);
$tpl->set('og_type', $og_type);
$tpl->set('og_image', $og_image);
$tpl->set('og_video_url', $og_video_url);
$tpl->set('og_video_type', $og_video_type);
$tpl->set('og_video_width', $og_video_width);
$tpl->set('og_video_height', $og_video_height);

$tpl->set('tw_card', $tw_card);
$tpl->set('tw_video_url', $tw_video_url);
$tpl->set('tw_video_width', $tw_video_width);
$tpl->set('tw_video_height', $tw_video_height);

$tpl->set('partners', $partners);

//Display navigation current class
$tpl->set('current_extra', $current_extra);
$tpl->set('current_partners', $current_partners);

//Display the template
$tpl->display('partners');
