$response = $client ->track($request);

    if ($response -> HighestSeverity != 'FAILURE' && $response -> HighestSeverity != 'ERROR'){
		if($response->HighestSeverity != 'SUCCESS'){
			echo '<table border="1">';
			echo '<tr><th>Track Reply</th><th>&nbsp;</th></tr>';
			trackDetails($response->Notifications, '');
			echo '</table>';
		}else{
	    	if ($response->CompletedTrackDetails->HighestSeverity != 'SUCCESS'){
				echo '<table border="1">';
			    echo '<tr><th>Shipment Level Tracking Details</th><th>&nbsp;</th></tr>';
			    trackDetails($response->CompletedTrackDetails, '');
				echo '</table>';
			}else{
				echo '<table border="1">';
			    echo '<tr><th>Package Level Tracking Details</th><th>&nbsp;</th></tr>';
			    trackDetails($response->CompletedTrackDetails->TrackDetails, '');
				echo '</table>';
			}
		}
        printSuccess($client, $response);
    }else{
        printError($client, $response);
    } 
    
    writeToLog($client);    // Write to log file   
} catch (SoapFault $exception) {
    printFault($exception, $client);
}
?>
Beispiel #2
0
}
?>
                            </select>
                        </div>
                        <div class="small-3 large-3 columns">
                            <input type="number" name="menge" placeholder="Menge" />
                        </div>
                        <div class="small-3 large-3 columns">
                            <input type="submit" name="erfassen" value="Bestellen" class="button postfix" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <?php 
if (isset($_POST['erfassen'])) {
    // Bestellung erfassen
    $sql = "call lieferantenbestellung(?, ?);";
    $stmt = $db->prepare($sql);
    $stmt->bindValue(1, (int) $_POST['artikel'], PDO::PARAM_INT);
    $stmt->bindValue(2, (int) $_POST['menge'], PDO::PARAM_INT);
    $stmt->execute();
    if (!$stmt) {
        printError("Die Prozedur 'lieferantenbestellung' besteht nicht!");
    } else {
        printSuccess("Die Bestellung wurde erfasst!");
    }
}
?>
    </div>
</div>
Beispiel #3
0
        $sql_file = dirname(__FILE__) . '/sql/import.sql';
        try {
            $sql = file_get_contents($sql_file);
            $bdd->exec($sql);
        } catch (PDOException $e) {
            printError($e->getMessage());
            exit - 1;
        }
        // Generate the hash
        $hash_pass = hashPass($admin_pass);
        // Insert the new admin
        $req = $bdd->prepare('INSERT INTO admin (admin_id, admin_pass) VALUES (?, ?)');
        $req->execute(array($admin_username, $hash_pass));
        unlink($sql_file);
        rmdir(dirname(__FILE__) . '/sql');
        printSuccess('Well done, OpenVPN-Admin is installed.');
    } else {
        require dirname(__FILE__) . '/include/html/menu.php';
        require dirname(__FILE__) . '/include/html/form/installation.php';
    }
    exit - 1;
}
// --------------- CONFIGURATION ---------------
if (!isset($_GET['admin'])) {
    if (isset($error) && $error == true) {
        printError('Login error');
    }
    require dirname(__FILE__) . '/include/html/menu.php';
    require dirname(__FILE__) . '/include/html/form/configuration.php';
} else {
    if (!isset($_SESSION['admin_id'])) {
Beispiel #4
0
<form action='' method='post'>

	<?php 
include '../assets/php/createNav.php';
?>

	<p class='para'>YOU ARE ABOUT TO CLEAR ALL EXISTING TICKETS IN THE TABLE. ARE YOU SURE YOU WANT
	TO DO THIS?</p>
	<input type='submit' class='button' name='submit' value='Submit' />
</form>

<?php 
// Clear the table
if (isset($_POST['submit'])) {
    $query = "DELETE FROM grades WHERE requestor LIKE :requestor";
    $result = getDB()->prepare($query);
    $result->bindParam(':requestor', $_SESSION['user']);
    $result->execute();
    printSuccess('Your grades have been cleared successfully');
}
// Navigation link action controller
navPOST();
?>

</div>
</body>
</html>


    printTitle('mark-en-route');
    $expectedDeliveryDate = $testClient->markEnRoute($orderId, true);
    printSuccess(sprintf(' (expectedDeliveryDate: %s)', $expectedDeliveryDate->format('j. n. Y')));
    printTitle('mark-getting-ready-for-pickup');
    $expectedDeliveryDate = $testClient->markGettingReadyForPickup($orderId);
    printSuccess(sprintf(' (expectedDeliveryDate: %s)', $expectedDeliveryDate->format('j. n. Y')));
    printTitle('mark-ready-for-pickup');
    $testClient->markReadyForPickup($orderId);
    printSuccess();
    printTitle('mark-delivered');
    $testClient->markDelivered($orderId);
    printSuccess();
    printTitle('cancel');
    $cancelOrderItems = [new \SlevomatZboziApi\Request\CancelOrderItem('787887454', 1), new \SlevomatZboziApi\Request\CancelOrderItem('7844544', 2)];
    $testClient->cancelOrder($orderId, $cancelOrderItems, 'Duvod storna');
    printSuccess();
} catch (\SlevomatZboziApi\Request\ConnectionErrorException $e) {
    printError(sprintf('%s %s', $e->getMessage(), $e->getPrevious()->getMessage()));
    //retry request
} catch (\SlevomatZboziApi\Request\InvalidRequestException $e) {
    printError($e->getMessage(), 'red', 'REQUEST ERROR: ');
    //fix error
} catch (\SlevomatZboziApi\ZboziApiException $e) {
    printError($e->getMessage());
    //retry request
}
function printError($message, $color = 'orangered', $startWith = '')
{
    echo sprintf('<br><b style="color: %s">%s%s</b><hr>', $color, $startWith, $message);
}
function printSuccess($additionalInfo = '')
			'Recipient' => addRecipient(),
			'ShippingChargesPayment' => addShippingChargesPayment(),
			'LabelSpecification' => addLabelSpecification(), 
			'MasterTrackingId' => $masterResponse->CompletedShipmentDetail->MasterTrackingId,
			'RateRequestTypes' => array('ACCOUNT', 'LIST'), // valid values ACCOUNT and LIST
			'PackageCount' => 2,
			'RequestedPackageLineItems' => array(
				'0' => addPackageLineItem2()
			)
	    );                                                                                                                                                                                                                                                                
	    $childResponse = $client->processShipment($childRequest); // FedEx web service invocation  
	    
	    writeToLog($client);    // Write to log file
	    
	    if ($childResponse->HighestSeverity != 'FAILURE' && $childResponse->HighestSeverity != 'ERROR'){
	        printSuccess($client, $childResponse);
	
	        $fp = fopen(SHIP_CODCHILDLABEL_1, 'wb');   
	        fwrite($fp, $childResponse->CompletedShipmentDetail->CompletedPackageDetails->CodReturnDetail->Label->Parts->Image); //Create COD Return PNG or PDF file
	        fclose($fp);
	        echo '<a href="./'.SHIP_CODCHILDLABEL_1.'">'.SHIP_CODCHILDLABEL_1.'</a> was generated.'.Newline;
	       
	        // Create PNG or PDF label
	        // Set LabelSpecification.ImageType to 'PDF' for generating a PDF label
	        $fp = fopen(SHIP_CHILDLABEL_1, 'wb');   
	        fwrite($fp, ($childResponse->CompletedShipmentDetail->CompletedPackageDetails->Label->Parts->Image));
	        fclose($fp);
	        echo '<a href="./'.SHIP_CHILDLABEL_1.'">'.SHIP_CHILDLABEL_1.'</a> was generated';   
	    }else{
	        echo 'Processing child master' . Newline;
	    	printError($client, $childResponse);
Beispiel #7
0
}
function printError($error)
{
    echo '<div class="alert alert-danger" style="padding:10px; margin: 10px; margin-bottom: 50px;">';
    echo $error;
    echo '</div>';
}
function printSuccess($success)
{
    echo '<div class="alert alert-success" style="padding:10px; margin: 10px; margin-bottom: 50px;">';
    echo $success;
    echo '</div>';
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (!isset($_POST['name']) || !isset($_POST['email']) || !isset($_POST['message'])) {
        printError('<b class="error">All fields are required!</b>');
    } else {
        if (!isValidEmail($_POST['email'])) {
            printError('<b class="error">Invalid email!</b>');
        } else {
            $message = $_POST['message'];
            $api_user = getenv("SENDGRID_USERNAME");
            $api_key = getenv("SENDGRID_PASSWORD");
            $sendgrid = new SendGrid($api_user, $api_key);
            $email = new SendGrid\Email();
            $email->addTo($email_to)->setFrom("*****@*****.**")->setSubject($subject)->setHtml($message);
            $sendgrid->send($email);
            printSuccess('Message sent successfully!');
        }
    }
}
Beispiel #8
0
        echo 'User already exists; please specify a different username';
        return;
    } else {
        // If username entered is empty, prompt error
        if (strlen(trim($newName)) == 0) {
            echo 'Please specify a username';
            return;
        }
    }
    // Perform password add; check requirements; only checks password length
    if (meetsPasswordLength($newPassword, true)) {
        $hash = password_hash($newPassword, PASSWORD_DEFAULT);
        $query = "INSERT INTO users (username, hash, groups) values (:newName, :hash, :userLevel)";
        $result = getDB()->prepare($query);
        $result->bindParam(':newName', $newName);
        $result->bindParam(':hash', $hash);
        $result->bindParam(':userLevel', $userLevel);
        $result->execute();
        printSuccess('User ' . $newName . ' added to database');
    }
}
// Navigation link action controller
navPOST();
?>

</div>
</body>
</html>


Beispiel #9
0
function process($filename)
{
    $curpath = getcwd() . '/';
    // commands to be launched
    $cmd = 'python processCSV.py ' . $curpath . $filename;
    $exitCode = -1;
    // command launched
    exec($cmd, $output, $exitCode);
    // script executed correctly
    if ($exitCode === 0) {
        $jsonfile = $output[0];
        // bring files to data directory
        // (old files are wiped out)
        copy($jsonfile, '../' . $jsonfile);
        copy($filename, '../' . $filename);
        // success
        printSuccess($filename . " updated.");
    } else {
        // script failed, print error message
        printError($output[0]);
    }
    // update home
    $cmd = 'python processCSV.py updatehome';
    $exitCode = -1;
    exec($cmd, $output, $exitCode);
    if ($exitCode === 0) {
        $jsonfile = $output[0];
        // bring files to data directory
        copy('home.json', '../home.json');
        printSuccess("Homepage data updated.");
    } else {
        printError($output[0]);
    }
}
Beispiel #10
0
require_once "../../resources/init.php";
require_once LIBRARY_PATH . "/emoji.php";
require_once LIBRARY_PATH . "/OP_RETURN.php";
require_once LIBRARY_PATH . "/functions.php";
$pageTitle = "Blockchain Wall";
require_once TEMPLATES_PATH . "/header.php";
// set variables to ""
$message = "";
if (isset($_POST['message'])) {
    $message = $_POST['message'];
    $result = @OP_RETURN_store($message, $config["testnet"]);
    if (isset($result["error"])) {
        printError($result["error"]);
    } else {
        printSuccess("Your message have been successfully sent to the blockchain.");
        // $timestamp = time();
        // set variables ...
    }
} else {
    if (isset($_GET['id'])) {
        // Retrieve message from DB/Blockchain
        // set variables ...
    } else {
        printWarning("No message selected.");
    }
}
?>
<div class="container">
  <div class="card">
    <div class="card-header">