private function getRealData(Hospital $hospital, $hospitalName = '') {/*{{{*/ $res = array(); $hospitalList = array(); if ($hospitalName) { $hsName = $hospitalName; } else { $hsName = $hospital->name; } $res['key'] = $hsName; $res['url'] = $hospital->getUrl(); $res['title'] = XString::truncate($hsName.'科室列表,门诊时间,专家推荐_好大夫在线', 59, '...'); $res['showUrl'] = 'www.haodf.com'; $res['pageSize'] = rand(60, 66).'K'; $res['date'] = date('Y-m-d', time()); $extContent = ($hospital->spaceCount > 0) ? ",以及".$hospital->spaceCount."位医生提供免费网上咨询":""; $res['content'] = "提供医院简介、地址、预约挂号电话、科室门诊时间,包括".$hsName.$hospital->facultyCount."个科室、".$hospital->doctorCount."位医生的相关介绍".$extContent; $hospitalList['item'] = $res; BeanFinder::get('LocalCache')->removeAll(); return $hospitalList; }/*}}}*/
private function getRealData(Hospital $hospital) {/*{{{*/ $hospitalList = array(); $isPlus = PlussignChannelClient::getInstance()->isHospitalBookDoctor($hospital->commonName); $res['url'] = $hospital->getUrl(); $res['name'] = $hospital->commonName; $res['address'] = ($hospital->address)?$hospital->address:"暂无"; $res['phone'] = ($hospital->address)?$hospital->phone:"暂无"; $res['pageSize'] = rand(60, 66).'K'; $res['date'] = date('Y-m-d', time()); $res['mapUrl'] = $hospital->getReMapUrl(); $res['scheduleUrl'] = $hospital->getScheduleUrl(); if($isPlus) { $res['extTitle'] = "预约加号"; $res['extUrl'] = 'http://jiahao.haodf.com/jiahao/search.htm?district='.urlencode($hospital->city).'&hospitalName='.urlencode($hospital->commonName); } else { $res['extTitle'] = "大夫文章"; $res['extUrl'] = $hospital->getArticleUrl(); } $res['doctorUrl'] = $hospital->getDoctorUrl(); $res['infoUrl'] = $hospital->getInfoUrl(); $hospitalList['item'] = $res + $this->getAlias($hospital); BeanFinder::get('LocalCache')->removeAll(); return $hospitalList; }/*}}}*/
private function getRealData(Hospital $hospital, $hospitalName = '') {/*{{{*/ $res = array(); if ($hospitalName) { $hsName = $hospitalName; } else { $hsName = $hospital->name; } $res['key'] = $hsName; $res['url'] = $hospital->getUrl(); $res['title'] = XString::truncate($hsName.'科室列表_门诊时间表_专家推荐_好大夫在线', 58, '...'); $res['type'] = isset(self::$hospitalLevelList[$hospital->grade])?self::$hospitalLevelList[$hospital->grade]:''; $res['address'] = XString::truncate($hospital->address, 70, ''); $res['mapUrl'] = $hospital->getReMapUrl(); $res['tel'] = $this->getPhoneStr($hospital->phone); $res['zixunUrl'] = $hospital->getDoctorUrl(); $res['jiahaoUrl'] = $hospital->getJiaHaoUrl(); $res['doctorUrl'] = $hospital->getDiseaseUrl(); $res['keshiUrl'] = $hospital->getScheduleUrl(); $res['showUrl'] = 'www.haodf.com'; $res['infoUrl'] = $hospital->getInfoUrl(); $res['date'] = date('Y-m-d', time()); return $res; }/*}}}*/
public function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }
public static function destroy($id) { $hospital = Hospital::find($id); $hospital->destroy(); flash('Hospital removed successfully!'); Redirect::to('/hospitals'); }
public function run() { DB::table('hospitals')->delete(); Hospital::create(array('name' => '海口市妇幼保健院', 'address' => '海口市琼山区国兴大道文坛6号', 'phone' => '0898-65222333', 'logo' => '/images/hospital/logo.png', 'photo' => '/images/hospital/hospital_picture.png', 'register_start' => '00:00', 'register_end' => '23:59', 'specialty' => '腹腔镜手术、超导可视人流、无痛人流、利普刀治疗宫颈疾病、早期乳腺癌的治疗、妊娠合并内科疾病治疗、胎儿远程监护、导乐分娩、无痛分娩', 'description' => '<p>海口市妇幼保健院始建于1951年11月,是一家集保健、医疗、科研、教学于一体的多功能三级妇幼保健机构。目前医院分为国兴总院和解放东分院,承担着海口市204万常驻人口、20万流动人口的妇幼保健任务,是全市的妇幼保健技术指导、业务培训中心、孕产妇保健基地、危急症孕产妇抢救中心及危重新生儿护理抢救中心。 </p> <p>我院的专业技术力量雄厚,设备先进,目前开放床位400张,现有职工600多人,其中教授、主任医师10人,副教授、副主任医师51人,中级职称技术人员142人。医院设有10个临床专科(国兴产科、妇科、国兴儿内科、新生儿科、乳腺科、儿外科、麻醉科手术室、国兴门(急)诊、解放东妇产科、解放东儿科),6个保健科室(妇女保健科、儿童保健科、健康生殖科、妇幼信息科、儿童康复科、体检中心),4个医技科室(影像科、功能科、检验科和药剂科),年门诊30万余人次 ,住院人次近2万,固定资产逾亿元,是目前全省最具规模、现代化医疗水平的妇女儿童专科医院。30余万人口在我院出生。 </p> <p>开展的主要业务有阴式全子宫切除术、腹腔镜手术、阴道成形术、超导可视人流、无痛人流、利普刀治疗宫颈疾病、早期乳腺癌的治疗、妊娠合并内科疾病治疗、胎儿远程监护、导乐分娩、无痛分娩、预防产后出血技术、新生儿急救、早产儿和极低体重儿的转运救治及护理、新生儿听力筛查、婴儿抚触、新生儿油浴、新生儿游泳、产后康复一条龙服务等项目。</p>', 'traffic_intro' => '<p>位于海口市解放东路15号(和平影城对面)。分院始建于1951年,是一所有着几十年历史的老院,已有30多万人口在这里降生,医院环境温馨、交通便利、以精湛的医疗位于海口市解放东路15号(和平影城对面)。分院始建于1951年,是一所有着几十年历史的老院,已有30多万人口在这里降生,医院环境温馨、交通便利、以精湛的医疗技术和贴心服务成为海口市广大妇女儿童的惠民医院。</p>', 'traffic_guide' => '<p>经过解放东分院的公交车有:2路、4路、5路、8路、25路、26路。</p>', 'longtitude' => 113.3, 'latitude' => 26.6)); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Hospital the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Hospital::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
private function getRealData(Hospital $hospital, $hospitalName = '') {/*{{{*/ $res = array(); if ($hospitalName) { $hsName = $hospitalName; } else { $hsName = $hospital->name; } $hospitals['item']['key'] = $hsName; $hospitals['item']['title'] = XString::truncate($hospital->commonName.'科室列表_门诊时间表_专家推荐_好大夫在线',59,''); $hospitals['item']['level'] = $hospital->getGradeStr();// $hospitals['item']['url'] = $hospital->getUrl(); $hospitals['item']['address'] = strip_tags($hospital->address); $hospitals['item']['address_url'] = $hospital->getReMapUrl(); $hospitals['item']['description'] = strip_tags($hospital->intro); $hospitals['item']['description_url'] = $hospital->getInfoUrl(); $hospitals['item']['luxian'] = $hospital->addressinfo; $hospitals['item']['telephone'] = $hospital->phone; $hospitals['item']['online_doctors'] = $hospital->spaceCount; $hospitals['item']['online_doctors_url'] = $hospital->getDoctorUrl(); $hospitals['item']['tel_doctors'] = HospitalClient::getInstance()->getHospitalDirectCallCount($hospital->id); $hospitals['item']['tel_doctors_url'] = $hospital->getTelDoctorUrl(); $hospitals['item']['showurl'] = 'www.haodf.com/'; $res[] = $hospitals; BeanFinder::get('LocalCache')->removeAll(); return $res; }/*}}}*/
public function select_department() { $hospital = Hospital::find(Input::get('hospital_id', 1)); if (!isset($hospital)) { // ... } $departments = $hospital->departments; if (!isset($departments)) { // ... } return View::make('register.select_department', array('hospital' => $hospital, 'departments' => $departments->toArray())); }
public function hospitalAction() { $hospitalid = $this->request->get('hospitalid', 'int'); $pagenumber = $this->request->get('pagenumber', 'int'); $hospital = Hospital::findFirst(array('id=' . $hospitalid)); $this->tag->appendTitle($hospital->name); $alldepartments = $hospital->Department; $departments = array(); foreach ($alldepartments as $key => $item) { $departments[$item->type][$item->name] = $item->id; } $city = $hospital->City; $this->view->setVars(array('city' => $city, 'hospital' => $hospital, 'departments' => $departments)); }
public function invoke() { if (isset($_POST['CheckCustomer'])) { $user = new User(); $hospitalID = $user->getID(); $customer = new Customer(); $customerID = $customer->getIDByNationalNb(); $customerName = $customer->getNameByNationalNb(); $hospital = new Hospital(); $myResult = $hospital->getOldServicesByCustomerNationalNb(); $myResult1 = $hospital->getOldServicesByCustomerNationalNb(); $oprView = new OperationView(); if ($row = mysql_fetch_assoc($myResult)) { $oprView->showServices($myResult1, $hospitalID, $customerID, $customerName); } else { $myResult = $customer->getInfoByNationalNb(); if ($row = mysql_fetch_assoc($myResult)) { $oprView->showCustomerInfo($row, $hospitalID, $customerID, $customerName); } else { $oprView->showUnavailable(); } } } }
public function myhomeAction() { if (!$this->session->has('userid')) { $this->response->redirect('index/index'); } else { $userid = $this->session->get('userid'); $user = User::findFirst(array('id=:id:', 'bind' => array('id' => $userid))); $reservations = array(); $availables = array(); $doctors = array(); $departments = array(); $hospitals = array(); $a = Hospital::find(); $res = $user->getReservation(array('order' => 'borntime')); $all = array(); if ($res->count() != 0) { $k = 0; foreach ($res as $item) { $k++; $reservations[$k] = $item; $availables[$k] = $item->getAvailable(); $doctors[$k] = $availables[$k]->getDoctor(); $departments[$k] = $doctors[$k]->getDepartment(); $hospitals[$k] = $departments[$k]->getHospital(); //用get才是只返回一个对象,直接model名返回resultset } } for ($i = 1; $i <= $k; $i++) { $all[$i]['reservationdate'] = $availables[$i]->date; $all[$i]['doctorid'] = $doctors[$i]->id; $all[$i]['doctorname'] = $doctors[$i]->name; $all[$i]['departmentname'] = $departments[$i]->name; $all[$i]['hospitalsname'] = $hospitals[$i]->name; $all[$i]['doctorfee'] = $doctors[$i]->fee; $all[$i]['reservationstatus'] = $reservations[$i]->status; $all[$i]['reservationid'] = $reservations[$i]->id; $all[$i]['availableid'] = $availables[$i]->id; } $this->view->setVars(array('user' => $user, 'all' => $all)); } }
<? Util::VerificaChamada(); $o = new Convenio(); $filtros = array( "con_nome" => $_GET["con_nome"], "hos_id" => $_GET["hos_id"] ); $ordenacao = array( "campo_ordenacao" => $_GET["campo_ordenacao"], "tipo_ordenacao" => $_GET["tipo_ordenacao"] ); $tamanho_pagina = (empty($_GET["tamanho_pagina"]) ? 20 : intval($_GET["tamanho_pagina"])); $pagina = (empty($_GET["pagina"]) ? 0 : intval($_GET["pagina"])); $o->setSqlBusca($filtros, $ordenacao, $tamanho_pagina); $p = new Pagination ($o->getLinkBasePaginacao(), $o->getSqlBusca(), $tamanho_pagina, $pagina); $tpl->assign("vet_hospitais", Hospital::getOptions()); $tpl->assign("seta_ordenacao", $o->getSetasOrdenacao()); $tpl->assign("link_ordenacao", $o->getLinksOrdenacao()); $tpl->assign("vet_tamanho_pagina", array("10", "20", "30", "50", "100")); $tpl->assign("tamanho_pagina", $tamanho_pagina); $tpl->assign("total_registros", $p->getTotalRegistros()); $tpl->assign("registros", $p->getRegistrosPagina()); $tpl->assign("paginacao", $p->getHtml()); $template_html = $path_tpl."gerenciar.tpl"; ?>
public function excelAction($path) { //phalcon向数据库导入的时候有点小问题,有default值的列需要赋值,不然这列的default值不会写入数据库 include '../app/classes/PHPExcel.php'; $this->view->disable(); $obj = new PHPExcel(); $name = '/home/sify/' . $path; $type = PHPExcel_IOFactory::identify($name); $reader = PHPExcel_IOFactory::createReader($type); $obj = $reader->load($name); //导入hospital子表 $sheet = $obj->getSheetByName('hospital'); for ($j = 2; $j <= $sheet->getHighestRow(); $j++) { $hospital = new Hospital(); $hospital->id = $sheet->getCell('A' . $j)->getValue(); $hospital->name = (string) $sheet->getCell('B' . $j)->getValue(); $hospital->intro = (string) $sheet->getCell('C' . $j)->getValue(); $hospital->cityid = $sheet->getCell('D' . $j)->getValue(); $hospital->street = (string) $sheet->getCell('E' . $j)->getValue(); $hospital->tele = (string) $sheet->getCell('F' . $j)->getValue(); $hospital->level = (string) $sheet->getCell('G' . $j)->getValue(); $hospital->notice = (string) $sheet->getCell('H' . $j)->getValue(); $hospital->img = '/img/hospital/default.img'; $hospital->save(); } //导入department子表 $sheet = $obj->getSheetByName('department'); for ($j = 2; $j <= $sheet->getHighestRow(); $j++) { $department = new Department(); $department->id = $sheet->getCell('A' . $j)->getValue(); $department->h_id = $sheet->getCell('B' . $j)->getValue(); $department->type = (string) $sheet->getCell('C' . $j)->getValue(); $department->intro = (string) $sheet->getCell('D' . $j)->getValue(); $department->name = (string) $sheet->getCell('E' . $j)->getValue(); $department->dcount = 0; $department->save(); } //导入doctor子表 $sheet = $obj->getSheetByName('doctor'); for ($j = 2; $j <= $sheet->getHighestRow(); $j++) { $doctor = new Doctor(); $doctor->id = $sheet->getCell('A' . $j)->getValue(); $doctor->name = (string) $sheet->getCell('B' . $j)->getValue(); $doctor->de_id = $sheet->getCell('C' . $j)->getValue(); $doctor->post = (string) $sheet->getCell('D' . $j)->getValue(); $doctor->intro = (string) $sheet->getCell('E' . $j)->getValue(); $doctor->specialty = (string) $sheet->getCell('F' . $j)->getValue(); $doctor->fee = $sheet->getCell('G' . $j)->getValue(); $doctor->img = '/img/doctor/default.img'; $doctor->save(); } //导入available子表 $sheet = $obj->getSheetByName('available'); for ($j = 2; $j <= $sheet->getHighestRow(); $j++) { $available = new Available(); $available->id = $sheet->getCell('A' . $j)->getValue(); $available->do_id = $sheet->getCell('B' . $j)->getValue(); $available->date = $sheet->getCell('C' . $j)->getFormattedValue(); $available->time = $sheet->getCell('D' . $j)->getValue(); $available->save(); } echo '数据导入成功!'; }
<? Util::VerificaChamada(); $o = new Hospital(); $filtros = array( "hos_nome" => $_GET["hos_nome"], ); $ordenacao = array( "campo_ordenacao" => $_GET["campo_ordenacao"], "tipo_ordenacao" => $_GET["tipo_ordenacao"] ); $tamanho_pagina = (empty($_GET["tamanho_pagina"]) ? 20 : intval($_GET["tamanho_pagina"])); $pagina = (empty($_GET["pagina"]) ? 0 : intval($_GET["pagina"])); $o->setSqlBusca($filtros, $ordenacao, $tamanho_pagina); $p = new Pagination ($o->getLinkBasePaginacao(), $o->getSqlBusca(), $tamanho_pagina, $pagina); $tpl->assign("seta_ordenacao", $o->getSetasOrdenacao()); $tpl->assign("link_ordenacao", $o->getLinksOrdenacao()); $tpl->assign("vet_tamanho_pagina", array("10", "20", "30", "50", "100")); $tpl->assign("tamanho_pagina", $tamanho_pagina); $tpl->assign("total_registros", $p->getTotalRegistros()); $tpl->assign("registros", $p->getRegistrosPagina()); $tpl->assign("paginacao", $p->getHtml()); $template_html = $path_tpl."gerenciar.tpl"; ?>
/** * gera um pdf dos laudos * * @param array $r */ function pdfLaudos($rs){ //error_reporting(E_ALL); set_time_limit(1800); include 'lib/php/classes/class.ezpdf.php'; $pdf = new Cezpdf('a4','portrait'); $pdf -> ezSetMargins(50,70,50,50); $all = $pdf->openObject(); $pdf->saveState(); $pdf->setStrokeColor(0,0,0,1); $pdf->restoreState(); $pdf->closeObject(); $pdf->addObject($all,'all'); $mainFont = './fonts/Courier.afm'; $codeFont = './fonts/Courier.afm'; $pdf->selectFont($mainFont); $n_rows = sizeof($rs); $c = 0; $t=945; $fator = 25; foreach($rs as $id => $r){ $o = new Interpretacao($r["int_id"]); $hos = new Hospital($o->get("hos_id")); $hos_nome = $hos->get("hos_nome"); $con = new Convenio($o->get("con_id")); $con_nome = $con->get("con_nome"); $exa = new Exame($o->get("exa_id")); $exa_nome = $exa->get("exa_nome"); $pdf->ezText($hos_nome,18,array('justification'=>'center')); $pdf->ezText(" ",20,array('justification'=>'left')); $pdf->ezText("PACIENTE : ".$r["int_paciente_prontuario"]." ".$r["int_paciente_nome"],10,array('justification'=>'left')); if ($r["int_paciente_nascimento"] == "0000-00-00") $pdf->ezText("NASCIMENTO : SEXO: ".$r["int_paciente_sexo"],10,array('justification'=>'left')); else $pdf->ezText("NASCIMENTO : ".Formatacao::formatBrData($r["int_paciente_nascimento"])." SEXO: ".$r["int_paciente_sexo"],10,array('justification'=>'left')); $pdf->ezText("CONVÊNIO : ".$con_nome,10,array('justification'=>'left')); $pdf->ezText("EXAME : ".$exa_nome,10,array('justification'=>'left')); $pdf->ezText(" ",20,array('justification'=>'left')); $pdf->ezText(" DATA: ".Formatacao::formatBrDataHoraminSeg($r["int_data_interpretacao"]),10,array('justification'=>'left')); $pdf->ezText("N DO EXAME : ".$r["int_opcional"],10,array('justification'=>'left')); $pdf->ezText("MÉDICO REQUISITANTE : ".$r["int_requisitante"],10,array('justification'=>'left')); $pdf->ezText("EXAME INTERPRETADO POR : 9679 Ernesto Sousa Nunes",10,array('justification'=>'left')); $pdf->ezText("TÉCNICO RX : ".$r["int_tecnico_rx"],10,array('justification'=>'left')); $pdf->ezText(" ",20,array('justification'=>'left')); $pdf->ezText("I N T E R P R E T A Ç Ã O",18,array('justification'=>'center')); $pdf->ezText(" ",20,array('justification'=>'left')); $vet_txt = split("\n",$r["int_texto"]); $pdf->ezText("============================================================================",10,array('justification'=>'left')); $pdf->ezText(" ",8,array('justification'=>'left')); foreach($vet_txt as $linha){ $pdf->ezText(" ".$linha,10,array('justification'=>'left')); } $pdf->ezText(" ",8,array('justification'=>'left')); $pdf->ezText("============================================================================",10,array('justification'=>'left')); $pdf->ezText(" Exame interpretado por: 9676 - Dr. Ernesto Sousa Nunes",10,array('justification'=>'left')); $pdf->addJpegFromFile('ass.jpg',250, 0); $pdf->openHere('Fit'); if ($c+1 < $n_rows) $pdf->ezNewPage(); $c++; $o->informaImpressao(); //$sql = "update laudo set LAU_DATA_EXPORTACAO = now() where LAU_ID = ".$r["LAU_ID"]." LIMIT 1"; //$up = mysql_query($sql, $db) or die(mysql_error()); } $pdfcode = $pdf->Output(); //$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcode)); //$cont = trim($pdfcode); $fh = fopen("laudos_prontos.pdf", 'w+'); fwrite($fh, $pdfcode); fclose($fh); ?><script language="javascript">document.location.href="laudos_prontos.pdf";</script><? }
?> <input type="hidden" name="find-doctor" value="1" /> <fieldset> <p class="type"><?php echo Yii::t('translation', 'layout.site.Find_a_Doctor'); ?> </p> <div class="group"> <div class="row"> <?php echo CHtml::dropDownList('specialty', '', Specialty::findAllArray()); ?> </div> <div class="row"> <?php echo CHtml::dropDownList('hospital', '', Hospital::findAllArray()); ?> </div> </div> <div class="group"> <div class="row"> <?php echo CHtml::dropDownList('insurance', '', Insurance::findAllArray()); ?> </div> <div class="row"> <input type="text" name="doctor_clinic" id="doctor_clinic" placeholder="<?php echo Yii::t('translation', 'layout.site.by_Doctor_s_Name'); ?> " /> </div>
<? Util::VerificaChamada(); if($_GET[id]){ $o = new ValorExame($_GET[id]); //$o->setDependences(); //util::prt("", get_class_methods($o)); foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $o->get($campo)); } $exa = new Exame($o->get("exa_id")); $tpl->assign("exa_nome", $exa->get("exa_nome")); $con = new Convenio($o->get("con_id")); $tpl->assign("con_nome", $con->get("con_nome")); $hos = new Hospital($con->get("hos_id")); $tpl->assign("hos_nome", $hos->get("hos_nome")); if ($_GET[del] == "1" || $_POST[del] == "1"){ if ($o->delete($_GET[delete_dependences])){ Js::goto(array("url" => "index.php?s=valor_exame")); } else { $dep = $o->getDependences(); if (sizeof($dep)){ $tpl->assign("dependences", $dep); } } } } else { Js::goto(array("url" => "index.php?s=convenio")); }
public function get_hospital_info() { $hospital_info = Hospital::find($this->hospital_id); return $hospital_info ? $hospital_info : Hospital::find(self::$default_hospital_id); }
/** * monta um array com os dados de clientes que deverão ser exibidos em options de select * * @return array */ function getOptions(){ $objs = Convenio::getAll(); $out = array(); foreach($objs as $o) { $h = new Hospital($o->get("hos_id")); $out[$o->get("con_id")] = $h->get("hos_nome")." | ".$o->get("con_nome"); } return $out; }
$tpl->assign("vet_tamanho_pagina", array("10", "20", "30", "50", "100", "300", "500")); $tpl->assign("tamanho_pagina", $tamanho_pagina); $tpl->assign("total_registros", $p->getTotalRegistros()); $tpl->assign("registros", $p->getRegistrosPagina()); $tpl->assign("paginacao", $p->getHtml()); $template_html = $path_tpl."gerenciar.tpl"; } else { //util::prt("", $p->getRegistrosPagina()); $max_caracteres = 75; $rs = array(); $i = 0; foreach($p->getRegistrosPagina() as $id => $r){ //util::prt("", $r); $rs[$i] = $r; $o = new Interpretacao($r["int_id"]); $hos = new Hospital($o->get("hos_id")); $rs[$i]["hos_nome"] = $hos->get("hos_nome"); $con = new Convenio($o->get("con_id")); $rs[$i]["con_nome"] = $con->get("con_nome"); $exa = new Exame($o->get("exa_id")); $rs[$i]["exa_nome"] = $exa->get("exa_nome"); $vet_txt = split("\n",$r["int_texto"]); $rs[$i]["int_texto"] = ""; foreach($vet_txt as $linha){ if(strlen($linha) > $max_caracteres){ //util::prt(strlen($linha), $linha); $parte1 = substr($linha,0,$max_caracteres)."\n"; $parte2 = substr($linha,$max_caracteres,$max_caracteres)."\n"; $parte3 = substr($linha,$max_caracteres*2,$max_caracteres)."\n"; $parte4 = substr($linha,$max_caracteres*3,$max_caracteres)."\n"; //util::prt("1", $parte1);
<? Util::VerificaChamada(); if($_GET[id]){ $o = new Hospital($_GET[id]); $_POST["med_id"] = $_SESSION["med_id"]; foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, (empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo])); $o->set($campo, $_POST[$campo]); } if ($_POST[form] == "ok"){ //$o->propertiesDump(); if ($o->update()){ Js::goto(array("url" => "index.php?s=hospital")); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } } else { Js::goto(array("url" => "index.php?s=hospital")); } $template_html = $path_tpl."formulario.tpl"; ?>
/** * monta um array com os dados que deverão ser exibidos em options de select * * @return array */ function getOptions(){ $objs = Hospital::getAll(); $out = array(); foreach($objs as $o) { $out[$o->get("hos_id")] = $o->get("hos_nome"); } return $out; }
public function editHospitalInfo($ID) { $newhospital = new Hospital(); $ID = $_REQUEST['ID']; $rs = mysql_query("SELECT u.UserName,h.Name,h.PhoneNumber,h.Address,h.Type FROM hospital h,user u where u.ID=h.ID and u.ID='" . $ID . "'"); $row = mysql_fetch_assoc($rs); echo '<form method="post" action="' . $newhospital->editHospital($ID) . '">'; ?> <table> <tr> <td> اسم المستخدم </td> <td> <?php echo '<input name="UserName" type="text" value="' . $row['UserName'] . '" />*'; ?> </td> </tr> <tr> <td> الاسم </td> <td> <?php echo '<input name="Name" type="text" value="' . $row['Name'] . '" />*'; ?> </td> </tr> <tr> <td> رقم الهاتف </td> <td> <?php echo '<input name="PhoneNumber" type="text" value="' . $row['PhoneNumber'] . '" />*'; ?> </td> </tr> <tr> <td> العنوان </td> <td> <?php echo '<input name="Address" type="text" value="' . $row['Address'] . '" />*'; ?> </td> </tr> <tr> <td> الاختصاص </td> <td> <?php echo '<input name="Type" type="text" value="' . $row['Type'] . '" />*'; ?> </td> </tr> </table> <?php echo '<input name="editHospital" type="submit" value="تعديل" />'; echo '</form>'; }
echo $form->dropDownList($model, 'classify', Hospital::exClassify('admin'), array('class' => 'form-control', 'empty' => '--请选择--')); ?> <?php echo $form->error($model, 'classify'); ?> </div> </div> <div class="form-group"> <?php echo $form->labelEx($model, 'class', array('class' => 'col-sm-2 control-label')); ?> <div class="col-sm-10"> <?php echo $form->dropDownList($model, 'class', Hospital::exClass('admin'), array('class' => 'form-control', 'empty' => '--请选择--')); ?> <?php echo $form->error($model, 'class'); ?> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label required">医院资质 <span class="required">*</span></label> <div class="col-sm-10"> <div class="row"> <div class="col-sm-6"> <?php echo $form->textField($model, 'xukezheng', array('class' => 'form-control'));
</td> <td style="width:50%;"> <table> <tr> <td> إضافة مشفى جديد </td> </tr> <tr> <td> <?php $newhospital = new Hospital(); echo '<form method="post" action="' . $newhospital->addHospital() . '">'; ?> <table> <tr> <td> اسم المستخدم </td> <td> <input name="UserName" type="text" />* </td> </tr> <tr> <td>
public function hospitalAction() { $this->view->disable(); $hospitalid = $this->request->get('hospitalid', 'int'); $this->response->setContentType('application/Json', 'UTF-8'); $hospital = Hospital::findFirst(array('conditions' => 'id=?1', 'bind' => array(1 => $hospitalid))); $departments = array(); foreach ($hospital->Department as $item) { $departments[$item->id] = $item->name; } $this->zhSort($departments); $this->response->setJsonContent(array('department' => $departments)); $this->response->send(); }
public static function index() { $hospitals = Hospital::all(); // make-metodi renderöi app/views-kansiossa sijaitsevia tiedostoja View::make('home.html', array('hospitals' => $hospitals)); }
<? Util::VerificaChamada(); $o = new Interpretacao(); foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $_POST[$campo]); //$o->set($campo, $_POST[$campo]); //util::prt($campo, $_POST[$campo]); } $tpl->assign("vet_exames", Exame::getOptions()); $tpl->assign("vet_convenios", Convenio::getOptions()); if ($_POST[form] == "ok"){ $data_cadastro = date("Y-m-d H:i:s"); $con = new Convenio($_POST["con_id"]); $hos = new Hospital($con->get("hos_id")); $exa = new Exame($_POST["exa_id"]); $o->set("hos_id" , $con->get("hos_id")); $o->set("con_id" , $_POST["con_id"]); $o->set("exa_id" , $_POST["exa_id"]); $o->set("int_status" , "nao_interpretado"); $o->set("int_data_cadastro" , $data_cadastro); $o->set("int_paciente_nome" , $_POST["int_paciente_nome"]); $o->set("int_paciente_sexo" , $_POST["int_paciente_sexo"]); $o->set("int_paciente_nascimento" , Formatacao::formatData($_POST["int_paciente_nascimento"])); $o->set("int_paciente_prontuario" , $_POST["int_paciente_prontuario"]); $o->set("int_opcional" , $_POST["int_opcional"]); $o->set("int_tecnico_rx" , $_POST["int_tecnico_rx"]); $o->set("int_requisitante" , $_POST["int_requisitante"]);
<? Util::VerificaChamada(); if($_GET[id]){ $o = new Hospital($_GET[id]); //$o->setDependences(); //util::prt("", get_class_methods($o)); foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $o->get($campo)); } if ($_GET[del] == "1" || $_POST[del] == "1"){ if ($o->delete($_GET[delete_dependences])){ Js::goto(array("url" => "index.php?s=hospital")); } else { $dep = $o->getDependences(); if (sizeof($dep)){ $tpl->assign("dependences", $dep); } } } } else { Js::goto(array("url" => "index.php?s=convenio")); } $template_html = $path_tpl."show.tpl"; ?>