示例#1
0
		</div>
<?php 
        break;
        //form to edit/upload documents
    //form to edit/upload documents
    case 'getUploadDocument':
        //document ID passed in for updates only
        if (isset($_GET['documentID'])) {
            $documentID = $_GET['documentID'];
        } else {
            $documentID = '';
        }
        $licenseID = $_GET['licenseID'];
        $document = new Document(new NamedArguments(array('primaryKey' => $documentID)));
        $license = new License(new NamedArguments(array('primaryKey' => $licenseID)));
        if (count($license->getDocumentsWithoutParents('documentID', $documentID)) > 0) {
            $blockArchiveCheck = 'disabled';
        } else {
            $blockArchiveCheck = '';
        }
        //if effective date isn't set, set it to today's date
        if ($document->effectiveDate == "0000-00-00" || $document->effectiveDate == "") {
            $effectiveDate = date("m/d/Y");
        } else {
            $effectiveDate = format_date($document->effectiveDate);
        }
        //if revision date isn't set, set it to today's date
        if ($document->revisionDate == "0000-00-00" || $document->revisionDate == "") {
            $revisionDate = date("m/d/Y");
        } else {
            $revisionDate = format_date($document->revisionDate);
     $displayArchiveInd = '';
 }
 //used to turn on/off display of specific child documents
 if (isset($_GET['showChildrenDocumentID'])) {
     $showChildrenDocumentID = $_GET['showChildrenDocumentID'];
 } else {
     $showChildrenDocumentID = '';
 }
 if ($showChildrenDocumentID == 'undefined') {
     $showChildrenDocumentID = '';
 }
 $license = new License(new NamedArguments(array('primaryKey' => $licenseID)));
 $document = new Document();
 //display archive not sent in for unarchived docs
 if ($displayArchiveInd == '') {
     $documentArray = $license->getDocumentsWithoutParents($parentOrderBy);
     $chJSFunction = "setChildOrder";
     $isArchive = 'N';
 } else {
     if ($displayArchiveInd == '1') {
         $documentArray = $license->getArchivedDocumentsWithoutParents($parentArchivedOrderBy);
         if (count($documentArray) > 0) {
             echo "<font style='font-size:110%;font-weight:bold;'>Archived Documents</font>  <i><a href='javascript:updateArchivedDocuments(2)'>hide archives</a></i>";
         }
         $chJSFunction = "setChildArchivedOrder";
         $childOrderBy = $childArchivedOrderBy;
         $isArchive = 'Y';
     } else {
         $documentArray = $license->getArchivedDocumentsWithoutParents($parentArchivedOrderBy);
         $jsFunction = "setParentArchivedOrder";
         $chJSFunction = "setChildArchivedOrder";