<?php //ini_set('display_errors',1); require_once "./common/ini/config.ini.php"; /* * Erro se o usuarios nao esta logados no sistema */ if (!isset($_SESSION["identified"]) || $_SESSION["identified"] != 1) { die($BVS_LANG["error404"]); } $dataModel = new facicOperations(); if (count($_REQUEST['YEAR']) == 0) { $h = $dataModel->getRealHolding($_REQUEST['title']); if (strpos(' ' . $h, 'converting') > 0) { $h = ''; } } if (count($_REQUEST['YEAR']) > 0 || $h == "" || !$h) { $hldgModule = new hldgModule($_SESSION['centerCode'], BVS_ROOT_DIR . "/" . HLDGMODULE, $configurator->getPath2Facic(), $configurator->getPath2Holdings(), $configurator->getPath2Title(), HLDGMODULE_TAG, BVS_DIR . "/cgi-bin/", BVS_TEMP_DIR); if (count($_REQUEST['YEAR']) > 0) { $hldgModule->setTempIssues($_REQUEST['YEAR'], $_REQUEST['VOLU'], $_REQUEST['FASC'], $_REQUEST['TYPE'], $_REQUEST['STAT'], $_REQUEST['SEQN']); } $h = $hldgModule->execute($_REQUEST['title'], HLDGMODULE_DEBUG); } if ($h == "") { $h = "empty"; } echo $h;
$smarty->assign("x", $x); $smarty->assign("yearList", $yearList); } break; case 'confirm_delete': if ($_POST["recid"]) { echo "<!-- [recid]" . $_POST["recid"] . "[/recid] -->"; } else { user_warning($BVS_LANG["confirmDelete"]); } break; case 'delete': $dataModel->deleteRecord($_GET["delete"]); if ($_GET["m"] == 'titleplus') { if ($_REQUEST["title"]) { $facicList = new facicOperations(); $facicList->multipleDelete($_REQUEST["title"]); } } if ($_GET["m"] == 'facic') { /* * The implementation of this section is made when the user * does "save" for the records marked as D in the list of FACIC * getting unnecessary reload the list */ if ($_REQUEST["recid"]) { /* * echo obligatory, used as a return of execution and * used in facic.list.tpl.php */ echo "<!-- [request]";
function importFile() { $strInitialPosition = stripos($_SERVER["SERVER_SOFTWARE"], "Win32"); $serverOS = substr($_SERVER["SERVER_SOFTWARE"], $strInitialPosition, "5"); if ($serverOS == "Win32") { //Variaveis para Windows $pathMX = BVS_DIR . "\\cgi-bin\\mx"; $uploaddir = BVS_DIR . "\\temp\\secs-web\\importedFiles\\"; } else { //Variaveis para Linux $pathMX = BVS_DIR . "/cgi-bin/mx"; $uploaddir = BVS_DIR . "/temp/secs-web/importedFiles/"; } $uploadfile = $uploaddir . $_FILES['importFile']['name']; $extension = end(explode(".", $_FILES['importFile']['name'])); $filesize = $_FILES['importFile']['size']; try { checkExtension($extension); checkFilesize($filesize); } catch (Exception $error) { print $error->getMessage(); die; } if (move_uploaded_file($_FILES['importFile']['tmp_name'], $uploaddir . $_FILES['importFile']['name'])) { $importedFile = file($uploadfile); for ($i = 0; $i < count($importedFile); $i++) { $dataModel = new facicOperations(); $temporaryArray = explode('|', $importedFile[$i]); $array_content = array("database" => "FACIC", "centerCode" => $temporaryArray[0], "titleCode" => $temporaryArray[1], "codeNameMask" => $temporaryArray[2], "year" => $temporaryArray[3], "volume" => $temporaryArray[4], "issue" => $temporaryArray[5], "number" => $temporaryArray[6], "creationDate" => date('Ymd'), "changeDate" => date('Ymd'), "documentalistCreation" => $_SESSION["logged"], "documentalistChange" => $_SESSION["logged"]); print "Registro #" . $i . " incluido com sucesso<br/>"; $dataModel->createRecord($array_content); $dataModel->saveRecord("New"); } } else { //user_error($BVS_LANG["errorImport"],E_USER_ERROR); print "error: "; print_r($_FILES); } }