本文整理汇总了PHP中XDateTime::createXDateTime方法的典型用法代码示例。如果您正苦于以下问题:PHP XDateTime::createXDateTime方法的具体用法?PHP XDateTime::createXDateTime怎么用?PHP XDateTime::createXDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XDateTime
的用法示例。
在下文中一共展示了XDateTime::createXDateTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addBingli
public function addBingli($request, $response)
{
$data = $request->getUnSafeData('attachment');
$data['title'] = Request::filter($data['title']);
$data['title02'] = Request::filter($data['title02']);
if(isset($data['title01']))
{
$data['title01'] = Request::filter($data['title01']);
}
$type = isset($data['type']) ? Request::filter($data['type']) : PatientAttachment::TYPE_OTHER;
$fileType = isset($data['fileType']) ? Request::filter($data['fileType']) : 0;
$content = isset($data['content']) ? $data['content'] : '';
$timeYear = $request->getRequest('time_year', '');
$timeMonth = $request->getRequest('time_month', '');
$timeDay = $request->getRequest('time_day', '');
if($timeYear && $timeMonth && $timeDay)
$checkTime = XDateTime::createXDateTime($timeYear, $timeMonth, $timeDay);
else
$checkTime = XDateTime::today();
$title1 = '';
if(isset($data['title01']) && $data['title01'])
{
$tmp = '';
if($type == PatientAttachment::TYPE_YINGXIANG)
$tmp = '检查部位:';
else if($type == PatientAttachment::TYPE_BINGLI)
$tmp = '病理标本:';
$title1 = $tmp.$data['title01']."\n";
}
$title2 = '';
if(isset($data['title02']) && $data['title02'])
{
$title2 = '检查医院:'.$data['title02']."\n";
}
$title = $title1.$title2.$data['title'];
// 传入默认的patientid
$pa = BingLiClient::getInstance()->addBingLi($this->_newUser->id, PatientAttachment::DEFAULT_PATIENTID, $title, $type, $fileType, $content, $checkTime);
$typeName = PatientAttachment::$typeList[$type];
echo "<script>parent.myAttach('el_my_attachment', true);</script>";
exit();
}
示例2: medicineList
public function medicineList($request, $response)
{/*{{{*/
$now = XDateTime::now();
$year = (int)$request->y;
$year = ($year > 0) ? $year : $now->getYear();
$month = (int)$request->m;
$month = ($month > 0) ? $month : $now->getMonth();
$user = $this->user;
$curDateTime = XDateTime::createXDateTime($year, $month, 1);
$response->curDateTime = $curDateTime;
$dayNumber = XCalender::getNumberOfDays($year, $month);
$startTime = $curDateTime;
$endTime = $curDateTime->addDay($dayNumber)->addSecond(-1);
$calTable = XCalender::getCalTable($year, $month);
$response->calTable = $calTable;
$hasAnswerMedicineList = MedicineClient::getInstance()->getHasAnswerMedicineList($user->id, $startTime->toShortString(), $endTime->toShortString());
$response->medicineList = $hasAnswerMedicineList;
$medicineId = ($request->medicineid == null)?key($hasAnswerMedicineList):$request->medicineid;
$response->curMedicineId = $medicineId;
$answerInfos = array();
if(empty($medicineId) == false)
{
$answers = MedicineClient::getInstance()->getAnswerList($user->id, $startTime->toShortString(), $endTime->toShortString(), array($medicineId));
foreach($answers as $answer)
{
$doTimeIndex = (int)$answer->doTime->getDay();
$answerInfos[$doTimeIndex] = $answer;
}
}
$response->answerInfos = $answerInfos;
$useMedicineQuestionCategory = DAL::get()->find_by_name('QuestionCategory','用药');
$childs = $useMedicineQuestionCategory->getChildCategories();
$childIds = (is_array($childs)) ? array_keys($childs) : array();
$childIds[] = $useMedicineQuestionCategory->id;
$caseHistories = PatientCaseHistoryClient::getInstance()->getCaseHistoryListByCate($childIds,$user->id,$startTime,$endTime);
$response->caseHistories = $caseHistories;
}/*}}}*/
示例3: getCalTable
public static function getCalTable($year, $month)
{
$firstDate = XDateTime::createXDateTime($year, $month, 1);
$firstDateIndex = (int)date('N', $firstDate->getTime());
$firstDateIndex = $firstDateIndex - 1;
$calTableCellNum = ($firstDateIndex > 2) ? self::CAL_TABLE_CELLS_BIG : self::CAL_TABLE_CELLS_SMALL;
$tableCells = array();
$dayNumber = self::getNumberOfDays($year, $month);
//var_dump($firstDateIndex, $calTableCellNum, $dayNumber);
$dayIndex = 0;
for($i=0; $i<$calTableCellNum; $i++)
{
if(($i >= $firstDateIndex && $i < $dayNumber) || ($i >= $dayNumber && $dayIndex < $dayNumber))
{
$dayIndex += 1;
$tableCells[] = $dayIndex;
}
else
{
$tableCells[] = '';
}
}
return $tableCells;
}
示例4: addBingli
public function addBingli($request, $response)
{/*{{{*/
$data = $request->getUnSafeData('attachment');
$data['title'] = Request::filter($data['title']);
$data['title02'] = Request::filter($data['title02']);
if(isset($data['title01']))
{
$data['title01'] = Request::filter($data['title01']);
}
$type = isset($data['type']) ? Request::filter($data['type']) : PatientAttachment::TYPE_OTHER;
$fileType = isset($data['fileType']) ? Request::filter($data['fileType']) : 0;
$content = isset($data['content']) ? $data['content'] : '';
$timeYear = $request->getRequest('time_year', '');
$timeMonth = $request->getRequest('time_month', '');
$timeDay = $request->getRequest('time_day', '');
if($timeYear && $timeMonth && $timeDay)
$checkTime = XDateTime::createXDateTime($timeYear, $timeMonth, $timeDay);
else
$checkTime = XDateTime::today();
$title1 = '';
if(isset($data['title01']) && $data['title01'])
{
$tmp = '';
if($type == PatientAttachment::TYPE_YINGXIANG)
$tmp = '检查部位:';
else if($type == PatientAttachment::TYPE_BINGLI)
$tmp = '病理标本:';
$title1 = $tmp.$data['title01']."\n";
}
$title2 = '';
if(isset($data['title02']) && $data['title02'])
{
$title2 = '检查医院:'.$data['title02']."\n";
}
$title = $title1.$title2.$data['title'];
// 传入默认的patientid
if($this->_newUser->isNull())
{
$this->_newUser = DAL::get()->find('user', PatientAttachment::DEFAULT_USERID);
}
$user = $this->_newUser;
$patientId = $request->patientId;
if(empty($patientId) || $patientId == "all")
{
$patientId = PatientAttachment::DEFAULT_PATIENTID;
}
else
{
//传过来patient以后,要用patient的user
$patient = DAL::get()->find('Patient', $patientId);
$patientId = $patient->id;
$user = $patient->user;
}
$hospitalId = $request->hoskey;
$date = $request->date;
$hospitalName = $request->hospitalName;
$facultyName = $request->facultyName;
$itemName = trim($request->itemName);
$hospitalId = isset($hospitalId)?$hospitalId:0;
$checkTime = isset($date)?$date:$checkTime;
$hospitalName = isset($hospitalName)?$hospitalName:'';
$facultyName = isset($facultyName)?$facultyName:'';
$itemName = isset($itemName)?$itemName:'';
$pa = BingLiClient::getInstance()->addBingLi($user->id, $patientId, $title, $type, $fileType, $content, $checkTime, '', $hospitalName, $facultyName, $itemName, $hospitalId);
$patientAttachmentDto = BingLiDto::createPatientAttachmentDto($pa->id, $hospitalId, $patientId);
AskSessionInfo::addPatientInfo(NodeObj::NODE_DEFINE_ATTACHMENT, $patientAttachmentDto);
$typeName = PatientAttachment::$typeList[$type];
//复查项目id
$questionCategoryId = $request->questionCategoryId;
if(empty($questionCategoryId))
{
echo "<script>parent.myAttach('el_my_attachment', true, '".$patientId."');</script>";;
}
else
{
echo "<script>parent.myAttach('el_my_attachment$questionCategoryId', true, '".$patientId."');parent.addCheckupReport('$questionCategoryId', '$pa->id')</script>";;
}
return parent::DIRECT_OUTPUT;
}/*}}}*/
示例5: doSavePatientInfo
private function doSavePatientInfo($request, $response)
{
/*{{{*/
$signinId = $request->signinId;
$patientSignin = DAL::get()->find('FollowupOwner', $signinId);
$params = $request->vars;
$params['birthday'] = XDateTime::createXDateTime($request->dateyear, $request->datemonth, $request->dateday)->toString();
$patient = $patientSignin->patient;
if ($patient->isNull() == false) {
PatientClient::getInstance()->modifyInfo($patient->id, $params);
}
}