• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DBManagerFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: display

 function display()
 {
     $db = DBManagerFactory::getInstance();
     /* <<<<<<< HEAD
     		$sql = "SELECT p.id,p.first_name,p.last_name,p.dob FROM reg_patient p WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.next_pmp_review_due_c is not null) ORDER By p.last_name, p.first_name";
     ======= */
     $sql = "SELECT p.id,p.first_name,p.last_name,p.dob, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) ORDER By p.last_name, p.first_name";
     // >>>>>>> 3097a71433de82fec730df252659026274347e46
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT p.id, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) GROUP BY provname ORDER By p.last_name, p.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients who do not have PMP");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report1REG_Patient.tpl');
     //        parent::display();
 }
开发者ID:apikck,项目名称:REG_Patient,代码行数:26,代码来源:view.reports1.php


示例2: scheduleRevenueLineItemUpdateJobs

 /**
  * This methods schedules the Jobs
  *
  * @param int $perJob
  * @return array|mixed
  */
 public static function scheduleRevenueLineItemUpdateJobs($perJob = 100)
 {
     /* @var $db DBManager */
     $db = DBManagerFactory::getInstance();
     // get all the opps to break into groups of 100 and go newest to oldest
     $sql = "select id from revenue_line_items where deleted = 0 ORDER BY date_modified DESC;";
     $results = $db->query($sql);
     $jobs = array();
     $toProcess = array();
     while ($row = $db->fetchRow($results)) {
         $toProcess[] = $row['id'];
         if (count($toProcess) == $perJob) {
             $jobs[] = static::createJob($toProcess);
             $toProcess = array();
         }
     }
     if (!empty($toProcess)) {
         $jobs[] = static::createJob($toProcess);
     }
     // if only one job was created, just return that id
     if (count($jobs) == 1) {
         return array_shift($jobs);
     }
     return $jobs;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:SugarJobUpdateRevenueLineItems.php


示例3: display

 function display()
 {
     $focus = new AirlinesTicketsLists();
     $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $template = file_get_contents('modules/AirlinesTicketsLists/tpls/export.tpl');
     $sql = "Select * From AirlinesTicketsLists p Where p.id = '" . $record . "' And p.deleted = 0";
     $result = $db->query($sql);
     $row = $db->fetchByAssoc($result);
     $fromitinerary = "";
     $itinerary = "";
     $time = "";
     $itinerary2 = "";
     $time2 = "";
     $template = str_replace("{FIT_RECORE}", $focus->get_AirlinesTickets_list($record, $fromitinerary, $itinerary, $time, $itinerary2, $time2), $template);
     $template = str_replace("{TITLE}", $row['name'], $template);
     $template = str_replace("{FROM}", $fromitinerary, $template);
     $template = str_replace("{CHUYENBAY1}", $itinerary, $template);
     $template = str_replace("{TIME1}", $time, $template);
     $template = str_replace("{CHUYENBAY2}", $itinerary2, $template);
     $template = str_replace("{TIME2}", $time2, $template);
     $size = strlen($template);
     $filename = "DANH_SACH_DOAN_" . strtoupper($row['code']) . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:34,代码来源:view.exporttoword.php


示例4: start

 function start()
 {
     $this->db = DBManagerFactory::getInstance();
     $this->userDemoData = new UserDemoData($this->user, false);
     $this->trackerManager = TrackerManager::getInstance();
     foreach ($this->modules as $mod) {
         $query = "select id from {$mod}";
         $result = $this->db->limitQuery($query, 0, 50);
         $ids = array();
         while ($row = $this->db->fetchByAssoc($result)) {
             $ids[] = $row['id'];
         }
         //while
         $this->beanIdMap[$mod] = $ids;
     }
     while ($this->monitorIds-- > 0) {
         $this->monitorId = create_guid();
         $this->trackerManager->setMonitorId($this->monitorId);
         $this->user = $this->userDemoData->guids[array_rand($this->userDemoData->guids)];
         $this->module = $this->modules[array_rand($this->modules)];
         $this->action = $this->actions[array_rand($this->actions)];
         $this->date = $this->randomTimestamp();
         $this->populate_tracker();
         $this->populate_tracker_perf();
         $this->populate_tracker_sessions();
         $this->populate_tracker_queries();
         $this->trackerManager->save();
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:29,代码来源:populateSeedData.php


示例5: commitManagerForecast

 /**
  * Commit a manager forecast from the draft records
  *
  * @param User $manager
  * @param string $timeperiod
  * @return bool
  */
 public function commitManagerForecast(User $manager, $timeperiod)
 {
     global $current_user;
     // make sure that the User passed in is actually a manager
     if (!User::isManager($manager->id)) {
         return false;
     }
     /* @var $db DBManager */
     $db = DBManagerFactory::getInstance();
     $sql = 'SELECT name, assigned_user_id, team_id, team_set_id, quota, best_case, best_case_adjusted,
             likely_case, likely_case_adjusted, worst_case, worst_case_adjusted, currency_id, base_rate,
             timeperiod_id, user_id, opp_count, pipeline_opp_count, pipeline_amount, closed_amount ' . 'FROM ' . $this->table_name . ' ' . 'WHERE assigned_user_id = ' . $db->quoted($manager->id) . ' AND user_id != ' . $db->quoted($manager->id) . ' ' . 'AND timeperiod_id = ' . $db->quoted($timeperiod) . ' AND draft = 1 AND deleted = 0 ' . 'UNION ALL ' . 'SELECT name, assigned_user_id, team_id, team_set_id, quota, best_case, best_case_adjusted,
                 likely_case, likely_case_adjusted, worst_case, worst_case_adjusted, currency_id, base_rate,
                 timeperiod_id, user_id, opp_count, pipeline_opp_count, pipeline_amount, closed_amount ' . 'FROM ' . $this->table_name . ' ' . 'WHERE assigned_user_id = ' . $db->quoted($manager->id) . ' AND user_id = ' . $db->quoted($manager->id) . ' ' . 'AND timeperiod_id = ' . $db->quoted($timeperiod) . ' AND draft = 1 AND deleted = 0';
     $results = $db->query($sql);
     $this->fixTopLevelManagerQuotaRollup($manager->id, $timeperiod);
     while ($row = $db->fetchByAssoc($results)) {
         /* @var $worksheet ForecastManagerWorksheet */
         $worksheet = BeanFactory::getBean('ForecastManagerWorksheets');
         $worksheet->retrieve_by_string_fields(array('user_id' => $row['user_id'], 'assigned_user_id' => $row['assigned_user_id'], 'timeperiod_id' => $row['timeperiod_id'], 'draft' => 0, 'deleted' => 0));
         foreach ($row as $key => $value) {
             $worksheet->{$key} = $value;
         }
         $worksheet->draft = 0;
         // make sure this is always 0!
         $worksheet->save();
         $type = $worksheet->user_id == $current_user->id ? 'Direct' : 'Rollup';
         $disableAS = $worksheet->user_id == $current_user->id;
         $this->_assignQuota($worksheet->quota, $type, $worksheet->user_id, $timeperiod, $disableAS);
     }
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:39,代码来源:ForecastManagerWorksheet.php


示例6: addVisibilityWhere

 /**
  * Add visibility clauses to the WHERE part of the query
  * @param string $query
  * @return string
  */
 public function addVisibilityWhere(&$query)
 {
     global $current_user;
     if (!empty($this->targetModuleField) && !$current_user->isAdmin()) {
         $table_alias = $this->getOption('table_alias');
         $db = DBManagerFactory::getInstance();
         if (empty($table_alias)) {
             $table_alias = $this->bean->table_name;
         }
         $modules = array_map(function ($value) use($db) {
             return $db->quoted($value);
         }, $current_user->getDeveloperModules());
         if (empty($modules)) {
             $devWhere = "{$table_alias}.{$this->targetModuleField} IS NULL";
         } else {
             $devWhere = "{$table_alias}.{$this->targetModuleField} IN (" . implode(',', $modules) . ")";
         }
         if (!empty($query)) {
             $query .= " AND {$devWhere}";
         } else {
             $query = $devWhere;
         }
     }
     return $query;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:30,代码来源:TargetModuleDeveloperVisibility.php


示例7: display

 function display()
 {
     global $sugar_config, $timedate;
     $focus = new GroupLists();
     $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $template = file_get_contents('modules/GroupLists/tpls/Export.tpl');
     $sql = "SELECT\r\n                 g.groupprogram_code\r\n                ,g.tour_name\r\n                ,g.end_date_group\r\n                ,g.start_date_group\r\n                FROM\r\n                  groupprograms g INNER JOIN grouplists_roupprograms_c ggr ON g.id = ggr.grouplistsf242rograms_idb \r\n                  INNER JOIN grouplists gl ON gl.id = ggr.grouplists87eduplists_ida \r\n                WHERE gl.deleted = 0 AND ggr.deleted = 0 AND g.deleted = 0 AND ggr.grouplists87eduplists_ida = '" . $record . "'";
     $result = $db->query($sql);
     $row = $db->fetchByAssoc($result);
     $template = str_replace("{TOURNAME}", mb_strtoupper($row['tour_name'], 'utf-8'), $template);
     $template = str_replace("{SITE_URL}", $sugar_config['site_url'], $template);
     $template = str_replace("{CODE}", $row['groupprogram_code'], $template);
     $template = str_replace("{START_DATE}", $timedate->to_display_date($row['start_date_group'], true), $template);
     $template = str_replace("{END_DATE}", $timedate->to_display_date($row['end_date_group'], true), $template);
     $template = str_replace("{SOLUONG}", $focus->get_count($record), $template);
     $template = str_replace("{TEL}", '', $template);
     $template = str_replace("{FAX}", '', $template);
     //$template = str_replace("{LIST_GIT}", $focus->get_GIT_to_report("('".$record."')"),$template);
     $template = str_replace("{LIST_FIT}", $focus->get_customer_list("('" . $record . "')"), $template);
     $template = str_replace("{DATE}", date('d/m/Y'), $template);
     $size = strlen($template);
     $filename = "DS Doan " . mb_strtoupper($row['tour_name'], 'utf-8') . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:34,代码来源:view.export2word.php


示例8: setUp

 public function setUp()
 {
     $this->_db = DBManagerFactory::getInstance();
     if (get_class($this->_db) != 'FreeTDSManager') {
         $this->markTestSkipped("Skipping test if not mssql configuration");
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:7,代码来源:FreeTDSManagerTest.php


示例9: add_prospects_to_prospect_list

function add_prospects_to_prospect_list($query, $parent_module, $parent_type, $parent_id, $child_id, $link_attribute, $link_type)
{
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $query);
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $parent_module);
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $parent_type);
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $parent_id);
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $child_id);
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $link_attribute);
    $GLOBALS['log']->debug('add_prospects_to_prospect_list:parameters:' . $link_type);
    if (!class_exists($parent_type)) {
        require_once 'modules/' . $parent_module . '/' . $parent_type . '.php';
    }
    $focus = new $parent_type();
    $focus->retrieve($parent_id);
    //if link_type is default then load relationship once and add all the child ids.
    $relationship_attribute = $link_attribute;
    //find all prospects based on the query
    $db = DBManagerFactory::getInstance();
    $result = $db->query($query);
    while (($row = $db->fetchByAssoc($result)) != null) {
        $GLOBALS['log']->debug('target_id' . $row[$child_id]);
        if ($link_type != 'default') {
            $relationship_attribute = strtolower($row[$link_attribute]);
        }
        $GLOBALS['log']->debug('add_prospects_to_prospect_list:relationship_attribute:' . $relationship_attribute);
        //load relationship for the first time or on change of relationship atribute.
        if (empty($focus->{$relationship_attribute})) {
            $focus->load_relationship($relationship_attribute);
        }
        //add
        $focus->{$relationship_attribute}->add($row[$child_id]);
    }
}
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:33,代码来源:Save2.php


示例10: snippet

 function snippet()
 {
     /* get sort order from session */
     //session_start(); // Make a reference to the current session object,set order
     //$_SESSION['regnamesort']= 'test' ; Set a value in a session variable
     //$GLOBALS['log']->fatal('start display');
     //var_dump($this->bean);
     $smarty = new Sugar_Smarty();
     //parent::display();
     $db = DBManagerFactory::getInstance();
     $myquery = "SELECT tab4a.first_name fname, tab4a.last_name lname,  tab5a.mrn_c mrn, tab4a.gender gender FROM reg_patient  tab4a , reg_patient_cstm tab5a WHERE tab4a.id = tab5a.id_c AND tab4a.id = '" . $_REQUEST['patid'] . "'";
     $result = $db->query($myquery);
     $patdata = null;
     $row = $db->fetchRow($result);
     $smarty->assign("patdata", $row);
     $risk = new RiskEvaluation();
     //when week filter need to add week interval
     //get patient risk if exists
     //if ($_POST['mysort'] == 'week')
     if (!empty($_REQUEST['patid'])) {
         $risk->getRisk($_REQUEST['patid']);
         $smarty->assign("pid", $_REQUEST['patid']);
     }
     //echo 'request'.$_REQUEST['patid'];
     //else return false; //param not found
     //var_dump($risk);
     $smarty->assign("myrisk", $risk);
     global $current_user;
     $smarty->assign("myuser", $current_user);
     $smarty->assign("test", "test");
     return $smarty->fetch('custom/modules/REG_Patient/tpls/RiskEvaluationREG_Patient.tpl');
 }
开发者ID:apikck,项目名称:REG_Patient,代码行数:32,代码来源:snippetexample.php


示例11: zuckerreports_query

 function zuckerreports_query($session, $sql)
 {
     global $current_user;
     $util = new SugarWebServiceUtilv4_1();
     if (!$util->validate_authenticated($session)) {
         return array('result' => 'error', 'message' => 'ZuckerReports Query invalid session');
     }
     $admin = new Administration();
     $admin->retrieveSettings();
     $sugaruser = $admin->settings['zuckerreports2_ondemandsugaruser'];
     if ($current_user->user_name != $sugaruser) {
         return array('result' => 'error', 'message' => 'ZuckerReports Query invalid user (' . $current_user->user_name . ')');
     }
     $db = DBManagerFactory::getInstance();
     $result = $db->query($sql);
     $row_list = array();
     $colnames_list = array();
     while (($row = $db->fetchByAssoc($result)) != null) {
         if (empty($colnames_list)) {
             foreach ($row as $colname => $colval) {
                 $colnames_list[] = $colname;
             }
         }
         $json_row = array();
         foreach ($row as $colname => $colval) {
             $json_row[] = $colval;
         }
         $row_list[] = $json_row;
     }
     return array('result' => 'ok', 'columnnames_list' => $colnames_list, 'rows_list' => $row_list);
 }
开发者ID:aldridged,项目名称:airtap-sugar,代码行数:31,代码来源:SugarWebServiceImpl_v4_custom.php


示例12: display

 function display()
 {
     $focus = new Insurances();
     $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $template = file_get_contents('modules/Insurances/tpls/export.tpl');
     $name = "";
     $start = "";
     $end = "";
     $canhan = "";
     $giadinh = "";
     $canhan = $focus->get_data_insurances_canhan($record, $name, $start, $end);
     $giadinh = $focus->get_data_insurances_giadinh($record, $name, $start, $end);
     $template = str_replace("{CANHAN}", $canhan, $template);
     $template = str_replace("{GIADINH}", $giadinh, $template);
     $template = str_replace("{TITLE}", $name, $template);
     $template = str_replace("{NGAYBATDAU}", $start, $template);
     $template = str_replace("{NGAYKETTHUC}", $end, $template);
     $size = strlen($template);
     $filename = strtoupper($name) . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:31,代码来源:view.exporttoword.php


示例13: upgradeFieldsMetaDataTable

 /**
  * Find custom address fields added to default modules (ones that show up in the field_meta_data table)
  * and upgrade them
  */
 public function upgradeFieldsMetaDataTable()
 {
     //Get unupgraded address_street fields (fields whose names follow the pattern %_street_c)
     $query = "SELECT id FROM fields_meta_data WHERE type <> 'text' AND deleted = 0 AND name LIKE '%_street_c'";
     $db = DBManagerFactory::getInstance();
     $result = $db->query($query);
     $updatedStreets = array();
     while ($street = $db->fetchByAssoc($result, false)) {
         //Search for a matching city row to add robustness (in case the user created a field named like %_street_c
         //that isn't actually a street address field)
         $uniqueNameIdx = strpos($street['id'], '_street_c');
         $uniqueName = substr($street['id'], 0, $uniqueNameIdx);
         $cityName = $db->quoted($uniqueName . '_city_c');
         $query = "SELECT id FROM fields_meta_data WHERE deleted = 0 AND id = {$cityName}";
         $result2 = $db->query($query);
         $city = $db->fetchByAssoc($result2, false);
         if ($city) {
             $updatedStreets[] = $db->quoted($street['id']);
         }
     }
     $updatedStreets = implode(',', $updatedStreets);
     if (!empty($updatedStreets)) {
         $query = "UPDATE fields_meta_data SET type = 'text', ext3 = 'varchar' WHERE id IN ({$updatedStreets})";
         $db->query($query);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:30,代码来源:7_FixAddressStreetFields.php


示例14: CurrencyService

 /**
  * sole constructor
  */
 function CurrencyService()
 {
     global $sugar_config;
     if (!class_exists('DBManagerFactory')) {
     }
     $this->db =& DBManagerFactory::getInstance();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:10,代码来源:CurrencyService.php


示例15: display

 function display()
 {
     $focus = new PassportList();
     $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $template = file_get_contents('modules/PassportList/tpls/export.tpl');
     $sql = "Select p.name,gp.start_date_group,gp.end_date_group,p.code From passportlist p, groupprograpassportlist_c gpc,groupprograms gp Where p.id = '" . $record . "' And p.id = gpc.groupprogrc66dortlist_idb And gp.id = groupprogr20c9rograms_ida And p.deleted = 0 And gpc.deleted = 0 And gp.deleted = 0";
     $result = $db->query($sql);
     $row = $db->fetchByAssoc($result);
     $template = str_replace("{FIT_RECORE}", $focus->get_passports_list($record), $template);
     $template = str_replace("{TITLE}", $row['name'], $template);
     $template = str_replace("{NGAYBATDAU}", $row['start_date_group'], $template);
     $template = str_replace("{NGAYKETTHUC}", $row['end_date_group'], $template);
     $size = strlen($template);
     $filename = "DANH_SACH_DOAN_" . strtoupper($row['code']) . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:26,代码来源:view.exporttoword.php


示例16: __construct

 /**
  * BreadCrumbStack
  * Constructor for BreadCrumbStack that builds list of breadcrumbs using tracker table
  *
  * @param $user_id String value of user id to get bread crumb items for
  * @param $modules mixed value of module name(s) to provide extra filtering
  */
 public function __construct($user_id, $modules = '')
 {
     $this->stack = array();
     $this->stackMap = array();
     $admin = new Administration();
     $admin->retrieveSettings('tracker');
     $this->deleteInvisible = !empty($admin->settings['tracker_Tracker']);
     $db = DBManagerFactory::getInstance();
     $module_query = '';
     if (!empty($modules)) {
         $history_max_viewed = 10;
         $module_query = is_array($modules) ? ' AND module_name IN (\'' . implode("','", $modules) . '\')' : ' AND module_name = \'' . $modules . '\'';
     } else {
         $history_max_viewed = !empty($GLOBALS['sugar_config']['history_max_viewed']) ? $GLOBALS['sugar_config']['history_max_viewed'] : 50;
     }
     $query = 'SELECT distinct item_id AS item_id, id, item_summary, module_name, monitor_id, date_modified FROM tracker WHERE user_id = \'' . $user_id . '\' AND deleted = 0 AND visible = 1 ' . $module_query . ' ORDER BY date_modified DESC';
     $result = $db->limitQuery($query, 0, $history_max_viewed);
     $items = array();
     while ($row = $db->fetchByAssoc($result)) {
         $items[] = $row;
     }
     $items = array_reverse($items);
     foreach ($items as $item) {
         $this->push($item);
     }
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:33,代码来源:BreadCrumbStack.php


示例17: display

 function display()
 {
     $tour = new Tour();
     global $sugar_config;
     // $ss = new Sugar_Smarty();
     $db = DBManagerFactory::getInstance();
     // ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
     // A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
     $record = isset($_GET["record"]) ? htmlspecialchars($_GET["record"]) : '';
     $tour->retrieve($record);
     $template = file_get_contents('modules/Tours/tpls/exports/template-dos.htm');
     $template = str_replace('${SITE_URL}', $sugar_config['site_url'], $template);
     $template = str_replace('${TOUR_NOTE}', html_entity_decode_utf8($tour->description), $template);
     $template = str_replace('${CODE}', $tour->tour_code, $template);
     $template = str_replace('${NAME}', $tour->name, $template);
     $template = str_replace('${TRANSPORT}', $tour->transport2, $template);
     $template = str_replace('${START_DATE}', $tour->start_date, $template);
     $template = str_replace('${DURATION}', $tour->duration, $template);
     // Hieu fix issue 1438
     if ($tour->picture) {
         $main_picture = '
                 <!--[if gte vml 1]>
                 <o:wrapblock>
                     <v:shape id="Picture_x0020_11"
                              o:spid="_x0000_s1028" type="#_x0000_t75"
                              alt=""
                              style=\'position:absolute;margin-left:0;margin-top:0;width:470.55pt;height:234pt;
               z-index:251657216;visibility:visible;mso-wrap-style:square;
               mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;
               mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
               mso-wrap-distance-bottom:0;mso-position-horizontal:center;
               mso-position-horizontal-relative:margin;mso-position-vertical:absolute;
               mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;
               mso-width-relative:page;mso-height-relative:page\'>
                         <v:imagedata src="' . $sugar_config['site_url'] . "/modules/images/" . $tour->picture . '"
                                      o:title="phan%20thiet%20beach"/>
                         <o:lock v:ext="edit" aspectratio="f"/>
                         <w:wrap type="topAndBottom" anchorx="margin"/>
                     </v:shape><![endif]--><![if !vml]><img width=627 height=312
                                                            src="' . $sugar_config['site_url'] . "/modules/images/" . $tour->picture . '"
                                                            alt=""
                                                            v:shapes="Picture_x0020_11"><![endif]><!--[if gte vml 1]></o:wrapblock>
                 <![endif]-->
             ';
     } else {
         $main_picture = '';
     }
     $template = str_replace('${PICTURE}', $main_picture, $template);
     // End issue 1438
     $template = str_replace('${TOUR_PROGRAM_LINES}', html_entity_decode_utf8($tour->get_data_to_expor2word()), $template);
     $size = strlen($template);
     $filename = "TOUR_PROGRAM_" . $tour->name . ".doc";
     ob_end_clean();
     header("Cache-Control: private");
     header("Content-Type: application/force-download;");
     header("Content-Disposition:attachment; filename=\"{$filename}\"");
     header("Content-length:{$size}");
     echo $template;
     ob_flush();
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:60,代码来源:view.export2word.php


示例18: GetProviders

function GetProviders()
{
    global $current_user;
    $db = DBManagerFactory::getInstance();
    $locations = "";
    $sql = "";
    $providers = "";
    if (isset($current_user) and $current_user->check_role_membership('PRESCRIBER_ONLY')) {
        $sql = "SELECT prov.name provname, prov.id provid FROM users_reg_provider_1_c provlink, reg_provider prov  where prov.id = provlink.users_reg_provider_1reg_provider_idb\n\t\t\tAND users_reg_provider_1users_ida = '" . $current_user->id . "'";
    }
    if (isset($current_user) and $current_user->check_role_membership('MULTI_LOCATION')) {
        $locations = GetLocations();
        $sql = "SELECT prov.name provname, prov.id provid  FROM reg_provider prov, reg_provider_cstm cstm  where  cstm.id_c = prov.id\n\t\t   AND cstm.provider_location_c IN ({$locations})";
    }
    if ($sql == "") {
        return "''";
    }
    $sql = $db->query($sql);
    while (($a = $db->fetchByAssoc($sql)) != null) {
        //echo "<p>". $a["provname"] . "</p>";
        if ($providers == "") {
            $providers = "'" . $a["provid"] . "'";
        } else {
            $providers = "'" . $a["provid"] . "'," . $providers;
        }
    }
    //echo "list of providers: " . $providers;
    return $providers;
}
开发者ID:apikck,项目名称:REG_Patient,代码行数:29,代码来源:Security.php


示例19: run

 /**
  * This method implements the run function of RunnableSchedulerJob and handles processing a SchedulersJob
  *
  * @param Mixed $data parameter passed in from the job_queue.data column when a SchedulerJob is run
  * @return bool true on success, false on error
  */
 public function run($data)
 {
     $data = unserialize($data);
     if (!is_array($data)) {
         // data must be array of arrays
         $this->job->failJob('invalid query data');
         return false;
     }
     /* @var $db DBManager */
     $db = DBManagerFactory::getInstance();
     foreach ($data as $query) {
         if (!is_string($query) || empty($query)) {
             // bad format? we're done
             $this->job->failJob('invalid query: ' . $query);
             return false;
         }
         $result = $db->query($query);
         if (!$result) {
             $this->job->failJob('query failed: ' . $query);
             return false;
         }
     }
     $this->job->succeedJob();
     return true;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:SugarJobSQLRunner.php


示例20: __construct

 function __construct()
 {
     parent::__construct();
     $this->db = DBManagerFactory::getInstance();
     $this->dbManager = DBManagerFactory::getInstance();
     $this->disable_row_level_security = true;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:7,代码来源:ContactOpportunityRelationship.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DBModel类代码示例发布时间:2022-05-23
下一篇:
PHP DBManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap