<?php
require_once("../include/includes.php");
$m = new MasterClass;
$resCatInfo = $m->getResCategoryInfo();
$pages = $m->getResPages($resCatInfo['Nbr']);
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <?php
    include('../include/header/header.php');
    ?>
    <title><?php echo $resCatInfo['Name']; ?></title>
    <meta name="description" content="Resource articles and informational pages that revolve the topic of <?php echo $resCatInfo['Name']; ?>">
    <meta name="keywords" content="pregnancy, pregnancy info, pro life info, pregnancy options, <?php echo $resCatInfo['Name']; ?>">
    <meta name="author" content="WebDuckDesigns MN">
    <meta name="robots" content="index,follow">    
</head>

<body>
    <?php
    include('../include/header/navigation.php');
    ?>
    <section class="container-fluid inner-banner" style="background-image: url(<?php echo WEBSITE_ADDY; ?>/assets/images/banner.png);">
        <div class="container">
            <div class="row d-flex align-items-center">
                <div class="col-lg-12 col-12 mx-auto d-block">
                    <div class="content">
                        <h3>Pregnancy Resource Categories</h3>
                        <h1><?php echo $resCatInfo['Name']; ?></h1>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="container-fluid custom-website">
        <div class="container">
            <div class="row d-flex align-items-center">
                <div class="col-lg-12 col-12">
                    <h3 class="sec-h3">Pregnancy Resources</h3>
                    <h2 class="sec-h2 mt-lg-0 mt-2"><span>Category:</span></br><?php echo $resCatInfo['Name']; ?></h2>
                    <div class="inner-bline cbg-secondary"></div>                    
                    <?php
                    if($pages[0]['Nbr'] != ''){


                        echo '<ul class="inner-listing">';
                        for($i=0;$i<count($pages);$i++){

                            echo '<li>';
                            echo '<a href="'.WEBSITE_ADDY.'/pregnancy-resource-page/'.$pages[$i]['Url'].'" title="Read '.$pages[$i]['Name'].'">';
                            echo '<h4>'.$pages[$i]['Name'].'</h4>';
                            echo $m->trimText($pages[$i]['Content'],500);
                            echo '</a>';
                            echo '<p>';
                            echo '<a href="'.WEBSITE_ADDY.'/pregnancy-resource-page/'.$pages[$i]['Url'].'" title="Read '.$pages[$i]['Name'].'">';
                            echo '<input type="button" class="listing-btn" value="View Article"/>';
                            echo '</a>';
                            echo '</p>';
                            echo '</li>';

                        }
                        echo '</ul>';

                    }else{

                        echo '<p style="padding-top:20px;">There are no pages yet for this particular category. Please continue to check back with us as we are constantly adding new pages and information about '.$resCatInfo['Name'].'.</p>';

                    }
                    ?>
                </div>
            </div>
        </div>
    </section>
    <?php
    include('../include/footer/footer.php');
    ?>