<?php
//echo'<pre>';print_r($leaders_details);print_r($district_list);exit;
?>
<?php $this->load->view('header'); ?>

<div class="margig" style="">
    <div class="row-fluid" style="padding-top: 2%;">
        <div class="">
            <div class="span3 party_details ">
                <div class="state_page_left_menu">
                    <?php
                    $state_id;
                    $state_name = $this->pnp->get_state_name($state_id);
                    //echo '<pre>';print_r ($country_name);exit;
                    $my_state_name = $state_name[0]->state_name;
                    ?>
                    <?php echo $my_state_name; ?>
                </div>
                <hr>
                <div>
                    <div>
                        <ul>
                            <?php foreach ($post_list as $post) { ?>


                                <a href="<?php echo WEB_URL; ?>welcome/members_post/<?php echo $my_state_name; ?>/<?php echo $post->candidate_post_id; ?>/<?php echo $state_id; ?>"> <li class="li"><?php echo $post->canditate_post_name; ?></li></a>

                            <?php } ?>
                            <?php if ($state_id == '4') { ?>
                                <a href="<?php echo WEB_URL; ?>welcome/members_post/<?php echo $my_state_name; ?>/<?php echo $post_list1[0]->candidate_post_id; ?>/<?php echo $state_id; ?>"> <li class="li"><?php echo $post_list1[0]->canditate_post_name; ?></li></a>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="state_page_left_menu">
                        MP's Of  <?php echo $my_state_name; ?>
                    </div>
                    <hr>
                    <div style="height:740px;overflow: scroll">

                        <?php $this->load->view('mp_page') ?>
                    </div>
                   
                </div>
                <div>
                    <div>
                        <!--                    <ul>
                        <?php //foreach ($district_list as $district) { ?>
                                                
                                                    <li class="li"> 
                                                        <a class="" href="<?php //echo WEB_URL;          ?>Welcome/district/<?php //echo$district->district_name;           ?>/<?php echo$district->district_id; ?>"> 
                        <?php // echo $district->district_name;?> 
                                                        </a>
                                                    </li>
                        <?php //} ?>
                                            </ul>-->
                    </div>
                </div>
            </div>
        </div>
        <div class="span6" style="border: 1px solid #ebebeb">
            <?php if ($state_id == '1') { ?>
                <div>
                    <img src="<?php echo WEB_DIR; ?>public/img/vs.png">
                </div>
            <?php } ?>
            <div class="party_details" style="padding-bottom: 2%">
                <h2 style="padding-left: 2%;color:#FB9D23"> CM of <?php echo $my_state_name . ' '; ?></h2>

            </div>
            <hr>
            <div>
                <?php $this->load->view('state_leaders'); ?>
            </div>
            <div>
                <?php if ($state_id == '1') { ?>
                    <?php $this->load->view('karnataka_map') ?>
                <?php } ?>
                <?php if ($state_id == '4') { ?>
                    <?php $this->load->view('ap_map') ?>
                <?php } ?>
            </div>

            <div class=" " style="background-color: #fff">
                <script src="<?php echo WEB_DIR; ?>public/js/jquery-123.js"></script>
                <script language="javascript" type="text/javascript">         
                    
                    function display(id)
                    {//alert(id);
                  
                        if(id=='disp')
                        { //alert(id)
                            $('#disp').show();
                            $('#const').hide();
                            $('#mpconst').hide();      
                            document.getElementById("op1").style.backgroundColor="#FB9D23";
                            document.getElementById("op2").style.backgroundColor="#00AEEF";
                            document.getElementById("op3").style.backgroundColor="#00AEEF";
                        }
                        if(id=='const')
                        { //alert(id)
                            $('#disp').hide();
                            $('#const').show();    
                            $('#mpconst').hide();
                            document.getElementById("op2").style.backgroundColor="#FB9D23";
                            document.getElementById("op1").style.backgroundColor="#00AEEF";
                            document.getElementById("op3").style.backgroundColor="#00AEEF";
                        }
                        if(id=='mpconst')
                        { //alert(id)
                            $('#disp').hide();
                            $('#const').hide();
                            $('#mpconst').show();
                            document.getElementById("op1").style.backgroundColor="#00AEEF";
                            document.getElementById("op2").style.backgroundColor="#00AEEF";
                            document.getElementById("op3").style.backgroundColor="#FB9D23";
                        }
                    
                
                    }
                </script>
                <div class="menu_background">
                    <ul id="menu" class="ul1" style="line-height:37px">
                        <li onclick="display('disp')" id="op1"><a value="dis" style="" >Districts</a></li>
                        <li onclick="display('const')" id="op2"><a value="const"  >Legislative Assemblies</a></li>
                        <li onclick="display('mpconst')" id="op3"><a value="mpconst" >Loka Sabha Assemblies</a></li>
                    </ul>
                </div>


                <div id="disp" style="background-color: #fff;height:455px; overflow: scroll">
                    <h2 style="padding-left: 4%">Districts Of <?php echo $my_state_name; ?></h2>
                    <ul class="">

                        <?php
                        $k = 0;
                        foreach ($district_list as $value) {
                            ?>

                            <?php if ($k % 2 == 0) { ?>
                                <div class="left_column">
                                    <li>  <a href="<?php echo WEB_URL; ?>welcome/district1/<?php echo $value->district_id; ?>"><?php echo $value->district_name; ?></a></li>
                                </div>
                            <?php } else if ($k % 2 == 1) { ?>
                                <div class="middle_column">  
                                    <li> <a href="<?php echo WEB_URL; ?>welcome/district1/<?php echo $value->district_id; ?>"><?php echo $value->district_name; ?></a></li>
                                </div>
                            <?php } else if ($k % 2 == 2) { ?>
                                <div class="right_column">  
                                    <li>  <a href="<?php echo WEB_URL; ?>welcome/district1/<?php echo $value->district_id; ?>"><?php echo $value->district_name; ?></a></li>
                                </div>
                            <?php } $k++; ?>
                        <?php } ?>

                    </ul>
                </div>
                <div id="const" style="display:none;background-color: #fff;height:455px;overflow: scroll">
                    <h2 style="padding-left: 4%">Legislative Assemblies</h2>
                    <?php
                    $k == 0;
                    foreach ($constituency as $value) {
                        ?>
                        <?php if ($k % 2 == 0) { ?>
                            <div class="left_column">
                                <a href="<?php echo WEB_URL; ?>welcome/constituency1/<?php echo $value->constituency_id; ?>/<?php echo $state_id ?>"><?php echo $value->constituency_name; ?></a>
                            </div>
                        <?php } else if ($k % 2 == 1) { ?>
                            <div class="middle_column">  
                                <a href="<?php echo WEB_URL; ?>welcome/constituency1/<?php echo $value->constituency_id; ?>/<?php echo $state_id ?>"><?php echo $value->constituency_name; ?></a>
                            </div>
                        <?php } else if ($k % 2 == 2) { ?>
                            <div class="right_column">  
                                <a href="<?php echo WEB_URL; ?>welcome/constituency1/<?php echo $value->constituency_id; ?>/<?php echo $state_id ?>"><?php echo $value->constituency_name; ?></a>
                            </div>
                            <?php
                        } $k++;
                    }
                    ?>



                </div>
                <div id="mpconst" style="display:none;height:455px;">
                    <h2 style="padding-left: 4%">Loka Sabha Assemblies</h2>
                    <div style="background-color:#000">
                        <?php
                        $k == 0;
                        foreach ($mpconstituency as $value) {
                            ?>
                            <?php if ($k % 2 == 0) { ?>
                                <div class="left_column">
                                    <a href="<?php //echo WEB_URL;     ?>"><?php echo $value->mp_constituency_name; ?></a>
                                </div>
                            <?php } else if ($k % 2 == 1) { ?>
                                <div class="middle_column">  
                                    <a href="<?php //echo WEB_URL;     ?>"><?php echo $value->mp_constituency_name; ?></a>
                                </div>
                            <?php } else if ($k % 2 == 2) { ?>
                                <div class="right_column">  
                                    <a href="<?php //echo WEB_URL;  ?>"><?php echo $value->mp_constituency_name; ?></a>
                                </div>
                                <?php
                            } $k++;
                        }
                        ?>
                    </div>

                </div>

            </div>
        </div>
        <div class="span3 party_details">
            <div class="state_page_left_menu">
                State Parties
            </div>
            <hr>
            <div class=" " style="padding-left: 1%">

                <?php $this->load->view('parties'); ?>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <?php $this->load->view('footer'); ?>
    </div>

</div>