Example #1
0
                 if ($_GET['action'] == 'edit') {
                     $asset->loadEntry($_GET['barcode']);
                     $asset->printForm($_GET['action']);
                 } else {
                     $asset->printForm($_GET['action']);
                 }
             }
         }
     }
 }
 if ($_GET['type'] == 'assettype') {
     $assettype = new AssetType($connection);
     if (isset($_POST['submit'])) {
         if ($_GET['action'] == 'add') {
             $assettype->loadFromPage();
             $assettype->insert();
         } else {
             if ($_GET['action'] == 'edit') {
                 $assettype->loadFromPage();
                 $assettype->update();
             }
         }
     } else {
         if ($_GET['action'] == 'list') {
             $assettype->listAll();
         } else {
             if ($_GET['action'] == 'delete') {
                 if (isset($_GET['confirm'])) {
                     $assettype->deleteAssetType($_GET['index']);
                 } else {
                     $index = $_GET['index'];