Example #1
0
<?php

require_once 'test_include.php';
if (isset($_GET["delete_id"])) {
    $message = "Document specified: " . $_GET["delete_id"];
    try {
        $result = Vuzit_Document::destroy($_GET["delete_id"]);
    } catch (Vuzit_Exception $ex) {
        $result = false;
        $message = "Delete failed with code: " . $ex->getCode() . ", message: " . $ex->getMessage();
    }
} else {
    $message = null;
}
?>

<html>
  <head>
    <title>Delete test</title>
  </head>
  <body onload="">
    <h2>
      <?php 
if ($message == null) {
    echo "No document specified";
} else {
    echo $message . "<br/>";
    echo "Success?: " . ($result == true ? 'yes' : 'no');
}
?>
    </h2>
Example #2
0
function delete_command()
{
  header_load();
  try
  {
    $id = get("id");
    Vuzit_Document::destroy($id);
    echo "Delete succeeded: " . $id;
  }
  catch(Vuzit_ClientException $ex)
  {
    echo "Delete of " . $id . " failed with code [" . $ex->getCode() . 
         "], message: " . $ex->getMessage();
  }
  footer_load();
}