function show($return = true) { $pSql = ""; $ctrl = ""; $ops = ""; $cnam = ""; $cid = ""; $pEvts = ""; $pOpts = ""; $extraLbl = ""; $xT = new cTipos(0); $rw = array(); //$xQl = new MQL(); //Sql if ($this->mEsSql == false) { $pSql = "SELECT * FROM " . $this->mSql; } else { $pSql = $this->mSql; } if ($this->mSqlWhere != "") { $pSql = $pSql . $this->mSqlWhere; } if ($this->mSqlLimit != "") { $pSql = $pSql . $this->mSqlLimit; } //if(trim($pSql) != ""){ $this->mRs = getRecordset($pSql); //} if ($this->mRs) { //saveError(2,$_SESSION["SN_b80bb7740288fda1f201890375a60c8f"], "Depurar :" . mysql_error() . "|||Numero: " .mysql_errno() . "|||Instruccion SQL:". $pSql . "|EN:" . $_SESSION["current_file"]); //return 0; //exit(); while ($rw = mysql_fetch_array($this->mRs)) { $slt = ""; $ival = $rw[$this->mFieldValue]; //$ival = $xT->setNoAcentos( $ival ); if ($this->mNoMayus == false) { $ival = strtoupper($ival); } $icap = isset($rw[$this->mFieldCaption]) ? $rw[$this->mFieldCaption] : $rw[$this->mFieldValue]; $icap = str_replace('"', "'", $icap); //$icap = htmlentities($icap); //$icap = $xT->setNoAcentos( $icap ); $icap = $xT->cMayusculas($icap); //$icap = $xT->cChar($icap); if ($this->mOptionSelect == $ival) { switch ($this->mPut) { case "xul": $extraLbl = $rw[$this->mFieldValue]; break; default: $slt = " selected = \"true\" "; break; } } switch ($this->mPut) { case "xul": $ops = $ops . "\n\t\t\t\t\t\t<listitem label=\"{$icap}\" value=\"{$ival}\"{$slt}/>"; break; case "xul-menu": $ops = $ops . "\n\t\t\t\t\t\t<menuitem label=\"{$icap}\" value=\"{$ival}\"{$slt}/>"; break; default: $ops = $ops . "\n\t\t\t\t\t\t<option value=\"{$ival}\"{$slt}>{$icap}</option>"; break; } $this->mCount++; } } //busca si hay ID if ($this->mId == "") { $cid = " id=\"id" . $this->mName . "\" "; } else { $cid = " id=\"" . $this->mId . "\" "; } $iEvts = sizeof($this->mEvents); $iEspOpts = sizeof($this->mEspOption); if ($iEvts > 0) { foreach ($this->mEvents as $key => $value) { $tmpValue = ""; if (isset($this->mEventsValue[$key])) { $tmpValue = "'" . $this->mEventsValue[$key] . "'"; } if (strpos($value, ")") > 0) { $pEvts = $pEvts . " {$key}=\"{$value};\" "; } else { $pEvts = $pEvts . " {$key}=\"{$value}(" . $tmpValue . ");\" "; } } } if ($iEspOpts > 0) { foreach ($this->mEspOption as $tmpOp => $tmpCap) { $sltt = ""; if ($this->mOptionSelect == $tmpOp) { $sltt = " selected = \"true\" "; } switch ($this->mPut) { case "xul": $pOpts = $pOpts . "\n\t\t\t\t\t\t<listitem label=\"{$tmpCap}\" value=\"{$tmpOp}\" {$sltt} />"; break; case "xul-menu": $pOpts = $pOpts . "<menuitem label=\"{$tmpCap}\" value=\"{$tmpOp}\" {$sltt} />"; break; default: $pOpts = $pOpts . "<option value=\"{$tmpOp}\"{$sltt}>{$tmpCap}</option>"; break; } } } switch ($this->mPut) { case "xul": $ctrl = "<listbox rows=\"" . $this->mNRows . "\" {$cid}>\n\t\t\t\t{$ops}\n\t\t\t\t{$pOpts}\n\t\t\t</listbox>"; break; case "xul-menu": //rows=\"" . $this->mNRows . "\" $ctrl = "<menulist label=\"{$extraLbl}\" {$cid}>\n\t\t\t<menupopup>\n\t\t\t\t{$ops}\n\t\t\t\t{$pOpts}\n\t\t\t</menupopup>\n\t\t\t</menulist>"; break; default: $ctrl = "<select size=\"" . $this->mNRows . "\" name=\"" . $this->mName . "\" {$cid} {$pEvts}>\n\t\t\t\t{$ops}\n\t\t\t\t{$pOpts}\n\t\t\t</select>"; break; } if ($return == true) { return $ctrl; } else { echo $ctrl; } }