Exemplo n.º 1
0
$statusMessage = "";
$statusCode = "";
try {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
        $partNumber = $_POST["PartNumber"];
        $field = $_POST["Field"];
        $value = $_POST["Value"];
    }
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'ModifyItem Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'ModifyItem Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID, "1");
    //1 = Requires edit privileges.
include "IMSBase.php";
$statusArray = "";
$dataArray = "";
$sessionID = "";
$statusCode = 0;
try {
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
    }
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'CheckThresholds Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'CheckThresholds Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID, "0");
    $dataArray = $sql->checkThresholds();
Exemplo n.º 3
0
include "Back_End/IMSLog.php";
include "Back_End/IMSSql.php";
$ipaddress = "";
$date = "";
$message = "";
$SID = "";
$key = "";
$timeout = 3600;
//default is 1 hour (3600 seconds)
try {
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log("UNKNOWN", 'Warning', 'Default Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    //Get Credential Time out Option
    $opt_timeout = $sql->getOption('Credential_Expiry_Time_Seconds');
    $log->add_log("UNKNOWN", 'Warning', "Default Warning: {$opt_timeout}");
    if ($opt_timeout === false) {
        $log->add_log("UNKNOWN", 'Warning', 'Default Warning: Credential_Expiry_Time_Seconds Option missing or invalid.');
    } else {
        $timeout = intval($opt_timeout);
    }
$statusMessage = "";
$statusCode = "";
$runLevel = "";
$dataArray = NULL;
try {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
        $partNumber = $_POST["PartNumber"];
    }
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'RetriveItem Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'RetriveItem Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID);
    //No special permission required.
     $quantity = $_POST["QN"];
 }
 $IMSBase = new IMSBase();
 $log = new IMSLog();
 $sql = new IMSSql();
 $IMSBase->verifyData($supplierNumber, "/^.+\$/", "Supplier Number");
 if ($itemLink == "") {
     $itemLink = "Unknown";
 }
 if ($quantity = "") {
     $quantity = 0;
 }
 //Set IMSLog options
 $opt_debugLog = $sql->getOption('Debug');
 if ($opt_debugLog === false) {
     $log->add_log($sessionID, 'Warning', 'AddPurchaseListItem Warning: Debug Option missing or invalid.');
 } else {
     if ($opt_debugLog == 'False') {
         $log->opt_debug = false;
     } else {
         $log->opt_debug = true;
     }
 }
 $opt_logLoc = $sql->getOption('Log_File_Location');
 if ($opt_logLoc === false) {
     $log->add_log($sessionID, 'Warning', 'AddPurchaseListItem Warning: Log_File_Location Option missing or invalid.');
 } else {
     $log->set_log_location($opt_logLoc);
 }
 $runLevel = $sql->verifySID($sessionID, "1");
 //1 = Requires edit privileges.
$dataArray = NULL;
$statusMessage = "";
$statusCode = "";
$runLevel = "";
try {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
        $emailAddress = $_POST["Email"];
    }
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'AddEmailAddress Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'AddEmailAddress Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID, "1");
    //1 = Requires edit privileges.
$quantity = "";
$somevalue = "";
$dataArray = "";
$aItem = "";
try {
    $sql = new IMSSql();
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $aItem = $_POST['itemList'];
        $sessionID = $_POST['SID'];
    }
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'RemoveManualEntries Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'RemoveManualEntries Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID, "1");
    //1 = Requires edit privileges.
$statusMessage = "";
$statusCode = "";
$runLevel = "";
$suggestionArray = NULL;
try {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
        $filter = $_POST["Filter"];
    }
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'QueryAutocomplete Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'QueryAutocomplete Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID);
    //No Special privileges required.
                        $dataArray .= "message: " . $error['message'] . "\n";
                    }
                }
                print_r(sqlsrv_errors());
                $dataArray .= "* ---End of result --- *\r\n";
                //echo "* ---End of result --- *\r\n";
            } while (sqlsrv_next_result($stmt));
            sqlsrv_free_stmt($stmt);
        }
    }
    sqlsrv_configure("WarningsReturnAsErrors", 1);
    sqlsrv_close($conn);
} catch (PDOException $e) {
    $statusCode = 1;
    $statusMessage = 'CreateDatabase SQLError: ' . $e->getMessage();
    $log->add_log($sessionID, 'Error', $statusMessage);
    echo "Error: " . $e->getMessage();
    sqlsrv_configure("WarningsReturnAsErrors", 1);
    sqlsrv_close($conn);
} catch (Exception $e) {
    $statusCode = $e->getCode();
    $statusMessage = 'CreateDatabase Error: ' . $e->getMessage();
    if (!$log->add_log($sessionID, 'Error', $statusMessage, "N/A", true)) {
        $statusMessage = $statusMessage . " **Logging Failed**";
    }
    echo "Error: " . $e->getMessage();
    sqlsrv_configure("WarningsReturnAsErrors", 1);
    sqlsrv_close($conn);
}
if ($statusCode == 0) {
    $statusMessage = 'Database creation successful.';
$sessionID = "";
$statusMessage = "";
$statusCode = 0;
$tableType = "";
try {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
        $tableType = $_POST["type"];
    }
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'GeneratePurchaseReport Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'GeneratePurchaseReport Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $IMSBase->verifyData($sessionID, "/^.+\$/");
    if ($tableType == "manual") {
Exemplo n.º 11
0
$statusMessage = "";
$statusCode = "";
$runLevel = "";
$partNumberChange = NULL;
try {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        $sessionID = $_POST["SID"];
        $partNumber = $_POST["PartNumber"];
    }
    $IMSBase = new IMSBase();
    $log = new IMSLog();
    $sql = new IMSSql();
    //Set IMSLog options
    $opt_debugLog = $sql->getOption('Debug');
    if ($opt_debugLog === false) {
        $log->add_log($sessionID, 'Warning', 'CreateNewItem Warning: Debug Option missing or invalid.');
    } else {
        if ($opt_debugLog == 'False') {
            $log->opt_debug = false;
        } else {
            $log->opt_debug = true;
        }
    }
    $opt_logLoc = $sql->getOption('Log_File_Location');
    if ($opt_logLoc === false) {
        $log->add_log($sessionID, 'Warning', 'CreateNewItem Warning: Log_File_Location Option missing or invalid.');
    } else {
        $log->set_log_location($opt_logLoc);
    }
    $runLevel = $sql->verifySID($sessionID, "1");
    //1 = Requires edit privileges.