function buildElements($multiArray)
{
    /*
    * Element Attributes
    * 0-Label str
    * 1-NodeID str
    * 2-Node Attributes str
    * 3-Node Type int
    * 4-Value List array
    * 5-Default Value str
    * 6-DivID
    * 7-Text
    */
    foreach ($multiArray as $pArray => $arrayName) {
        echo '<div class="frmrow" >';
        foreach ($arrayName as $element) {
            $divID = isset($element[6]) ? "id='" . $element[6] . "'" : null;
            $default = isset($element[5]) ? $element[5] : null;
            switch ($element[3]) {
                case 0:
                    /*text*/
                    if ($default != null) {
                        $value = "value=\"" . $default . "\"";
                    } else {
                        $value = "";
                    }
                    echo "<div class=\"frmcol\"><label>" . $element[0] . "</label><input " . $element[2] . " type=\"text\" id=\"" . $element[1] . "\" name=\"" . $element[1] . "\"" . $value . "/></div>";
                    break;
                case 1:
                    /*list*/
                    echo "<div class=\"frmcol\"><label>" . $element[0] . "</label><span {$divID} >" . selList($element[4], $element[1], null, $element[2], null, null, $default) . "</span></div>";
                    break;
                case 2:
                    /*button*/
                    echo '<div class="frmcol"><div>&nbsp;</div><input id="' . $element[1] . '" type="button" ' . $element[2] . ' value="' . $default . '" /></div>';
                    break;
                case 3:
                    /*hidden*/
                    echo "<div class=\"frmcol\"><label>" . $element[0] . "</label><input " . $element[2] . " type=\"hidden\" id=\"" . $element[1] . "\" name=\"" . $element[1] . "\"/></div>";
                    break;
                case 4:
                    /*radio*/
                    echo "<div class=\"frmcol\"><label>" . $element[0] . "</label>";
                    foreach ($element[4] as $radList => $radValue) {
                        $selected = $element[5] == $radValue[0] ? "checked=\"checked\"" : "";
                        echo '<input type="radio" ' . $selected . ' name="' . $element[1] . '" value="' . $radValue[0] . '"/>' . $radValue[1];
                    }
                    echo "</div>";
                    break;
                case 5:
                    /*image*/
                    echo '<div class="frmcol"><img id="' . $element[1] . '"' . $element[2] . ' src="' . $element[0] . '"/></div>';
                    break;
                case 6:
                    /*textarea*/
                    if ($default != null) {
                        $value = hex2str($default);
                    } else {
                        $value = "";
                    }
                    echo "<div class=\"frmcol\"><label>" . $element[0] . "</label><textarea " . $element[2] . " id=\"" . $element[1] . "\" name=\"" . $element[1] . "\">" . $value . "</textarea></div>";
                    break;
                case 7:
                    /*password*/
                    if ($default != null) {
                        $value = "value=\"" . $default . "\"";
                    } else {
                        $value = "";
                    }
                    echo "<div class=\"frmcol\"><label>" . $element[0] . "</label><input " . $element[2] . " type=\"password\" id=\"" . $element[1] . "\" name=\"" . $element[1] . "\"" . $value . "/></div>";
                    break;
                case 8:
                    /*checkbox*/
                    $element[7] = !isset($element[7]) ? '' : $element[7];
                    $selected = $element[5] == 1 ? "checked=\"checked\"" : "";
                    echo '<div ' . $divID . ' class="frmcol"><label>' . $element[0] . '</label><input type="checkbox" ' . $selected . ' name="' . $element[1] . '" value="1"/>' . $element[7] . '</div>';
                    break;
            }
        }
        echo '</div>';
    }
}
Exemple #2
0
$requiredFields = "id_cust_department,srv_board";
?>
<form method="post" name="editBoard" action="javascript:submitFrmVals('content','/_mod/smod_09/insertSQL.php','<?php 
echo $requiredFields;
?>
','&id_srv_board=<?php 
echo $_POST["id_srv_board"];
?>
&edit=1','editBoard')">
<fieldset id="service_board_detail">
<legend>Service Board Detail</legend>
<div class="frmrow">
<div class="frmcol">
<label>*Department</label>
<?php 
echo selList($aDepartment, "id_cust_department", null, null, null, null, $aBoard[0][1]);
?>
</div>
<div class="frmcol">
<label>*Board Name</label>
<input type="text" name="srv_board" id="srv_board" value="<?php 
echo $aBoard[0][2];
?>
"/>
</div>
</div>
</fieldset>
</form>
<div class="cList">
<div id="list09-1" ><?php 
require "listServiceTickets.php";
Exemple #3
0
$gdbo->getRec();
$sdList = $gdbo->dbData;
foreach ($sdList as $key => $col) {
    $sch[$key] = $col[0];
    $schLabel[$key] = $col[1];
    $buttonAdd = '<div class="elementIconBox" onclick="arc(\'add\',\'' . $path . 'sqlResults.php\',\'table=\'+document.getElementById(\'schList\').options[document.getElementById(\'schList\').selectedIndex].value+\'&edit=1\',1,1)"><i class="fa fa-plus"></i></div>';
}
array_multisort($schLabel, SORT_ASC, $sdList);
?>
<script type="text/javascript">$(".icoadd").remove();</script>
<fieldset>
<legend>Manage System Tables</legend>
<div class="frmrow">
<div class="frmcol-x">
<label>Tables</label>
<?php 
echo selList($sdList, "schList", "arc('list12','" . $path . "sqlResults.php','table='+document.getElementById('schList').options[document.getElementById('schList').selectedIndex].value+'&edit=0',1,1);clearPop('add')", "style=\"width:300px !important\"");
echo $buttonAdd;
?>
</div>
</div>
<div id="add"></div>
<div id="list12Nav"></div>
<div id="list12"></div>
<div id="status"></div>
</fieldset>
<script type="text/javascript">
$('#list12').css('width',($('fieldset').innerWidth()-20)+"px");
$('#list12').css('overflow','auto');
</script>
Exemple #4
0
    ?>
 associated service records. What do you want to do to these records?
</div>
<div class="frmrow" style="margin-top:10px">
<div class="frmcol">
<input type="radio" name="srvConfirmation" value="1" onclick="delSrvBoardOption(1)"/>Remove
</div>
<div class="frmcol">
<input type="radio" name="srvConfirmation" value="2" onclick="delSrvBoardOption(2)"/>Do Nothing
</div>
<div class="frmcol">
<input type="radio" name="srvConfirmation" checked="checked" value="0" onclick="delSrvBoardOption(0)"/>Move
</div>
<div class="frmcol">
<?php 
    echo selList($aSrvBoard, "id_srv_board_alt");
    ?>
</div>
</div>
<div id="delList" style="margin-top:10px">
<?php 
    include $path . "dellist.php";
    ?>
</div>
<?php 
}
?>
<div class="frmrow">
<div class="flLeft">
<input type="button" onclick="clearPop()" value="Cancel"/>
</div>
$e = str_replace("!squt!", "'", $e);
$sql = "SELECT {$e} FROM {$d} WHERE {$k} {$l}";
if ($debug == 1) {
    echo $sql;
}
# test if MSSQL or MySQL
if ($h == 0) {
    myRec($r, $con, $c, $sql);
    rec2arrayMY($array, $r);
    mysql_close($con);
} else {
    msRec($r, $con, $c, $sql);
    rec2arrayMS($array, $r);
    mssql_close($con);
}
if ($m == "null") {
    $m = null;
} else {
    $m = str_replace("x34", "\"", $m);
}
if (isset($a)) {
    $label = "<label>{$a}</label>";
} else {
    $label = "";
}
if (count($array) > 0) {
    echo $label . selList($array, $f, $g, $m);
    printArray($a);
} else {
    echo $label . "<select disabled=disabled id=\"{$f}\"><option>--</option></select>";
}
Exemple #6
0
/* ********************************************************************** */
/* list.department */
/* ********************************************************************** */
$gdbo->sql = "SELECT id_cust_department,cust_department FROM _cust_department";
$gdbo->getRec();
$aDepartment = $gdbo->dbData;
/* ********************************************************************** */
$requiredFields = "id_cust_department,srv_board";
?>
<script type="text/javascript">$(".icoadd").remove();</script>
<form method="post" action="javascript:submitFrmVals('content','/_mod/smod_09/insertSQL.php','<?php 
echo $requiredFields;
?>
','&edit=0')">
<fieldset id="service_board_detail">
<legend>Service Board Detail</legend>
<div class="frmrow">
<div class="frmcol">
<label>*Department</label>
<?php 
echo selList($aDepartment, "id_cust_department");
?>
</div>
<div class="frmcol">
<label>*Board Name</label>
<input type="text" name="srv_board" id="srv_board"/>
</div>
</div>
</fieldset>
</form>
<div class="multimenu">
<input type="button" id="phonesAddButton" onclick="multiRowAddElement(this,'frmrow',null,null);hideMFControls(this,'cRemove');booCheck()" class="clAddButton" value="Add">
<input type="button" onclick="multiRowRemoveLastElement(this,'frmrow');" value="Remove Last">
</div>
<div class="frmrow">
<div class="frmcol">
<label>Column</label>
<?php 
echo selList($colFullArray, "x1_filtercol", "getSelFilter(this)", "class=\"mFilterCol\"");
?>
</div>
<div class="frmcol">
<label>Filter</label>
<?php 
$placeholder = array();
echo selList($placeholder, "x1_filterby", "setFilterValue(this)", "disabled=\"disabled\" class=\"mFilterBy\"");
?>
</div>
<div class="frmcol">
<label>Value</label>
<input type="text" id="x1_filterval" name="x1_filterval" class="mFilterVal" disabled="disabled">
</div>
<div class="frmcol">
<label>Filter Group</label>
<select name="x1_grpID" id="x1_grpID" class="mGrpBy">
<?php 
$i = 0;
while ($i < 10) {
    echo "<option value='{$i}'>Group {$i}</option>";
    $i++;
}
    }
}
$attributes = isset($dbo->attributes) ? $dbo->attributes : "";
$recID = isset($dbo->id) ? $dbo->id : "";
if (!empty($_POST["VAL"])) {
    $dbo->sql = $dbo->sql . " " . $dbo->dbFilter . hex2str($_POST["VAL"]);
    $dbo->getRec();
    $results = $dbo->dbData;
    $count = $dbo->dbRows;
    $disabled = "";
} else {
    $results = array();
    $disabled = 'disabled="disabled"';
}
if ($count == 0) {
    $disabled = 'disabled="disabled"';
    $first = null;
    $text = null;
} else {
    $first = $results[0][0];
    $text = $results[0][1];
}
switch ($dbo->type) {
    case "list":
        echo selList($results, $recID, null, $attributes . ' ' . $disabled);
        break;
    case "text":
        echo '<input type="text" name="' . $recID . '" id="' . $recID . '" ' . $attributes . ' readonly="readonly" ' . $disabled . ' value="' . $text . '" />';
        echo '<input type="hidden" name="' . rtrim($recID, "_") . '" id="' . rtrim($recID, "_") . '" value="' . $first . '" />';
        break;
}
Exemple #9
0
        }
        echo "</div>";
    }
} else {
    echo "";
}
?>
</div>
</fieldset>
<fieldset id="resources">
<legend>Resources</legend>
<div class="frmrow">
<div class="frmcol">
<label>Import from Group</label>
<?php 
echo selList($listSystemGroup, "id_sys_group", "arc('fldUser','" . $path . "filterMembers.php','id='+this.options[this.selectedIndex].value,0,1)", "class='elementIcon'");
?>
<span class="elementIconBox" onClick="addResource(<?php 
echo $_POST["id_srv"];
?>
)"><i class="fa fa-check"></i></span>
</div>
</div>
<div id="fldUser" style="display:none">&nbsp;</div>
<div id="listResource">
<?php 
include "listResources.php";
?>
</div>
</fieldset>
<fieldset id="time_entry">
    echo "Period: ".$period[0]." ".$period[1]."<br/>";
    } */
    ?>
<div class="cStatus<?php 
    echo $status;
    ?>
" id="tcStatusBlock"><i class="fa fa-info-circle"></i><strong>Status:</strong> <?php 
    echo $status;
    ?>
</div>
<div class="cList">
<div class="frmrow">
<div class="frmcol">
<label>Year</label>
<?php 
    echo selList($years, "year", "arc('vpPayPeriod','" . $path . "payperiodfiltered.php','yearID='+this.options[this.selectedIndex].value,0,0)", null, null, null, $yearID, true);
    ?>
</div>
<div class="frmcol" id="vpPayPeriod">
<?php 
    if ($payFrequency == "biweekly") {
        $periodLabel = $periodKey / 2 + 1;
    } else {
        $periodLabel = $periodKey + 1;
    }
    require_once "_mod/smod_11/inc_perioddropdown.php";
    ?>
</div>
</div>
<div id="timecard">
<table class="dataGrid" id="tblPayPeriod">