PHP Classes

File: datamanage/inc/s_filter.php

Recommend this page to a friend!
  Classes of Mathew   Data Manager   datamanage/inc/s_filter.php   Download  
File: datamanage/inc/s_filter.php
Role: Auxiliary script
Content type: text/plain
Description: s_filter
Class: Data Manager
Retrieve and store MySQL records using Web forms
Author: By
Last change:
Date: 10 years ago
Size: 9,884 bytes
 

Contents

Class file image Download
<style>
.title-outer-filter{border-top:1px #ffffff solid; float:left; width:100%;background-color:#F1F1F1; border-bottom:1px #CCCCCC solid;}
.col-outer-filter{ border-bottom:1px #CCCCCC solid; float:left; width:100%; overflow:hidden;}

.filter-title-1,.filter-title-2,.filter-title-3{ padding:4px; float:left; border-right:1px #CCCCCC solid; font-weight:bold; }
.filter-title-1{ width:32%;}
.filter-title-2{ width:32%;}
.filter-title-3{ width:32%; border:0;}

.filter-col-1,.filter-col-2,.filter-col-3{ padding:4px; float:left; border-right:1px #CCCCCC solid;margin-bottom:-300px; padding-bottom:300px;}
.filter-col-1{ width:32%;}
.filter-col-2{ width:32%;}
.filter-col-3{ width:32%;border:0;}

</style>

<div class="title-outer-filter">
    <div class="filter-title-1">Field</div>
    <div class="filter-title-2">Operator</div>
    <div class="filter-title-3">Value</div>
</div>
<div class="col-outer-filter">
<!-- Start -->
<div class="col-outer-filter">
        <div class="filter-col-1">
            <select name="sIn[]" id="select-from">
                 <option value="" selected="selected">-- None --</option>
                 <?php for($i=0;$i<count($searchList); $i++) { ?>
<option value="<?=$i?>" <?=($sIn[0] != "" && $i == $sIn[0]) ? "selected='selected'" : ""; ?> >
                <?=$searchList[$i]?></option>
                 <? } ?>
</select>
        </div>
        <div class="filter-col-2">
            <select name="operator[]" onchange="callBtwn(this.value,0)">
                <option value="">--None--</option>
                <option value="e" <?=( $operator[0] == "e") ? "selected='selected'" : ""; ?>>equals</option>
                <option value="n" <?=( $operator[0] == "n") ? "selected='selected'" : ""; ?>>not equal to</option>
                <option value="s" <?=( $operator[0] == "s") ? "selected='selected'" : ""; ?>>starts with</option>
                <option value="c" <?=( $operator[0] == "c") ? "selected='selected'" : ""; ?>>contains</option>
                <option value="k" <?=( $operator[0] == "k") ? "selected='selected'" : ""; ?>>does not contain</option>
                <option value="l" <?=( $operator[0] == "l") ? "selected='selected'" : ""; ?>>less than</option>
                <option value="g" <?=( $operator[0] == "g") ? "selected='selected'" : ""; ?>>greater than</option>
                <option value="m" <?=( $operator[0] == "m") ? "selected='selected'" : ""; ?>>less or equal</option>
                <option value="h" <?=( $operator[0] == "h") ? "selected='selected'" : ""; ?>>greater or equal</option>
                <option value="u" <?=( $operator[0] == "u") ? "selected='selected'" : ""; ?>>includes</option>
                <option value="x" <?=( $operator[0] == "x") ? "selected='selected'" : ""; ?>>excludes</option>
                <option value="btw" <?=( $operator[0] == "btw") ? "selected='selected'" : ""; ?>>between</option>
            </select>
        </div>
        <div class="filter-col-3">
            <input type="text" name="sFor[]" value="<?=$sFor[0]?>" style="width:130px;" class="myinput"/>
            <div style="float:left; margin-left:5px; display:none;" id='sDiv0'>
            <input type="text" name="sTo[]" value="<?=$sTo[0]?>" style="width:130px;" class="myinput"/>
            </div>
        </div>
    </div>
<!-- end-->
   
<!-- Start -->
<div class="col-outer-filter">
        <div class="filter-col-1">
            <select name="sIn[]" id="select-from">
                 <option value="" selected="selected">-- None --</option>
                 <?php for($i=0;$i<count($searchList); $i++) { ?>
<option value="<?=$i?>" <?=($sIn[1] != "" && $i == $sIn[1]) ? "selected='selected'" : ""; ?> >
                <?=$searchList[$i]?></option>
                 <? } ?>
</select>
        </div>
        <div class="filter-col-2">
            <select name="operator[]" onchange="callBtwn(this.value,1)">
                <option value="">--None--</option>
                <option value="e" <?=( $operator[1] == "e") ? "selected='selected'" : ""; ?>>equals</option>
                <option value="n" <?=( $operator[1] == "n") ? "selected='selected'" : ""; ?>>not equal to</option>
                <option value="s" <?=( $operator[1] == "s") ? "selected='selected'" : ""; ?>>starts with</option>
                <option value="c" <?=( $operator[1] == "c") ? "selected='selected'" : ""; ?>>contains</option>
                <option value="k" <?=( $operator[1] == "k") ? "selected='selected'" : ""; ?>>does not contain</option>
                <option value="l" <?=( $operator[1] == "l") ? "selected='selected'" : ""; ?>>less than</option>
                <option value="g" <?=( $operator[1] == "g") ? "selected='selected'" : ""; ?>>greater than</option>
                <option value="m" <?=( $operator[1] == "m") ? "selected='selected'" : ""; ?>>less or equal</option>
                <option value="h" <?=( $operator[1] == "h") ? "selected='selected'" : ""; ?>>greater or equal</option>
                <option value="u" <?=( $operator[1] == "u") ? "selected='selected'" : ""; ?>>includes</option>
                <option value="x" <?=( $operator[1] == "x") ? "selected='selected'" : ""; ?>>excludes</option>
                <option value="btw" <?=( $operator[1] == "btw") ? "selected='selected'" : ""; ?>>between</option>
            </select>
        </div>
        <div class="filter-col-3">
            <input type="text" name="sFor[]" value="<?=$sFor[1]?>" style="width:130px;" class="myinput"/>
            <div style="float:left; margin-left:5px; display:none;" id='sDiv1'>
            <input type="text" name="sTo[]" value="<?=$sTo[1]?>" style="width:130px;" class="myinput"/>
            </div>
        </div>
    </div>
<!-- end-->
<!-- Start -->
<div class="col-outer-filter">
        <div class="filter-col-1">
            <select name="sIn[]" id="select-from">
                 <option value="" selected="selected">-- None --</option>
                 <?php for($i=0;$i<count($searchList); $i++) { ?>
<option value="<?=$i?>" <?=($sIn[2] != "" && $i == $sIn[2]) ? "selected='selected'" : ""; ?> >
                <?=$searchList[$i]?></option>
                 <? } ?>
</select>
        </div>
        <div class="filter-col-2">
            <select name="operator[]" onchange="callBtwn(this.value,2)">
                <option value="">--None--</option>
                <option value="e" <?=( $operator[2] == "e") ? "selected='selected'" : ""; ?>>equals</option>
                <option value="n" <?=( $operator[2] == "n") ? "selected='selected'" : ""; ?>>not equal to</option>
                <option value="s" <?=( $operator[2] == "s") ? "selected='selected'" : ""; ?>>starts with</option>
                <option value="c" <?=( $operator[2] == "c") ? "selected='selected'" : ""; ?>>contains</option>
                <option value="k" <?=( $operator[2] == "k") ? "selected='selected'" : ""; ?>>does not contain</option>
                <option value="l" <?=( $operator[2] == "l") ? "selected='selected'" : ""; ?>>less than</option>
                <option value="g" <?=( $operator[2] == "g") ? "selected='selected'" : ""; ?>>greater than</option>
                <option value="m" <?=( $operator[2] == "m") ? "selected='selected'" : ""; ?>>less or equal</option>
                <option value="h" <?=( $operator[2] == "h") ? "selected='selected'" : ""; ?>>greater or equal</option>
                <option value="u" <?=( $operator[2] == "u") ? "selected='selected'" : ""; ?>>includes</option>
                <option value="x" <?=( $operator[2] == "x") ? "selected='selected'" : ""; ?>>excludes</option>
                <option value="btw" <?=( $operator[2] == "btw") ? "selected='selected'" : ""; ?>>between</option>
            </select>
        </div>
        <div class="filter-col-3">
            <input type="text" name="sFor[]" value="<?=$sFor[2]?>" style="width:130px;" class="myinput"/>
            <div style="float:left; margin-left:5px; display:none;" id='sDiv2'>
            <input type="text" name="sTo[]" value="<?=$sTo[2]?>" style="width:130px;" class="myinput"/>
            </div>
        </div>
    </div>
<!-- end-->
<!-- Start -->
<div class="col-outer-filter">
        <div class="filter-col-1">
            <select name="sIn[]" id="select-from">
                 <option value="" selected="selected">-- None --</option>
                 <?php for($i=0;$i<count($searchList); $i++) { ?>
<option value="<?=$i?>" <?=($sIn[3] != "" && $i == $sIn[3]) ? "selected='selected'" : ""; ?> >
                <?=$searchList[$i]?></option>
                 <? } ?>
</select>
        </div>
        <div class="filter-col-2">
            <select name="operator[]" onchange="callBtwn(this.value,3)">
                <option value="">--None--</option>
                <option value="e" <?=( $operator[3] == "e") ? "selected='selected'" : ""; ?>>equals</option>
                <option value="n" <?=( $operator[3] == "n") ? "selected='selected'" : ""; ?>>not equal to</option>
                <option value="s" <?=( $operator[3] == "s") ? "selected='selected'" : ""; ?>>starts with</option>
                <option value="c" <?=( $operator[3] == "c") ? "selected='selected'" : ""; ?>>contains</option>
                <option value="k" <?=( $operator[3] == "k") ? "selected='selected'" : ""; ?>>does not contain</option>
                <option value="l" <?=( $operator[3] == "l") ? "selected='selected'" : ""; ?>>less than</option>
                <option value="g" <?=( $operator[3] == "g") ? "selected='selected'" : ""; ?>>greater than</option>
                <option value="m" <?=( $operator[3] == "m") ? "selected='selected'" : ""; ?>>less or equal</option>
                <option value="h" <?=( $operator[3] == "h") ? "selected='selected'" : ""; ?>>greater or equal</option>
                <option value="u" <?=( $operator[3] == "u") ? "selected='selected'" : ""; ?>>includes</option>
                <option value="x" <?=( $operator[3] == "x") ? "selected='selected'" : ""; ?>>excludes</option>
                <option value="btw" <?=( $operator[3] == "btw") ? "selected='selected'" : ""; ?>>between</option>
            </select>
        </div>
        <div class="filter-col-3">
            <input type="text" name="sFor[]" value="<?=$sFor[3]?>" style="width:130px;" class="myinput"/>
            <div style="float:left; margin-left:5px; display:none;" id='sDiv3'>
            <input type="text" name="sTo[]" value="<?=$sTo[3]?>" style="width:130px;" class="myinput"/>
            </div>
        </div>
    </div>
<!-- end-->
</div>
<script language="javascript">
<?php if($operator[0] !="") { ?> callBtwn('<?=$operator[0]?>',0); <?php } ?>
<?php
if($operator[1] !="") { ?> callBtwn('<?=$operator[1]?>',1); <?php } ?>
<?php
if($operator[2] !="") { ?> callBtwn('<?=$operator[2]?>',2); <?php } ?>
<?php
if($operator[3] !="") { ?> callBtwn('<?=$operator[3]?>',3); <?php } ?>
</script>