本文整理汇总了PHP中CRequest::addColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP CRequest::addColumn方法的具体用法?PHP CRequest::addColumn怎么用?PHP CRequest::addColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRequest
的用法示例。
在下文中一共展示了CRequest::addColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CRequest
<?php
/* $Id$ */
/**
* @package Mediboard
* @subpackage sante400
* @version $Revision$
* @author SARL OpenXtrem
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
CCanDo::checkEdit();
CView::enforceSlave();
// Statistiques sur les id400
$req = new CRequest();
$req->addTable("id_sante400");
$req->addColumn("COUNT(DISTINCT object_id)", "nbObjects");
$req->addColumn("COUNT(id_sante400_id)", "nbID400s");
$ds = CSQLDataSource::get("std");
$statTotal = $ds->loadList($req->makeSelect());
$statTotal = $statTotal[0];
$req->addSelect("object_class");
$req->addGroup("object_class");
$stats = $ds->loadList($req->makeSelect());
// Computes average ID400 count per object
foreach ($stats as &$stat) {
$stat["average"] = $stat["nbID400s"] / $stat["nbObjects"];
}
$statTotal["average"] = @($statTotal["nbID400s"] / $statTotal["nbObjects"]);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("stats", $stats);
示例2: CPlageOp
* @category Bloc
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id:$
* @link http://www.mediboard.org
*/
CCanDo::checkAdmin();
$merge = CView::get("merge", "bool default|0");
$auto = CView::get("auto", "bool default|0");
$max = CView::get("max", "num default|10");
CView::checkin();
$group = CGroups::loadCurrent();
$plage = new CPlageOp();
$query = new CRequest();
$query->addColumn("GROUP_CONCAT( plageop_id SEPARATOR '-')", "plage_ids");
$query->addColumn("COUNT( plageop_id )", "plage_count");
$query->addColumn("date");
$query->addGroup("date");
$query->addColumn("debut");
$query->addGroup("debut");
$query->addColumn("fin");
$query->addGroup("fin");
$query->addColumn("chir_id");
$query->addGroup("chir_id");
$query->addColumn("spec_id");
$query->addGroup("spec_id");
$query->addColumn("plagesop.salle_id");
$query->addGroup("plagesop.salle_id");
$query->addLJoinClause("sallesbloc", "sallesbloc.salle_id = plagesop.salle_id");
$query->addLJoinClause("bloc_operatoire", "bloc_operatoire.bloc_operatoire_id = sallesbloc.bloc_id");
示例3: CRHS
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage SSR
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkEdit();
// Liste des RHSs
$rhs = new CRHS();
$req = new CRequest();
$req->addTable("rhs");
$req->addLJoinClause("sejour", "sejour.sejour_id = rhs.sejour_id");
$req->addColumn("date_monday", "mondate");
$req->addColumn("COUNT(*)", "count");
$req->addWhereClause("rhs.facture", " = '0'");
$req->addWhereClause("sejour.annule", " = '0'");
$req->addGroup("date_monday");
$ds = $rhs->_spec->ds;
$rhs_counts = $ds->loadList($req->makeSelect());
foreach ($rhs_counts as &$_rhs_count) {
$_rhs_count["sundate"] = CMbDT::date("+6 DAYS", $_rhs_count["mondate"]);
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("rhs_counts", $rhs_counts);
$smarty->display("vw_facturation_rhs.tpl");
示例4: CRequest
*
* @package Mediboard
* @subpackage SSR
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkEdit();
$date = CValue::getOrSession("date", CMbDT::date());
$date_min = CMbDT::date("last monday", CMbDT::date("+1 day", $date));
$date_max = CMbDT::date("+7 DAY", $date_min);
// Comptage des événements hors-séjours
$group = "sejour.sejour_id";
$query = new CRequest();
$query->addTable("evenement_ssr");
$query->addColumn("COUNT(evenement_ssr_id)", "evenements_count");
$query->addWhereClause("debut", "BETWEEN '{$date_min}' AND '{$date_max}'");
$query->addWhereClause("type", "= 'ssr'");
$query->addLJoinClause("sejour", "sejour.sejour_id = evenement_ssr.sejour_id");
$query->addColumn("sejour.sejour_id");
$query->addWhereClause(null, "debut NOT BETWEEN DATE(entree) AND DATE(ADDDATE(sortie, 1))");
$query->addWhereClause("sejour.annule", "!= '1'");
$query->addGroup("sejour.sejour_id");
$sejour = new CSejour();
$ds = $sejour->_spec->ds;
$evenements_counts = array();
foreach ($ds->loadList($query->makeSelect()) as $row) {
$evenements_counts[$row["sejour_id"]] = $row["evenements_count"];
}
// Chargement des séjours concernés
/** @var CSejour[] $sejours */
示例5: CMediusersStats
* @package Mediboard
* @subpackage SSR
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkAdmin();
$type = CValue::get("type", "CEvenementSSR");
$date = CValue::get("date");
$period = CValue::get("period", "month");
$stats = new CMediusersStats($date, $period, "DATE(debut)", 18);
$consult = new CConsultation();
$ds = $consult->_spec->ds;
$group = CGroups::loadCurrent();
$query = new CRequest();
$query->addColumn("COUNT(*) total");
$query->addColumn("therapeute_id", "user_id");
$query->addColumn($stats->sql_date, "refdate");
$query->addWhere("{$stats->sql_date} BETWEEN '{$stats->min_date}' AND '{$stats->max_date}'");
$query->addWhereClause("functions_mediboard.group_id", "= '{$group->_id}'");
$query->addGroup("therapeute_id, refdate");
$query->addOrder("refdate DESC");
$totals = array();
switch ($type) {
case "CEvenementSSR":
$query->addTable("`evenement_ssr`");
$query->addLJoinClause("sejour", "sejour.sejour_id = evenement_ssr.sejour_id");
$query->addLJoinClause("users_mediboard", "users_mediboard.user_id = evenement_ssr.therapeute_id");
$query->addLJoinClause("functions_mediboard", "functions_mediboard.function_id = users_mediboard.function_id");
// Réalisés
$query1 = clone $query;
示例6: CDomain
<?php
/**
* Add domain with idex EAI
*
* @category EAI
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id:$
* @link http://www.mediboard.org
*/
CCanDo::checkAdmin();
$domain = new CDomain();
// Récupération des objet_class
$req = new CRequest();
$req->addTable("id_sante400");
$req->addColumn("object_class");
$req->addGroup("object_class");
$ds = CSQLDataSource::get("std");
$idexs_class = CMbArray::pluck($ds->loadList($req->makeSelect()), "object_class");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("domain", $domain);
$smarty->assign("idexs_class", $idexs_class);
$smarty->display("inc_add_domain_with_idex.tpl");
示例7: massCountAllergies
/**
* MassCount des allergies
*
* @param array $dossiers Dossier médicaux
*
* @return array
*/
static function massCountAllergies($dossiers = array())
{
$antecedent = new CAntecedent();
$where["type"] = "= 'alle'";
$where["annule"] = " ='0'";
$where["dossier_medical_id"] = CSQLDataSource::prepareIn($dossiers);
$where["rques"] = 'NOT IN ("' . str_replace('|', '","', CAppUI::conf("soins Other ignore_allergies", CGroups::loadCurrent()->_guid)) . '")';
$request = new CRequest();
$request->addColumn("dossier_medical_id");
$request->addColumn("count(*)", "c");
$request->addWhere($where);
$request->addGroup("dossier_medical_id");
$request->addTable("antecedent");
return $antecedent->getDS()->loadHashList($request->makeSelect());
}
示例8: getPeriodicalStatsDetails
/**
* @see parent::getPeriodicalStatsDetails();
*/
function getPeriodicalStatsDetails($user_ids, $depth = 8)
{
$period_types = array("yearly" => array("format" => "%Y", "unit" => "YEAR"), "monthly" => array("format" => "%m/%Y", "unit" => "MONTH"), "weekly" => array("format" => "%Y S%U", "unit" => "WEEK"), "daily" => array("format" => "%d/%m", "unit" => "DAY"), "hourly" => array("format" => "%d %Hh", "unit" => "HOUR"));
$details = array();
$now = CMbDT::dateTime();
$doc = new self();
$ds = $doc->_spec->ds;
$deeper = $depth + 1;
foreach ($period_types as $_type => $_period_info) {
$format = $_period_info["format"];
$unit = $_period_info["unit"];
$request = new CRequest();
$request->addColumn("DATE_FORMAT(`file_date`, '{$format}')", "period");
$request->addColumn("COUNT(`file_id`)", "count");
$request->addColumn("SUM(`doc_size`)", "weight");
$date_min = CMbDT::dateTime("- {$deeper} {$unit}", $now);
$request->addWhereClause("file_date", " > '{$date_min}'");
if (count($user_ids)) {
$request->addWhereClause("author_id", CSQLDataSource::prepareIn($user_ids));
}
$request->addGroup("period");
$results = $ds->loadHashAssoc($request->makeSelect($doc));
foreach (range($depth, 0) as $i) {
$period = CMbDT::transform("-{$i} {$unit}", $now, $format);
$details[$_type][$period] = isset($results[$period]) ? $results[$period] : 0;
}
}
return $details;
}
示例9: getDbIds
function getDbIds($min_id = null)
{
$ds = CSQLDataSource::get("std");
$request = new CRequest();
$request->addColumn("DISTINCT id400");
$request->addTable("id_sante400");
$tag = $this->getImportTag();
$where = array("object_class" => "= '{$this->_class}'", "tag" => "= '{$tag}'");
if ($min_id) {
$where["id400"] = $ds->prepare("> ?", $min_id);
}
$request->addWhere($where);
return $ds->loadColumn($request->makeSelect());
}
示例10: array
<?php
/* $Id $ */
/**
* Show list tags EAI
*
* @category EAI
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id:$
* @link http://www.mediboard.org
*/
CCanDo::checkAdmin();
$object_class = CValue::get("object_class");
$ds = CSQLDataSource::get("std");
$where = array("object_class" => "= '{$object_class}'");
// Liste des tags pour un object_class
$req = new CRequest();
$req->addTable("id_sante400");
$req->addColumn("tag");
$req->addWhere($where);
$req->addGroup("tag");
$tags = CMbArray::pluck($ds->loadList($req->makeSelect()), "tag");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("tags", $tags);
$smarty->display("inc_show_list_tags.tpl");
示例11: getActions
/**
* Get actions for given module
*
* @param string $module Module name
*
* @return ref[] Array of actions with actions as keys and ids as values
*/
static function getActions($module)
{
static $modules_actions;
if (!$modules_actions) {
$request = new CRequest();
$request->addColumn("module");
$request->addColumn("action");
$request->addColumn("module_action_id");
$self = new self();
$ds = $self->_spec->ds;
$modules_actions = $ds->loadTree($request->makeSelect($self));
}
return $modules_actions[$module];
}
示例12: updateMontants
/**
* Mise à jour du montant du tarif
*
* @return integer|null
**/
function updateMontants()
{
if (!$this->_update_montants) {
return $this->secteur1;
}
$types_code = array("codes_ccam" => "CActeCCAM", "codes_ngap" => "CActeNGAP");
if (CModule::getActive("tarmed")) {
$types_code["codes_tarmed"] = "CActeTarmed";
$types_code["codes_caisse"] = "CActeCaisse";
}
$this->loadRefsFwd();
$this->completeField(array_keys($types_code));
if (!$this->codes_ngap && !$this->codes_ccam && !$this->codes_tarmed && !$this->codes_caisse) {
return $this->secteur1;
}
$this->secteur1 = 0.0;
$secteur2 = $this->secteur2;
foreach ($types_code as $codes => $class_acte) {
$_codes = "_" . $codes;
$this->{$_codes} = explode("|", $this->{$codes});
CMbArray::removeValue("", $this->{$_codes});
foreach ($this->{$_codes} as &$_code) {
/** @var CActe $acte */
$acte = new $class_acte();
if ($this->chir_id) {
$acte->executant_id = $this->chir_id;
} elseif ($this->function_id) {
/* Recupération de l'id du premier praticien de la fonction dont la spécialité est renseignée */
$ds = CSQLDataSource::get('std');
$query = new CRequest();
$query->addColumn('user_id');
$query->addTable('users_mediboard');
$query->addWhereClause('function_id', "= {$this->function_id}");
$query->addWhereClause('spec_cpam_id', 'IS NOT NULL');
$result = $ds->loadColumn($query->makeSelect(), 1);
if (!empty($result)) {
$acte->executant_id = $result[0];
}
}
$acte->setFullCode($_code);
$this->secteur1 += $acte->updateMontantBase();
// Affectation du secteur 2 au dépassement du premier acte principal trouvé
if ($secteur2) {
switch ($class_acte) {
case 'CActeNGAP':
if ($acte->lettre_cle) {
$acte->montant_depassement = $secteur2;
$secteur2 = 0;
}
break;
default:
$acte->montant_depassement = $secteur2;
$secteur2 = 0;
}
}
$_code = $acte->makeFullCode();
}
$this->{$codes} = implode("|", $this->{$_codes});
}
return $this->secteur1;
}
示例13: graphWorkflowOperation
/**
* Récuparation du graphique du nombre d'interventions annulées le jour même
*
* @param string $date_min Date de début
* @param string $date_max Date de fin
* @param int $prat_id Filtre du praticien
* @param int $salle_id Filtre de la salle
* @param int $bloc_id Filtre du bloc
* @param int $func_id Filtre sur un cabinet
* @param int $discipline_id Filtre sur une discipline
* @param string $code_ccam Code CCAM
* @param string $type_sejour Type de séjour
* @param bool $hors_plage Prise en charge des hors plage
*
* @return array
*/
function graphWorkflowOperation($date_min = null, $date_max = null, $prat_id = null, $salle_id = null, $bloc_id = null, $func_id = null, $discipline_id = null, $code_ccam = null, $type_sejour = null, $hors_plage = false)
{
$miner = new COperationWorkflow();
$miner->warnUsage();
if (!$date_min) {
$date_min = CMbDT::date("-1 YEAR");
}
if (!$date_max) {
$date_max = CMbDT::date();
}
$date_min = CMbDT::format($date_min, "%Y-%m-01");
$date_max = CMbDT::transform("+1 MONTH", $date_max, "%Y-%m-01");
// Series declarations
$labels = array("op_count" => utf8_encode("Nombre d'interventions"), "creation" => utf8_encode("Planification intervention"), "consult_chir" => utf8_encode("Consultation chirurgicale"), "consult_anesth" => utf8_encode("Consultation anesthésiste"), "visite_anesth" => utf8_encode("Visite anesthésiste"), "creation_consult_chir" => utf8_encode("RDV de consultation chirurgicale"), "creation_consult_anesth" => utf8_encode("RDV de consultation anesthésiste"));
$salles = CSalle::getSallesStats($salle_id, $bloc_id);
$query = new CRequest();
$query->addColumn("DATE_FORMAT(date_operation, '%Y-%m')", "mois");
$query->addColumn("COUNT(operations.operation_id)", "op_count");
// Prévention des données négatives aberrantes
$tolerance_in_days = 0;
$columns = array("creation", "consult_chir", "consult_anesth", "visite_anesth", "creation_consult_chir", "creation_consult_anesth");
foreach ($columns as $_column) {
$field = "date_{$_column}";
$diff = "DATEDIFF(ow.date_operation, ow.{$field})";
$query->addColumn("AVG (IF({$diff} > {$tolerance_in_days}, {$diff}, NULL))", $_column);
$query->addColumn("COUNT(IF({$diff} > {$tolerance_in_days}, {$diff}, NULL))", "count_{$_column}");
}
$query->addTable("operations");
$query->addLJoin("operation_workflow AS ow ON ow.operation_id = operations.operation_id");
$query->addWhereClause("date_operation", "BETWEEN '{$date_min}' AND '{$date_max}'");
$query->addWhereClause("salle_id", CSQLDataSource::prepareIn(array_keys($salles)));
$query->addGroup("mois");
$query->addOrder("mois");
$subtitle = "";
// Filtre sur hors plage
if (!$hors_plage) {
$query->addWhereClause("plageop_id", "IS NOT NULL");
$subtitle .= " - sans hors plage";
}
// Filtre sur le salle (pas besoin de clause supplémentaire)
if ($salle_id) {
$salle = reset($salles);
$subtitle .= " - {$salle->_view}";
}
// Filtre sur le praticien
if ($prat_id) {
$query->addWhereClause("operations.chir_id", "= '{$prat_id}'");
$prat = new CMediusers();
$prat->load($prat_id);
$subtitle .= " - Dr {$prat->_view}";
}
// Filtre sur le cabinet
if ($func_id) {
$query->addLJoinClause("users_mediboard", "operations.chir_id = users_mediboard.user_id");
$query->addWhereClause("users_mediboard.function_id", "= '{$func_id}'");
$func = new CFunctions();
$func->load($func_id);
$subtitle .= " - {$func->_view}";
}
// Filtre sur la discipline
if ($discipline_id) {
$discipline = new CDiscipline();
$discipline->load($discipline_id);
$query->addLJoinClause("users_mediboard", "operations.chir_id = users_mediboard.user_id");
$query->addWhereClause("users_mediboard.discipline_id", "= '{$discipline_id}'");
$subtitle .= " - {$discipline->_view}";
}
// Filtre sur les codes CCAM
if ($code_ccam) {
$query->addWhereClause("operations.codes_ccam", "LIKE '%{$code_ccam}%'");
$subtitle .= " - CCAM: {$code_ccam}";
}
// Filtre sur le type d'hospitalisation
if ($type_sejour) {
$query->addLJoinClause("sejour", "sejour.sejour_id = operations.sejour_id");
$query->addWhereClause("sejour.type", "= '{$type_sejour}'");
$subtitle .= " - " . CAppUI::tr("CSejour.type.{$type_sejour}");
}
// Query result
$ds = CSQLDataSource::get("std");
$all_values = $ds->loadHashAssoc($query->makeSelect());
// Build horizontal ticks
$months = array();
$ticks = array();
//.........这里部分代码省略.........
示例14: array
}
if ($selected_context_guid == "all") {
$context = null;
}
$patient->loadRefPhotoIdentite();
$where = array("patient_id" => " = '{$patient->_id}'");
// Construction d'une constante médicale
$constantes->patient_id = $patient->_id;
$constantes->loadRefPatient();
// Les constantes qui correspondent (dans le contexte ou non)
$where_context = $where;
$where_context["context_class"] = "IS NOT NULL";
$where_context["context_id"] = "IS NOT NULL";
$query = new CRequest();
$query->addTable($constantes->_spec->table);
$query->addColumn("context_class");
$query->addColumn("context_id");
$query->addWhere($where_context);
$query->addGroup(array("context_class", "context_id"));
$query = $query->makeSelect();
$list = $constantes->_spec->ds->loadList($query);
$list_contexts = array();
foreach ($list as $_context) {
/** @var CMbObject $c */
$c = new $_context["context_class"]();
$c = $c->getCached($_context["context_id"]);
// Cas d'un RPU
if ($c instanceof CConsultation && $c->sejour_id) {
$c->loadRefSejour();
if ($c->_ref_sejour->type == 'urg') {
continue;
示例15: CRequest
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage PlanningOp
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
CCanDo::checkAdmin();
// Tous les libelllés
$query = new CRequest();
$query->addTable("sejour");
$query->addColumn("COUNT(libelle)", "libelle_count");
$query->addColumn("libelle");
$query->addWhereClause("type", "= 'ssr'");
$query->addOrder("libelle_count DESC");
$query->addGroup("libelle");
$sejour = new CSejour();
$ds = $sejour->_spec->ds;
$libelle_counts = array();
foreach ($ds->loadList($query->makeSelect()) as $row) {
$libelle_counts[$row["libelle"]] = $row["libelle_count"];
}
unset($libelle_counts[""]);
// Libellés disponibles
$colors = CColorLibelleSejour::loadAllFor(array_keys($libelle_counts));
// Création du template
$smarty = new CSmartyDP();