<div class="col-sm-12 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <div class="">
        <a href="<?php echo base_url(); ?>super_admin">Dashboard</a>->>
        <span>Add Technology Keyword</span>
    </div>
    <h1 class="page-header">Add Technology Keyword Form</h1>
    <p>
        <?php
        $message = $this->session->userdata('message');
        $this->session->unset_userdata('message');
        if ($message) {
            echo $message;
        }
        ?>
    </p>
    <div class="table-responsive col-sm-4">
        <?php 
            if($technology_keyword_info){
                $url = 'edit_technology_keyword/'.$technology_keyword_info->technology_keyword_id;
            }else{
                $url = 'add_technology_keyword';
            }
        ?>
        
        <form action="<?php echo base_url(); ?>super_admin/<?php echo $url;?>" method="post" name="technologyKeywordForm" enctype="multipart/form-data" >

            <div class="form-group col-sm-12">

                <div class="form-group col-sm-10">
                    <label for="technology_keyword_name">technology_keyword Name</label><span class="required"> * </span> <?php ?>"
                    <input type="text" class="form-control" id="technology_keyword_name" name="technology_keyword_name" value="<?php
                    if ($technology_keyword_info) {
                        echo $technology_keyword_info->technology_keyword_name;
                    } else {
                        echo set_value('technology_keyword_name');
                    }
                    ?>" onblur="chectechnology_keywordName(this.value, 'technology_keyword_name_status')" placeholder="Enter technology_keyword Name" >
                </div>

                <script>

                    function chectechnology_keywordName(given_text, objID) {
                        if (given_text == '') {
                            document.getElementById(objID).innerHTML = '<p style="color:red;">Please Enter your technology_keyword Name</p>';
                        } else {
                            document.getElementById(objID).innerHTML = '<p style="color:red;"></p>';
                        }
                    }

                </script>

                <div class="form-group col-sm-4" id="technology_keyword_name_status">
                    <?php echo form_error('technology_keyword_name'); ?>
                </div>

            </div>

            <div class="form-group col-sm-10">
                <div class="checkbox col-sm-6" >
                    <button type="submit" id="submit" class="btn btn-default">Submit</button>
                </div>
            </div>
        </form>
    </div>

    <div class="table-responsive col-sm-8">

        <div class="container col-sm-8 col-sm-offset-2 col-md-offset-0 col-md-12" id="res">

            <!--Technology LIST-->

            <div class="table-responsive col-lg-12 col-md-10 col-sm-7" id="user_list">
                <form name="myform" action=""  method="post">
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th><input type="checkbox" name="all_list" id="all_list" onchange="toggleAllUserSelection(document.myform.technology_keyword_id)" /></th>
                                <th>ID</th>
                                <th>technology_keyword Name</th>
                                <th>Status</th>
                                <th>action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($technology_keywords as $v_technology_keyword) { ?>
                                <tr>
                                    <td>
                                        <input name="technology_keyword_id" id="technology_keyword_id<?php echo $v_technology_keyword->technology_keyword_id; ?>" type="checkbox"  value="<?php echo $v_technology_keyword->technology_keyword_id; ?>" onchange="setUserIdList(this.value);"/>
                                    </td>

                                    <td><?php echo $v_technology_keyword->technology_keyword_id ?></td>

                                    <td><?php echo $v_technology_keyword->technology_keyword_name ?></td>

                                    <td><?php
                                        if ($v_technology_keyword->technology_keyword_status == '1') {
                                            echo '<p style="color:limegreen;">Active</p>';
                                            ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_technology_keyword_inactive/<?php echo $v_technology_keyword->technology_keyword_id; ?>"><i class="fa fa-user-times" title="Inactive"></i></a>
                                            <?php
                                        } else if ($v_technology_keyword->technology_keyword_status == '0') {
                                            echo '<p style="color:red;">Inactive</p>';
                                            ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_technology_keyword_active/<?php echo $v_technology_keyword->technology_keyword_id; ?>">
                                                <i class="fa fa-user-plus" title="Active"></i></a>
                                            <?php
                                        } else if ($v_technology_keyword->technology_keyword_status == '2') {
                                            echo '<p style="color:blue;">Archived';
                                            ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_technology_keyword_active/<?php echo $v_technology_keyword->technology_keyword_id; ?>"><i class="fa fa-user-plus" title="Active"></i> </a>
                                        <?php } ?>
                                    </td>

                                    <td style="width: 200px;">
                                        <a href="<?php echo base_url(); ?>super_admin/edit_technology_keyword/<?php echo $v_technology_keyword->technology_keyword_id; ?>"><div class="span1"><i class="fa fa-edit">Edit</i></div></a>
                                        <?php if ($v_technology_keyword->technology_keyword_status != 2) { ?>
                                            <a href="<?php echo base_url(); ?>super_admin/make_technology_keyword_archive/<?php echo $v_technology_keyword->technology_keyword_id; ?>" onclick="return checkAction('delete');">
                                                <i class="fa fa-remove">Delete</i>
                                            </a><?php } ?>
                                    </td>

                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                    <br>
                </form>
            </div>
        </div>  
    </div> 


    <script>
        function checkAction(action) {
            message = 'do you want to ' + action + '!!';
            chk = confirm(message);
            if (chk) {
                return true;
            } else {
                return false;
            }
        }
    </script>
</div>


