<?php
    require_once('header.php');
    print_header();
?>    

    <div class="right">
        <form method="post" id="record">
            <table tab="_basic" class="verticalTh grid table table-striped table-hover table-bordered table-condensed">
                <tbody>
                    <tr arrayfield="tabFilters" style="display: none;">
                        <th>Etykieta filtra</th>
                        <td><input type="text" style="width: 200px;" value="" class="form-control" name="tab#filter_label@<?php echo $_SESSION['edit_language']?>"></td>
                    </tr>
                    <tr arrayfield="tabFilters" style="display: none;">
                        <th>Pole w tabeli</th>
                        <td><select name="tab#filter_field" class="form-control" style="width: auto;">
                            <?php foreach($fields as $key=>$item) { ?>
                                <option value="<?php echo $key ?>"><?php echo _t($item['title']) ?></option>
                            <?php } ?>
                        </select></td>
                    </tr>
                    <tr arrayfield="tabFilters" style="display: none;">
                        <th>Operator</th>
                        <td><select name="tab#filter_operator" class="form-control" style="width: auto;">
                                <option value="eq">=</option>
                                <option value="gt">&gt;</option>
                                <option value="lt">&lt;</option>
                                <option value="neq">!=</option>
                                <option value="like">LIKE</option>
                        </select></td>
                    </tr>
                    <tr arrayfield="tabFilters" style="display: none;">
                        <th>Wartość</th>
                        <td><input type="text" style="width: 150px;" value="" class="form-control" name="tab#filter_value"></td>
                    </tr>
                    <tr>
                        <th>Filtry</th>
                        <td>
                            <?php if($table['tabFilters']) { ?><div class="af_loader" for="tabFilters" style="display: none;"><?php echo $table['tabFilters'] ?></div><?php } ?>                        
                            <input type="hidden" value="@_REACTOR_ARRAY_FIELDS_@" name="tabFilters">
                            <div name="tabFilters" class="array_fields">
                                <table for="tabFilters" class="table table-striped table-bordered table-condensed af_table">
                                    <thead><tr class="nodrag">
                                        <th>Etykieta filtra</th>
                                        <th>Pole w tabeli</th>
                                        <th>Operator</th>
                                        <th>Wartość</th>
                                        <th>&nbsp;</th>
                                    </tr></thead>
                                    <tbody>
                                    
                                    </tbody>
                                </table>
                                <a for="tabFilters" type="button" class="btn btn-primary add_af_row" style="float: right; margin-right: 5px;">
                                    <span class="glyphicon glyphicon-plus"></span>
                                </a>
                            </div>
                        </td>
                    </tr>
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   
                   

                    <tr arrayfield="tabConditionColor" style="display: none;">
                        <th>Pole w tabeli</th>
                        <td><select name="tab#cc_field" class="form-control" style="width: auto;">
                            <?php foreach($fields as $key=>$item) { ?>
                                <option value="<?php echo $key ?>"><?php echo _t($item['title']) ?></option>
                            <?php } ?>
                        </select></td>
                    </tr>
                    <tr arrayfield="tabConditionColor" style="display: none;">
                        <th>Operator</th>
                        <td><select name="tab#cc_operator" class="form-control" style="width: auto;">
                                <option value="eq">=</option>
                                <option value="gt">&gt;</option>
                                <option value="lt">&lt;</option>
                                <option value="neq">!=</option>
                                <option value="like">LIKE</option>
                        </select></td>
                    </tr>
                    <tr arrayfield="tabConditionColor" style="display: none;">
                        <th>Wartość</th>
                        <td><input type="text" style="width: 150px;" value="" class="form-control" name="tab#cc_value"></td>
                    </tr>  
                    <tr arrayfield="tabConditionColor" style="display: none;">
                        <th>Kolor</th>
                        <td>
                            <div class="input-group colorpicker-component bscp color" data-color="<?php echo $item['color'] ?>" data-color-format="hex" style="width: 150px; float: left; margin-right: 10px;">
                                <input type="text" value="<?php echo $item['color'] ?>" class="form-control input-sm" name="tab#cc_color"/>
                                <span class="input-group-addon"><i></i></span>
                            </div>                         
                        </td>
                    </tr>                                     
                    
                    <tr>
                        <th>Warunkowe podświetlanie</th>
                        <td>
                            <?php if($table['tabConditionColor']) { ?><div class="af_loader" for="tabConditionColor" style="display: none;"><?php echo $table['tabConditionColor'] ?></div><?php } ?>                        
                            <input type="hidden" value="@_REACTOR_ARRAY_FIELDS_@" name="tabConditionColor">
                            <div name="tabConditionColor" class="array_fields">
                                <table for="tabConditionColor" class="table table-striped table-bordered table-condensed af_table">
                                    <thead><tr class="nodrag">
                                        <th>Pole w tabeli</th>
                                        <th>Operator</th>
                                        <th>Wartość</th>
                                        <th>Kolor</th>
                                        <th>&nbsp;</th>
                                    </tr></thead>
                                    <tbody>
                                    
                                    </tbody>
                                </table>
                                <a for="tabFilters" type="button" class="btn btn-primary add_af_row" style="float: right; margin-right: 5px;">
                                    <span class="glyphicon glyphicon-plus"></span>
                                </a>
                            </div>                                                    
                        </td>                    
                    </tr>
                   
                    
                </tbody>
            </table>
            <input type="hidden" value="tables" name="table"/>
            <input type="hidden" value="update_record" name="action"/>
            <input type="hidden" name="tabFilters#fields" value="tab#filter_label@pl,tab#filter_label@en,tab#filter_field,tab#filter_operator,tab#filter_value"/>
            <input type="hidden" name="tabConditionColor#fields" value="tab#cc_color,tab#cc_field,tab#cc_operator,tab#cc_value"/>            
            <input type="hidden" value="<?php echo $_GET['tid']?>" name="id"/>
        </form>
    </div> 

    <div class="panel-footer"><a id="saveRecord" style="float: right;" class="ajaxModal btn btn-success"><span class="glyphicon glyphicon-plus"></span> Zapisz</a><div class="clear"></div></div>
     <script type="text/javascript">
            
    </script>
<?php    
    require_once('footer.php');

?>

