コード例 #1
0
ファイル: api.documents.php プロジェクト: nightflyza/Ubilling
 /**
  * downloads previous users document and check it validity
  * 
  * @param $documentid id of existing document
  * 
  * @return void
  */
 public function downloadUserDocument($documentid)
 {
     $documentid = vf($documentid, 3);
     if (!empty($documentid)) {
         if (isset($this->userDocuments[$documentid])) {
             $documentFileName = $this->userDocuments[$documentid]['path'];
             $fullPath = $this->dOCUMENTS_PATH . $documentFileName;
             zbs_DownloadFile($fullPath, 'docx');
         } else {
             show_window(__('Sorry'), __('No such document'));
         }
     }
 }
コード例 #2
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
                     $templateData = $documents->getUserData();
                     if (isset($us_config['AGENTS_ASSIGN'])) {
                         $userAgentData = $documents->getUserAgentData();
                     } else {
                         $userAgentData = array();
                     }
                     $documents->setCustomFields();
                     $templateData = array_merge($templateData, $documents->getCustomFields(), $userAgentData);
                     //parse document template
                     $docx = new DOCXTemplate($fullPath);
                     $docx->set($templateData);
                     $docx->saveAs($saveFullPath);
                     //register document
                     $documents->registerDocument($user_login, $templateId, $saveFileName);
                     //output
                     zbs_DownloadFile($saveFullPath, 'docx');
                 }
             } else {
                 show_window(__('Sorry'), __('This template is not accessible'));
             }
         } else {
             show_window(__('Sorry'), __('Not existing template'));
         }
     }
 }
 //show docs list
 show_window(__('Previous documents'), $documents->renderUserDocuments());
 //document downloading subroutine
 if (la_CheckGet(array('documentdownload'))) {
     $documents->downloadUserDocument($_GET['documentdownload']);
 }