当前位置: 首页>>代码示例>>PHP>>正文


PHP CApp::serverCall方法代码示例

本文整理汇总了PHP中CApp::serverCall方法的典型用法代码示例。如果您正苦于以下问题:PHP CApp::serverCall方法的具体用法?PHP CApp::serverCall怎么用?PHP CApp::serverCall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CApp的用法示例。


在下文中一共展示了CApp::serverCall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CSejour

CValue::setSession("praticien_id", $praticien_id);
$sejour = new CSejour();
$ds = $sejour->getDS();
$where = array("praticien_id" => $ds->prepareIn($praticien_id));
if ($date_min) {
    $where["sortie"] = $ds->prepare("BETWEEN ?1 AND ?2", $date_min, $date_max);
} else {
    $where["sortie"] = $ds->prepare("< ?", $date_max);
}
/** @var CSejour[] $sejours */
$sejours = $sejour->loadList($where, "sortie ASC", "{$start},{$step}");
foreach ($sejours as $_sejour) {
    $_sejour->makePDFarchive();
    CAppUI::stepAjax("Archive créée pour le %s du patient '%s'", UI_MSG_OK, $_sejour->_view, $_sejour->loadRefPatient()->_view);
    if (CModule::getActive("dPprescription")) {
        $prescriptions = $_sejour->loadRefsPrescriptions();
        foreach ($prescriptions as $_type => $_prescription) {
            if ($_prescription->_id && in_array($_type, array("pre_admission", "sortie"))) {
                if ($_prescription->countBackRefs("prescription_line_medicament") > 0 || $_prescription->countBackRefs("prescription_line_element") > 0 || $_prescription->countBackRefs("prescription_line_comment") > 0 || $_prescription->countBackRefs("prescription_line_mix") > 0 || $_prescription->countBackRefs("prescription_line_dmi") > 0) {
                    $query = array("m" => "prescription", "raw" => "print_prescription", "prescription_id" => $_prescription->_id, "dci" => 0, "in_progress" => 0, "preview" => 0);
                    $base = $_SERVER["SCRIPT_NAME"] . "?" . http_build_query($query, "", "&");
                    CApp::serverCall("http://127.0.0.1{$base}");
                    CAppUI::stepAjax("Archive créée pour la prescription de %s", UI_MSG_OK, CAppUI::tr("CPrescription.type.{$_type}"));
                }
            }
        }
    }
}
if (count($sejours)) {
    CAppUI::js("nextStepSejours()");
}
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:do_make_sejour_archives.php

示例2: makePDFarchive

 /**
  * Make a PDF document archive of the sejour (based on soins/print_dossier_soins)
  *
  * @param string $title   File title
  * @param bool   $replace Replace existing file
  *
  * @return bool
  * @throws CMbException
  */
 function makePDFarchive($title = "Dossier complet", $replace = false)
 {
     if (!CModule::getActive("soins")) {
         return false;
     }
     $query = array("m" => "soins", "a" => "print_dossier_soins", "sejour_id" => $this->_id, "dialog" => 1, "offline" => 1, "limit" => 10000, "_aio" => 1, "_aio_ignore_scripts" => 1);
     $base = $_SERVER["SCRIPT_NAME"] . "?" . http_build_query($query, "", "&");
     $result = CApp::serverCall("http://127.0.0.1{$base}");
     $content = $result["body"];
     $file = new CFile();
     $file->setObject($this);
     $file->file_name = "{$title}.pdf";
     $file->file_type = "application/pdf";
     /*if ($file->loadMatchingObject()) {
           if ($replace) {
             $file->delete();
     
             // New file
             $file = new CFile();
             $file->setObject($this);
             $file->file_name = "$title.pdf";
             $file->file_type = "application/pdf";
           }
         }*/
     $file->fillFields();
     $file->updateFormFields();
     $file->forceDir();
     $file->author_id = CAppUI::$user->_id;
     $compte_rendu = new CCompteRendu();
     $compte_rendu->_orientation = "portrait";
     $format = CCompteRendu::$_page_formats["a4"];
     $page_width = round(72 / 2.54 * $format[0], 2);
     $page_height = round(72 / 2.54 * $format[1], 2);
     $compte_rendu->_page_format = array(0, 0, $page_width, $page_height);
     $content = str_replace("<!DOCTYPE html>", "", $content);
     CHtmlToPDFConverter::init("CWkHtmlToPDFConverter");
     //CHtmlToPDFConverter::init("CPrinceXMLConverter");
     $pdf = CHtmlToPDFConverter::convert($content, $compte_rendu->_page_format, $compte_rendu->_orientation);
     $file->putContent($pdf);
     if ($msg = $file->store()) {
         throw new CMbException($msg);
     }
     return true;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:53,代码来源:CSejour.class.php


注:本文中的CApp::serverCall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。