本文整理汇总了PHP中Documents::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Documents::find方法的具体用法?PHP Documents::find怎么用?PHP Documents::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Documents
的用法示例。
在下文中一共展示了Documents::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findByCategory
/**
* Return all documents that belong to a category
*
* @param DocumentCategory $category
* @return array
*/
function findByCategory($category)
{
return Documents::find(array('conditions' => array('category_id = ?', $category->getId()), 'order' => 'name'));
}
示例2: postPrintQueue
public function postPrintQueue($id)
{
$pid = Session::get('pid');
$page = Input::get('page');
$limit = Input::get('rows');
$sidx = Input::get('sidx');
$sord = Input::get('sord');
$query = DB::table('hippa')->where('other_hippa_id', '=', $id)->get();
if ($query) {
$count = count($query);
$total_pages = ceil($count / $limit);
} else {
$count = 0;
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$start = $limit * $page - $limit;
if ($start < 0) {
$start = 0;
}
$query1 = DB::table('hippa')->where('other_hippa_id', '=', $id)->orderBy($sidx, $sord)->skip($start)->take($limit)->get();
$response['page'] = $page;
$response['total'] = $total_pages;
$response['records'] = $count;
$i = 0;
foreach ($query1 as $row1) {
$row = (array) $row1;
if (isset($row['eid'])) {
$result1 = Encounters::find($row['eid']);
$row['description'] = $result1->encounter_cc;
$row['date'] = $result1->encounter_DOS;
$row['type'] = 'Encounter';
}
if (isset($row['t_messages_id'])) {
$result2 = T_messages::find($row['t_messages_id']);
$row['description'] = $result2->t_messages_subject;
$row['date'] = $result2->t_messages_dos;
$row['type'] = 'Telephone Messages';
}
if (isset($row['documents_id'])) {
$result3 = Documents::find($row['documents_id']);
$row['description'] = $result3->documents_desc . ' from ' . $result3->documents_from;
$row['date'] = $result3->documents_date;
$row['type'] = $result3->documents_type;
}
$response['rows'][$i]['id'] = $row['hippa_id'];
$response['rows'][$i]['cell'] = array($row['hippa_id'], $row['date'], $row['type'], $row['description']);
$i++;
}
echo json_encode($response);
}
示例3: postDocumentsView
public function postDocumentsView($id, $pid)
{
$result = Documents::find($id);
$file_path = $result->documents_url;
$data1 = array('documents_viewed' => Session::get('displayname'));
DB::table('documents')->where('documents_id', '=', $id)->update($data);
$this->audit('Update');
$name = time() . '_' . $pid . '.pdf';
$data['filepath'] = '/var/www/nosh/temp' . $name;
copy($file_path, $data['filepath']);
while (!file_exists($data['filepath'])) {
sleep(2);
}
$data['html'] = '<iframe src="' . asset('temp/' . $name) . '" width="770" height="425" style="border: none;"></iframe>';
$data['id'] = $id;
echo json_encode($data);
}
示例4: bluebutton
public function bluebutton($id)
{
$result = Documents::find($id);
$file_path = $result->documents_url;
$data['ccda'] = File::get($file_path);
$data['js'] = File::get(__DIR__ . '/../../public/js/bluebutton1.js');
return View::make('bluebutton', $data);
}
示例5: view_documents
public function view_documents($id)
{
$result = Documents::find($id);
$file_path = $result->documents_url;
$data = array('documents_viewed' => Session::get('displayname'));
DB::table('documents')->where('documents_id', '=', $id)->update($data);
$this->audit('Update');
return Response::download($file_path);
}