<?= $this->extend('Modules\Admin\Views\index'); ?>
<?= $this->section('content');?>
<div class="container-fluid">
<div class="row mb-md-3">
	<div class="col">
		<h4>Edit Team Member with Blocks</h4>
		<!-- Breadcrumb !-->
		<nav aria-label="breadcrumb"><small>
			<ol class="breadcrumb mb-0">
				<li class="breadcrumb-item"><a href="<?= base_url('administrator') ?> ">Home</a></li>
                <li class="breadcrumb-item"><a href="<?= base_url('administrator/posts') ?> ">All Posts</a></li>
				<li class="breadcrumb-item active" aria-current="page"><?= esc($bcrumb) ?> </li>
			</ol></small>
		</nav>
		<!-- End Breadcrumb !-->
	</div>
</div>
<!-- print success message !-->
<div class="row">
    <div class="col">
		<!-- print success message !-->
		<?php if(session()->getTempdata('success')): ?>
			<div class="alert alert-success" role="alert"><?= session()->getTempdata('success');?></div>
		<?php endif;?>
		<!-- print failure message !-->
		<?php if(session()->getTempdata('error')): ?>
			<div class="alert alert-danger" role="alert"><?= session()->getTempdata('error');?></div>
		<?php endif;?>
        <?php if(isset($validation)): ?>
			<div class="alert alert-danger">
		<?= $validation->listErrors()?>
		</div>
        <?php endif;?>
        <div id="showMsg"></div>
</div></div>
<!-- Create/Post !-->
<form method="POST" action="<?= base_url('administrator/team/member/block/update')?>" enctype="multipart/form-data" id="post-form">
    <?= csrf_field();?>
    <input type="hidden" name="id" value="<?= $member->id; ?>" />
    <!-- Save/New/Cancel Btns !-->
    <div class="d-flex bd-highlight align-items-center">
                <div class="p-1 bd-highlight align-items-center">
                    <div class="btn-group border shadow-sm">
                    <button type="button" class="btn bg-success rounded-0"><i class="bi bi-plus-lg text-white"></i></button>
                    <button type="submit" class="btn btn-sm btn-success align-items-center"> Save & Close</button>
                    </div>
                </div>
                <div class="p-1 bd-highlight d-none d-md-block">
                    <div class="btn-group border shadow-sm">
                    <button type="button" class="btn bg-secondary bg-opacity-25 rounded-0"><i class="bi bi-plus-lg"></i></button>
                    <a href="<?= base_url('administrator/team/member/block/add') ?>" class="btn btn-sm btn-light">Add New</a>
                    </div>
                </div>
                <div class="p-1 bd-highlight">
                    <div class="btn-group border shadow-sm">
                    <button type="button" class="btn bg-primary bg-opacity-25 rounded-0"><i class="bi bi-x-lg"></i></button>
                    <a href="<?= base_url('administrator/team/member/blocks') ?>" class="btn btn-sm btn-primary">Back to Block Members</a>
                    </div>
                </div>
            </div>
            <!-- END Save/New/Cancel Btns !-->
    <div class="row g-2">
        <div class="col-lg-9">
            <div class="card card-body">
                <div class="row mb-3">
                    <div class="col-lg-6 col-md-6 col-sm-7 mb-3">
                        <label class="form-label fw-bold" for="mainphoto">Add Member Photo <br/><span style="font-size: 11px; color: #666">Please ensure image is less than 1MB in size</span></label>
                        <div style="min-height: 200px; background: #F2F9FF; border-radius: 0px;">
                        <div id="postImgPreview"></div>

                        <input type="file" name="photo" id="post_image" class="postImg upload-photo"   accept="image/jpeg,image/jpg,image/gif,image/png,image/webp,"/>
                        <img src="<?= $member->photo; ?>" width="60px" />
                        </div>
                    </div><!-- photo !-->
                    <div class="col-lg-6 col-md-6 col-sm-5">
                        <div class="mb-3">
                            <input type="text" name="title" placeholder="Enter Full Name" class="form-control rounded-0" id="Name" value="<?= $member->title; ?>" required/>
                        </div><!-- Name !-->
                        <div class="mb-3">
                            <input type="text" name="position" placeholder="Job Title" class="form-control rounded-0" id="Title" value="<?= $member->position; ?>" required/>
                        </div><!-- Position !-->
                        <div class="mb-3">
                            <?php function generateSelectOptions($categories, $indent = '', $member = null) { ?>
                                <?php foreach ($categories as $category) { ?>
                                    <option value="<?= $category['id'] ?>" <?php if ($member && $category['id'] == $member->category_id) echo "selected"; ?>><?= $indent . $category['name'] ?></option>
                                    <?php if (isset($category['subcategories']) && is_array($category['subcategories'])) { ?>
                                        <?php generateSelectOptions($category['subcategories'], $indent . '- ', $member); ?>
                                    <?php } ?>
                                <?php } ?>
                            <?php } ?>
                            <label class="form-label"><strong>Category</strong></label>
                            <select name="category_id" class="form-select" required>
                                <option value="">Select Category</option>
                                <?php generateSelectOptions($categoryTree, '', $member); ?>
                            </select>
                        </div><!-- Post Category !-->
                        <div class="mb-3">
                            <textarea name="excerpt" class="form-control rounded-0" placeholder="Provide a brief about the Member (Max 250 words)" rows="3" maxlength="250"><?= $member->excerpt; ?></textarea>
                        </div><!-- Brief About - Member !-->
                    </div><!-- Name Details !-->
                </div><!-- row !-->
                <div class="accordion accordion-flush" id="accordionFlushDetails">
                    <div class="accordion-item">
                        <h2 class="accordion-header" id="flush-headingOne">
                        <button class="accordion-button collapsed bg-primary bg-opacity-25 text-dark" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
                            Add More Member Details (optional)
                        </button>
                        </h2>
                        <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushDetails">
                            <div class="accordion-body">
                                <div class="row">
                                    <div class="col-lg-4 col-md-4 col-sm-4  mb-3">
                                        <label class="form-label fw-bold" for="bDay">Birthday</label>
                                        <input type="date" name="birthday" class="form-control rounded-0" id="bDay" value="<?= date('Y-m-d', strtotime($member->birthday)); ?>"/>
                                    </div><!-- Birthday !-->
                                    <div class="col-lg-4 col-md-4 col-sm-4  mb-3">
                                        <label class="form-label fw-bold" for="relationship">Select Relationship</label>
                                        <select name="relationship_status" class="form-select rounded-0" id="relationship">
                                            <option value="Single" <?php if($member->relationship_status == "Single") echo "selected";?>>Single</option>
                                            <option value="Married" <?php if($member->relationship_status == "Married") echo "selected";?>>Married</option>
                                            <option value="Divorced" <?php if($member->relationship_status == "Divorced") echo "selected";?>>Divorced</option>
                                            <option value="Widow" <?php if($member->relationship_status == "Widow") echo "selected";?>>Widow</option>
                                        </select>
                                    </div><!-- Relationship !-->
                                    <div class="col-lg-4 col-md-4 col-sm-4 mb-3">
                                        <label class="form-label fw-bold" for="link">Website</label>
                                        <input type="text" name="urls" class="form-control rounded-0" id="link" value="<?= $member->urls; ?>"/>
                                    </div><!-- Website !-->
                                    <div class="col-lg-12  mb-3">
                                        <label class="form-label fw-bold" for="goals">Member's Achievements</label>
                                        <textarea type="text" name="achievements" class="form-control rounded-0" id="tiny"><?= $member->achievements; ?></textarea>
                                    </div><!-- Achievements !-->
                                    <div class="col-lg-6 col-md-6 col-sm-6 mb-3">
                                        <label class="form-label fw-bold" for="da">Died On <br/><small class="fw-lighter">(This option is only necessary for celebrity Talk and life Magazine.)</small></label>
                                        <input type="date" name="died_at" class="form-control rounded-0" id="da" value="<?= date('Y-m-d', strtotime($member->died_at)); ?>"/>
                                    </div><!-- Website !-->

                                </div><!-- Row !-->
                            </div><!-- Accordion Body !-->
                        </div>
                    </div>
                </div><!-- End According for More Details !-->
                <!-- Full Bio - Edit with TEAM BLOCKS !-->

                <!-- Main post content !-->
                <div class="mb-3 mt-3" id="editPostArea">
                    <label class="form-label"><strong>Member Full Bio</strong></label>

                    
                    <!-- Display Blocks !-->
                    <div>
                    <?php foreach ($blockData as $block): ?>
                        <?php if ($block->block_type === 'text'): ?>
                            <!-- Display Text Block -->
                            <div class=" text-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-md-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" onclick="edit_blocktext(<?= $block->id; ?>)" style="cursor: pointer;"><small>Edit</small></a></li>
                                            <li><a  class=" dropdown-item" title="Delete Block" onclick="delete_textblock(<?= $block->id; ?>)" style="cursor: pointer;">
                                            <small>Delete</small></a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    <!-- Display text content -->
                                    <p><?= nl2br($block->content); ?></p>
                                </div>
                            </div>
                        <?php elseif ($block->block_type === 'image'): ?>
                            <!-- Display Image Block -->
                            <div class="image-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-sm-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" onclick="edit_imageblock(<?= $block->id; ?>)" style="cursor: pointer;"><small>Edit</small></a></li>
                                            <li><a class="dropdown-item" title="Delete Block" style="cursor: pointer;" onclick="delete_imageblock(<?= $block->id; ?>)"><small> Delete</small></a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    
                                    <!-- Display image and caption -->
                                    <img src="<?= $block->photo; ?>" alt="<?= $block->caption; ?>" class="img-fluid">
                                    <span style="font-size: 12px; color: #666; font-style: italic; margin-bottom: 10px, margin-top: 3px; align-self: center"><?= $block->caption; ?></span>
                                </div>
                            </div>
                        <?php elseif ($block->block_type === 'video'): ?>
                            <!-- Display Video Block -->
                            <div class="video-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-sm-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" style="cursor: pointer;" onclick="edit_videoblock(<?= $block->id; ?>)"><small>Edit</small></a></li>
                                            <li><a class="dropdown-item delstatus" title="Delete Block" onclick="delete_videoblock(<?= $block->id; ?>)" style="cursor: pointer;">
                                            <small>Delete</small></a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    <!-- Display Video and caption -->
                                    <iframe width="100%" height="345"
                                    src="<?= $block->url; ?>">
                                    </iframe>
                                    <span style="font-size: 12px; color: #666; font-style: italic; margin-bottom: 10px, margin-top: 3px; align-self: center"><?= $block->content; ?></span>
                                </div>
                            </div>
                        <?php elseif ($block->block_type === 'heading'): ?>
                            <!-- Display Heading Block -->
                            <div class=" heading-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-sm-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" onclick="edit_headingblock(<?= $block->id; ?>)" style="cursor: pointer;">Edit</a></li>
                                            <li><a href="#" class=" dropdown-item delstatus" title="Delete Block" onclick="delete_headingblock(<?= $block->id; ?>)">
                                            Delete</a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    <!-- Display heading content -->
                                    <<?= $block->heading_type; ?> style="color: <?= $block->color?>"><?= $block->heading; ?></<?= $block->heading_type; ?>>
                                </div>
                            </div>
                        <?php elseif ($block->block_type === 'list'): ?>
                            <div class="list-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-sm-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" style="cursor: pointer;" onclick="edit_listblock(<?= $block->id; ?>)"><small>Edit</small></a></li>
                                            <li><a href="#" class=" dropdown-item" title="Delete Block" onclick="delete_listblock(<?= $block->id; ?>)">
                                            <small>Delete</small></a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    <?php
                                    $items = explode(PHP_EOL, $block->content);
                                    if ($block->list_type === 'unordered'): ?>
                                        <!-- Unordered List -->
                                        <ul type="square">
                                            <?php foreach ($items as $item): ?>
                                                <li><?= $item; ?></li>
                                            <?php endforeach; ?>
                                        </ul>
                                    <?php elseif ($block->list_type === 'ordered'): ?>
                                        <!-- Ordered List -->
                                        <ol>
                                            <?php foreach ($items as $item): ?>
                                                <li><?= $item; ?></li>
                                            <?php endforeach; ?>
                                        </ol>
                                    <?php endif; ?>
                                </div>
                            </div>
                        <?php elseif ($block->block_type === 'code'): ?>
                            <!-- Display Code Block -->
                            <div class=" code-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-sm-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" style="cursor: pointer;" onclick="edit_codeblock(<?= $block->id; ?>)"><small>Edit</small></a></li>
                                            <li><a href="#" class=" dropdown-item" title="Delete Block" style="cursor: pointer;" onclick="delete_codeblock(<?= $block->id; ?>)">
                                            Delete</a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    <!-- Display code content -->
                                    <pre> 
                                    <div class="codemirror-container" data-code="<?= htmlspecialchars($block->code); ?>"></div></pre>
                                </div>
                            </div>
                        <?php elseif ($block->block_type === 'advert'): ?>
                            <!-- Display ADVERT Code Block -->
                            <div class="advertcode-block">
                                <!-- EDIT Menu !-->
                                <div class="dropdown dropstart float-sm-end">
                                        <a  href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-three-dots fs-3"></i></a>
                                        <ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                                            <li><a  class="dropdown-item"  title="Edit Block" onclick="edit_advertcodeblock(<?= $block->id; ?>)" style="cursor: pointer;">Edit</a></li>
                                            <li><a class=" dropdown-item" title="Delete Block" onclick="delete_advertcodeblock(<?= $block->id; ?>)">
                                            Delete</a></li>
                                        </ul>
                                </div><!-- EDIT Menu !-->
                                <div class="mb-3">
                                    <!-- Display code content -->
                                    <pre><code><?= $block->advert_code; ?></code></pre>
                                </div>
                            </div>
                        <?php endif; ?>
                        <!-- End of Display of Blocks !-->
                    <?php endforeach; ?>
                    </div>
                    <!-- END Display Blocks !-->

                    <!-- Not needed !-->
                    <?= form_open(); ?>
                    <div class="col"></div>
                    <?= form_close();?>
                    <!-- End Not Needed !-->

                    <!-- Add Heading Block !-->
                    <div class="block-element heading-block">
                    <form method="POST" id="heading-form" enctype="multipart/form-data">
                    <?= csrf_field(); ?>
                    <div class="row mb-3">
                        <div class="col-lg-12 col-md-12 col-sm-12">
                            <label class="form-label fw-bold" for="heading">Add Heading</label>
                            <input type="text" name="heading" placeholder="Add heading here" class="form-control mb-2" id="heading">
                        </div>
                        <div class="col-lg-4 col-md-4 col-sm-4 col-4 align-self-center">
                            <select name="heading_type" class="form-select mb-2">
                                <option value="H1">Heading 1 </option>
                                <option value="H2">Heading 2 </option>
                                <option value="H3" selected>Heading 3 </option>
                                <option value="H4">Heading 4</option>
                                <option value="H5">Heading 5</option>
                                <option value="H6">Heading 6</option>
                            </select>
                        </div>
                        <div class="col-lg-1 col-md-2 col-sm-2 col-3 align-self-center">
                            <input type="color" name="color" placeholder="Select color" class="form-control mb-2">
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-4 align-self-center">
                        <input type="hidden" name="post_id" value="<?= $member->id ?>">
                        <button type="submit" class="btn btn-sm btn-secondary rounded-0 mb-2" id="addHeadingButton">Add Heading</button>
                        </div>
                    </div>
                    </form>
                    </div>
                    <!-- End Heading Block !-->

                    <!-- Add Text Block !-->
                    <div class="block-element text-block">
                        <div class="mb-3">
                            <form method="POST" id="text-form" enctype="multipart/form-data">
                            <?= csrf_field(); ?>
                            <label class="form-label fw-bold" for="text">Add Full Text here</label>
                            <textarea placeholder="Full text here in paragraph format" name="content" id="text" class="form-control " data-emoji-input="unicode" data-emojiable="true"></textarea>
                            <input type="hidden" name="post_id" value="<?= $member->id ?>">
                            <button type="submit" class="btn btn-sm btn-secondary rounded-0 d-grid w-50" id="addTextButton">Add Text</button>
                            </form>
                        </div>
                    </div>
                    <!-- End Text Block !-->

                    <!-- Add IMAGE Block !-->
                    <div class="block-element image-block">
                    <form method="POST" id="image-form" enctype="multipart/form-data">
                    <?= csrf_field(); ?>
                    <div class="row mb-3">
                        <div class="col-lg-12 col-md-12 col-sm-12">
                            <label class="form-label fw-bold" for="image">Add Image</label>
                            <input type="file" name="photo" placeholder="Add image" class="form-control mb-2" id="image" accept=".jpeg, .jpg, .png, .gif">
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-7 align-self-center">
                            <input type="text" name="caption" placeholder="Enter image caption" class="form-control mb-2">
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-4 align-self-center">
                        <input type="hidden" name="post_id" value="<?= $member->id ?>">
                        <button type="submit" class="btn btn-sm btn-secondary rounded-0 mb-2" id="addImageButton">Add Image</button>
                        </div>
                    </div>
                    </form>
                    </div>
                    <!-- End IMAGE Block !-->

                    <!-- Add CODE Block !-->
                    <div class="block-element code-block">
                    <div class="mb-3">
                    <form method="POST" id="code-form" enctype="multipart/form-data">
                        <?= csrf_field(); ?>
                        <label class="form-label fw-bold" for="code">Add Code</label>
                        <textarea name="code" class="form-control rounded-0" rows="3" placeholder="Place your code here" id="code-editor"></textarea>
                        
                        <!-- Hidden input field to store code content -->
                        <input type="hidden" name="code-content" id="code-content" value="">
                        
                        <input type="hidden" name="post_id" value="<?= $member->id ?>">
                        <button type="submit" class="btn btn-sm btn-secondary rounded-0 d-grid w-50" id="addCodeButton">Add Code</button>
                    </form>
                    </div>
                    </div>
                    <!-- End CODE Block !-->

                    <!-- Add ADVERT CODE Block !-->
                    <div class="block-element advertcode-block">
                    <div class="mb-3">
                        <form method="POST" id="advertcode-form" enctype="multipart/form-data">
                        <?= csrf_field(); ?>
                        <label class="form-label fw-bold" for="google-code">Ad Google Code</label>
                        <textarea name="advert_code" class="form-control rounded-0" placeholder="Place your Google Advert code here" id="google-code"></textarea>
                        <input type="hidden" name="post_id" value="<?= $member->id ?>">
                        <button type="submit" class="btn btn-sm btn-secondary rounded-0 d-grid w-50" id="addAdvertCodeButton">Add Advert</button>
                        </form>
                    </div>
                    </div>
                    <!-- End ADVERT CODE Block !-->

                    <!-- Add Video Block !-->
                    <div class="block-element video-block">
                    <div class="mb-3">
                        <form method="POST" id="video-form" enctype="multipart/form-data">
                        <?= csrf_field(); ?>
                        <label class="form-label fw-bold" for="video">Add Video Link <small class="fw-lighter"><br/>NOTE: For your video to display in post. Go to Youtube and click on Share then "Embed". Pick link within that starts with src="" and save it in your video link.</small></label>
                        <input type="text" name="url" class="form-control rounded-0 mb-2" placeholder="Enter your video link E.g Youtube, Vimeo" id="video">
                        <div class="row">
                        <div class="col-lg-6 col-md-6 col-sm-7 align-self-center">
                            <input type="text" name="content" placeholder="Enter video caption" class="form-control mb-2">
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-4 align-self-center">
                            <input type="hidden" name="post_id" value="<?= $member->id ?>">
                            <button type="submit" class="btn btn-sm btn-secondary rounded-0 mb-2" id="addVideoButton">Add Video</button>
                        </div></div>
                        </form>
                    </div>
                    </div>
                    <!-- End Video Block !-->

                    <!-- Add LIST Block !-->
                    <div class="block-element list-block">
                    <div class="mb-3">
                        <form method="POST" id="list-form" enctype="multipart/form-data">
                        <?= csrf_field(); ?>
                        <label class="form-label fw-bold" for="list">Add List <small class="text-muted fst-italic fw-lighter">(Add each point on separate line and choose listy type.)</small></label>
                        <textarea name="content" class="form-control rounded-0 mb-2" rows="3" placeholder="Add each point on separate line and choose listy type." id="list"></textarea>
                        <div class="row">
                            <div class="col-lg-2 col-md-2 col-sm-2 col-2">
                                <select name="list_type" class="form-select rounded-0">
                                    <option value="unordered">ul</option>
                                    <option value="ordered">ol</option>
                                </select>
                            </div>
                            <div class="col-lg-3 col-md-3 col-sm-3 col-3 align-self-center">
                                <input type="hidden" name="post_id" value="<?= $member->id ?>">
                                <button type="submit" class="btn btn-sm btn-secondary rounded-0 d-grid w-100" id="addListButton">Add List</button>
                            </div>
                        </div>
                        </form>
                    </div>
                    </div>
                    <!-- End LIST Block !-->



                    <!-- Block Add Buttons !-->
                    <div class="d-flex mb-3">
                    <div class="btn-group dropup">
                    <button class="btn btn-dark dropdown-toggle" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-expanded="false">
                    <i class="bi bi-plus fs-5 "></i> Add Block
                    </button>
                    <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="dropdownMenuButton2" style="font-size: 13px">
                        <li><a class="dropdown-item border-bottom border-secondary" id="heading-block" style="cursor: pointer">Add Heading</a></li>
                        <li><a class="dropdown-item border-bottom border-secondary" id="text-block" style="cursor: pointer">Add Text</a></li>
                        <li><a class="dropdown-item border-bottom border-secondary" id="image-block" style="cursor: pointer">Add Image</a></li>
                        <li><a class="dropdown-item border-bottom border-secondary" id="code-block" style="cursor: pointer">Add Code</a></li>
                        <li><a class="dropdown-item border-bottom border-secondary" id="video-block" style="cursor: pointer">Add Video</a></li>
                        <li><a class="dropdown-item border-bottom border-secondary" id="list-block" style="cursor: pointer">Add List</a></li>
                        <li><a class="dropdown-item" id="advertcode-block" style="cursor: pointer">Add Advert</a></li>
                    </ul>
                    </div>
                    </div>
                    <!-- End Block Add Buttons !-->
                  </div>

                <!-- END Full Bio - Edit with TEAM BLOCKS !-->
            </div><!-- card !-->
        </div><!-- Col LEFT !-->
        <div class="col-lg-3">
            <div class="card card-body">
                <div class="mb-3">
                    <label class="form-label"><strong>Status</strong></label>
                    <select name="status" class="form-select bg-success bg-opacity-75 text-white" >
                        <option value="Published" <?php if($member->status == "Published") echo "selected";?>>Published</option>
                        <option value="Unpublished"  <?php if($member->status == "Unpublished") echo "selected";?>>Unpublished</option>
                        <option value="Archived"  <?php if($member->status == "Archived") echo "selected";?>>Archived</option>
                        <option value="Trashed"  <?php if($member->status == "Trashed") echo "selected";?>>Trashed</option>
                    </select>
                  </div><!-- Status of publishing !-->
                <p>Only provide team member's social handle <small class="text-muted">E.g "lwegatech"</small></p>
                <div class=" input-group mb-2">
                    <span class="input-group-text" id="instagram" style="background: #fa7e1e; color: #fff;"><i class="bi bi-instagram"></i></span>
                    <input type="text" name="instagram" class="form-control rounded-0" placeholder="Instagram" aria-label="Instagram" aria-describedby="social" value="<?= $member->instagram; ?>">
                </div><!-- Instagram !-->
                <div class=" input-group mb-2">
                    <span class="input-group-text" id="twitter" style="background: #000; color: #fff;"><i class="bi bi-twitter-x"></i></span>
                    <input type="text" name="twitter"  class="form-control rounded-0" placeholder="X / Twitter" aria-label="Twitter" aria-describedby="social" value="<?= $member->twitter; ?>">
                </div><!-- X / Twitter !-->
                <div class=" input-group mb-2">
                    <span class="input-group-text" id="Facebook" style="background: #3b5998; color: #fff;"><i class="bi bi-facebook"></i></span>
                    <input type="text" name="facebook"  class="form-control rounded-0" placeholder="Facebook" aria-label="Facebook" aria-describedby="social" value="<?= $member->facebook; ?>">
                </div><!-- Facebook !-->
                <div class=" input-group mb-2">
                    <span class="input-group-text" id="Tiktok" style="background: #FE2C55; color: #fff;"><i class="bi bi-tiktok"></i></span>
                    <input type="text" name="tiktok"  class="form-control rounded-0" placeholder="TikTok" aria-label="Tiktok" aria-describedby="social" value="<?= $member->tiktok; ?>">
                </div><!-- Tiktok !-->
                <div class=" input-group mb-2">
                    <span class="input-group-text" id="LinkedIn" style="background: #0072b1; color: #fff;"><i class="bi bi-linkedin"></i></span>
                    <input type="text" name="linkedin"  class="form-control rounded-0" placeholder="LinkedIn" aria-label="LinkedIn" aria-describedby="social" value="<?= $member->linkedin; ?>">
                </div><!-- LinkedIn !-->
                <div class=" input-group mb-2">
                    <span class="input-group-text" id="Snapchat" style="background: #ffcc00; color: #fff;"><i class="bi bi-snapchat"></i></span>
                    <input type="text" name="snapchat" class="form-control rounded-0" placeholder="Snapchat" aria-label="Snapchat" aria-describedby="social" value="<?= $member->snapchat; ?>">
                </div><!-- Snapchat !-->
            </div><!-- Card !-->
        </div><!-- Col RIGHT !-->
    </div><!--Row Team Member Info !-->

</form>
<!-- End Create/Post !--> 

<!-- Modal !-->
<?= view('Modules\Posts\Views\tags\modals\\addTag_Modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\text_modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\heading_modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\image_modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\video_modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\list_modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\code_modal') ?>
<?= view('Modules\Team\Views\team-blocks\modals\\advertcode_modal') ?>

<!---- JS --->
<script src="<?= base_url();?>/assets/js/modules/tags.js"></script>
<script src="<?= base_url();?>/assets/js/modules/teams.js"></script>
<script src="<?= base_url();?>/assets/js/modules/team-blocks.js"></script> 
<?= $this->endSection();?>