<?php

include_once("../../AccessControl.php");
$fields  = LoadFieldSelect();
?> 
<div class="nav-tabs-custom">
    <ul class="nav nav-tabs">
        <li class="active"><a data-toggle="tab" class="manage-segments-btn"><?php echo _MANAGE_SEGMENTS; ?></a></li> 
        <li class=""><a data-toggle="tab" class="new-segment-btn"><?php echo _CREATE_NEW_SEGMENT; ?></a></li>      
        <li class="pull-right"><a class="help-segments" href="#"><i class='fa fa-info'></i></a></li>
    </ul>
</div>

<div class="manage-segments col-xs-12">
    <div class="inner-info" style="display:none;">
        <div class="alert alert-info filteralertinfo">
        <i class="fa fa-info"></i>
        <div>        
            <?php echo _DEFINE_A_GROUP_OF_VISITORS; ?>
            <?php echo _FILTER_INFO_AND_EXPLAIN; ?>
            <br>
            <?php echo _LIST_OF_AVAILABLE_FIELDS; ?>
        </div>
    </div>
        
    </div>

    <div class="manage-filters">
        <table class="table">
            <thead>
                <tr><td><?php echo _FILTER_NAME; ?></td><td><?php echo _FILTER_CATEGORY; ?></td><td></td><td></td></tr>
            </thead>
            <tbody>
                <tr class="segment hidden">
                    <td class="name"></td>
                    <td class="cat"></td>
                    <td><a class="edit-segment" href=""><?php echo _EDIT; ?></a></td>
                    <td><a class="del-segment" href=""><?php echo _DELETE; ?></a></td>
                </tr>
                <tr><td><?php echo _LOADING; ?>...</td><td></td><td></td><td></td></tr>
            </tbody>
        </table>     
    </div>
    <div class="filters-form" style="display:none;">
        <form action="" method="post" name="segment">
            <div class="form-group segments">
                <label for=""><?php echo _FILTER_NAME; ?>:</label>
                <input type="text" class="form-control" name="name" />
                <input type="hidden" name="filterid" value="0" />
            </div>
            <div class="form-group">
                <label for=""><?php echo _FILTER_CATEGORY; ?></label>
                <select class="form-control" name="category"></select>                                

                <a class="addnewcat">
                    <i class="fa fa-fw fa-angle-double-right"></i><?php echo _ADD_NEW_CATEGORY;?>
                </a>
                <div class="form-group filternewcatagory">
                    <label for=""><?php echo _NEW_CATEGORY;?></label>
                    <input type="text" class="form-control" name="newcategory" />
                </div>
            </div>

            <label for=""><b><?php echo "Segment Availability"; ?></b></label><br>
            <div class="col-md-12 filterradiobottomline">
                <div class="col-md-6 col-xs-6 filterradiooption">
                    <span class="filterradio"><input type="checkbox" name="segment_access" value="private"></span>
                    <span class="filterradiolabel"><?php echo _PRIVATE_SEGMENT;?></span>
                </div>
                <div class="col-md-6 col-xs-6 filterradiooption">
                    <span class="filterradio"><input type="checkbox" name="segment_profile" value="global"></span>
                    <span class="filterradiolabel"><?php echo _GLOBAL_SEGMENT;?></span>
                </div>
            </div>


            <label for=""><b><?php echo _FILTER_STATISTICS_TO_INCLUDE_VISITORS; ?></b></label><br>
            <div class="col-md-12">
                <div class="col-md-5 col-xs-6 filterradiooption">
                    <span class="filterradio"><input type="radio" name="andor" value="OR"></span>
                    <span class="filterradiolabel"><?php echo _ANY_OF_FOLLOWING_CRITERIA;?></span>
                </div>
                <div class="col-md-5 col-xs-6 filterradiooption">
                    <span class="filterradio"><input type="radio" name="andor" value="AND" checked="checked"></span>
                    <span class="filterradiolabel"><?php echo _ALL_OF_FOLLOWING_CRITERIA;?></span>
                </div>
            </div>
            <table class="col-md-12 criteriatable">
                <thead>
                    <tr>
                        <th class="col-md-2 col-xs-3"><?php echo _FIELD;?></th>
                        <th class="col-md-3 col-xs-4"><?php echo _CONDITION;?></th>
                        <th class="col-md-2 col-xs-3"><?php echo _VALUE;?></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="rowinput">
                        <td class="col-md-2 col-xs-3">
                            <div class="form-group">
                                <select class="form-control filter-field" id="field0" name="field0" data-key="0"><?php echo $fields; ?></select>        
                            </div>
                        </td>
                         <td class="col-md-3 col-xs-4">
                            <div class="form-group">
                                <select class="form-control filter-condition" name="condition0" id="condition0" data-key="0">
                                    <option></option>
                                    <option value="is"><?php echo _IS_SELECT;?></option>
                                    <option value="start"><?php echo _STARTS_WITH;?></option>
                                    <option value="end"><?php echo _ENDS_WITH;?></option>
                                    <option value="contains"><?php echo _CONTAINS;?></option>
                                    <option value="isnot"><?php echo _IS_NOT;?></option>
                                    <option value="nostart"><?php echo _DOES_NOT_START_WITH;?></option>
                                    <option value="nocontain"><?php echo _DOES_NOT_CONTAIN;?></option>

                                </select>
                            </div>        
                        </td>
                         <td class="col-md-4 col-xs-3">                                    
                            <div class="form-group">
                                <input type="text" class="form-control filter-cvalue" name="cvalue0" id="cvalue0" data-key="0" />
                            </div>
                        </td>
                        <td>
                            <div class="form-group">
                                <button class="add btn btn-default "> + </button>
                                <button class="remove btn btn-default disabled"> - </button>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>

            <input data-loading-text="Saving Segment" type="submit" class="btn btn-primary save-filter"  value="<?php echo _SAVE;?>" />
        </form>

            
    </div>
</div>