Example #1
0
$lang = $_SESSION["lang"];
include "../lang/dbadmin.php";
if (!isset($_SESSION["permiso"])) {
    die;
}
include "../common/get_post.php";
//foreach ($arrHttp as $var=>$value) echo "$var=$value<br>";
//die;
$fp = fopen($db_path . $arrHttp["base"] . "/def/" . $_SESSION["lang"] . "/" . $arrHttp["nombre"] . ".fmt", "w", 0);
if (!$fp) {
    echo $arrHttp["base"] . "/def/" . $_SESSION["lang"] . "/" . $arrHttp["nombre"] . ".fmt" . " ";
    echo $msgstr["nopudoseractualizado"];
    die;
}
if (isset($arrHttp["wks"])) {
    $fmt = ConstruyeWorksheetFMT();
    foreach ($fmt as $value) {
        $value = trim($value);
        if ($value != "") {
            $res = fwrite($fp, $value . "\n");
        }
    }
    fclose($fp);
    #close the file
}
if (file_exists($db_path . $arrHttp["base"] . "/def/" . $_SESSION["lang"] . "/formatos.wks")) {
    $fp = file($db_path . $arrHttp["base"] . "/def/" . $_SESSION["lang"] . "/formatos.wks");
} else {
    if (file_exists($db_path . $arrHttp["base"] . "/def/" . $lang_db . "/formatos.wks")) {
        $fp = file($db_path . $arrHttp["base"] . "/def/" . $_SESSION["lang"] . "/formatos.wks");
    }
Example #2
0
function PlantillaDeIngreso()
{
    global $arrHttp, $valortag, $tm, $vars, $base, $fdt, $tab_prop, $msgstr, $tagisis, $db_path, $Marc, $tl, $nr, $lang_db;
    $ixsfdt = 0;
    if (!isset($arrHttp["wks"])) {
        ConstruyeWorksheetFDT("");
        return;
    }
    if (isset($arrHttp["wks"]) and $arrHttp["wks"] != "") {
        $ix = strpos($arrHttp["wks"], ".");
        $tipo_f = substr($arrHttp["wks"], $ix);
        if ($tipo_f == ".fdt") {
            ConstruyeWorksheetFDT($arrHttp["wks"]);
            return;
        } else {
            ConstruyeWorksheetFMT($arrHttp["wks"] . ".fmt");
            return;
        }
    } else {
        $tipom = $valortag[trim($tl)] . $valortag[trim($nr)];
        if ($tipom == "") {
            $tipom = $arrHttp["base"] . ".fdt";
        }
        $tipom = strtolower($tipom);
        $archivo = $db_path . $base . "/def/" . $_SESSION["lang"] . "/" . $tipom;
        if (!file_exists($archivo)) {
            $archivo = $db_path . $base . "/def/" . $lang_db . "/" . $tipom;
        }
        $fp = file($archivo);
        $tipov = "";
        $filas = array();
        $vars = array();
        $i = -1;
        foreach ($fp as $linea) {
            if ($i == -1) {
                $i = 0;
            }
            $linea = rtrim($linea);
            if ($linea != "") {
                $vars[] = $linea;
            }
        }
    }
    $FdtHtml = "S";
    $arrHttp["administrador"] = "S";
    for ($ivars = 0; $ivars < count($vars); $ivars++) {
        $linea = $vars[$ivars];
        $t = explode('|', $linea);
        $tag = $t[1];
        $fdt[$tag] = $linea;
    }
}