function update_item(&$mensaje, $id_item, $codigo_proveedor, $codigo_barras, $stock_disponible, $stock_transito, $precio_fob, $precio_nac, $precio_ref, $id_proveedor, $agrupacion)
{
    if (item_scan_oblig($id_item) and $codigo_barras == "") {
        // Si falta alguno de los campos requeridos.
        //
        $mensaje = "Error: Debe ingresar los items marcados con *.";
        return FALSE;
    } else {
        // Si estan todos los campos requeridos
        //
        if (obtener_tipo_proveedor($id_item) == "EXTRANJERO") {
            //Calculo los precios nac y ref a partir del precio_fob ingresado si es un item de proveedor extranjero
            //
            $id_categoria = obtener_categoria($id_item);
            $precio_nac = $precio_fob + $precio_fob * porcentaje_impuesto_categoria($id_categoria) / 100;
            $precio_ref = $precio_nac * precio_dolar();
        }
        $codigo_proveedor = addslashes(trim(strtoupper($codigo_proveedor)));
        if ($codigo_barras == "") {
            $codigo_barras = 'NULL';
        } else {
            $codigo_barras = "\"" . addslashes(trim($codigo_barras)) . "\"";
        }
        if ($precio_fob == "") {
            $precio_fob = 'NULL';
        }
        if ($precio_nac == "") {
            $precio_nac = 'NULL';
        }
        if ($precio_ref == "") {
            $precio_ref = 'NULL';
        }
        get_item_data($datos, $id_item);
        // solo si los precios y los ocultos eran iguales updatear los ocultos con el nuevo precio ingresado
        $oculto_fob = $datos[6] == $datos[9] ? $precio_fob : $datos[9];
        $oculto_nac = $datos[7] == $datos[10] ? $precio_nac : $datos[10];
        $query = "UPDATE Item SET\n\tcodigo_proveedor = \"{$codigo_proveedor}\",\n\tcodigo_barras = {$codigo_barras},\n\tstock_disponible = {$stock_disponible},\n\tstock_transito = {$stock_transito},\n\tprecio_fob = {$precio_fob},\n\tprecio_nac = {$precio_nac},\n\tprecio_ref = {$precio_ref},\n\toculto_fob = {$oculto_fob},\n\toculto_nac = {$oculto_nac},\n\tid_proveedor = {$id_proveedor},\n\tagrupacion_contable = {$agrupacion}\n  WHERE\n\tItem.id_item = {$id_item}";
        if (!($result = mysql_query($query))) {
            // Si hay un error al insertar los datos en la base.
            //
            $mensaje = "Error: El item no pudo ser actualizado. Motivo posible: El codigo de barras del item ya existia.";
            // . mysql_error();
            return FALSE;
        } else {
            // Si se puede insertar los campos en la base.
            //
            $mensaje = "El item ha sido actualizado.";
            return TRUE;
        }
    }
}
Beispiel #2
0
'  width='30' height='30' />
									</a>
								<?php 
    } else {
        ?>
									<a href="" class="skinnytip" data-text="<div style='width:600px;'><img class='armory-itemicon' src='http://wow.zamimg.com/images/wow/icons/large/inv_misc_questionmark.jpg' width='46' height='46' /><div class='item-frame'>This slot is empty <br><br><br></div></div>">
									<img class='armory-itemicon' src='http://wow.zamimg.com/images/wow/icons/large/inv_misc_questionmark.jpg'  width='30' height='30' />
									</a>
								<?php 
    }
    ?>
							</div>
							<div class="itmicn">
								<?php 
    if (isset($charinfo->data3[13])) {
        $trinket2 = get_item_data($charinfo->data3[13]);
        ?>
									<a href="" class="skinnytip" data-text="<div style='width:600px;'><img class='armory-itemicon' src='<?php 
        echo geticon($trinket2['displayID']);
        ?>
' width='46' height='46' /><div class='item-frame'><?php 
        echo return_item_string($trinket2['entry']);
        ?>
</div></div>">
									<img class='armory-itemicon' src='<?php 
        echo geticon($trinket2['displayID']);
        ?>
'  width='30' height='30' />
									</a>
								<?php 
    } else {
function return_item_string($item_entry)
{
    $data = get_item_data($item_entry);
    $string = '<table>';
    $string .= "<tr><td class='item_name'>" . qualityString($data["quality"], $data["name"]) . "</td></tr>";
    if ($data["itemlevel"] > 0) {
        $string .= "<tr><td class='armory-itemlevel'> Item Level " . $data["itemlevel"] . "</td></tr>";
    }
    if ($data["bonding"] > 0) {
        $string .= "<tr><td class='armory-bonding'>" . bondingstring($data["bonding"]) . "</td></tr>";
    }
    $string .= "<tr><td class='armory-inventorytype'>" . inventorytypeString($data["invtype"]) . "</td> <td class='armory-itemclass'>" . itemclass($data["class"], $data["subclass"]) . "</td></tr>";
    if ($data["dmg_min"] > 0 && $data["dmg_max"] > 0 && $data["speed"] > 0) {
        $string .= "<tr><td class='armory-dmgmin'>" . $data["dmg_min"] . "</td><td class='armory-dmdiv'>-</td><td class='armory-dmgmax'> " . $data["dmg_max"] . " Damage</td> <td class='armory-speed'>Speed " . number_format((double) ($data["speed"] / 1000), 2, '.', '') . "</td></tr>";
    }
    if ($data["stat_type1"] <= 7 && $data["stat_value1"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value1"] . " " . stat_typeString($data["stat_type1"]) . "</td></tr>";
    }
    if ($data["stat_type2"] <= 7 && $data["stat_value2"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value2"] . " " . stat_typeString($data["stat_type2"]) . "</td></tr>";
    }
    if ($data["stat_type3"] <= 7 && $data["stat_value3"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value3"] . " " . stat_typeString($data["stat_type3"]) . "</td></tr>";
    }
    if ($data["stat_type4"] <= 7 && $data["stat_value4"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value4"] . " " . stat_typeString($data["stat_type4"]) . "</td></tr>";
    }
    if ($data["stat_type5"] <= 7 && $data["stat_value5"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value5"] . " " . stat_typeString($data["stat_type5"]) . "</td></tr>";
    }
    if ($data["stat_type6"] <= 7 && $data["stat_value6"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value6"] . " " . stat_typeString($data["stat_type6"]) . "</td></tr>";
    }
    if ($data["stat_type7"] <= 7 && $data["stat_value7"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value7"] . " " . stat_typeString($data["stat_type7"]) . "</td></tr>";
    }
    if ($data["stat_type8"] <= 7 && $data["stat_value8"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value8"] . " " . stat_typeString($data["stat_type8"]) . "</td></tr>";
    }
    if ($data["stat_type9"] <= 7 && $data["stat_value9"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value9"] . " " . stat_typeString($data["stat_type9"]) . "</td></tr>";
    }
    if ($data["stat_type10"] <= 7 && $data["stat_value10"] > 0) {
        $string .= "<tr><td class='stats_1'>+" . $data["stat_value10"] . " " . stat_typeString($data["stat_type10"]) . "</td></tr>";
    }
    if ($data["durability"] > 0) {
        $string .= "<tr><td class='durability'>Durability " . $data["durability"] . '/' . $data["durability"] . "</td></tr>";
    }
    if ($data["socket1"] > 0) {
        $string .= "<tr>" . socketColor($data["socket1"]) . "</tr>";
    }
    if ($data["socket2"] > 0) {
        $string .= "<tr>" . socketColor($data["socket2"]) . "</tr>";
    }
    if ($data["socket3"] > 0) {
        $string .= "<tr>" . socketColor($data["socket3"]) . "</tr>";
    }
    if ($data["requiredlevel"] > 0) {
        $string .= "<tr><td class='lvlreq'>Requires Level " . $data["requiredlevel"] . "</td></tr>";
    }
    if ($data["stat_type1"] >= 8 && $data["stat_value1"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type1"]) . " by " . $data["stat_value1"] . "</font></td></tr>";
    }
    if ($data["stat_type2"] >= 8 && $data["stat_value2"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type2"]) . " by " . $data["stat_value2"] . "</font></td></tr>";
    }
    if ($data["stat_type3"] >= 8 && $data["stat_value3"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type3"]) . " by " . $data["stat_value3"] . "</font></td></tr>";
    }
    if ($data["stat_type4"] >= 8 && $data["stat_value4"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type4"]) . " by " . $data["stat_value4"] . "</font></td></tr>";
    }
    if ($data["stat_type5"] >= 8 && $data["stat_value5"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type5"]) . " by " . $data["stat_value5"] . "</font></td></tr>";
    }
    if ($data["stat_type6"] >= 8 && $data["stat_value6"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type6"]) . " by " . $data["stat_value6"] . "</font></td></tr>";
    }
    if ($data["stat_type7"] >= 8 && $data["stat_value7"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type7"]) . " by " . $data["stat_value7"] . "</font></td></tr>";
    }
    if ($data["stat_type8"] >= 8 && $data["stat_value8"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type8"]) . " by " . $data["stat_value8"] . "</font></td></tr>";
    }
    if ($data["stat_type9"] >= 8 && $data["stat_value9"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type9"]) . " by " . $data["stat_value9"] . "</font></td></tr>";
    }
    if ($data["stat_type10"] >= 8 && $data["stat_value10"] > 0) {
        $string .= "<tr><td class='stats_2'><font color='#1eff00'>Equip: Increases " . stat_typeString($data["stat_type10"]) . " by " . $data["stat_value10"] . "</font></td></tr>";
    }
    if ($data["spell1"] > 0) {
        $string .= "<tr><td class='spell'>" . spellStrings($data["spell1"], $data["strigger1"]) . "</td></tr>";
    }
    if ($data["spell2"] > 0) {
        $string .= "<tr><td class='spell'>" . spellStrings($data["spell2"], $data["strigger2"]) . "</td></tr>";
    }
    if ($data["spell3"] > 0) {
        $string .= "<tr><td class='spell'>" . spellStrings($data["spell3"], $data["strigger3"]) . "</td></tr>";
    }
    if ($data["spell4"] > 0) {
        $string .= "<tr><td class='spell'>" . spellStrings($data["spell4"], $data["strigger4"]) . "</td></tr>";
    }
    if ($data["spell5"] > 0) {
        $string .= "<tr><td class='spell'>" . spellStrings($data["spell5"], $data["strigger5"]) . "</td></tr>";
    }
    return $string;
}
Beispiel #4
0
    echo '</header>';
    //loop through
    for ($i = 0; $i < $total_items; $i++) {
        echo '<div class="item">';
        echo '<h2><a rel="external" href="' . get_item_data("link") . '">' . get_item_data("name") . '</a></h2>';
        echo '<div class="top">';
        //echo '<div class="date-added">Added on <span>' . get_item_data("date-added") . '</span></div>';
        if (get_item_data("rating") != "") {
            echo '<div class="rating"><img src="images/rating-' . get_item_data("rating") . '.png" alt="' . get_item_data("rating") . ' star review" title="' . get_item_data("rating") . ' star review" width="110" height="22" /> ';
            echo '<span class="num-ratings">(<a href="' . get_item_data("link") . '#customerReviews">' . get_item_data("total-ratings") . ' Reviews</a>)</span></div>';
        } else {
            echo '<div class="rating"><img src="images/rating-0.png" alt="No ratings" title="No ratings" width="110" height="22" /> ';
            echo '<span class="num-ratings">(No reviews)</span></div>';
        }
        echo '</div>';
        //end top
        echo '<div class="bottom">';
        echo '<img class="picture" src="' . get_item_data("picture") . '" alt="' . get_item_data("item") . ' " title="' . get_item_data("item") . '" />';
        echo '<div class="price"><span>' . get_item_data("new-price") . '</span></div>';
        echo '<div class="buy"><a href="' . get_item_data("link") . '">BUY ME</a></div>';
        echo '<div class="priority"><img src="images/priority-' . get_item_data("priority") . '.png" alt="' . get_item_data("priority") . ' rating" title="' . get_item_data("priority") . ' rating" width="124" height="24" /></div>';
        echo '</div>';
        //end bottom
        if (get_item_data("comment") != "") {
            echo '<div class="comment-top"><div class="comment">Comment: <span>' . get_item_data("comment") . '</span></div></div>';
        }
        echo '</div>';
        //end item
        $item_number++;
    }
}
Beispiel #5
0
<?php

require 'includes/conenct_db.php';
# Includes these helper functions
require 'includes/item_helper.php';
$data = get_item_data($dbc, $_GET['id']);
?>

<head>
<title>Limbo - Item</title>
<link rel="stylesheet" type="text/css" href="limbo.css">
</head>
<?php 
include 'header.html';
?>
<div id='content'>

<h1><?php 
echo $data['description'];
?>
</h1>

</div>
<?php 
include 'footer.html';
        $id_subproducto = $id_item;
        if (item_scan_oblig($id_item)) {
            $barras_class = "obligatorio";
            $barras_sign = "*";
        } else {
            $barras_class = "opcional";
            $barras_sign = "";
        }
        if (mensaje != "") {
            $mensaje = "<script type=\"text/javascript\">alert(\"{$mensaje}\")</script>";
        }
        $var = array("mensaje" => $mensaje, "catname" => $catname, "provname" => $provname, "opcionesprov" => obtener_proveedores($provname), "id_prov" => obtener_id_proveedor($provname), "codigo_proveedor" => $codigo_proveedor, "codigo_barras" => $codigo_barras, "stock_disponible" => $stock_disponible, "stock_transito" => $stock_transito, "precio_fob" => $precio_fob, "precio_nac" => $precio_nac, "precio_ref" => $precio_ref, "oculto_fob" => $oculto_fob, "oculto_nac" => $oculto_nac, "id_subproducto" => $id_subproducto, "barras_class" => $barras_class, "barras_sign" => $barras_sign, "focus" => $focus, "unidad_descarga" => $unidad_descarga, "unidades" => $unidades, "factor_unidades" => $factor_unidades, "agrupacion" => get_item_agrupacion_contable($id_item));
        eval_html('producto_datosmodificar.html', $var);
    }
} elseif ($formname == "item_modificacion") {
    get_item_data($datos, $id_item);
    $catname = $datos[0];
    $provname = $datos[1];
    $codigo_proveedor = $datos[2];
    $codigo_barras = $datos[3];
    $stock_disponible = $datos[4];
    $stock_transito = $datos[5];
    $precio_fob = $datos[6];
    $precio_nac = $datos[7];
    $precio_ref = $datos[8];
    $oculto_fob = $datos[9];
    $oculto_nac = $datos[10];
    $id_unidad_compra = $datos[11];
    $unidades = get_units_opt($id_unidad_compra);
    $factor_unidades = $datos[12];
    $unidad_descarga = get_unidad_descarga($datos[13]);