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


PHP CSmartyDP::fetch方法代码示例

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


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

示例1: addObservationDataToTemplate

 /**
  * Ajoute les données des graphiques de supervision
  *
  * @param CTemplateManager $template The template manager
  * @param CMbObject        $object   The host object
  * @param string           $name     The field name
  *
  * @return void
  */
 static function addObservationDataToTemplate(CTemplateManager $template, CMbObject $object, $name)
 {
     $prefix = "Supervision";
     $group_id = CGroups::loadCurrent()->_id;
     $results = array();
     $times = array();
     if ($object->_id) {
         list($results, $times) = CObservationResultSet::getResultsFor($object, false);
         $times = array_combine($times, $times);
     }
     // CSupervisionGraphAxis
     $axis = new CSupervisionGraphAxis();
     $ds = $axis->getDS();
     $where = array("supervision_graph_axis.in_doc_template" => "= '1'", "supervision_graph.owner_class" => "= 'CGroups'", "supervision_graph.owner_id" => $ds->prepare("= ?", $group_id));
     $ljoin = array("supervision_graph" => "supervision_graph.supervision_graph_id = supervision_graph_axis.supervision_graph_id");
     $order = array("supervision_graph.title", "supervision_graph_axis.title");
     /** @var CSupervisionGraphAxis[] $axes */
     $axes = $axis->loadList($where, $order, null, null, $ljoin);
     CStoredObject::massLoadFwdRef($axes, "supervision_graph_id", null, true);
     foreach ($axes as $_axis) {
         $_graph = $_axis->loadRefGraph();
         $_series = $_axis->loadRefsSeries();
         $_axis->loadRefsLabels();
         $_data = array_fill_keys($times, array());
         foreach ($_series as $_serie) {
             $_unit_id = $_serie->value_unit_id ?: "none";
             $_unit_label = $_serie->loadRefValueUnit();
             if (!isset($results[$_serie->value_type_id][$_unit_id])) {
                 continue;
             }
             foreach ($results[$_serie->value_type_id][$_unit_id] as $_value) {
                 foreach ($times as $_time) {
                     if ($_value["datetime"] != $_time) {
                         continue;
                     }
                     $_value["unit"] = $_unit_label->label;
                     $_data["{$_time}"][$_serie->_id] = $_value;
                     break;
                 }
             }
         }
         $view = "";
         if (count($_data)) {
             $smarty = new CSmartyDP("modules/dPsalleOp");
             $smarty->assign("data", $_data);
             $smarty->assign("series", $_series);
             $smarty->assign("times", $times);
             $view = $smarty->fetch("inc_print_observation_result_set.tpl", '', '', 0);
             $view = preg_replace('`([\\n\\r])`', '', $view);
         }
         $template->addProperty("{$name} - {$prefix} - {$_graph->title} - {$_axis->title}", trim($view), "", false);
     }
     // CSupervisionTimedPicture
     // CSupervisionTimedData
     $data = array("CSupervisionTimedPicture", "CSupervisionTimedData");
     foreach ($data as $_class) {
         /** @var CSupervisionTimedPicture|CSupervisionTimedData $_object */
         $_object = new $_class();
         $_table = $_object->_spec->table;
         $_ds = $_object->getDS();
         $where = array("{$_table}.in_doc_template" => "= '1'", "{$_table}.owner_class" => "= 'CGroups'", "{$_table}.owner_id" => $_ds->prepare("= ?", $group_id));
         $order = "title";
         /** @var CSupervisionTimedPicture[]|CSupervisionTimedData[] $_objects */
         $_objects = $_object->loadList($where, $order);
         foreach ($_objects as $_timed) {
             $_data = array_fill_keys($times, null);
             if (!isset($results[$_timed->value_type_id])) {
                 continue;
             }
             foreach ($results[$_timed->value_type_id]["none"] as $_value) {
                 foreach ($times as $_time) {
                     if ($_value["datetime"] != $_time) {
                         continue;
                     }
                     if ($_value["file_id"]) {
                         $_file = new CFile();
                         $_file->load($_value["file_id"]);
                         $_value["datauri"] = $_file->getDataURI();
                         $_value["file"] = $_file;
                     }
                     $_data["{$_time}"] = $_value;
                     break;
                 }
             }
             $view = "";
             if (count($_data)) {
                 $smarty = new CSmartyDP("modules/dPsalleOp");
                 $smarty->assign("data", $_data);
                 $smarty->assign("times", $times);
                 $smarty->assign("timed_data", true);
                 $view = $smarty->fetch("inc_print_observation_result_set.tpl", '', '', 0);
//.........这里部分代码省略.........
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:101,代码来源:CSupervisionGraph.class.php

示例2: fillLimitedTemplate


//.........这里部分代码省略.........
                 $template->addProperty("Patient - confiance - tel", $_correspondant->getFormattedValue("tel"));
                 $template->addProperty("Patient - confiance - mobile", $_correspondant->getFormattedValue("mob"));
                 $template->addProperty("Patient - confiance - parente", $_correspondant->parente);
         }
     }
     // Vider les anciens holders
     for ($i = 1; $i < 4; $i++) {
         $template->addProperty("Patient - médecin correspondant {$i}");
         $template->addProperty("Patient - médecin correspondant {$i} - adresse");
         $template->addProperty("Patient - médecin correspondant {$i} - spécialité");
     }
     $this->loadRefsCorrespondants();
     $i = 0;
     $noms = array();
     foreach ($this->_ref_medecins_correspondants as $corresp) {
         $i++;
         $corresp->loadRefsFwd();
         $medecin = $corresp->_ref_medecin;
         $nom = "{$medecin->nom} {$medecin->prenom}";
         $noms[] = $nom;
         $template->addProperty("Patient - médecin correspondant {$i}", $nom);
         $template->addProperty("Patient - médecin correspondant {$i} - adresse", "{$medecin->adresse}\n{$medecin->cp} {$medecin->ville}");
         $template->addProperty("Patient - médecin correspondant {$i} - spécialité", CMbString::htmlEntities($medecin->disciplines));
     }
     $template->addProperty("Patient - médecins correspondants", implode(" - ", $noms));
     //Liste des séjours du patient
     $this->loadRefsSejours();
     if (is_array($this->_ref_sejours)) {
         foreach ($this->_ref_sejours as $_sejour) {
             $_sejour->loadRefPraticien();
         }
         $smarty = new CSmartyDP("modules/dPpatients");
         $smarty->assign("sejours", $this->_ref_sejours);
         $sejours = $smarty->fetch("print_closed_sejours.tpl", '', '', 0);
         $sejours = preg_replace('`([\\n\\r])`', '', $sejours);
     } else {
         $sejours = CAppUI::tr("CSejour.none");
     }
     $template->addProperty("Patient - liste des séjours", $sejours, '', false);
     $const_med = $this->_ref_constantes_medicales;
     $const_dates = $this->_latest_constantes_dates;
     $grid_complet = CConstantesMedicales::buildGridLatest($const_med, $const_dates, true);
     $grid_minimal = CConstantesMedicales::buildGridLatest($const_med, $const_dates, false);
     $grid_valued = CConstantesMedicales::buildGridLatest($const_med, $const_dates, false, true);
     $smarty = new CSmartyDP("modules/dPpatients");
     // Horizontal
     $smarty->assign("constantes_medicales_grid", $grid_complet);
     $constantes_complet_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_complet_horiz = preg_replace('`([\\n\\r])`', '', $constantes_complet_horiz);
     $smarty->assign("constantes_medicales_grid", $grid_minimal);
     $constantes_minimal_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_minimal_horiz = preg_replace('`([\\n\\r])`', '', $constantes_minimal_horiz);
     $smarty->assign("constantes_medicales_grid", $grid_valued);
     $constantes_valued_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_valued_horiz = preg_replace('`([\\n\\r])`', '', $constantes_valued_horiz);
     // Vertical
     $smarty->assign("constantes_medicales_grid", $grid_complet);
     $constantes_complet_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_complet_vert = preg_replace('`([\\n\\r])`', '', $constantes_complet_vert);
     $smarty->assign("constantes_medicales_grid", $grid_minimal);
     $constantes_minimal_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_minimal_vert = preg_replace('`([\\n\\r])`', '', $constantes_minimal_vert);
     $smarty->assign("constantes_medicales_grid", $grid_valued);
     $constantes_valued_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_valued_vert = preg_replace('`([\\n\\r])`', '', $constantes_valued_vert);
     // Liste des fichiers
开发者ID:fbone,项目名称:mediboard4,代码行数:67,代码来源:CPatient.class.php

示例3: foreach

        }
        $_consultation->loadRefPraticien()->loadRefFunction();
        $patients_offline[$patient->_guid]["consultations"][$_consultation->_ref_chir->function_id] = $_consultation;
    }
    array_multisort(CMbArray::pluck($patients_offline[$patient->_guid]["consultations"], "_datetime"), SORT_DESC, $patients_offline[$patient->_guid]["consultations"]);
    // Constantes
    $patients_offline[$patient->_guid]["constantes"] = "";
    $cstes = array_reverse($_sejour->loadListConstantesMedicales($where_cste));
    if (count($cstes)) {
        CStoredObject::massLoadFwdRef($cstes, "user_id");
        foreach ($cstes as $_cste) {
            $_cste->loadRefUser();
        }
        $smarty_cstes->assign("constantes_medicales_grid", CConstantesMedicales::buildGrid($cstes, false));
        $smarty_cstes->assign("sejour", $_sejour);
        $patients_offline[$patient->_guid]["constantes"] = $smarty_cstes->fetch("print_constantes.tpl", '', '', 0);
    }
    // Plan de soins
    $page_break = 0;
    if (count($patients_offline[$patient->_guid]["transmissions"]) || count($patients_offline[$patient->_guid]["observations"]) || count($patients_offline[$patient->_guid]["consultations"]) || $patients_offline[$patient->_guid]["constantes"]) {
        $page_break = 1;
    }
    $params = array("sejours_ids" => $_sejour->_id, "date" => $date, "hours_before" => "2", "hours_after" => "2", "empty_lines" => "2", "dialog" => 1, "mode_lite" => 1, "page_break" => $page_break);
    $patients_offline[$patient->_guid]["plan_soins"] = CApp::fetch("soins", "offline_plan_soins", $params);
    // Pour IE9 qui a des soucis avec les espaces entre une fermeture et une ouverture de td
    $patients_offline[$patient->_guid]["plan_soins"] = preg_replace('/>\\s+<(t[dh])/mi', "><\\1", $patients_offline[$patient->_guid]["plan_soins"]);
}
if ($service_id != "urgence") {
    if ($service_id == "NP") {
        array_multisort(CMbArray::pluck($patients_offline, "sejour", "_ref_patient", "nom"), SORT_ASC, $patients_offline);
    } else {
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:offline_sejours_lite.php

示例4: CSmartyDP

    $footer->loadContent();
    $facture->fillTemplate($template_footer);
    $template_footer->renderDocument($footer->_source);
    if ($footer->height) {
        $footer_height = $footer->height;
    }
}
$style = file_get_contents("style/mediboard/tables.css");
$smarty = new CSmartyDP();
$smarty->assign("style", $style);
$smarty->assign("facture", $facture);
$smarty->assign("header_height", $header_height);
$smarty->assign("footer_height", $footer_height);
$smarty->assign("header", $template_header->document);
$smarty->assign("footer", $template_footer->document);
$smarty->assign("body_height", 550 - $template_footer->document - $template_header->document);
$content = $smarty->fetch("print_facture.tpl");
$file = new CFile();
$file->file_name = "Impression de la facture.pdf";
$file->setObject($facture);
$file->file_type = "application/pdf";
$file->author_id = CMediusers::get()->_id;
$file->fillFields();
$file->updateFormFields();
$file->forceDir();
$file->store();
$htmltopdf = new CHtmlToPDF("CDomPDFConverter");
$cr = new CCompteRendu();
$cr->_page_format = "a4";
$cr->_orientation = "portrait";
$htmltopdf->generatePDF($content, 1, $cr, $file);
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:print_facture.php

示例5: fillLimitedTemplate

 /**
  * @see parent::fillLimitedTemplate
  */
 function fillLimitedTemplate(&$template)
 {
     global $rootName;
     $this->updateFormFields();
     $this->notify("BeforeFillLimitedTemplate", $template);
     $template->addProperty("Anesthésie - Tabac", $this->tabac);
     $template->addProperty("Anesthésie - Oenolisme", $this->oenolisme);
     $dossier_medical = $this->loadRefPatient()->loadRefDossierMedical();
     $template->addProperty("Anesthésie - Groupe sanguin", $dossier_medical->groupe_sanguin . " " . $dossier_medical->rhesus);
     $template->addProperty("Anesthésie - RAI", $this->rai);
     $template->addProperty("Anesthésie - Hb", "{$this->hb} g/dl");
     $template->addProperty("Anesthésie - Ht", "{$this->ht} %");
     $template->addProperty("Anesthésie - Ht final", "{$this->ht_final} %");
     $template->addProperty("Anesthésie - PSA", "{$this->_psa} ml/GR");
     $template->addProperty("Anesthésie - Plaquettes", $this->plaquettes * 1000 . "/mm3");
     $template->addProperty("Anesthésie - Créatinine", "{$this->creatinine} mg/l");
     $template->addProperty("Anesthésie - Clairance", "{$this->_clairance} ml/min");
     $template->addProperty("Anesthésie - Na+", "{$this->na} mmol/l");
     $template->addProperty("Anesthésie - K+", "{$this->k} mmol/l");
     $template->addProperty("Anesthésie - TP", "{$this->tp} %");
     $template->addProperty("Anesthésie - TCA", "{$this->tca_temoin} s / {$this->tca} s");
     $template->addProperty("Anesthésie - TS Ivy", "{$this->_min_tsivy} min {$this->_sec_tsivy} s");
     $template->addProperty("Anesthésie - ECBU", $this->ecbu);
     $template->addProperty("Anesthésie - Commentaire", $this->result_com);
     $template->addProperty("Anesthésie - ASA", $this->_ref_operation->ASA ? $this->_ref_operation->getFormattedValue("ASA") : $this->getFormattedValue("ASA"));
     $template->addProperty("Anesthésie - Préparation pré-opératoire", $this->prepa_preop);
     $template->addProperty("Anesthésie - Prémédication", $this->premedication);
     $template->addProperty("Anesthésie - Position", $this->_ref_operation->getFormattedValue('position'));
     $list = CMbArray::pluck($this->loadRefsTechniques(), 'technique');
     $template->addListProperty("Anesthésie - Techniques complémentaires", $list);
     $template->addProperty("Anesthésie - Résultats ECG", $this->result_ecg);
     $template->addProperty("Anesthésie - Résultats Radio pulmonaire", $this->result_rp);
     $template->addProperty("Anesthésie - Examen cardiovasculaire", $this->examenCardio);
     $template->addProperty("Anesthésie - Examen pulmonaire", $this->examenPulmo);
     $template->addProperty("Anesthésie - Examen digestif", $this->examenDigest);
     $template->addProperty("Anesthésie - Examen autre", $this->examenAutre);
     $template->addProperty("Anesthésie - Type d'anesthésie", $this->_ref_operation->type_anesth ? $this->_ref_operation->getFormattedValue("type_anesth") : $this->getFormattedValue("type_anesth"));
     $template->addProperty("Anesthésie - Ouverture de la bouche", $this->getFormattedValue('bouche'), null, false);
     $template->addProperty("Anesthésie - Intubation", CAppUI::tr("CConsultAnesth-_intub_" . ($this->_intub_difficile ? "difficile" : "pas_difficile")));
     $ventilation = $this->plus_de_55_ans ? "Plus de 55 ans, " : "";
     $ventilation .= $this->imc_sup_26 ? "IMC > 26Kg/m², " : "";
     $ventilation .= $this->edentation ? "Edentation, " : "";
     $ventilation .= $this->ronflements ? "Ronflements, " : "";
     $ventilation .= $this->barbe ? "Barbe" : "";
     $ventilation .= $this->piercing ? "Piercing" : "";
     $template->addProperty("Anesthésie - Critères de ventilation", $ventilation ? $ventilation : "Aucun", null, false);
     $template->addProperty("Anesthésie - Distance thyro-mentonnière", $this->getFormattedValue('distThyro'), null, false);
     $template->addProperty("Anesthésie - Mobilité cervicale", $this->getFormattedValue('mob_cervicale'), null, false);
     $template->addProperty("Anesthésie - Etat bucco-dentaire", $this->etatBucco);
     $img = "";
     if ($this->mallampati) {
         $img = $this->mallampati . '<br /> .
     <img src="/' . $rootName . '/images/pictures/' . $this->mallampati . '.png" alt="' . $this->mallampati . '" />';
     }
     $template->addProperty("Anesthésie - Mallampati", $img, null, false);
     $template->addProperty("Anesthésie - Mallampati (texte seul)", $this->getFormattedValue("mallampati"));
     $template->addProperty("Anesthésie - Remarques", $this->conclusion);
     $template->addProperty("Anesthésie - Score APFEL", $this->_score_apfel);
     $template->addProperty("Anesthésie - Stratégie antibioprophylactique ", $this->strategie_antibio);
     // Constantes médicales dans le contexte de la consultation
     $this->loadRefConsultation();
     $patient = $this->loadRefPatient();
     $patient->loadRefLatestConstantes(null, null, $this->_ref_consultation, false);
     $const_dates = $patient->_latest_constantes_dates;
     $const_med = $patient->_ref_constantes_medicales;
     $const_med->updateFormFields();
     $grid_complet = CConstantesMedicales::buildGridLatest($const_med, $const_dates, true);
     $grid_minimal = CConstantesMedicales::buildGridLatest($const_med, $const_dates, false);
     $grid_valued = CConstantesMedicales::buildGridLatest($const_med, $const_dates, false, true);
     $smarty = new CSmartyDP("modules/dPpatients");
     // Horizontal
     $smarty->assign("constantes_medicales_grid", $grid_complet);
     $constantes_complet_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_complet_horiz = preg_replace('`([\\n\\r])`', '', $constantes_complet_horiz);
     $smarty->assign("constantes_medicales_grid", $grid_minimal);
     $constantes_minimal_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_minimal_horiz = preg_replace('`([\\n\\r])`', '', $constantes_minimal_horiz);
     $smarty->assign("constantes_medicales_grid", $grid_valued);
     $constantes_valued_horiz = $smarty->fetch("print_constantes.tpl", '', '', 0);
     $constantes_valued_horiz = preg_replace('`([\\n\\r])`', '', $constantes_valued_horiz);
     // Vertical
     $smarty->assign("constantes_medicales_grid", $grid_complet);
     $constantes_complet_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_complet_vert = preg_replace('`([\\n\\r])`', '', $constantes_complet_vert);
     $smarty->assign("constantes_medicales_grid", $grid_minimal);
     $constantes_minimal_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_minimal_vert = preg_replace('`([\\n\\r])`', '', $constantes_minimal_vert);
     $smarty->assign("constantes_medicales_grid", $grid_valued);
     $constantes_valued_vert = $smarty->fetch("print_constantes_vert.tpl", '', '', 0);
     $constantes_valued_vert = preg_replace('`([\\n\\r])`', '', $constantes_valued_vert);
     $template->addProperty("Anesthésie - Constantes - mode complet horizontal", $constantes_complet_horiz, '', false);
     $template->addProperty("Anesthésie - Constantes - mode minimal horizontal", $constantes_minimal_horiz, '', false);
     $template->addProperty("Anesthésie - Constantes - mode avec valeurs horizontal", $constantes_valued_horiz, '', false);
     $template->addProperty("Anesthésie - Constantes - mode complet vertical", $constantes_complet_vert, '', false);
     $template->addProperty("Anesthésie - Constantes - mode minimal vertical", $constantes_minimal_vert, '', false);
     $template->addProperty("Anesthésie - Constantes - mode avec valeurs vertical", $constantes_valued_vert, '', false);
     if (CModule::getActive("forms")) {
//.........这里部分代码省略.........
开发者ID:fbone,项目名称:mediboard4,代码行数:101,代码来源:CConsultAnesth.class.php

示例6: foreach

    $i = array_search($salle_id, $salles_ids);
    CMbObject::massLoadRefsNotes($_plages);
    CMbObject::massLoadFwdRef($_plages, "chir_id");
    CMbObject::massLoadFwdRef($_plages, "anesth_id");
    CMbObject::massLoadFwdRef($_plages, "spec_id");
    foreach ($_plages as $_plage) {
        $_plage->loadRefsNotes();
        $_plage->loadRefChir()->loadRefFunction();
        $_plage->loadRefSpec();
        $_plage->loadRefAnesth()->loadRefFunction();
        $debut = "{$i} " . CMbDT::time($_plage->debut);
        $duree = CMbDT::minutesRelative(CMbDT::time($_plage->debut), CMbDT::time($_plage->fin));
        //fetch
        $smarty = new CSmartyDP("modules/reservation");
        $smarty->assign("plageop", $_plage);
        $smarty_plageop = $smarty->fetch("inc_planning/libelle_plageop.tpl");
        $smarty_plageop = htmlspecialchars_decode(CMbString::htmlEntities($smarty_plageop, ENT_NOQUOTES), ENT_NOQUOTES);
        $event = new CPlanningEvent($_plage->_guid, $debut, $duree, $smarty_plageop, "#efbf99", true, null, $_plage->_guid, false);
        $event->below = true;
        $event->type = "plage_planning";
        $event->plage["id"] = $_plage->_id;
        if ($can_edit) {
            $event->addMenuItem("edit", CMbString::htmlEntities("Modifier cette plage"));
            $event->addMenuItem("list", CMbString::htmlEntities("Gestion des interventions"));
        }
        $planning->addEvent($event);
    }
}
$m = $save_m;
$planning->rearrange(true);
//ReArrange the planning
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:ajax_vw_planning.php

示例7: fillLimitedTemplate


//.........这里部分代码省略.........
     $template->addTimeProperty("Opération - fin induction", $this->induction_fin);
     $template->addTimeProperty("Opération - retrait garrot", $this->retrait_garrot);
     $template->addTimeProperty("Opération - sortie bloc", $this->sortie_salle);
     $template->addTimeProperty("Opération - entrée SSPI", $this->entree_reveil);
     $template->addTimeProperty("Opération - sortie SSPI", $this->sortie_reveil_reel);
     $template->addProperty("Opération - dépassement anesth", $this->depassement_anesth);
     $template->addProperty("Opération - Passage USCPO", "{$this->duree_uscpo} nuit(s)");
     if (CModule::getActive("mvsante")) {
         $template->addTimeProperty("Opération - Remise au chirurgien", $this->remise_chir);
         /** @var CLiaisonLibelleInterv[] $liaisons_libelles */
         $liaisons_libelles = $this->loadBackRefs("liaison_libelle", "numero");
         CMbObject::massLoadFwdRef($liaisons_libelles, "libelleop_id");
         $libelles = array(0 => "", 1 => "", 2 => "", 3 => "");
         foreach ($liaisons_libelles as $_liaison) {
             $libelles[$_liaison->numero - 1] = $_liaison->loadRefLibelle()->nom;
         }
         $template->addProperty("Opération - Libellé 1", $libelles[0]);
         $template->addProperty("Opération - Libellé 2", $libelles[1]);
         $template->addProperty("Opération - Libellé 3", $libelles[2]);
         $template->addProperty("Opération - Libellé 4", $libelles[3]);
     }
     $template->addProperty("Opération - depassement", $this->depassement);
     $template->addProperty("Opération - exams pre-op", $this->examen);
     $template->addProperty("Opération - matériel", $this->materiel);
     $template->addProperty("Opération - exam per-op", $this->exam_per_op);
     $template->addProperty("Opération - convalescence", $this->_ref_sejour->convalescence);
     $template->addProperty("Opération - remarques", $this->rques);
     $template->addProperty("Opération - Score ASA", $this->getFormattedValue("ASA"));
     $consult_anesth = $this->_ref_consult_anesth;
     $consult = $consult_anesth->loadRefConsultation();
     $consult->loadRefPlageConsult();
     $prat = $consult->loadRefPraticien();
     $template->addDateProperty("Opération - Consultation anesthésie - Date", $consult->_id ? $consult->_datetime : "");
     $template->addLongDateProperty("Opération - Consultation anesthésie - Date (longue)", $consult->_id ? $consult->_datetime : "");
     $template->addLongDateProperty("Opération - Consultation anesthésie - Date (longue, minuscule)", $consult->_id ? $consult->_datetime : "", true);
     $template->addTimeProperty("Opération - Consultation anesthésie - Heure", $consult->_id ? $consult->_datetime : "");
     $template->addProperty("Opération - Consultation anesthésie - Praticien - Prénom", $consult->_id ? $prat->_user_first_name : "");
     $template->addProperty("Opération - Consultation anesthésie - Praticien - Nom", $consult->_id ? $prat->_user_last_name : "");
     $template->addProperty("Opération - Consultation anesthésie - Remarques", $consult->rques);
     /** @var CMediusers $prat_visite */
     $prat_visite = $this->loadFwdRef("prat_visite_anesth_id", true);
     $template->addDateProperty("Opération - Visite pré anesthésie - Date", $this->date_visite_anesth);
     $template->addLongDateProperty("Opération - Visite pré anesthésie - Date (longue)", $this->date_visite_anesth);
     $template->addProperty("Opération - Visite pré anesthésie - Rques", $this->getFormattedValue("rques_visite_anesth"));
     $template->addProperty("Opération - Visite pré anesthésie - Autorisation", $this->getFormattedValue("autorisation_anesth"));
     $template->addProperty("Opération - Visite pré anesthésie - Praticien - Prénom", $prat_visite->_user_first_name);
     $template->addProperty("Opération - Visite pré anesthésie - Praticien - Nom", $prat_visite->_user_last_name);
     $template->addBarcode("Opération - Code Barre ID", $this->_id);
     $list = CMbArray::pluck($this->_ref_files, "file_name");
     $template->addListProperty("Opération - Liste des fichiers", $list);
     foreach ($this->_ref_affectations_personnel as $emplacement => $affectations) {
         $locale = CAppUI::tr("CPersonnel.emplacement.{$emplacement}");
         $property = implode(" - ", CMbArray::pluck($affectations, "_ref_personnel", "_ref_user", "_view"));
         $template->addProperty("Opération - personnel réel - {$locale}", $property);
     }
     foreach ($plageop->_ref_affectations_personnel as $emplacement => $affectations) {
         $locale = CAppUI::tr("CPersonnel.emplacement.{$emplacement}");
         $property = implode(" - ", CMbArray::pluck($affectations, "_ref_personnel", "_ref_user", "_view"));
         $template->addProperty("Opération - personnel prévu - {$locale}", $property);
     }
     $evts = $incidents = array();
     foreach ($this->loadRefsAnesthPerops() as $_evt) {
         if ($_evt->incident) {
             $incidents[] = $_evt;
             continue;
         }
         $evts[] = $_evt;
     }
     $template->addListProperty("Opération - Evenements per-opératoires", $evts);
     $template->addListProperty("Opération - Incidents per-opératoires", $incidents);
     CSupervisionGraph::addObservationDataToTemplate($template, $this, "Opération");
     if (CModule::getActive("forms")) {
         CExObject::addFormsToTemplate($template, $this, "Opération");
     }
     if (CAppUI::conf("dPsalleOp enable_surveillance_perop")) {
         $obs_view = "";
         if ($template->valueMode && $this->_id && $this->graph_pack_id) {
             /** @var CObservationResultSet[] $list_obr */
             list($list, $grid, $graphs, $labels, $list_obr) = CObservationResultSet::getChronological($this, $this->graph_pack_id);
             foreach ($grid as $_row) {
                 /** @var CObservationResult[] $_row */
                 foreach ($_row as $_cell) {
                     if ($_cell && $_cell->file_id) {
                         $_cell->loadRefFile()->getDataUri();
                     }
                 }
             }
             $smarty = new CSmartyDP("modules/dPpatients");
             // Horizontal
             $smarty->assign("observation_grid", $grid);
             $smarty->assign("observation_labels", $labels);
             $smarty->assign("observation_list", $list_obr);
             $smarty->assign("in_compte_rendu", true);
             $obs_view = $smarty->fetch("inc_observation_results_grid.tpl", '', '', 0);
             $obs_view = preg_replace('`([\\n\\r])`', '', $obs_view);
         }
         $template->addProperty("Opération - Tableau supervision", $obs_view, '', false);
     }
     $this->notify("AfterFillLimitedTemplate", $template);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:101,代码来源:COperation.class.php

示例8: createClassFromXSD

 /**
  * fonction permettant de créér la structure principal des classes d'un XSD
  *
  * @return bool
  */
 static function createClassFromXSD()
 {
     $pathXSD = "modules/cda/resources/POCD_MT000040.xsd";
     $pathDir = "modules/cda/classes/classesCDA/classesGenerate/";
     $dom = new CMbXMLDocument("UTF-8");
     $dom->load($pathXSD);
     $xpath = new CMbXPath($dom);
     $xpath->registerNamespace("xs", "http://www.w3.org/2001/XMLSchema");
     $nodeList = $xpath->query("//xs:complexType[@name] | //xs:simpleType[@name]");
     foreach ($nodeList as $_node) {
         $tabVariable = array();
         $tabProps = array();
         /** @var DOMElement $_node */
         $elements = $_node->getElementsByTagName("element");
         $nodeAttributes = $_node->getElementsByTagName("attribute");
         $nameNode = $xpath->queryAttributNode(".", $_node, "name");
         $nameNode = str_replace(".", "_", $nameNode);
         list($tabVariable, $tabProps) = self::createPropsForElement($elements, $tabVariable, $tabProps);
         list($tabVariable, $tabProps) = self::createPropsForElement($nodeAttributes, $tabVariable, $tabProps);
         $smarty = new CSmartyDP();
         $smarty->assign("name", $nameNode);
         $smarty->assign("variables", $tabVariable);
         $smarty->assign("props", $tabProps);
         $data = $smarty->fetch("defaultClassCDA.tpl");
         file_put_contents($pathDir . "CCDA" . $nameNode . ".class.php", $data);
     }
     return true;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:33,代码来源:CCdaTools.class.php

示例9: CDoObjectAddEdit

<?php

/**
 * $Id: do_fichePaie_save.php 19621 2013-06-20 20:40:45Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage GestionCab
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19621 $
 */
mbTrace("Start");
$do = new CDoObjectAddEdit("CFichePaie");
$do->redirect = null;
$do->doIt();
mbTrace("End");
$fichePaie = new CFichePaie();
$fichePaie->load($do->_obj->_id);
$fichePaie->loadRefsFwd();
$fichePaie->_ref_params_paie->loadRefsFwd();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("fichePaie", $fichePaie);
$fichePaie->final_file = $smarty->fetch("print_fiche.tpl");
mbTrace($fichePaie->store());
CApp::rip();
开发者ID:fbone,项目名称:mediboard4,代码行数:26,代码来源:do_fichePaie_save.php

示例10: foreach

    $_plage_consult->countPatients();
    $_plage_consult->_ref_chir->loadRefFunction();
    $_plage_consult->updateFormFields();
    $_plage_consult->loadFillRate();
    /** @var $consultations CConsultation[] */
    foreach ($_plage_consult->_ref_consultations as $_consult) {
        if (isset($resumes_patient[$_consult->patient_id])) {
            continue;
        }
        $patient = $_consult->loadRefPatient();
        $patient->loadDossierComplet();
        $patient->loadRefDossierMedical();
        $smarty = new CSmartyDP();
        $smarty->assign("offline", 1);
        $smarty->assign("patient", $_consult->_ref_patient);
        $resumes_patient[$patient->_id] = $smarty->fetch("vw_resume.tpl");
        //dynamic assignment
        if ($_consult->patient_id) {
            $nbConsultations++;
        }
    }
}
//smarty global
$smarty = new CSmartyDP();
$smarty->assign("consultations", $Pconsultations);
$smarty->assign("nbConsultations", $nbConsultations);
$smarty->assign("date_generated", CMbDT::dateTime());
$smarty->assign("praticiens", $praticiens);
$smarty->assign("resumes_patient", $resumes_patient);
$smarty->assign("date", $date);
$smarty->display("vw_offline/consult_patients.tpl");
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_offline_consult_patients.php

示例11: store

 /**
  * @see parent::store()
  */
 function store()
 {
     // Must store to get all fields
     if ($this->_final_store) {
         $this->loadRefsFwd();
         $this->_ref_params_paie->loadRefsFwd();
         $this->updateFormFields();
         // Création du template
         $smarty = new CSmartyDP();
         $smarty->assign("fichePaie", $this);
         $this->final_file = $smarty->fetch("print_fiche.tpl");
         file_put_contents("tmp/fichePaie.htm", $this->final_file);
     }
     return parent::store();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:18,代码来源:CFichePaie.class.php

示例12: loadHTMLcontent

 /**
  * Construit une source html
  *
  * @param string $htmlcontent html source to use if not a model
  * @param string $mode        [optional]
  * @param array  $margins     [optional]
  * @param string $font        Font name
  * @param string $size        Font size
  * @param string $auto_print  [optional]
  * @param string $type        [optional]
  * @param string $header      [optional]
  * @param int    $sizeheader  [optional]
  * @param string $footer      [optional]
  * @param int    $sizefooter  [optional]
  * @param string $preface     [optional]
  * @param string $ending      [optional]
  *
  * @return string
  */
 function loadHTMLcontent($htmlcontent, $mode = "modele", $margins = array(), $font = "", $size = "", $auto_print = true, $type = "body", $header = "", $sizeheader = 0, $footer = "", $sizefooter = 0, $preface = "", $ending = "")
 {
     $default_font = $font;
     $default_size = $size;
     if ($default_font == "") {
         $default_font = CAppUI::conf("dPcompteRendu CCompteRendu default_font");
     }
     if ($default_size == "") {
         $default_size = CAppUI::conf("dPcompteRendu CCompteRendu default_size");
     }
     $style = file_get_contents("style/mediboard/htmlarea.css") . "@page {\n         margin-top:    {$margins[0]}cm;\n         margin-right:  {$margins[1]}cm;\n         margin-bottom: {$margins[2]}cm;\n         margin-left:   {$margins[3]}cm;\n       }\n       body, table {\n         font-family: {$default_font};\n         font-size: {$default_size};\n       }\n       body {\n         margin:  0;\n         padding: 0;\n       }\n       .orig {\n         display: none;\n       }";
     $content = "";
     $position = array("header" => "top", "footer" => "bottom");
     if ($mode == "modele") {
         switch ($type) {
             case "header":
             case "footer":
                 $position = $position[$type];
                 $sizeheader = $sizeheader != '' ? $sizeheader : 50;
                 $style .= "\n            #{$type} {\n              height: {$sizeheader}px;\n              {$position}: 0cm;\n              width: auto;\n            }";
                 $content = "<div id=\"{$type}\">{$htmlcontent}</div>";
                 break;
             case "body":
             case "preface":
             case "ending":
                 if ($header) {
                     $sizeheader = $sizeheader != '' ? $sizeheader : 50;
                     $padding_top = $sizeheader;
                     $style .= "\n                @media print {\n                  body { \n                    margin-top: {$padding_top}px;\n                  }\n                  #header {\n                    height: {$sizeheader}px;\n                    top: 0cm;\n                  }\n                }";
                     $content .= "<div id=\"header\">{$header}</div>";
                 }
                 if ($footer) {
                     $sizefooter = $sizefooter != '' ? $sizefooter : 50;
                     $padding_bottom = $sizefooter;
                     $style .= "\n                @media print {\n                  body { \n                    margin-bottom: {$padding_bottom}px;\n                  }\n                  #footer {\n                    height: {$sizefooter}px;\n                    bottom: 0cm;\n                  }\n                }";
                     $content .= "<div id=\"footer\">{$footer}</div>";
                 }
                 if ($preface) {
                     $htmlcontent = "{$preface}<br />" . $htmlcontent;
                 }
                 if ($ending) {
                     $htmlcontent .= "<br />{$ending}";
                 }
                 $content .= "<div id=\"body\">{$htmlcontent}</div>";
         }
     } else {
         $content = $htmlcontent;
     }
     $smarty = new CSmartyDP();
     $smarty->assign("style", $style);
     $smarty->assign("content", $content);
     $smarty->assign("auto_print", $auto_print);
     return $smarty->fetch("../../dPcompteRendu/templates/htmlheader.tpl");
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:73,代码来源:CCompteRendu.class.php

示例13: loadFiles

 /**
  * Builds a list of HTML <link> tags to load the stylesheets of the theme
  * 
  * @param string $theme The theme name
  * @param string $media A valid CSS media query
  * @param string $type  The mime type to load the stylesheets
  * 
  * @return string A list of HTML <link> tags 
  */
 static function loadFiles($theme = "mediboard", $media = "all", $type = "text/css")
 {
     $compress = CAppUI::conf("minify_css");
     if ($theme === "modules") {
         $files = glob("modules/*/css/main.css");
         $files = array_merge($files, glob("modules/*/css/templates/main.css.tpl"));
     } else {
         if ($theme === "mobile") {
             $path = "mobile/style";
         } else {
             $path = "style/{$theme}";
         }
         /*if (!$compress) {
             $css_file = "$path/main.css";
             return self::loadFile($css_file, $media, null, self::getLastChange($css_file), $type);
           }*/
         if (file_exists("{$path}/css.list")) {
             $list = file("{$path}/css.list", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
             $list = array_map("trim", $list);
         } else {
             $list = array("main.css");
         }
         $files = array();
         foreach ($list as $_file) {
             $files[] = "{$path}/{$_file}";
         }
     }
     $result = "";
     $uptodate = false;
     $hash = self::getHash(implode("", $files) . "-level-{$compress}");
     $cachefile = "tmp/{$hash}-{$theme}.css";
     $last_update = null;
     // If it exists, we check if it is up to date
     if (file_exists($cachefile)) {
         $uptodate = true;
         $last_update = self::getLastChange($cachefile);
         foreach ($files as $file) {
             if (self::getLastChange($file) > $last_update) {
                 $uptodate = false;
                 break;
             }
         }
     }
     if (!$uptodate) {
         $all = "";
         foreach ($files as $_file) {
             $_path = dirname($_file);
             // CSS templates
             if (substr($_file, -8) == ".css.tpl") {
                 $template = new CSmartyDP(dirname(dirname($_file)));
                 $content = $template->fetch(basename($_file));
             } else {
                 $content = file_get_contents($_file);
                 $content = preg_replace("/\\@import\\s+(?:url\\()?[\"']?([^\"\\'\\)]+)[\"']?\\)?;/i", "", $content);
                 // remove @imports
             }
             // relative paths
             $content = preg_replace_callback("/(url\\s*\\(\\s*[\"\\']?)(.*\\))/", function ($matches) use($_path) {
                 if (strpos($matches[2], "data:") === false) {
                     return $matches[1] . "../{$_path}/" . $matches[2];
                 } else {
                     return $matches[1] . $matches[2];
                 }
             }, $content);
             // @todo: remove this commented call if function behind is stable
             // $content = preg_replace("/(url\s*\(\s*[\"\']?)/", "$1../$_path/", $content); // relative paths
             $all .= $content . "\n";
         }
         if ($compress == 2) {
             $all = self::minify($all);
         }
         file_put_contents($cachefile, $all);
         $last_update = time();
     }
     $result .= self::loadFile($cachefile, $media, null, $last_update, $type) . "\n";
     return $result;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:86,代码来源:CCSSLoader.class.php


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