Beispiel #1
0
function ModForm()
{
    global $xoopsDB;
    $idb = $_GET['idb'];
    if ($idb <= 0) {
        ShowBanns();
        die;
    }
    include 'functions.php';
    $result = $xoopsDB->query("SELECT * FROM {$tbann} WHERE id_ban='{$idb}'");
    $num = $xoopsDB->getRowsNum($result);
    if ($num <= 0) {
        redirect_header('banners.php', 1, _AM_NOEXIST);
        die;
    }
    $row = $xoopsDB->fetchArray($result);
    include XOOPS_ROOT_PATH . "/include/xoopscodes.php";
    xoops_cp_header();
    ShowNav();
    echo "<table width='100%' class='outer' cellspacing='1'>\n\n\t\t\t<tr><th colspan='2'>" . _AM_MODBANN . "</th></tr>\n\t\t\t<form name='frmNew' method='post' action='banners.php'>\n\t\t\t<tr><td class='even' align='left'>" . _AM_FORMSERV . "</td>\n\n\t\t\t<td class='odd' align='left'><select name='ids'>\n\n\t\t\t<option value='0'>" . _AM_SELECTSRV . "</option>";
    $result = $xoopsDB->query("SELECT nombre, id_srv, id_cat FROM " . $xoopsDB->prefix("rmsrv_servicios") . " ORDER BY nombre");
    while ($rw = $xoopsDB->fetchArray($result)) {
        if ($row['id_srv'] == $rw['id_srv']) {
            echo "<option value='{$rw['id_srv']}' selected>{$rw['nombre']} (" . CategoName($rw['id_cat']) . ")</option>";
        } else {
            echo "<option value='{$rw['id_srv']}'>{$rw['nombre']} (" . CategoName($rw['id_cat']) . ")</option>";
        }
    }
    echo "</select></td></tr>\n\t\t  <tr><td class='even' align='left'>" . _AM_FORMIMG . "</td>\n\t\t  <td class='odd' align='left'><textarea cols='30' rows='3' name='img'>{$row['img']}</textarea></td></tr>\n\t\t  <tr><td align='left' class='even'>" . _AM_DESC . "</td>\n\t\t  <td class='odd' align='left'>";
    $GLOBALS['desc'] = $row['desc'];
    xoopsCodeTarea("desc", 20, 15);
    xoopsSmilies("desc");
    echo "</td></tr>\n\n\t\t  <tr><td class='even' align='left'>" . _AM_SHOWBUY . "</td>\n\t\t  <td class='odd' align='left'>";
    if ($row['buy']) {
        echo "<input type='radio' name='buy' value='1' checked='checked' /> " . _AM_YES . "&nbsp;\n\t\t  \t\t  <input type='radio' name='buy' value='0' /> " . _AM_NO . "</td></tr>";
    } else {
        echo "<input type='radio' name='buy' value='1' /> " . _AM_YES . "&nbsp;\n\t\t  \t\t  <input type='radio' name='buy' value='0' checked='checked' /> " . _AM_NO . "</td></tr>";
    }
    echo "<tr><td class='even' align='left'>" . _AM_SHOWBORDER . "</td>\n\t\t  <td class='odd' align='left'>";
    if ($row['showborder']) {
        echo "<input type='radio' name='borde' value='1' checked='checked' /> " . _AM_YES . "&nbsp;\n\t\t  \t\t  <input type='radio' name='borde' value='0' /> " . _AM_NO . "</td></tr>";
    } else {
        echo "<input type='radio' name='borde' value='1' /> " . _AM_YES . "&nbsp;\n\t\t  \t\t  <input type='radio' name='borde' value='0' checked='checked' /> " . _AM_NO . "</td></tr>";
    }
    echo "<tr><td class='even'>&nbsp;</td>\n\t\t  <td class='odd' align='left'><input type='submit' name='sbt' value='" . _AM_SEND . "'></td></tr>\n\t\t  <input type='hidden' name='op' value='savemod'>\n\t\t  <input type='hidden' name='idb' value='{$idb}'></form></table>";
    xoops_cp_footer();
}
Beispiel #2
0
// ------------------------------------------------------------------------ //
// Para Desarrollo de módulos, Diseño de temas para XOOPS y otros servicios //
// dirigete a http://www.redmexico.com.mx                                   //
//////////////////////////////////////////////////////////////////////////////
$location = 'index';
include '../../mainfile.php';
include XOOPS_ROOT_PATH . "/header.php";
$myts =& MyTextSanitizer::getInstance();
$xoopsOption['template_main'] = 'rmsrv_index.html';
//Plantilla para esta página
include 'include/banners.php';
include_once 'include/functions.php';
GetBanner();
//Cargamos los servicios existentes
$result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix('rmsrv_servicios') . " WHERE activo=1 ORDER BY nombre, id_cat");
while ($row = $xoopsDB->fetchArray($result)) {
    setlocale(LC_MONETARY, $xoopsModuleConfig['money']);
    $p1 = money_format($xoopsModuleConfig['formatmoney'], $row['precio']);
    setlocale(LC_MONETARY, $xoopsModuleConfig['secondmoney']);
    $p2 = money_format($xoopsModuleConfig['formatsecondmoney'], $row['precio'] * $xoopsModuleConfig['changetype']);
    $form = FormBuy($row['nombre'], $row['codigo'], $row['precio'], 'srv');
    $xoopsTpl->append('servicios', array('id' => $row['id_srv'], 'nombre' => $row['nombre'], 'img' => $row['img'], 'desc' => $myts->makeTboxData4Show($row['shortdesc']), 'precio' => $p1, 'precio2' => $p2, 'catego' => CategoName($row['id_cat']), 'formbuy' => $form, 'curconvert' => "<br><a href='javascript:;' style='font-size: 10px; font-weight: normal;' onClick=\"openWithSelfMain('http://www.xe.com/ecc/input.cgi?Template=sw&Amount={$row['precio']}','convert',600,170)\">" . _MM_CONVERT_CUR . "</a>"));
}
$result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix('rmsrv_categos') . " ORDER BY nombre");
while ($row = $xoopsDB->fetchArray($result)) {
    $xoopsTpl->append('categos', array('id' => $row['id_cat'], 'nombre' => $row['nombre']));
}
LoadPromos();
$xoopsTpl->assign('lng_precio', _MM_PRICE);
$xoopsTpl->assign('lng_servicios', _MM_OURSERVICES);
include XOOPS_ROOT_PATH . "/footer.php";