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


PHP CApp::setTimeLimit方法代码示例

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


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

示例1: swapPratIds

 /**
  * Change prat usernames to prat ids
  *
  * @return bool
  */
 protected function swapPratIds()
 {
     $ds = CSQLDataSource::get("std");
     CApp::setTimeLimit(1800);
     $user = new CUser();
     // Changement des chirurgiens
     $query = "SELECT id_chir\r\n        FROM plagesop\r\n        GROUP BY id_chir";
     $listPlages = $ds->loadList($query);
     foreach ($listPlages as $plage) {
         $where["user_username"] = "= '" . $plage["id_chir"] . "'";
         $user->loadObject($where);
         if ($user->user_id) {
             $query = "UPDATE plagesop\r\n            SET chir_id = '{$user->user_id}'\r\n            WHERE id_chir = '{$user->user_username}'";
             $ds->exec($query);
             $ds->error();
         }
     }
     //Changement des anesthésistes
     $query = "SELECT id_anesth\r\n         FROM plagesop\r\n         GROUP BY id_anesth";
     $listPlages = $ds->loadList($query);
     foreach ($listPlages as $plage) {
         $where["user_username"] = "= '" . $plage["id_anesth"] . "'";
         $user->loadObject($where);
         if ($user->user_id) {
             $query = "UPDATE plagesop\r\n            SET anesth_id = '{$user->user_id}'\r\n            WHERE id_anesth = '{$user->user_username}'";
             $ds->exec($query);
             $ds->error();
         }
     }
     return true;
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:36,代码来源:setup.php

示例2: upgrade

 /**
  * Launches module upgrade process
  *
  * @param string $oldRevision  Revision before upgrade
  * @param bool   $core_upgrade True if it's a core module upgrade
  *
  * @return string|null New revision, null on error
  */
 function upgrade($oldRevision, $core_upgrade = false)
 {
     /*if (array_key_exists($this->mod_version, $this->queries)) {
         CAppUI::setMsg("Latest revision '%s' should not have upgrade queries", UI_MSG_ERROR, $this->mod_version);
         return;
       }*/
     if (!array_key_exists($oldRevision, $this->queries) && !array_key_exists($oldRevision, $this->config_moves) && !array_key_exists($oldRevision, $this->functions)) {
         CAppUI::setMsg("No queries, functions or config moves for '%s' setup at revision '%s'", UI_MSG_WARNING, $this->mod_name, $oldRevision);
         return null;
     }
     // Point to the current revision
     reset($this->revisions);
     while ($oldRevision != ($currRevision = current($this->revisions))) {
         next($this->revisions);
     }
     $depFailed = false;
     do {
         // Check for dependencies
         foreach ($this->dependencies[$currRevision] as $dependency) {
             $module = @CModule::getInstalled($dependency->module);
             if (!$module || $module->mod_version < $dependency->revision) {
                 $depFailed = true;
                 CAppUI::setMsg("Failed module depency for '%s' at revision '%s'", UI_MSG_WARNING, $dependency->module, $dependency->revision);
             }
         }
         if ($depFailed) {
             return $currRevision;
         }
         // Set Time Limit
         if ($this->timeLimit[$currRevision]) {
             CApp::setTimeLimit($this->timeLimit[$currRevision]);
         }
         // Query upgrading
         foreach ($this->queries[$currRevision] as $_query) {
             list($query, $ignore_errors, $dsn) = $_query;
             $ds = $dsn ? CSQLDataSource::get($dsn) : $this->ds;
             if (!$ds->exec($query)) {
                 if ($ignore_errors) {
                     CAppUI::setMsg("Errors ignored for revision '%s'", UI_MSG_OK, $currRevision);
                     continue;
                 }
                 CAppUI::setMsg("Error in queries for revision '%s': see logs", UI_MSG_ERROR, $currRevision);
                 return $currRevision;
             }
         }
         // Callback upgrading
         foreach ($this->functions[$currRevision] as $function) {
             if (!call_user_func($function)) {
                 $function_name = get_class($function[0]) . "->" . $function[1];
                 CAppUI::setMsg("Error in function '%s' call back for revision '%s': see logs", UI_MSG_ERROR, $function_name, $currRevision);
                 return $currRevision;
             }
         }
         // Preferences
         foreach ($this->preferences[$currRevision] as $_pref) {
             list($_name, $_default, $_restricted) = $_pref;
             // Former pure SQL system
             // Cannot check against module version or fresh install will generate errors
             if (self::isOldPrefSystem($core_upgrade)) {
                 $query = "SELECT * FROM `user_preferences` WHERE `pref_user` = '0' AND `pref_name` = '{$_name}'";
                 $result = $this->ds->exec($query);
                 if (!$this->ds->numRows($result)) {
                     $query = "INSERT INTO `user_preferences` (`pref_user` , `pref_name` , `pref_value`)\n              VALUES ('0', '{$_name}', '{$_default}');";
                     $this->ds->exec($query);
                 }
             } else {
                 $pref = new CPreferences();
                 $where = array();
                 $where["user_id"] = " IS NULL";
                 $where["key"] = " = '{$_name}'";
                 if (!$pref->loadObject($where)) {
                     $pref->key = $_name;
                     $pref->value = $_default;
                     $pref->restricted = $_restricted ? "1" : "0";
                     $pref->store();
                 }
             }
         }
         // Config moves
         if (count($this->config_moves[$currRevision])) {
             foreach ($this->config_moves[$currRevision] as $config) {
                 CAppUI::setConf($config[1], CAppUI::conf($config[0]));
             }
         }
     } while ($currRevision = next($this->revisions));
     return $this->mod_version;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:95,代码来源:CSetup.class.php

示例3: Chronometer

<?php

/**
 * $Id: import_medecin.php 19280 2013-05-24 16:04:46Z rhum1 $
 *
 * @package    Mediboard
 * @subpackage Patients
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19280 $
 */
global $m;
CApp::setTimeLimit(150);
if (!class_exists("DOMDocument")) {
    trigger_error("sorry, DOMDocument is needed");
    return;
}
if (null == ($pass = CValue::get("pass"))) {
    CAppUI::stepAjax("Fonctionnalité désactivée car trop instable.", UI_MSG_WARNING);
    return;
}
if (md5($pass) != "aa450aff6d0f4974711ff4c5536ed4cb") {
    CAppUI::stepAjax("Mot de passe incorrect.\nAttention, fonctionnalité à utiliser avec une extrême prudence", UI_MSG_ERROR);
}
// Chrono start
$chrono = new Chronometer();
$chrono->start();
$segment = CValue::get("segment", 1000);
$step = CValue::get("step", 1);
$from = $step > 1 ? 100 + $segment * ($step - 2) : 0;
$to = $step > 1 ? 100 + ($step - 1) * $segment : 100;
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:import_medecin.php

示例4: ob_clean

<?php

/**
 * $Id: offline_prescriptions_multipart.php 27852 2015-04-03 09:55:15Z alexis_granger $
 *
 * @package    Mediboard
 * @subpackage Soins
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27852 $
 */
ob_clean();
CApp::setMemoryLimit("1024M");
CApp::setTimeLimit(240);
$service_id = CValue::get("service_id");
$date = CValue::get("date", CMbDT::date());
$service = new CService();
$service->load($service_id);
$datetime_min = "{$date} 00:00:00";
$datetime_max = "{$date} 23:59:59";
$datetime_avg = "{$date} " . CMbDT::time();
$sejour = new CSejour();
$where = array();
$ljoin = array();
$ljoin["affectation"] = "sejour.sejour_id = affectation.sejour_id";
$where["sejour.entree"] = "<= '{$datetime_max}'";
$where["sejour.sortie"] = " >= '{$datetime_min}'";
$where["affectation.entree"] = "<= '{$datetime_max}'";
$where["affectation.sortie"] = ">= '{$datetime_min}'";
$where["affectation.service_id"] = " = '{$service_id}'";
/** @var CSejour[] $sejours */
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:offline_prescriptions_multipart.php

示例5: addExObjectGroupId

 /**
  * Add a group_id to all the ex_objects
  *
  * @return bool
  */
 protected function addExObjectGroupId()
 {
     CApp::setTimeLimit(1800);
     $ds = $this->ds;
     // Changement des ExClasses
     $query = "SELECT ex_class_id, host_class FROM ex_class";
     $list_ex_class = $ds->loadHashAssoc($query);
     foreach ($list_ex_class as $key => $hash) {
         $query = "ALTER TABLE `ex_object_{$key}`\r\n      ADD `group_id` INT (11) UNSIGNED NOT NULL AFTER `ex_object_id`";
         $ds->exec($query);
         $field_class = null;
         $field_id = null;
         switch ($hash["host_class"]) {
             default:
             case "CMbObject":
                 break;
             case "CPrescriptionLineElement":
             case "CPrescriptionLineMedicament":
             case "COperation":
             case "CConsultation":
             case "CConsultAnesth":
             case "CAdministration":
                 $field_class = "reference_class";
                 $field_id = "reference_id";
                 break;
             case "CSejour":
                 $field_class = "object_class";
                 $field_id = "object_id";
         }
         if ($field_class && $field_id) {
             $query = "UPDATE `ex_object_{$key}`\r\n            LEFT JOIN `sejour` ON `ex_object_{$key}`.`{$field_id}`    = `sejour`.`sejour_id` AND\r\n                  `ex_object_{$key}`.`{$field_class}` = 'CSejour'\r\n            SET `ex_object_{$key}`.`group_id` = `sejour`.`group_id`";
             $ds->exec($query);
         }
     }
     return true;
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:41,代码来源:setup.php

示例6: ini_set

 * @package    Mediboard
 * @subpackage dPpatients
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GPLv2
 * @version    $Revision: 4983 $
 */
CCanDo::checkAdmin();
ini_set("auto_detect_line_endings", true);
global $dPconfig;
$dPconfig["object_handlers"] = array();
CAppUI::stepAjax("Désactivation du gestionnaire", UI_MSG_OK);
$start = CValue::post("start");
$count = CValue::post("count");
$callback = CValue::post("callback");
$date = CMbDT::date();
CApp::setTimeLimit(600);
CApp::setMemoryLimit("512M");
CMbObject::$useObjectCache = false;
$file_import = fopen(CAppUI::conf("root_dir") . "/tmp/rapport_import_patient_{$date}.txt", "a");
importFile(CAppUI::conf("dPpatients imports pat_csv_path"), $start, $count, $file_import);
fclose($file_import);
$start += $count;
file_put_contents(CAppUI::conf("root_dir") . "/tmp/import_patient.txt", "{$start};{$count}");
if ($callback) {
    CAppUI::js("{$callback}({$start},{$count})");
}
echo "<tr><td colspan=\"2\">MEMORY: " . memory_get_peak_usage(true) / (1024 * 1024) . " MB" . "</td>";
CMbObject::$useObjectCache = true;
CApp::rip();
/**
 * import the patient file
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:do_import_patient_qd.php

示例7: fichier

<?php

/**
 * dPccam
 *
 * @category Ccam
 * @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();
CApp::setTimeLimit(360);
$sourcePath = "modules/dPccam/base/ccam.tar.gz";
$targetDir = "tmp/ccam";
$targetTables = "tmp/ccam/tables.sql";
$targetBaseDatas = "tmp/ccam/basedata.sql";
// Extract the SQL dump
if (null == ($nbFiles = CMbPath::extract($sourcePath, $targetDir))) {
    CAppUI::stepAjax("Erreur, impossible d'extraire l'archive", UI_MSG_ERROR);
}
CAppUI::stepAjax("Extraction de {$nbFiles} fichier(s)", UI_MSG_OK);
$ds = CSQLDataSource::get("ccamV2");
// Création des tables
if (null == ($lineCount = $ds->queryDump($targetTables, true))) {
    $msg = $ds->error();
    CAppUI::stepAjax("Import des tables - erreur de requête SQL: {$msg}", UI_MSG_ERROR);
}
CAppUI::stepAjax("Création de {$lineCount} tables", UI_MSG_OK);
// Ajout des données de base
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:httpreq_do_add_ccam.php

示例8: min

// Bornes
if ($export_id_min = $sip_config["export_id_min"]) {
    $where[] = $patient->_spec->key . " >= '{$export_id_min}'";
}
if ($export_id_max = $sip_config["export_id_max"]) {
    $where[] = $patient->_spec->key . " <= '{$export_id_max}'";
}
// Comptage
$count = $patient->countList($where);
$max = $sip_config["export_segment"];
$max = min($max, $count);
CAppUI::stepAjax("Export de {$max} sur {$count} objets de type 'CPatient' à partir de l'ID '{$idMin}'", UI_MSG_OK);
// Time limit
$seconds = max($max / 20, 120);
CAppUI::stepAjax("Limite de temps du script positionné à '{$seconds}' secondes", UI_MSG_OK);
CApp::setTimeLimit($seconds);
// Export réel
$errors = 0;
$patients = $patient->loadList($where, $patient->_spec->key, "0, {$max}");
$echange = 0;
foreach ($patients as $patient) {
    $patient->loadIPP();
    $patient->loadRefsSejours();
    $patient->_ref_last_log->type = "create";
    $receiver = new CDestinataireHprim();
    $receiver->load(CAppUI::conf("sip export_dest"));
    $receiver->loadConfigValues();
    if (!$patient->_IPP) {
        $IPP = new CIdSante400();
        //Paramétrage de l'id 400
        $IPP->object_class = "CPatient";
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_export_patient.php

示例9: importCatalogue

/**
 * Catalogue import
 */
function importCatalogue($cat, $parent_id = null)
{
    global $remote_name;
    CApp::setTimeLimit(180);
    // On rend toutes les analyses du catalogue obsoletes
    $idAnalyse = new CIdSante400();
    $idAnalyse->tag = $remote_name;
    $idAnalyse->object_class = "CExamenLabo";
    $idAnalyses = $idAnalyse->loadMatchingList();
    foreach ($idAnalyses as $_id_analyse) {
        $examenLabo = new CExamenLabo();
        $examenLabo->identifiant = $_id_analyse->id400;
        $examenLabo->loadMatchingObject();
        if ($examenLabo->_id) {
            $examenLabo->obsolete = 1;
            $examenLabo->store();
        }
    }
    $idCatalogue = new CIdSante400();
    $idCatalogue->tag = $remote_name;
    $idCatalogue->object_class = "CCatalogueLabo";
    $idCatalogues = $idCatalogue->loadMatchingList();
    foreach ($idCatalogues as $_id_catalogue) {
        $catalogueLabo = new CCatalogueLabo();
        $catalogueLabo->identifiant = $_id_catalogue->id400;
        $catalogueLabo->loadMatchingObject();
        if ($catalogueLabo->_id) {
            $catalogueLabo->obsolete = 1;
            $catalogueLabo->store();
        }
    }
    $compteur["analyses"] = 0;
    $compteur["chapitres"] = 0;
    $compteur["sousChapitre"] = 0;
    $catalogues = array();
    // Creation du catalogue global LABO
    $catal = new CCatalogueLabo();
    $catalogue = new CCatalogueLabo();
    $catal->identifiant = substr(hash('md5', $remote_name), 0, 4);
    // libelle modifié par hash
    $catal->libelle = $remote_name;
    $catal->pere_id = $parent_id;
    // creation de son id400
    $idCat = new CIdSante400();
    $idCat->tag = $remote_name;
    $idCat->id400 = $remote_name;
    $catal->obsolete = 0;
    $idCat->bindObject($catal);
    //CAppUI::stepAjax("Catalogue '$catal->libelle' importé", UI_MSG_OK);
    $path = $remote_name;
    // on met a jour $catalogues
    $catalogues[$path] = $catal;
    //Parcours des analyses
    foreach ($cat->analyse as $_analyse) {
        $chapitre = (string) $_analyse->chapitre;
        $path = "{$remote_name}/{$chapitre}/";
        if (!$chapitre) {
            $path = $remote_name;
        }
        $catChapitre = new CCatalogueLabo();
        // si le catalogue n'existe pas deja
        if (!array_key_exists($path, $catalogues)) {
            // creation du catalogue
            $catChapitre->identifiant = substr(hash('md5', $chapitre), 0, 4);
            // libelle modifié par hash;
            $catChapitre->libelle = $chapitre;
            $catChapitre->pere_id = $catal->_id;
            $catChapitre->decodeUtfStrings();
            //creation de l'id400
            $idCatChapitre = new CIdSante400();
            $idCatChapitre->tag = $remote_name;
            $idCatChapitre->id400 = substr(hash('md5', $chapitre), 0, 4);
            $catChapitre->obsolete = 0;
            $idCatChapitre->bindObject($catChapitre);
            //CAppUI::stepAjax("Catalogue '$catChapitre->libelle' importé", UI_MSG_OK);
            $compteur["chapitres"]++;
            // on met a jour $catalogues
            $catalogues[$path] = $catChapitre;
        }
        $catChapitre = $catalogues[$path];
        $catalogue = $catChapitre;
        // si il y a un sous chapitre a creer==> le pere du sous chapitre est $catalogue->_id;
        $sschapitre = (string) $_analyse->sschapitre;
        if ($sschapitre) {
            // modification du path
            $path .= $sschapitre;
            $catssChapitre = new CCatalogueLabo();
            if (!array_key_exists($path, $catalogues)) {
                // creation du catalogue
                $catssChapitre->identifiant = substr(hash('md5', $sschapitre), 0, 4);
                // libelle modifié par hash;
                $catssChapitre->libelle = $sschapitre;
                $catssChapitre->pere_id = $catChapitre->_id;
                $catssChapitre->decodeUtfStrings();
                //creation de l'id400
                $idCatssChapitre = new CIdSante400();
                $idCatssChapitre->tag = $remote_name;
//.........这里部分代码省略.........
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:101,代码来源:httpreq_import_catalogue.php

示例10: glob

<?php

/**
 * $Id$
 *
 * @category Files
 * @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
CApp::setTimeLimit(300);
$show = CValue::get("show", 50);
// Search files without documents
$files = glob(CFile::$directory . "/*/*/*/*");
$filesCount = 0;
$filesWithoutDocCount = 0;
$filesWithoutDocTruncated = array();
$filesWithBadDocCount = 0;
$filesWithBadDocTruncated = array();
foreach ($files as $filePath) {
    $filesCount++;
    $fileName = basename($filePath);
    $fileObjectId = basename(dirname($filePath));
    $fileObjectClass = basename(dirname(dirname(dirname($filePath))));
    $where = array("file_real_filename" => "= '{$fileName}'");
    $doc = new CFile();
    $doc->loadObject($where);
    if (!$doc->file_id) {
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:httpreq_check_file_integrity.php

示例11: CRequest

<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Stock
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$ratio = (double) CValue::get("ratio", 2);
CApp::setMemoryLimit('512M');
CApp::setTimeLimit(120);
$sql = new CRequest();
$sql->addTable("product_order_item");
$sql->addSelect("\r\n  product_order_item.order_item_id,\r\n  product_order_item.reference_id, \r\n  product_reference.price AS RP, \r\n  product_order_item.unit_price AS OP, \r\n  product_order_item.quantity AS OQ, \r\n  product_order.order_id, \r\n  product_order.order_number, \r\n  product_order.date_ordered");
$sql->addLJoin(array("product_reference" => "product_reference.reference_id = product_order_item.reference_id", "product_order" => "product_order.order_id = product_order_item.order_id"));
$sql->addWhere("\r\n  product_order.cancelled = '0' \r\n  AND (product_reference.cancelled = '0' OR product_reference.cancelled IS NULL)\r\n  AND product_reference.price != product_order_item.unit_price\r\n  AND (\r\n    product_order_item.unit_price > product_reference.price*{$ratio} OR \r\n    product_reference.price > product_order_item.unit_price*{$ratio}\r\n  )");
$sql->addOrder("product_reference.code");
$changes = $this->_spec->ds->loadList($sql->makeSelect());
$changes_struct = array();
$references = array();
$references_cahpp = array();
foreach ($changes as $_change) {
    if (!isset($references[$_change["reference_id"]])) {
        $_reference = new CProductReference();
        $_reference->load($_change["reference_id"]);
        $references[$_reference->_id] = $_reference;
        $article = new CCAHPPArticle();
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_reference_price_changes.php

示例12:

<?php

/**
 * $Id$
 *
 * @category System
 * @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
CApp::setTimeLimit(0);
CApp::setMemoryLimit("1024M");
$dry_run = CValue::get("dry_run", false);
$table = CValue::get("table");
switch ($table) {
    case "access_log":
        CAccessLog::aggregate(10, 60, 1440, $dry_run);
        break;
    case "access_log_archive":
        CAccessLogArchive::aggregate(10, 60, 1440, $dry_run);
        break;
    case "datasource_log":
        CDataSourceLog::aggregate(10, 60, 1440, $dry_run);
        break;
    case "datasource_log_archive":
        CDataSourceLogArchive::aggregate(10, 60, 1440, $dry_run);
        break;
    default:
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:aggregate_access_logs.php

示例13: unlink

<?php

/* $Id: repas_offline.php 27413 2015-03-04 08:06:56Z mytto $ */
/**
* @package Mediboard
* @subpackage dPrepas
* @version $Revision: 27413 $
* @author Sébastien Fillonneau
*/
CCanDo::checkRead();
global $uistyle, $messages, $version;
CApp::setTimeLimit(90);
$indexFile = CValue::post("indexFile", 0);
$style = CValue::post("style", 0);
$image = CValue::post("image", 0);
$javascript = CValue::post("javascript", 0);
$lib = CValue::post("lib", 0);
$typeArch = CValue::post("typeArch", "zip");
// Création du fichier Zip
if (file_exists("tmp/mediboard_repas.zip")) {
    unlink("tmp/mediboard_repas.zip");
}
if (file_exists("tmp/mediboard_repas.tar.gz")) {
    unlink("tmp/mediboard_repas.tar.gz");
}
if ($typeArch == "zip") {
    $zipFile = new ZipArchive();
    $zipFile->open("tmp/mediboard_repas.zip", ZIPARCHIVE::CREATE);
} elseif ($typeArch == "tar") {
    $zipFile = new Archive_Tar("tmp/mediboard_repas.tar.gz", true);
} else {
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:repas_offline.php

示例14: __construct

 function __construct()
 {
     parent::__construct();
     $this->mod_name = "dPcabinet";
     $this->makeRevision("all");
     $query = "CREATE TABLE consultation (\r\n                    consultation_id bigint(20) NOT NULL auto_increment,\r\n                    plageconsult_id bigint(20) NOT NULL default '0',\r\n                    patient_id bigint(20) NOT NULL default '0',\r\n                    heure time NOT NULL default '00:00:00',\r\n                    duree time NOT NULL default '00:00:00',\r\n                    motif text,\r\n                    secteur1 smallint(6) NOT NULL default '0',\r\n                    secteur2 smallint(6) NOT NULL default '0',\r\n                    rques text,\r\n                    PRIMARY KEY  (consultation_id),\r\n                    KEY plageconsult_id (plageconsult_id,patient_id)\r\n                    ) /*! ENGINE=MyISAM */ COMMENT='Table des consultations';";
     $this->addQuery($query);
     $query = "CREATE TABLE plageconsult (\r\n                    plageconsult_id bigint(20) NOT NULL auto_increment,\r\n                    chir_id bigint(20) NOT NULL default '0',\r\n                    date date NOT NULL default '0000-00-00',\r\n                    debut time NOT NULL default '00:00:00',\r\n                    fin time NOT NULL default '00:00:00',\r\n                    PRIMARY KEY  (plageconsult_id),\r\n                    KEY chir_id (chir_id)\r\n                    ) /*! ENGINE=MyISAM */ COMMENT='Table des plages de consultation des médecins';";
     $this->addQuery($query);
     $this->makeRevision("0.1");
     $query = "ALTER TABLE plageconsult ADD freq TIME DEFAULT '00:15:00' NOT NULL AFTER date ;";
     $this->addQuery($query);
     $this->makeRevision("0.2");
     $query = "ALTER TABLE consultation ADD compte_rendu TEXT DEFAULT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.21");
     $query = "ALTER TABLE consultation CHANGE duree duree TINYINT DEFAULT '1' NOT NULL ";
     $this->addQuery($query);
     $query = "UPDATE consultation SET duree='1' ";
     $this->addQuery($query);
     $this->makeRevision("0.22");
     $query = "ALTER TABLE `consultation`\r\n                ADD `chrono` TINYINT DEFAULT '16' NOT NULL,\r\n                ADD `annule` TINYINT DEFAULT '0' NOT NULL,\r\n                ADD `paye` TINYINT DEFAULT '0' NOT NULL,\r\n                ADD `cr_valide` TINYINT DEFAULT '0' NOT NULL,\r\n                ADD `examen` TEXT,\r\n                ADD `traitement` TEXT";
     $this->addQuery($query);
     $this->makeRevision("0.23");
     $query = "ALTER TABLE `consultation` ADD `premiere` TINYINT NOT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.24");
     $query = "CREATE TABLE `tarifs` (\r\n                `tarif_id` BIGINT NOT NULL AUTO_INCREMENT ,\r\n                `chir_id` BIGINT DEFAULT '0' NOT NULL ,\r\n                `function_id` BIGINT DEFAULT '0' NOT NULL ,\r\n                `description` VARCHAR( 50 ) ,\r\n                `valeur` TINYINT,\r\n                PRIMARY KEY ( `tarif_id` ) ,\r\n                INDEX ( `chir_id`),\r\n                INDEX ( `function_id` )\r\n                ) /*! ENGINE=MyISAM */ COMMENT = 'table des tarifs de consultation';";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation` ADD `tarif` TINYINT,\r\n              ADD `type_tarif` ENUM( 'cheque', 'CB', 'especes', 'tiers', 'autre' ) ;";
     $this->addQuery($query);
     $this->makeRevision("0.25");
     $query = "ALTER TABLE `tarifs` CHANGE `valeur` `secteur1` FLOAT( 6 ) DEFAULT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `tarifs` ADD `secteur2` FLOAT( 6 ) NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation` CHANGE `secteur1` `secteur1` FLOAT( 6 ) DEFAULT '0' NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation` CHANGE `secteur2` `secteur2` FLOAT( 6 ) DEFAULT '0' NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation` CHANGE `tarif` `tarif` VARCHAR( 50 ) DEFAULT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `plageconsult` ADD `libelle` VARCHAR( 50 ) DEFAULT NULL AFTER `chir_id` ;";
     $this->addQuery($query);
     $this->makeRevision("0.26");
     $query = "ALTER TABLE `consultation`\r\n                ADD `ordonnance` TEXT DEFAULT NULL,\r\n                ADD `or_valide` TINYINT DEFAULT '0' NOT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.27");
     $query = "ALTER TABLE `consultation`\r\n                ADD `courrier1` TEXT DEFAULT NULL,\r\n                ADD `c1_valide` TINYINT DEFAULT '0' NOT NULL";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation`\r\n                ADD `courrier2` TEXT DEFAULT NULL,\r\n                ADD `c2_valide` TINYINT DEFAULT '0' NOT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.28");
     $query = "ALTER TABLE `consultation` ADD `date_paiement` DATE AFTER `paye` ;";
     $this->addQuery($query);
     $query = "UPDATE consultation, plageconsult\r\n                SET consultation.date_paiement = plageconsult.date\r\n                WHERE consultation.plageconsult_id = plageconsult.plageconsult_id\r\n                AND consultation.paye = 1";
     $this->addQuery($query);
     $this->makeRevision("0.29");
     $query = "CREATE TABLE `consultation_anesth` (\r\n          `consultation_anesth_id` BIGINT NOT NULL AUTO_INCREMENT ,\r\n          `consultation_id` BIGINT DEFAULT '0' NOT NULL ,\r\n          `operation_id` BIGINT DEFAULT '0' NOT NULL ,\r\n          `poid` FLOAT,\r\n          `taille` FLOAT,\r\n          `groupe` ENUM( '0', 'A', 'B', 'AB' ) ,\r\n          `rhesus` ENUM( '+', '-' ) ,\r\n          `antecedents` TEXT,\r\n          `traitements` TEXT,\r\n          `tabac` ENUM( '-', '+', '++' ) ,\r\n          `oenolisme` ENUM( '-', '+', '++' ) ,\r\n          `transfusions` ENUM( '-', '+' ) ,\r\n          `tasys` TINYINT,\r\n          `tadias` TINYINT,\r\n          `listCim10` TEXT,\r\n          `intubation` ENUM( 'dents', 'bouche', 'cou' ) ,\r\n          `biologie` ENUM( 'NF', 'COAG', 'IONO' ) ,\r\n          `commande_sang` ENUM( 'clinique', 'CTS', 'autologue' ) ,\r\n          `ASA` TINYINT,\r\n          PRIMARY KEY ( `consultation_anesth_id` ) ,\r\n          INDEX ( `consultation_id`) ,\r\n          INDEX ( `operation_id` )\r\n          ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     // CR passage des champs à enregistrements supprimé car regressifs
     // $this->makeRevision("0.30");
     $this->makeRevision("0.31");
     $query = "CREATE TABLE `examaudio` (\r\n                `examaudio_id` INT NOT NULL AUTO_INCREMENT ,\r\n                `consultation_id` INT NOT NULL ,\r\n                `gauche_aerien` VARCHAR( 64 ) ,\r\n                `gauche_osseux` VARCHAR( 64 ) ,\r\n                `droite_aerien` VARCHAR( 64 ) ,\r\n                `droite_osseux` VARCHAR( 64 ) ,\r\n                PRIMARY KEY ( `examaudio_id` ) ,\r\n                INDEX ( `consultation_id` )) /*! ENGINE=MyISAM */";
     $this->addQuery($query);
     $this->makeRevision("0.32");
     $query = "ALTER TABLE `examaudio` ADD UNIQUE (`consultation_id`)";
     $this->addQuery($query);
     $this->makeRevision("0.33");
     $query = "ALTER TABLE `examaudio`\r\n                ADD `remarques` TEXT AFTER `consultation_id`,\r\n                ADD `gauche_conlat` VARCHAR( 64 ) ,\r\n                ADD `gauche_ipslat` VARCHAR( 64 ) ,\r\n                ADD `gauche_pasrep` VARCHAR( 64 ) ,\r\n                ADD `gauche_vocale` VARCHAR( 64 ) ,\r\n                ADD `gauche_tympan` VARCHAR( 64 ) ,\r\n                ADD `droite_conlat` VARCHAR( 64 ) ,\r\n                ADD `droite_ipslat` VARCHAR( 64 ) ,\r\n                ADD `droite_pasrep` VARCHAR( 64 ) ,\r\n                ADD `droite_vocale` VARCHAR( 64 ) ,\r\n                ADD `droite_tympan` VARCHAR( 64 )";
     $this->addQuery($query);
     $this->makeRevision("0.34");
     $query = "ALTER TABLE `consultation_anesth`\r\n                CHANGE `groupe` `groupe` ENUM( '?', '0', 'A', 'B', 'AB' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `rhesus` `rhesus` ENUM( '?', '+', '-' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `tabac` `tabac` ENUM( '?', '-', '+', '++' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `oenolisme` `oenolisme` ENUM( '?', '-', '+', '++' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `transfusions` `transfusions` ENUM( '?', '-', '+' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `intubation` `intubation` ENUM( '?', 'dents', 'bouche', 'cou' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `biologie` `biologie` ENUM( '?', 'NF', 'COAG', 'IONO' ) DEFAULT '?' NOT NULL ,\r\n                CHANGE `commande_sang` `commande_sang` ENUM( '?', 'clinique', 'CTS', 'autologue' ) DEFAULT '?' NOT NULL ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation_anesth`\r\n                CHANGE `tasys` `tasys` INT( 5 ) DEFAULT NULL ,\r\n                CHANGE `tadias` `tadias` INT( 5 ) DEFAULT NULL;";
     $this->addQuery($query);
     $this->makeRevision("0.35");
     $query = "ALTER TABLE `consultation` ADD `arrivee` DATETIME AFTER `type_tarif` ;";
     $this->addQuery($query);
     $this->makeRevision("0.36");
     $query = "ALTER TABLE `consultation_anesth`\r\n                CHANGE `groupe` `groupe` ENUM( '?', 'O', 'A', 'B', 'AB' ) DEFAULT '?' NOT NULL ;";
     $this->addQuery($query);
     $this->makeRevision("0.37");
     $this->makeRevision("0.38");
     $this->makeRevision("0.39");
     $query = "ALTER TABLE `consultation_anesth`\r\n              ADD `mallampati` ENUM( 'classe1', 'classe2', 'classe3', 'classe4' ),\r\n              ADD `bouche` ENUM( 'm20', 'm35', 'p35' ),\r\n              ADD `distThyro` ENUM( 'm65', 'p65' ),\r\n              ADD `etatBucco` VARCHAR(50),\r\n              ADD `conclusion` VARCHAR(50),\r\n              ADD `position` ENUM( 'DD', 'DV', 'DL', 'GP', 'AS', 'TO' );";
     $this->addQuery($query);
     $this->makeRevision("0.40");
     $this->makeRevision("0.41");
     $this->makeRevision("0.42");
     $this->setTimeLimit(1800);
     $query = "ALTER TABLE `consultation` DROP INDEX `plageconsult_id`  ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation` ADD INDEX ( `plageconsult_id` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `consultation` ADD INDEX ( `patient_id` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `tarifs` DROP INDEX `chir_id` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `tarifs` ADD INDEX ( `chir_id` ) ;";
//.........这里部分代码省略.........
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:101,代码来源:setup.php

示例15: __construct

 function __construct()
 {
     parent::__construct();
     $this->mod_name = "dPpatients";
     $this->makeRevision("all");
     $query = "CREATE TABLE `patients` (\r\n                `patient_id` INT(11) NOT NULL AUTO_INCREMENT,\r\n                `nom` VARCHAR(50) NOT NULL DEFAULT '',\r\n                `prenom` VARCHAR(50) NOT NULL DEFAULT '',\r\n                `naissance` DATE NOT NULL DEFAULT '0000-00-00',\r\n                `sexe` ENUM('m','f') NOT NULL DEFAULT 'm',\r\n                `adresse` VARCHAR(50) NOT NULL DEFAULT '',\r\n                `ville` VARCHAR(50) NOT NULL DEFAULT '',\r\n                `cp` VARCHAR(5) NOT NULL DEFAULT '',\r\n                `tel` VARCHAR(10) NOT NULL DEFAULT '',\r\n                `medecin_traitant` INT(11) NOT NULL DEFAULT '0',\r\n                `incapable_majeur` ENUM('o','n') NOT NULL DEFAULT 'n',\r\n                `ATNC` ENUM('o','n') NOT NULL DEFAULT 'n',\r\n                `matricule` VARCHAR(15) NOT NULL DEFAULT '',\r\n                `SHS` VARCHAR(10) NOT NULL DEFAULT '',\r\n                PRIMARY KEY  (`patient_id`),\r\n                UNIQUE KEY `patient_id` (`patient_id`),\r\n                KEY `matricule` (`matricule`,`SHS`),\r\n                KEY `nom` (`nom`,`prenom`)\r\n              ) /*! ENGINE=MyISAM */;";
     $this->addQuery($query);
     $this->makeRevision("0.1");
     $query = "ALTER TABLE patients\r\n                ADD tel2 VARCHAR( 10 ) AFTER tel ,\r\n                ADD medecin1 INT( 11 ) AFTER medecin_traitant ,\r\n                ADD medecin2 INT( 11 ) AFTER medecin1 ,\r\n                ADD medecin3 INT( 11 ) AFTER medecin2 ,\r\n                ADD rques TEXT;";
     $this->addQuery($query);
     $query = "CREATE TABLE medecin (\r\n                medecin_id INT(11) NOT NULL AUTO_INCREMENT,\r\n                nom VARCHAR(50) NOT NULL DEFAULT '',\r\n                prenom VARCHAR(50) NOT NULL DEFAULT '',\r\n                tel VARCHAR(10) DEFAULT NULL,\r\n                fax VARCHAR(10) DEFAULT NULL,\r\n                email VARCHAR(50) DEFAULT NULL,\r\n                adresse VARCHAR(50) DEFAULT NULL,\r\n                ville VARCHAR(50) DEFAULT NULL,\r\n                cp VARCHAR(5) DEFAULT NULL,\r\n                PRIMARY KEY  (`medecin_id`)\r\n              )/*! ENGINE=MyISAM */ COMMENT='Table des medecins correspondants';";
     $this->addQuery($query);
     $this->makeRevision("0.2");
     $query = "ALTER TABLE medecin\r\n                ADD specialite TEXT AFTER prenom ;";
     $this->addQuery($query);
     $this->makeRevision("0.21");
     $query = "ALTER TABLE medecin\r\n                ADD disciplines TEXT AFTER prenom ;";
     $this->addQuery($query);
     $this->makeRevision("0.22");
     $query = "ALTER TABLE `medecin`\r\n                CHANGE `adresse` `adresse` TEXT DEFAULT NULL ;";
     $this->addQuery($query);
     $this->makeRevision("0.23");
     $query = "ALTER TABLE `medecin`\r\n                ADD INDEX ( `nom` ),\r\n                ADD INDEX ( `prenom` ),\r\n                ADD INDEX ( `cp` ) ;";
     $this->addQuery($query);
     $this->makeRevision("0.24");
     $query = "ALTER TABLE `patients`\r\n                ADD `nom_jeune_fille` VARCHAR( 50 ) NOT NULL AFTER `nom` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients`\r\n                CHANGE `sexe` `sexe` ENUM( 'm', 'f', 'j' ) DEFAULT 'm' NOT NULL";
     $this->addQuery($query);
     $this->makeRevision("0.25");
     $query = "ALTER TABLE `patients` CHANGE `adresse` `adresse` TEXT NOT NULL ";
     $this->addQuery($query);
     $this->makeRevision("0.26");
     $query = "CREATE TABLE `antecedent` (\r\n                `antecedent_id` BIGINT NOT NULL AUTO_INCREMENT ,\r\n                `patient_id` BIGINT NOT NULL ,\r\n                `type` ENUM( 'trans', 'obst', 'chir', 'med' ) DEFAULT 'med' NOT NULL ,\r\n                `date` DATE,\r\n                `rques` TEXT,\r\n                PRIMARY KEY ( `antecedent_id` ) ,\r\n                INDEX ( `patient_id` )\r\n              ) /*! ENGINE=MyISAM */ COMMENT = 'antecedents des patients';";
     $this->addQuery($query);
     $this->makeRevision("0.27");
     $query = "ALTER TABLE `antecedent`\r\n                CHANGE `type` `type` ENUM( 'trans', 'obst', 'chir', 'med', 'fam' ) DEFAULT 'med' NOT NULL;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients`\r\n                ADD `listCim10` TEXT DEFAULT NULL ;";
     $this->addQuery($query);
     $query = "CREATE TABLE `traitement` (\r\n                `traitement_id` BIGINT NOT NULL AUTO_INCREMENT ,\r\n                `patient_id` BIGINT NOT NULL ,\r\n                `debut` DATE DEFAULT '0000-00-00' NOT NULL ,\r\n                `fin` DATE,\r\n                `traitement` TEXT,\r\n                PRIMARY KEY ( `traitement_id` ) ,\r\n                INDEX ( `patient_id` )\r\n              ) /*! ENGINE=MyISAM */ COMMENT = 'traitements des patients';";
     $this->addQuery($query);
     $this->makeRevision("0.28");
     $query = "ALTER TABLE `patients`\r\n                CHANGE `SHS` `regime_sante` VARCHAR( 40 );";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients`\r\n                ADD `SHS` VARCHAR( 8 ) AFTER `matricule`;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients`\r\n                ADD INDEX ( `SHS` );";
     $this->addQuery($query);
     $this->makeRevision("0.29");
     $query = "ALTER TABLE `patients` DROP INDEX `patient_id` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients` DROP INDEX `nom` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients` ADD INDEX ( `nom` ) ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients` ADD INDEX ( `prenom` ) ;";
     $this->addQuery($query);
     $this->makeRevision("0.30");
     $query = "ALTER TABLE `antecedent` CHANGE `type` `type`\r\n                ENUM( 'trans', 'obst', 'chir', 'med', 'fam', 'alle' ) NOT NULL DEFAULT 'med';";
     $this->addQuery($query);
     $this->makeRevision("0.31");
     $query = "ALTER TABLE `patients` ADD `cmu` date NULL AFTER `matricule` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `patients` ADD `ald` text AFTER `rques` ;";
     $this->addQuery($query);
     $this->makeRevision("0.32");
     $query = "UPDATE `medecin` SET `tel` = NULL WHERE `tel`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `fax` = NULL WHERE `fax`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `email` = NULL WHERE `email`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `specialite` = NULL WHERE `specialite`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `disciplines` = NULL WHERE `disciplines`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `adresse` = NULL WHERE `adresse`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `ville` = NULL WHERE `ville`='NULL' ;";
     $this->addQuery($query);
     $query = "UPDATE `medecin` SET `cp` = NULL WHERE `cp` LIKE 'NULL%' ;";
     $this->addQuery($query);
     $this->makeRevision("0.33");
     $query = "ALTER TABLE `medecin` ADD `jeunefille` VARCHAR( 50 ) AFTER `prenom` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `medecin` ADD `complementaires` TEXT AFTER `disciplines` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `medecin` ADD `orientations` TEXT AFTER `disciplines` ;";
     $this->addQuery($query);
     $query = "ALTER TABLE `medecin` DROP `specialite` ;";
     $this->addQuery($query);
     $this->makeRevision("0.34");
     $query = "ALTER TABLE `patients`\r\n                ADD `pays` VARCHAR( 50 ),\r\n                ADD `nationalite` ENUM( 'local', 'etranger' ) NOT NULL DEFAULT 'local',\r\n                ADD `lieu_naissance` VARCHAR( 50 ),\r\n                ADD `profession` VARCHAR( 50 ),\r\n                ADD `employeur_nom` VARCHAR( 50 ),\r\n                ADD `employeur_adresse` TEXT,\r\n                ADD `employeur_cp` VARCHAR( 5 ),\r\n                ADD `employeur_ville` VARCHAR( 50 ),\r\n                ADD `employeur_tel` VARCHAR( 10 ),\r\n                ADD `employeur_urssaf` VARCHAR( 11 ),\r\n                ADD `prevenir_nom` VARCHAR( 50 ),\r\n                ADD `prevenir_prenom` VARCHAR( 50 ),\r\n                ADD `prevenir_adresse` TEXT,\r\n                ADD `prevenir_cp` VARCHAR( 5 ),\r\n                ADD `prevenir_ville` VARCHAR( 50 ),\r\n                ADD `prevenir_tel` VARCHAR( 10 ),\r\n                ADD `prevenir_parente` ENUM( 'conjoint', 'enfant', 'ascendant', 'colateral', 'divers' ) ;";
     $this->addQuery($query);
     $this->makeRevision("0.35");
     $query = "ALTER TABLE `antecedent` CHANGE `type` `type`\r\n                ENUM( 'med', 'alle', 'trans', 'obst', 'chir', 'fam', 'anesth' ) NOT NULL DEFAULT 'med';";
     $this->addQuery($query);
     $this->makeRevision("0.36");
     $this->setTimeLimit(1800);
//.........这里部分代码省略.........
开发者ID:fbone,项目名称:mediboard4,代码行数:101,代码来源:setup.php


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