function getCuentasForPut($socio, $tipoOrigen, $tipoDestino) { $xT = new cTipos(0); $sql = "SELECT\n\t`captacion_cuentas`.`numero_cuenta` AS `cuenta`,\n\tCONCAT(`captacion_cuentas`.`numero_cuenta`, '|',\n\t`captacion_subproductos`.`descripcion_subproductos`, '|',\n\t`captacion_cuentas`.`saldo_cuenta`) AS 'descripcion'\nFROM\n\t`captacion_cuentas` `captacion_cuentas` \n\t\tINNER JOIN `captacion_cuentastipos` `captacion_cuentastipos` \n\t\tON `captacion_cuentas`.`tipo_cuenta` = `captacion_cuentastipos`.\n\t\t`idcaptacion_cuentastipos` \n\t\t\tINNER JOIN `captacion_subproductos` `captacion_subproductos` \n\t\t\tON `captacion_cuentas`.`tipo_subproducto` = `captacion_subproductos`\n\t\t\t.`idcaptacion_subproductos` \nWHERE\n\t(`captacion_cuentas`.`numero_socio` = {$socio} )\n\tAND\n\t( `captacion_cuentas`.`tipo_cuenta` = _KEY_ )\n\t_OTHER_\n\t\tORDER BY\n\t\t\t`captacion_cuentas`.`tipo_cuenta`,\n\t\t\t`captacion_cuentas`.`saldo_cuenta` DESC,\n\t\t\t`captacion_cuentas`.`fecha_afectacion`"; $sql1 = str_replace("_KEY_", $tipoOrigen, $sql); if ($tipoOrigen == CAPTACION_TIPO_PLAZO) { $sql1 = str_replace("_OTHER_", " AND (`captacion_cuentas`.`saldo_cuenta` > " . TOLERANCIA_SALDOS . ") AND ( inversion_fecha_vcto =CURDATE() ) ", $sql1); } else { $sql1 = str_replace("_OTHER_", " AND (`captacion_cuentas`.`saldo_cuenta` > " . TOLERANCIA_SALDOS . ") ", $sql1); } $sql2 = str_replace("_KEY_", $tipoDestino, $sql); if ($tipoDestino == CAPTACION_TIPO_PLAZO) { $sql2 = str_replace("_OTHER_", " AND (`captacion_cuentas`.`saldo_cuenta` > " . TOLERANCIA_SALDOS . ") AND ( inversion_fecha_vcto =CURDATE() ) ", $sql2); } else { $sql2 = str_replace("_OTHER_", "", $sql2); } $xSel1 = new cSelect("cCuentaOrigen", "idCuentaOrigen", $sql1); $xSel1->setEsSql(); $xSel1->addEvent("onchange", "jsSetSaldoCuenta"); $xSel1->setNRows(5); // $xSel2 = new cSelect("cCuentaDestino", "idCuentaDestino", $sql2); $xSel2->setEsSql(); $xSel2->setNRows(5); return "<td colspan='2'>De la Cuenta:<br />\n\t\t\t" . $xSel1->show() . "</td>\n\t\t\t<td colspan='2'>A la Cuenta:<br />\n\t\t\t" . $xSel2->show() . "</td>\n"; }
<th>Nombre</th> <th>Tipo de Referencia</th> <th>Opinion Personal</th> <th>Tiempo de conocerlo</th> <th>Guardar Calificación</th> </tr> <?php $sql = "SELECT\n\t`socios_relaciones`.`idsocios_relaciones` AS `control`,\n\tCONCAT(`socios_relaciones`.`nombres`, ' ',\n\t`socios_relaciones`.`apellido_paterno`, ' ',\n\t`socios_relaciones`.`apellido_materno`) AS 'nombre_completo',\n\t`socios_relacionestipos`.`descripcion_relacionestipos` AS `tipo_de_relacion`\n\t,\n\t`socios_relaciones`.`telefono_residencia`,\n\t`socios_relaciones`.`telefono_movil` \nFROM\n\t`socios_relaciones` `socios_relaciones` \n\t\tINNER JOIN `socios_relacionestipos` `socios_relacionestipos` \n\t\tON `socios_relaciones`.`tipo_relacion` = `socios_relacionestipos`.\n\t\t`idsocios_relacionestipos`\nWHERE\n\t(`socios_relaciones`.`socio_relacionado` ={$socio})\n\tAND\n\t(`socios_relacionestipos`.`subclasificacion` =2)"; $rs = mysql_query($sql, cnnGeneral()); while ($rw = mysql_fetch_array($rs)) { $control = $rw["control"]; $defSelOpinion = "<select name=\"cScoreOpinion{$control}\" id=\"idScoreOpinion{$control}\" size=\"3\">\n\t\t\t\t\t\t\t\t<option value=\"10\">Buena</option>\n\t\t\t\t\t\t\t\t<option value=\"5\">Regular</option>\n\t\t\t\t\t\t\t\t<option value=\"0\" selected='true' >Indiferente</option>\n\t\t\t\t\t\t\t\t<option value=\"-5\">Mala</option>\n\t\t\t\t\t\t\t\t<option value=\"-10\">Muy Mala</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t"; $sql = "SELECT\n\t\t\t\t\t\t\t\t`socios_tiempo`.`valor_calificacion_por_referencia`,\n\t\t\t\t\t\t\t\t`socios_tiempo`.`descripcion_tiempo` \n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`socios_tiempo` `socios_tiempo`"; $SelTiempo = new cSelect("ScoreTiempo{$control}", "", $sql); $SelTiempo->setEsSql(); $SelTiempo->setNRows(3); $defSelTiempo = $SelTiempo->show(); //Datos de la DB $nombre = $rw["nombre_completo"]; $relacion = $rw["tipo_de_relacion"]; echo "<tr id =\"tr-{$control}\">\n\t\t\t\t\t<th>{$control}</th>\n\t\t\t\t\t<td>{$nombre}</td>\n\t\t\t\t\t<td>{$relacion}</td>\n\t\t\t\t\t<td>{$defSelTiempo}</td>\n\t\t\t\t\t<td>{$defSelOpinion}</td>\n\t\t\t\t\t<th><a class='button' onclick=\"setScoreReference({$control});\">Guardar Calificación</a></th>\n\t\t\t\t</tr>"; } ?> </tbody> </table> </fieldset> </form> <?php } ?> </body>