<?php
session_start();
if(isset($_SESSION['officer'])){
    $username = $_SESSION['officer'];

?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <meta charset="utf-8" />
    <?php include('../admin/includes/styles.php'); ?>
    <title> View Clergy | <?php echo $church_name; ?></title>
   <style>
    #user{
        display: none;
    }
    </style>
</head>
<style>
.text-uppercase {
        text-transform: uppercase !important;
        letter-spacing: 0 !important;
    }
    @media screen {
        #printSection {
            display: none;
        }

        .printspan, .bible{
            display: none !important;
        }

        .bibles{
            font-size: 72px;
        }

        .bank, .bankd, .copy {
            display: none;
        }
    }

    @media print {
        span {

        }

    @media print {

        body {
            color: black;
            font-style: normal;
            text-rendering: optimizeLegibility;
            height: auto;
            margin-left: 0;
        }
        .printspan{
            font-size: 14pt !important;
            margin-left: -60px !important;
            margin-right: 0 !important;
            padding-top: 10px;
        }
.col-lg-3{
    padding-right: 0 !important;
}
        .printscreen{
            display: none !important;
        }
        .biblescreen{
            display: none !important;
        }
    }
        .bible{
            font-size: 14pt !important;
            padding-top: 10px;
        }

        .bank{
            font-size: 12pt !important;
            padding-top: 20px;
        }

        .bankd{
            font-size: 12pt !important;
            padding-top: 5px;
        }

        .copy{
             font-size: 12pt !important;
            font-style: normal;
            font-style: italic;
             padding-top: 20px;
         }

        .bibles{
            font-size: xxx-large !important;
            padding-top: 10px;
            padding-bottom: 10px;
        }

        body, #main-container  *  {
            visibility:hidden;

        }
        #printSection, #printSection * {
            visibility:visible;
        }
        #printSection {
            position:absolute;
            left:0;
            top:0;
        }


    }

    #notify{
        animation:signup-response 0.5s 1;
        -webkit-animation:signup-response 0.5s 1;
        animation-fill-mode: forwards;

        animation-delay:2s;
        -webkit-animation-delay:2s; /* Safari and Chrome */
        -webkit-animation-fill-mode: forwards;

    }

    @keyframes signup-response{
        from {opacity :1;}
        to {opacity :0;}
    }

    @-webkit-keyframes signup-response{
        from {opacity :1;}
        to {opacity :0;}
    }

</style>
<?php

?>

<body class="fixed-header dashboard">
<?php include('includes/sidebar.php'); ?>
<?php $base_url = $conn->base_url(); ?>
    <?php
      if(isset($_GET['clergy'])){
          $clergy_id = $_GET['clergy'];
          $sql = "SELECT * FROM clergy WHERE id =:id";
          $conn->query($sql);
          $conn->bind(":id", $clergy_id);
          $result = $conn->fetchSingle();
          $db_id = $result->id;
          if($clergy_id == $db_id){
              $clergy_name = $result->name;
              $sex = $result->sex;
              $designation = $result->designation;
              $reg_date = $result->reg_date;
              $phone = $result->phone;
              $address = $result->address;
              $username = $result->username;
              $email = $result->email;
              $church = $result->church;
              $bible = $result->bible;




    ?>

<div class="page-container ">
    <?php include('includes/header.php'); ?>
    <!-- END HEADER -->
    <!-- START PAGE CONTENT WRAPPER -->
    <div class="page-content-wrapper ">
        <!-- START PAGE CONTENT -->
        <div class="content ">
            <!-- START CONTAINER FLUID -->
            <div class=" container-fluid   container-fixed-lg">
                <!-- START BREADCRUMB -->
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php echo $base_url; ?>">Home</a></li>
                    <li class="breadcrumb-item"><a href="<?php echo $base_url; ?>clergy">Clergy</a></li>
                    <li class="breadcrumb-item active">View Clergy</li>
                </ol>
                <!-- END BREADCRUMB -->
                <div class="row m-t-50">
                <div class="col-lg-4">
                        <div id="card-linear" class="card card-default">
                            <!-- <div class="card-header">
                                <div class="card-title">
                                </div>
                                <div class="card-controls">
                                    <ul>
                                        <li><a href="#" class="card-collapse" data-toggle="collapse"><i class="card-icon card-icon-collapse"></i></a>
                                        </li>
                                        <li><a href="#" id="" class="card-refresh" data-toggle="refresh"><i class="card-icon card-icon-refresh"></i></a>
                                        </li>
                                        <li><a href="#" class="card-close" data-toggle="close"><i class="card-icon card-icon-close"></i></a>
                                        </li>
                                    </ul>
                                </div>
                            </div> -->
                            <div class="card-body">
                            
                            <?php
                                if(empty($photo)){
                                    ?> <p style="text-align: center;">
                                    <div class='icon-container'>
                                    <img class="thumbnail-wrapper circular shadow" src="<?php echo $base_url; ?>images/default.jpg" alt="No image set"  height="150px" width="150px">
                                    </div></p><?php
                                }else{
                                    ?> <p style="text-align: center;">
                                    <div class='icon-container'>
                                    <img class="thumbnail-wrapper circular shadow" src="<?php echo $base_url; ?>upload/<?php echo $photo; ?>" alt="<?php echo $photo; ?>" height="150px" width="150px">
                                    </div></p><?php
                                }
                                ?>

                                        <div class="m-t-30 text-center">
                                        <h4><?php echo $clergy_name; ?></h4>
                                        </div>

                                       

                                      
                                        
                                        <div class="text-center" style="color: #288855;width: 225px;padding: 6px;border-radius: 15.5px;background-color: rgba(184,251,215,.2);margin: 47px auto;font-weight: 600;"><a href="javascript:void(0); " data-toggle="modal" data-target="#generateprint" style="font-weight: 700;color:#288855">
                                        Generate Registration Slip </a> </div>



                        


                            
                            </div>
                        </div>
                        <!-- <div id="card-linear-color" class="card card-default">
                            <div class="card-header  ">
                                <div class="card-title">Announcements
                                </div>
                                <div class="card-controls">
                                    <ul>
                                        <li><a href="#" class="card-collapse" data-toggle="collapse"><i class="card-icon card-icon-collapse"></i></a>
                                        </li>
                                        <li><a href="#" id="newsreload" onclick="loadDoc()" class="card-refresh" data-source="add-member-new.php" data-toggle="refresh"><i class="card-icon card-icon-refresh"></i></a>
                                        </li>
                                        <li><a href="#" class="card-close" data-toggle="close"><i class="card-icon card-icon-close"></i></a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="card-body" id="news">
                                <?php include('notice.php'); ?>
                            </div>
                        </div> -->
                    </div>
                    <div class="col-xl-8 col-lg-8">
                <div class="card card-borderless">
                  <ul class="nav nav-tabs nav-tabs-simple d-none d-md-flex d-lg-flex d-xl-flex" role="tablist" data-init-reponsive-tabs="dropdownfx">
                    <li class="nav-item">
                      <a class="active" data-toggle="tab" role="tab" data-target="#tab2profile" href="#">Profile</a>
                    </li>
                    <!-- <li class="nav-item">
                      <a href="#" data-toggle="tab" role="tab" data-target="#tab2settings">Settings</a>
                    </li> -->
                  </ul><div class="nav-tab-dropdown cs-wrapper full-width d-lg-none d-xl-none d-md-none"></div>
                  <div class="tab-content">
                    <div class="tab-pane active" id="tab2profile">
                      <div class="row column-seperation">
                        <div class="col-lg-6">
                        <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Joining Date
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php  
                                                $orgDate = $reg_date;  
                                                $newDate = date("l, jS F, Y h:i A", strtotime($orgDate)); 
                                            ?>
                                            <?php echo $newDate; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data -->
                        <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Designation
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $designation; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                            <!-- profile data -->
                        <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Church
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $church; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                            <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Email Address
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $email; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data --> 
                        
                        <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                               Bible Study Group
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $bible; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data -->
                          

                        </div>
                        <div class="col-lg-6">
                            <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Total Time in System
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php 
                                            $date = date("$reg_date");
                                            $today = date("Y-m-d H:i:s");
                                            $diff = date_diff(date_create($date), date_create($today));
                                            echo $diff->format('%yyr %mmo %dd %Hh %Im %Ss'); ?>
                                            
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data -->
                          
                        <!-- profile data -->
                           <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Sex
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $sex; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data -->
                           <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Phone Number
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $phone; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data -->
                       
                            <!-- profile data -->
                        <div class="b-b b-grey m-t-30">
                                        <div class="padding-10">
                                            <div class="clearfix">
                                            <p class="bold v-align-middle pull-left no-margin">
                                                Residential Address
                                            </p>
                                            <p class="text-right v-align-middle pull-right no-margin">
                                            <?php echo $address; ?>
                                            </p>
                                            </div>
                                        </div>
                        </div>
                        <!-- profile data -->
                            
                          
                        </div>

                        <div class="text-center" style="color: #288855;width: 124px;padding: 6px;border-radius: 15.5px;background-color: rgba(184,251,215,.2);margin: 50px auto;font-weight: 600;"><a href="<?php echo $main_url;?>/conference/edit-clergy/<?php echo $clergy_id;?>" style="font-weight: 700;color:#288855">
                                        Edit <svg style="height: 16px;width: 16px;display: inline-block;" data-v-3072428e="" viewBox="0 0 16 16" width="1em" height="1em" focusable="false" role="img" aria-label="pencil" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi-pencil b-icon bi"><title data-v-3072428e="">Update details</title><g data-v-3072428e=""><path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"></path></g></svg>
                                        </a> </div>
                      </div>
                    </div>

                    
                   
            </div>
        </div>
                        
                    </div>
                    


                </div>
                </div>
            </div>
            <!-- END CONTAINER FLUID -->
        </div>
        <!-- END PAGE CONTENT -->


        <?php include('../admin/includes/foot.php'); ?>
    </div>
    <!-- END PAGE CONTENT WRAPPER -->
</div>





<!-- END QUICKVIEW-->

<?php include('../admin/includes/footer.php'); ?>
<!--        Printout Modal Start-->
<!-- Modal -->
<div class="modal fade slide-up disable-scroll" id="generateprint" tabindex="-1" role="dialog" aria-hidden="false">
    <div class="modal-dialog ">
        <div class="modal-content-wrapper">
            <div class="modal-content text-center" >
                <div class="modal-header clearfix" style="display: block">
                    <button aria-label="" type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="pg-icon">close</i>
                    </button>

                    <div id="notify" class="alert alert-success" style=" width: 100%; margin-top: 23px; display: flex; "role="alert">
                        <button aria-label="" class="close" data-dismiss="alert" style="position: absolute; right: 25px;top: 30px;"></button>
                        <strong><i class="pg-icon">tick_circle </i></strong>Printout generated successfully
                    </div>


                    <h5 style="margin-bottom: -6px"><span class="semi-bold">Registration Receipt</span></h5>
                    <p class="p-b-10">Please confirm before printing</p>
                </div>
                <div class="modal-body">
                   <div class="row d-flex" id="printThis">
                       <div class="col-xl-12 d-flex printscreen" style="font-size: 12px;"><div class="col-lg-6 text-right"><span class="text-uppercase bold">Name: </span></div>
                           <div class="col-lg-6 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $clergy_name; ?></span></div></div>

                       <div class="col-xl-12 d-flex printspan" style="font-size: 16px; padding-right: 0"><div class="col-lg-3 text-right"><span class="text-uppercase">Name:&nbsp; </span></div>
                           <div class="col-lg-9 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $clergy_name; ?></span></div></div>

                       <div class="col-xl-12 d-flex printscreen" style="font-size: 12px;"><div class="col-lg-6 text-right"><span class="text-uppercase bold">Designation: </span></div>
                           <div class="col-lg-6 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $designation; ?></span></div></div>

                       <div class="col-xl-12 d-flex printspan" style="font-size: 12px; padding-right: 0"><div class="col-lg-3 text-right"><span class="text-uppercase">Designation: &nbsp;</span></div>
                           <div class="col-lg-9 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $designation; ?></span></div></div>

                           <div class="col-xl-12 d-flex printscreen" style="font-size: 12px;"><div class="col-lg-6 text-right"><span class="text-uppercase bold">Gender: </span></div>
                               <div class="col-lg-6 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $sex; ?></span></div></div>

                       <div class="col-xl-12 d-flex printspan" style="font-size: 12px;  padding-right: 0"><div class="col-lg-3 text-right"><span class="text-uppercase">Gender: &nbsp;</span></div>
                           <div class="col-lg-9 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $sex; ?></span></div></div>

                               <div class="col-xl-12 d-flex printscreen" style="font-size: 12px;"><div class="col-lg-6 text-right"><span class="text-uppercase bold">Church: </span></div>
                                   <div class="col-lg-6 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $church; ?></span></div></div>

                       <div class="col-xl-12 d-flex printspan" style="font-size: 12px; padding-right: 0"><div class="col-lg-3 text-right"><span class="text-uppercase">Church: &nbsp;</span></div>
                           <div class="col-lg-9 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo $church; ?></span></div></div>

                                   <div class="col-xl-12 d-flex printscreen" style="font-size: 12px;"><div class="col-lg-6 text-right"><span class="text-uppercase bold">Reg. Date: </span></div>
                                       <div class="col-lg-6 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo date('jS F, Y'); ?></span></div></div>

                       <div class="col-xl-12 d-flex printspan" style="font-size: 12px; padding-right: 0"><div class="col-lg-3 text-right"><span class="text-uppercase">Reg. Date: &nbsp;</span></div>
                           <div class="col-lg-9 text-left" style="padding-left: 0; text-wrap: none !important;"><span class="text-uppercase bold"><?php echo date('d F, Y'); ?></span></div></div>

                                       <div class="col-xl-12 d-flex printscreen" style="font-size: 12px;"><div class="col-lg-6 text-right"><span class="text-uppercase bold">Reg. Time: </span></div>
                        <div class="col-lg-6 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo date('h:i A'); ?></span></div>
                                       </div>

                       <div class="col-xl-12 d-flex printspan" style="font-size: 12px; padding-right: 0"><div class="col-lg-3 text-right"><span class="text-uppercase">Reg. Time: &nbsp;</span></div>
                           <div class="col-lg-9 text-left" style="padding-left: 0"><span class="text-uppercase bold"><?php echo date('h:i A'); ?></span></div>
                       </div>

                       <!--<div class="col-xl-12 text-center m-t-10 biblescreen" style="font-size: 12px;"><span class="text-uppercase bold">BIBLE STUDY GROUP</span></div>-->

                       <!--<div class="col-xl-12 text-center m-t-10 bible" style="font-size: 12px;"><span class="text-uppercase bold">BIBLE STUDY GROUP</span></div>-->

                       <!--<div class="col-xl-12 text-center m-t-20 bibles"><span style="font-size: 62pt" class="text-uppercase bold"><?php $letter = chr(rand(65,74)); echo $letter; ?></span></div>-->



                       <div class="col-xl-12 text-center m-t-20 biblescreen" style="font-size: 12px;"><span class="text-uppercase bold">NCFI Account Information</span></div>

                       <div class="col-xl-12 text-center m-t-20 bank" style="font-size: 12px;"><span class="text-uppercase bold">NCFI Account Information</span></div>

                       <div class="col-xl-12 text-center biblescreen" style="font-size: 12px;"><span class="text-uppercase bold">Zenith Bank | 1015662210</span></div>

                       <div class="col-xl-12 text-center bankd" style="font-size: 12px;"><span class="text-uppercase bold">Zenith Bank | 1015662210</span></div>


                       <div style="margin-top: 20px" class="col-xl-12 text-center biblescreen"><span style="font-size: 10px" class="">©Copyright GoltStudios</span></div>

                       <div style="margin-top: 20px" class="col-xl-12 text-center copy"><span style="font-size: 12px" class="copy">©Copyright GoltStudios</span></div>



                   </div>


                        <div class="col-xl-12 m-t-50">
                            <button aria-label="" type="submit" id="btnPrint" class="btn btn-primary btn-lg btn-animated from-left">
                                <span>Print Receipt</span>
                                <span class="hidden-block">
													<i class="pg-icon">tick_circle</i>
												</span></button>
                        </div>

                </div>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
</div>
<!-- /.modal-dialog -->
<!--        Printout Modal End-->

<script>
    $('[data-toggle="tooltip"]').tooltip();
</script>
<script>
        document.getElementById("btnPrint").onclick = function () {
            printElement(document.getElementById("printThis"));
        }

        function printElement(elem) {
            var domClone = elem.cloneNode(true);

            var $printSection = document.getElementById("printSection");

            if (!$printSection) {
                var $printSection = document.createElement("div");
                $printSection.id = "printSection";
                document.body.appendChild($printSection);
            }

            $printSection.innerHTML = "";
            $printSection.appendChild(domClone);
            window.print();
        }

    </script>

<script>
    const s = document.getElementById("notify");
    s.addEventListener("animationend", (ev) => {
        if (ev.type === "animationend") {
            s.style.display = "none";
        }
    }, false);
</script>




<?php
}else{
    ?>
    
  <?php include('session.php'); ?>

    <?php

}
      }}
?>