<?php
$message = $this->session->userdata('message');
if (!empty($message)) {
    ?>
    <div class="alert alert-block alert-success">
        <h6 class="lighter arial green" style="text-align:center;"><b>
                <?php echo $message;
                $this->session->unset_userdata('message');
                ?>
            </b></h6>
    </div>
    <?php
}
$errormessage = $this->session->userdata('errormessage');
if (!empty($errormessage)) {
    ?>
    <div class="alert alert-block alert-danger">
        <h6 class="lighter arial red" style="text-align:center;"><b>
                <?php echo $errormessage;
                $this->session->unset_userdata('errormessage');
                ?>
            </b></h6>
    </div>
    <?php
}
?>
<div class="page-content" >
    <div class="row" >
        <div class="col-sm-12">
            <div class="widget-box">
                <div class="widget-header" style="height:40px;">
                    <h5  style="text-align:center; color:red;"><b>Search Expense By Month</b> </h5>
                </div>

                <div class="widget-body">
                    <div class="widget-main no-padding">
                        <form action="<?php echo admin_url()?>/expensesetup/searchExpense/month" method="post">

                            <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label>Date From</label></div>
                                <?php echo form_error('data[fromdate]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-8 col-sm-8">
                                    <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[fromdate]" value="<?php echo set_value('data[fromdate]',false); ?>" data-date-format="dd-mm-yyyy" />
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                                </div>
                            </fieldset>

                            <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label>Date To</label></div>
                                <?php echo form_error('data[todate]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-8 col-sm-8">
                                    <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[todate]" value="<?php echo set_value('data[todate]',false); ?>" data-date-format="dd-mm-yyyy" />
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                                </div>
                            </fieldset>

                            <div class="clearfix"></div>

                            <div class="form-actions center">
                                <button type="submit" name="btnSdateRange" class="btn btn-sm btn-success">
                                    <i class="ace-icon fa fa-undo bigger-110"></i>
                                    Search By Month
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--Search By Year-->
<div class="page-content" >
    <div class="row" >
        <div class="col-sm-12">
            <div class="widget-box">
                <div class="widget-header" style="height:40px;">
                    <h5  style="text-align:center; color:red;"><b>Search Expense By Year</b> </h5>
                </div>

                <div class="widget-body">
                    <div class="widget-main no-padding">
                        <form action="<?php echo admin_url()?>/expensesetup/searchExpense/year" method="post">

                            <fieldset class="col-xs-6 col-sm-6">
                                <div class="col-xs-4 col-sm-4"><label>Select Year</label></div>
                                <?php echo form_error('data[fromdate]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-8 col-sm-8">
                                    <select class="selectpicker" name="select_year" data-live-search="true">
                                        <option value="" disabled selected>Select A Year</option>
                                        <?php
                                            $year = 2014;
                                            while($year < date('Y')){
                                                $year++;
                                        ?>
                                            <option value="<?php echo $year;?>"><?php echo $year;?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </fieldset>
                            <div class="clearfix"></div>

                            <div class="form-actions center">
                                <button type="submit" name="btnSdateRange" class="btn btn-sm btn-success">
                                    <i class="ace-icon fa fa-undo bigger-110"></i>
                                    Start Search
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


