<?php
//include 'conn.php';

$cred_db = '';
$cred_user = '';
$cred_dbpwd = '';
$cred_office = '';
$cred_loc_nbi = '';
$cred_loc_meru = '';
$cred_loc_tampa = '';
$cred_loc_india = '';
$cred_contact = '';
$cred_phone = '';
$cred_email = '';
$cred_platform = '';
$cred_link = '';
$cred_fb = '';
$cred_telegram_p = '';
$cred_telegram_m = '';
$cred_youtube = '';
$cred_instagram = '';
$cred_twitter = '';
$cred_web_logo = '';
$cred_portal_logo = '';
$cred_kenya_handbook ='';
$cred_zim_handbook ='';
$cred_prime_handbook = '';

$query = mysqli_query($conn, "SELECT * FROM system_credentials");
if(mysqli_num_rows($query)>0){
    while($row = mysqli_fetch_assoc($query)){
        if($row['category']=='Socials' && $row['platform']=='Facebook'){
            $cred_fb = $row['link'];
        }
        if($row['category']=='Socials' && $row['platform']=='Twitter'){
            $cred_twitter = $row['link'];
        }
        if($row['category']=='Socials' && $row['platform']=='Telegram Prospective'){
            $cred_telegram_p = $row['link'];
        }
        if($row['category']=='Socials' && $row['platform']=='Telegram Members'){
            $cred_telegram_m = $row['link'];
        }
        if($row['category']=='Socials' && $row['platform']=='Instagram'){
            $cred_instagram = $row['link'];
        }
        if($row['category']=='Socials' && $row['platform']=='Youtube'){
            $cred_youtube = $row['link'];
        }
        if($row['category']=='Location' && $row['office']=='Nairobi'){
            $cred_loc_nbi = $row['location'];
        }
        if($row['category']=='Location' && $row['office']=='Tampa'){
            $cred_loc_tampa = $row['location'];
        }
        if($row['category']=='Location' && $row['office']=='Meru'){
            $cred_loc_meru = $row['location'];
        }
        if($row['category']=='Location' && $row['office']=='India'){
            $cred_loc_india = $row['location'];
        }
        if($row['category']=='Contacts' && $row['contact']=='Phone'){
            $cred_phone = $row['phone'];
        }
        if($row['category']=='Contacts' && $row['contact']=='Email'){
            $cred_email = $row['email'];
        }
        if($row['category']=='Website Logo'){
            $cred_web_logo = $row['link'];
        }
        if($row['category']=='Portal Logo'){
            $cred_portal_logo = $row['link'];
        }
        if($row['category']=='Kenya Handbook'){
            $cred_kenya_handbook = $row['link'];
        }
        if($row['category']=='Zimbabwe Handbook'){
            $cred_zim_handbook = $row['link'];
        }
        if($row['category']=='Prime Handbook'){
            $cred_prime_handbook = $row['link'];
        }
    }
}


?>