<!-- MENU NAVBAR HEADER-->
<?php echo Modules::run('menuadmin/menubyactive',5);?>
<!-- /MENU NAVBAR HEADER -->

<section id="middle">


    <!-- page title -->
    <header id="page-header">
        <h1>Content</h1>
        <ol class="breadcrumb">
            <li><a href="#">Content</a></li>
            <li class="active"><?php echo $item!=NULL?"Edit":"Add"?></li>
        </ol>
    </header>
    <!-- /page title -->


    <div id="content" class="padding-20">

        <div class="row">
            <div class="panel panel-default">
                <div class="panel-heading panel-heading-transparent">
                    <strong><?php echo $item!=NULL?"Edit":"Add"?> Content</strong>

                </div>

                <div class="panel-body">

                    <form class="validate" id="contentform" action="<?php echo base_url()?>content/add" method="post" enctype="multipart/form-data" data-success="Sent! Thank you!" data-toastr-position="top-right">

                        <fieldset>
                            <!-- required [php action request] -->
                            <input type="hidden" name="id" value="<?php echo @$item->id?>" />

                            <div class="row">
                                <div class="col-md-12 col-sm-12">

                                    <div class="row">
                                        <div class="form-group">
                                            <div class="col-md-12 col-sm-12">
                                                <label>Key *</label>
                                                <input  type="text" name="key" value="<?php echo @$item->key?>" class="form-control required">
                                            </div>
                                        </div>
                                    </div>

                                    <div class="tabs nomargin">

                                        <!-- tabs -->
                                        <ul class="nav nav-tabs">
                                            <?php foreach ($langs as $key => $lang){?>
                                            <li class="<?php echo $key==0?'active':''?>">
                                                <a href="#tab<?php echo $key+1?>_title" data-toggle="tab">
                                                    <label>Value <?php echo strtoupper($lang->shorttitle)?> * </label>
                                                </a>
                                            </li>
                                            <?php }?>
                                        </ul>

                                        <!-- tabs content -->
                                        <div class="tab-content ">
                                            <?php foreach ($langs as $key => $lang){?>
                                                <div id="tab<?php echo $key+1?>_title" class="tab-pane <?php echo $key==0?'active':''?>">
                                                    <div class="row">
                                                        <div class="form-group">
                                                            <div class="col-md-12 col-sm-12">
                                                                <textarea name="value_<?php echo $lang->shorttitle?>" rows="4" class="form-control required"><?php echo @$item->{"value_".$lang->shorttitle}?></textarea>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            <?php }?>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="form-group">
                                            <div class=" col-md-12 col-sm-12" align="right">
                                                <label class="switch switch switch-round">
                                                    <span> Active to public on the web?</span>

                                                    <input name="is_active" type="checkbox" <?php echo @$item->is_active=='Y'?'checked=""':''?> >
                                                    <span class="switch-label" data-on="Yes" data-off="No"></span>
                                                </label>
                                            </div>

                                        </div>
                                    </div>

                                </div>
                            </div>

                        </fieldset>

                        <div class="row">
                            <div class="col-md-12">
                                <button id="savebtn" type="submit" form="contentform" value="Submit" class="progress-button btn btn-3d btn-teal btn-xlg btn-block margin-top-30" >
                                    SAVE
                                </button>
                            </div>
                        </div>

                    </form>

                </div>

            </div>
        </div>

    </div>
</section>