<style>
    .social-wrapper {
        /*display: flex; */
        /* justify-content: center; */
        /* align-items: center; */
        /* height: 10%; */
        position: absolute;
        top: 10px;
        left: 50px;
        font-size: 8px;
    }

    .social-wrapper i {
        padding: 5px;
        /*text-shadow: 0px 6px 8px rgba(0, 0, 0, 0.6);
        transition: all ease-in-out 150ms;*/
        color: #ccc;
    }
    /*.wrapper a:nth-child(1) {
      color: #4867AA;
    }
    .wrapper a:nth-child(2) {
      color: #4FCE5D;
    }
    .wrapper a:nth-child(3) {
      color: #1DA1F2;
    }
    
    .wrapper a:nth-child(4) {
      color: #F58529;
    }*/
    .social-wrapper i:hover {
        /*margin-top: -3px;
        text-shadow: 0px 14px 10px rgba(0, 0, 0, 0.4);*/
        color: #000;
    }	
</style>
<style>

    /* The Modal (background) */
    .modal {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 1000; /* Sit on top */
        padding-top: 100px; /* Location of the box */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: rgb(0,0,0); /* Fallback color */
        background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }

    /* Modal Content */
    .modal-content {
        position: relative;
        background-color: #fefefe;
        margin: auto;
        padding: 0;
        border: 1px solid #888;
        width: 80%;
        box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
        -webkit-animation-name: animatetop;
        -webkit-animation-duration: 0.4s;
        animation-name: animatetop;
        animation-duration: 0.4s
    }

    /* Add Animation */
    @-webkit-keyframes animatetop {
        from {top:-300px; opacity:0} 
        to {top:0; opacity:1}
    }

    @keyframes animatetop {
        from {top:-300px; opacity:0}
        to {top:0; opacity:1}
    }

    /* The Close Button */
    .close {
        color: black;
        float: left;
        font-size: 28px;
        font-weight: bold;
    }

    .close:hover,
    .close:focus {
        color: #000;
        text-decoration: none;
        cursor: pointer;
    }

    .modal-header {
        padding: 2px 16px;
        background-color: #fafafa;
        color: black;
    }

    .modal-body {padding: 2px 16px;}

    .modal-footer {
        padding: 2px 16px;
        background-color: #fafafa;
        color: black;
    }

    .modal-footer a{
        color: red;
    }

</style>
<div class="book-body">



    <div class="body-inner">







        <div class="book-header" role="navigation" id="book-header">





            <!-- Title -->

            <h1 id="title">

                <i class="fa fa-circle-o-notch fa-spin"></i>

                <a href="#"><?php echo $article[0]->title; ?></a>

            </h1>

        </div>









        <div class="page-wrapper" tabindex="-1" role="main">

            <div class="page-inner">



                <div id="book-search-results">

                    <div class="search-noresults">



                        <section class="normal markdown-section">


                            <?php //if ($logged == 'yes') { if ($this->ion_auth->in_group($delete_article_group)) { ?> 
                            <!-- <button class="button"  id="removeModal" >حذف الدليل</button>-->
                            <?php //}} ?>
                            <h1 id="&#x627;&#x644;&#x631;&#x624;&#x64A;&#x629;-&#x648;&#x627;&#x644;&#x623;&#x647;&#x62F;&#x627;&#x641;"><?php echo $article[0]->title; ?></h1>

                            <?php echo $article[0]->text; ?>

                        </section>



                    </div>

                    <!--<div class="search-results">

                        <div class="has-results">



                            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>

                            <ul class="search-results-list"></ul>



                        </div>

                        <div class="no-results">



                            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>



                        </div>

                    </div>-->

                </div>



            </div>





            <!-- Feedback Section -->

            <?php if ($article[0]->check_rate == "تقييم") { ?>

                <div class="page-inner" id="article_rate">

                    <span class="feedback">

                        هل كانت هذه المقالة مفيدة؟

                    </span>

                    <?php if ($logged == 'yes') { ?>

                        <span id="yes_rate" class="h_btn <?php
                        if (isset($rate) && $rate != null) {

                            if ($rate[0]->rate == 'نعم') {

                                echo 'yes_rate_active';
                            }
                        }
                        ?>">نعم</span>



                        <span id="no_rate" class="h_btn <?php
                        if (isset($rate) && $rate != null) {

                            if ($rate[0]->rate == 'لا') {

                                echo 'no_rate_active';
                            }
                        }
                        ?>">لا</span>



                        <input name="article_id" type="hidden" value="<?php echo $article[0]->id; ?>" />

                        <?php
                    } else {

                        $article_rate = $this->session->userdata('article' . $article[0]->id);
                        ?>



                        <span id="yes_rate" class="h_btn <?php
                        if (isset($article_rate) && $article_rate != null) {

                            if ($article_rate == 'نعم') {

                                echo 'yes_rate_active';
                            }
                        }
                        ?>">نعم</span>

                        <span id="no_rate" class="h_btn <?php
                        if (isset($article_rate) && $article_rate != null) {

                            if ($article_rate == 'لا') {

                                echo 'no_rate_active';
                            }
                        }
                        ?>">لا</span>

                        <input name="article_id" type="hidden" value="<?php echo $article[0]->id; ?>" />

                    <?php } ?>



                </div>

            <?php } ?>





            <?php
            if ($article[0]->check_comment !== "بلا تعليقات") {

                if ($logged == 'no') {
                    ?>

                    <!-- Add Comment -->

                    <hr />

                    <div class="blog_comment_box page-inner reader_comment">

                        <h2 class="c_head">اترك تعليقاً</h2>

                        <p>لن يتم نشر بريدك الإلكتروني</p>

                        <div id="rc_results"></div>

                        <!--<form class="get_quote_form row" action="#" method="post">-->

                        <div class="comment-field">

                            <input type="text" class="form-control" id="c_name" name="r_name" placeholder="الاسم *" required="true">

                                                    <!--<input type="hidden" name="article_id" value="<?php //echo $article[0]->id; 
                    ?>"  />-->

                        </div>

                        <div class="comment-field">

                            <input type="email" class="form-control" id="c_email" name="r_email" placeholder="البريد الإلكتروني *" required="true">

                        </div>

                        <div>

                            <textarea class="form-control message textarea" placeholder="التعليق *" name="r_comment" required="true"></textarea>
                            <input name="article_id" type="hidden" value="<?php echo $article[0]->id; ?>" />

                            <button id="c_button" class="rc_btn" type="submit">نشر التعليق</button>

                        </div>



                        <!--</form>-->

                    </div>

                    <?php
                } else {

                    // if ($this->ion_auth->in_group($add_comment_group)) { 
                    ?>

                    <!-- Add Comment -->

                    <hr />

                    <div class="blog_comment_box page-inner user_comment">

                        <h2 class="c_head">اترك تعليقاً</h2>

                        <div id="uc_results"></div>

                        <!--<form class="get_quote_form row" action="#" method="post">-->

                        <div>

                            <textarea class="form-control message" placeholder="التعليق *" name="u_comment" required="true"></textarea><br />
                            <input name="article_id" type="hidden" value="<?php echo $article[0]->id; ?>" />
                            <button id="c_button" class="uc_btn" type="submit">نشر التعليق</button>

                        </div>



                        <!--</form>-->

                    </div>

                    <?php
                    //}
                }
            }
            ?>

            <hr />

            <?php if ($article[0]->check_comment !== "بلا تعليقات") { ?>

                <!-- All Comments -->

                <div class="blog_comment_box page-inner all-comments">

                    <div class="comments-title">
                        <?php if (isset($comments) && $comments != null) { ?>
                            <h2 class="c_head">التعليقات</h2>

                            (<p><span>

                                    <?php echo count($comments); ?>

                                </span> تعليقاً</p>)
                        <?php } else echo 'لا تعليقات'; ?>

                    </div>

                    <?php
                    if (isset($comments) && $comments != null) {

                        for ($k = 0; $k < count($comments); ++$k) {
                            ?>

                            <div id="comment_<?php echo $comments[$k]->id; ?>" class="comment">



                                <div class="di avatar-div">

                                    <img class="avatar di" src="<?= base_url('assets/knowledge_base/img/users.png') ?>">

                                </div>

                                <div class="di">



                                    <div class="media-body">

                                        <div class="comment_info">

                                            <p>
                                                <span class="commenter-name"><?php echo $comments[$k]->user_name; ?></span> &nbsp;&nbsp;

                                                <span class="date"><?php echo $comments[$k]->c_date; ?></span>

                                            </p>

                                        </div>

                                    </div>

                                    <p>

                                        <?php echo $comments[$k]->comment_text; ?>

                                    </p>

                                                                    <!--<a href="#" class="comment_reply"><i class="fa fa-thumbs-up"></i>10</a>

                                                                <a href="#" class="comment_reply"><i class="fa fa-thumbs-down"></i>15</a>-->

                                    <!--<a href="#" onclick="$('#replay').appendTo('#comment_<?php //echo $comments[$k]->id; 
                                        ?>'); $('#replay').show();" class="comment_reply"><i class="fa fa-reply-all"></i>إضافة رد</a>-->

                                    <?php
                                    if ($article[0]->check_comment == "تعليقات وردود" || $article[0]->check_comment == "تعليقات") {

                                        if ($logged == 'yes') {

                                            //if ($this->ion_auth->in_group($add_comment_group)) {
                                            ?>
                                            <?php if ($article[0]->check_comment == "تعليقات وردود") { ?>
                                                <a href="#" onclick="$('#reply<?php echo $comments[$k]->id; ?>').show();" class="comment_reply"><i class="fa fa-reply-all"></i>إضافة رد</a>
                                            <?php } ?>
                                            <a href="<?php echo base_url('article/deleteComment/') . $comments[$k]->id; ?>" class="comment_delete"><i class="fa fa-remove"></i> حذف التعليق</a>
                                            <?php
                                            //}
                                            //if ($this->ion_auth->in_group($delete_comments_group)) { 
                                            ?>



                                            <?php
                                            //}
                                            //if ($this->ion_auth->in_group($edit_comments_group)) {
                                            ?>

                                            <!--                                            <a href="<?php
                                            //if ($comments[$k]->user_type == 'logged') {
                                            //echo base_url('dashboard/editcomment/') . $comments[$k]->id;
                                            //} else {
                                            //echo base_url('dashboard/editcomment/') . $comments[$k]->id;
                                            //} 
                                            ?>" class="comment_reply"><i class="fa fa-edit"></i> تعديل </a>-->

                                            <?php
                                            //}
                                        }

                                        if ($logged == 'no') {
                                            ?>
                                            <?php if ($article[0]->check_comment == "تعليقات وردود") { ?>
                                                <a href="#" onclick="$('#reply<?php echo $comments[$k]->id; ?>').show();" class="comment_reply"><i class="fa fa-reply-all"></i>إضافة رد</a>
                                            <?php } ?>

                                            <?php
                                        }
                                    }
                                    ?>



                                </div>

                                <?php if ($article[0]->check_comment == "تعليقات وردود") { ?>

                                    <div id="reply<?php echo $comments[$k]->id; ?>" class="ui form reply">

                                        <div id="reply_results<?php echo $comments[$k]->id; ?>"></div>

                                        <?php if ($logged == 'no') { ?>

                                            <input type="text" id="r_name" class="form-control replay-text" name="reply_name<?php echo $comments[$k]->id; ?>" placeholder="الاسم *" required="true">



                                            <input type="email" id="r_email" class="form-control replay-text" name="reply_email<?php echo $comments[$k]->id; ?>" placeholder="البريد الإلكتروني *" required="true">

                                        <?php } ?>

                                        <textarea class="form-control replay-textarea" rows="2" placeholder="اكتب رداً" name="reply<?php echo $comments[$k]->id; ?>" required="true"></textarea><br />

                                        <div class="fl">

                                            <button id="ac_button" class="reply_btn" comment_id="<?php echo $comments[$k]->id; ?>" type="submit">نشر الرد</button>

                                            <button onclick="$('#reply<?php echo $comments[$k]->id; ?>').hide();" id="ac_button" type="submit">إلغاء الأمر</button>

                                        </div>

                                    </div>

                                    <!--end reply form-->

                                <?php } ?>

                            </div><!-- end comment -->

                            <?php
                            $reply = $cont->getReply($comments[$k]->id);

                            if (isset($reply) && $reply != null) {

                                for ($i = 0; $i < count($reply); ++$i) {
                                    ?>

                                    <div id="replay_<?php echo $comments[$k]->id . $reply[$i]->id; ?>" class="replay">

                                                                                                <!-- <a href="#" class="comment_delete"><i class="fa fa-remove"></i> حذف </a>-->

                                        <div class="di avatar-div">

                                            <img class="avatar di" src="<?= base_url('assets/knowledge_base/img/users.png') ?>">

                                        </div>

                                        <div class="di">



                                            <div class="media-body">

                                                <div class="comment_info">

                                                    <p></p><span class="commenter-name"><?php echo $reply[$i]->user_name; ?></span> &nbsp;&nbsp;

                                                    <span class="date"><?php echo $reply[$i]->r_date; ?></span>

                                                    </p>

                                                </div>

                                            </div>

                                            <p>

                                                <?php echo $reply[$i]->reply_text; ?>

                                            </p>

                                                                                                    <!--<a href="#" class="comment_reply"><i class="fa fa-thumbs-up"></i>10</a>

                                                                                            <a href="#" class="comment_reply"><i class="fa fa-thumbs-down"></i>15</a>-->

                                            <!--<a href="#" onclick="$('#replay').appendTo('#replay_<?php //echo $comments[$k]->id.$reply[$i]->id; 
                                                ?>'); $('#replay').show();" class="comment_reply"><i class="fa fa-reply-all"></i>إضافة رد</a>-->

                                            <?php
                                            if ($logged == 'yes') {

                                                //if ($this->ion_auth->in_group($delete_comments_group)) { 
                                                ?>

                                                <a href="<?php echo base_url('article/deleteReply/') . $reply[$i]->id; ?>" class="comment_delete"><i class="fa fa-remove"></i> حذف الرد</a>

                                                <?php
                                                //}
                                                //if ($this->ion_auth->in_group($edit_comments_group)) {
                                                ?>

                                                <!--                                                <a href="<?php
                                                //if ($reply[$i]->user_type == 'logged') {
                                                //echo base_url('dashboard/editreply/') . $reply[$i]->id.'/'.$comments[$k]->id;
                                                //} else {
                                                // echo base_url('dashboard/editreply/') . $reply[$i]->id.'/'.$comments[$k]->id;
                                                //} 
                                                ?>" class="comment_reply"><i class="fa fa-edit"></i> تعديل </a>-->

                                                <?php
                                                //}
                                            }
                                            ?>

                                        </div>

                                    </div><!-- end reply -->

                                    <?php
                                }
                            }
                        }
                    }
                    ?>

                    <!--<div id="replay" class="ui form">

                        <textarea class="form-control replay-textarea" rows="2" placeholder="اكتب رداً" name="reply"></textarea><br />

                        <div class="fl">

                            <button id="ac_button" class="reply_btn" type="submit">نشر الرد</button>

                            <button onclick="$(this).hide();" id="ac_button" type="submit">إلغاء الأمر</button>

                        </div>

                    </div>-->

                    <!--end reply form-->



                </div><!-- end All Comments -->

            <?php } ?>


        </div>



    </div>





</div>

<!--Remove Modal-->
<!-- The Modal -->
<div id="myModal" class="modal">

    <!-- Modal content -->
    <div class="modal-content">
        <div class="modal-header">
            <span class="close">&times;</span>
            <h2>حذف دليل || <?php echo $article[0]->title; ?></h2>
        </div>
        <div class="modal-body">
            <p>هل تريد بالتأكيد حذف الدليل؟</p>
        </div>
        <div class="modal-footer">
            <strong> <a href="<?php echo base_url("article/delete/") . $article[0]->id; ?>" class="btn btn-danger btn-small">
                    حذف
                </a></strong>
        </div>
    </div>

</div>
<!--<div class="modal" id="removeModal" role="dialog">

    <div class="modal-dialog modal-sm">

        <div class="modal-content">

            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal">&times;</button>

                <h4 class="modal-title">حذف دليل || <?php //echo $article[0]->title;    ?></h4>

            </div>

            <div class="modal-body">

                <p>هل تريد بالتأكيد حذف الدليل؟</p>

            </div>

            <div class="modal-footer">

                <a href="<?php //echo base_url("article/delete/") . $article[0]->id;    ?>" class="btn btn-danger btn-small">

                    حذف

                </a>

                <button type="button" class="btn btn-default" data-dismiss="modal">إغلاق</button>

            </div>

        </div>

    </div>

</div>-->



</div>


<!--<a href="https://playbook.hsoub.com/" class="navigation navigation-prev " aria-label="Previous page: المقدمة">

    <i class="fa fa-angle-left"></i>

</a>





<a href="challenges.html" class="navigation navigation-next " aria-label="Next page: التحديات">

    <i class="fa fa-angle-right"></i>

</a>-->







</div>