public function action_paginate() { if (DataTables::is_request()) { $orm = ORM::factory('Avatar'); $paginate = Paginate::factory($orm)->columns(array('id', 'title', 'img', 'default')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $avatar) { $datatables->add_row(array(URL::base() . 'assets/img/avatars/' . $avatar->img, $avatar->title, $avatar->default, $avatar->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory(500, 'error'); } }
public function action_paginate() { if (!$this->user->can('Admin_Forum_Category_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin forum category paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Forum_Category'); $paginate = Paginate::factory($orm)->columns(array('id', 'title', 'locked')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $category) { $datatables->add_row(array($category->title, $category->locked, $category->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory('500', 'Internal server error'); } }
public function action_paginate() { if (!$this->user->can('Admin_Item_Types_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin item types paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Item_Type'); $paginate = Paginate::factory($orm)->columns(array('id', 'name')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $avatar) { $datatables->add_row(array($avatar->name, $avatar->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory(500, 'Internal server error'); } }
public function action_paginate() { if (!$this->user->can('Admin_User_Role_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin user role paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Role'); $paginate = Paginate::factory($orm)->columns(array('id', 'name', 'description')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $role) { $datatables->add_row(array($role->name, $role->description, $role->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory('500', 'Internal server error'); } }
public function action_paginate() { if (!$this->user->can('Admin_Item_Shops_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin item shops paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Shop'); $paginate = Paginate::factory($orm)->columns(array('shop.id', 'title', 'status', 'stock_type'))->search_columns(array('title', 'status', 'stock_type')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $shop) { $datatables->add_row(array($shop->title, $shop->status, $shop->stock_type, $shop->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory(500, 'Internal server error'); } }
public function action_paginate() { if (!$this->user->can('Admin_User_Log_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin user log paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Log'); $paginate = Paginate::factory($orm)->columns(array('id', 'user_id', 'location', 'alias', 'time', 'type'))->search_columns(array('user.username', 'alias', 'location', 'type')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $log) { $datatables->add_row(array($log->type, $log->alias, $log->user->username, $log->location, $log->time, $log->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory(500, 'error'); } }
public function action_paginate() { if (!$this->user->can('Admin_Item_Recipes_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin item recipies paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Item_Recipe'); $paginate = Paginate::factory($orm)->columns(array('id', 'name', 'materials', 'crafted_item_id'))->search_columns(array('item.name')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $recipe) { $datatables->add_row(array($recipe->name, $recipe->materials->count_all(), $recipe->item->img(), $recipe->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory(500, 'Internal server error'); } }
/** * Setter/Getter for jquery DataTables support * * @param array $columns Columns for setting [Optional] * @return object DataTables */ public function dataTables(array $columns = NULL) { if (!empty($columns)) { $this->_datatables = DataTables::factory($this)->columns($columns)->execute(); } return $this->_datatables; }
public static function handlerSSSourceData(Audit $audit) { $data = array(); if ($audit->objectClass != 'ESignature') { return $data; } $eSignature = new ESignature(); $eSignature->eSignatureId = $audit->objectId; $eSignature->populate(); if ($eSignature->objectClass != 'Medication' || !strlen($eSignature->signature) > 0) { WebVista::log('esignature is not signed or medication'); return $data; } // MEDICATION DATA $medication = new Medication(); $medication->medicationId = (int) $eSignature->objectId; $medication->populate(); if ($medication->transmit != 'ePrescribe' || $medication->isScheduled()) { WebVista::log('medication is either scheduled or not an eprescribe'); return $data; } WebVista::log('generating source data'); $data['_audit'] = $audit; $uuid = NSDR::create_guid(); $data['messageId'] = str_replace('-', '', $uuid); $data['prescriberOrderNumber'] = $medication->medicationId . '_' . $audit->auditId; $data['rxReferenceNumber'] = $medication->rxReferenceNumber; WebVista::log('messageId:[' . $data['messageId'] . '] prescriberOrderNumber:[' . $data['prescriberOrderNumber'] . '], rxReferenceNumber:[' . $data['rxReferenceNumber'] . ']'); $medData = array(); $medData['description'] = $medication->description; $medData['strength'] = $medication->dose; $qualifiers = Medication::listQuantityQualifiersMapping(); $medData['strengthUnits'] = $qualifiers[$medication->quantityQualifier]; // temporarily set to the same with quantity $medData['quantity'] = $medication->quantity; $medData['quantityUnits'] = $qualifiers[$medication->quantityQualifier]; $medData['daysSupply'] = $medication->daysSupply; $medData['directions'] = $medication->directions; $qualifier = 'R'; if ($medication->prn) { $qualifier = 'PRN'; } $medData['refills'] = $medication->refills; $medData['refillsUnits'] = $qualifier; $medData['substitutions'] = $medication->substitution ? '0' : '1'; $writtenDate = date('Ymd', strtotime($medication->datePrescribed)); if ($medication->datePrescribed == '0000-00-00 00:00:00') { $writtenDate = ''; } $medData['writtenDate'] = $writtenDate; $medData['productCode'] = $medication->hipaaNDC; $medData['productQualifier'] = 'ND'; $medData['dosageForm'] = DataTables::getDosageForm($medication->chmedDose); $medData['drugDBCode'] = $medication->pkey; $medData['drugDBQualifier'] = ''; //'pkey'; valid options: "E|G|FG|FS|MC|MD|MG|MM" $medData['note'] = $medication->comment; $data['Medication'] = $medData; WebVista::log('medication data: ' . print_r($medData, true)); // PHARMACY DATA $pharmacy = new Pharmacy(); $pharmacy->pharmacyId = $medication->pharmacyId; $pharmacy->populate(); $pharmacyData = array(); $pharmacyData['NCPDPID'] = $pharmacy->NCPDPID; $pharmacyData['fileId'] = $pharmacy->pharmacyId; $pharmacyData['NPI'] = $pharmacy->NPI; $pharmacyData['storeName'] = $pharmacy->StoreName; $pharmacyData['storeNumber'] = $pharmacy->StoreNumber; $pharmacyData['email'] = $pharmacy->Email; $pharmacyData['twentyFourHourFlag'] = $pharmacy->TwentyFourHourFlag; $pharmacyData['crossStreet'] = $pharmacy->CrossStreet; $pharmacyData['addressLine1'] = $pharmacy->AddressLine1; $pharmacyData['addressLine2'] = $pharmacy->AddressLine2; $pharmacyData['city'] = $pharmacy->City; $pharmacyData['state'] = $pharmacy->State; $pharmacyData['zip'] = $pharmacy->Zip; $phones = array(); $phones[] = array('number' => $pharmacy->PhonePrimary, 'type' => 'TE'); $phones[] = array('number' => $pharmacy->Fax, 'type' => 'FX'); $phones[] = array('number' => $pharmacy->PhoneAlt1, 'type' => $pharmacy->PhoneAlt1Qualifier); $phones[] = array('number' => $pharmacy->PhoneAlt2, 'type' => $pharmacy->PhoneAlt2Qualifier); $phones[] = array('number' => $pharmacy->PhoneAlt3, 'type' => $pharmacy->PhoneAlt3Qualifier); $phones[] = array('number' => $pharmacy->PhoneAlt4, 'type' => $pharmacy->PhoneAlt4Qualifier); $phones[] = array('number' => $pharmacy->PhoneAlt5, 'type' => $pharmacy->PhoneAlt5Qualifier); $pharmacyData['phones'] = $phones; $data['Pharmacy'] = $pharmacyData; WebVista::log('pharmacy data: ' . print_r($pharmacyData, true)); // PRESCRIBER DATA $provider = new Provider(); $provider->personId = $medication->prescriberPersonId; $provider->populate(); $prescriberData = array(); $prescriberData['DEANumber'] = $provider->deaNumber; // it has conflicts with DEANumber //$prescriberData['stateLicenseNumber'] = $provider->stateLicenseNumber; $prescriberData['fileId'] = $provider->personId; $prescriberData['clinicName'] = ''; $identifierType = $provider->identifierType; if (strlen($identifierType) > 0) { // $prescriberData[$identifierType] = $provider->identifier; } $prescriberData['lastName'] = $provider->person->lastName; $prescriberData['firstName'] = $provider->person->firstName; $prescriberData['middleName'] = $provider->person->middleName; $prescriberData['suffix'] = $provider->person->suffix; $prescriberData['prefix'] = ''; $prescriberData['email'] = $provider->person->email; $prescriberData['specialtyCode'] = $provider->specialty; $specialtyQualifier = ''; if (strlen($provider->specialty) > 0) { $specialtyQualifier = 'AM'; } $prescriberData['specialtyQualifier'] = $specialtyQualifier; $building = Building::getBuildingDefaultLocation((int) $provider->personId); $ePrescriber = new EPrescriber(); $ePrescriber->providerId = (int) $provider->personId; $ePrescriber->buildingId = (int) $building->buildingId; $ePrescriber->populateWithBuildingProvider(); $prescriberData['SPI'] = $ePrescriber->SSID; $prescriberData['addressLine1'] = $building->line1; $prescriberData['addressLine2'] = $building->line2; $prescriberData['city'] = $building->city; $prescriberData['state'] = $building->state; $prescriberData['zip'] = $building->zipCode; $prescriberData['phones'] = $building->phoneNumbers; $data['Prescriber'] = $prescriberData; WebVista::log('prescriber data: ' . print_r($prescriberData, true)); // PATIENT DATA $patient = new Patient(); $patient->personId = $medication->personId; $patient->populate(); $patientData = array(); $patientData['lastName'] = $patient->person->lastName; $patientData['firstName'] = $patient->person->firstName; $patientData['middleName'] = $patient->person->middleName; $patientData['suffix'] = $patient->person->suffix; $patientData['prefix'] = ''; $patientData['email'] = $patient->person->email; $patientData['fileId'] = $patient->recordNumber; $patientData['medicareNumber'] = ''; // TODO: to be implemented $identifierType = $patient->identifierType; if (strlen($identifierType) > 0) { $patientData[$identifierType] = $patient->identifier; } $patientData['gender'] = $patient->person->getDisplayGender(); $dateOfBirth = date('Ymd', strtotime($patient->person->dateOfBirth)); if ($patient->person->dateOfBirth == '0000-00-00') { $dateOfBirth = ''; } $patientData['dateOfBirth'] = $dateOfBirth; $address = new Address(); $address->personId = $patient->personId; $addressIterator = $address->getIteratorByPersonId(); foreach ($addressIterator as $address) { break; // retrieves the top address } $patientData['addressLine1'] = $address->line1; $patientData['addressLine2'] = $address->line2; $patientData['city'] = $address->city; $patientData['state'] = $address->state; $patientData['zip'] = $address->zipCode; $phoneNumber = new PhoneNumber(); $phoneNumber->personId = $patient->personId; $patientData['phones'] = $phoneNumber->phoneNumbers; $data['Patient'] = $patientData; WebVista::log('patient data: ' . print_r($patientData, true)); // CHECK for attending/supervisor $attendingId = (int) TeamMember::getAttending($patient->teamId); $building = Building::getBuildingDefaultLocation($attendingId); $ePrescriber = new EPrescriber(); $ePrescriber->providerId = $attendingId; $ePrescriber->buildingId = (int) $building->buildingId; $ePrescriber->populateWithBuildingProvider(); if ($attendingId > 0 && strlen($ePrescriber->SSID) > 0) { // SUPERVISOR $provider = new Provider(); $provider->personId = $attendingId; $provider->populate(); $supervisorData = array(); $supervisorData['DEANumber'] = $provider->deaNumber; $supervisorData['SPI'] = $ePrescriber->SSID; // it has conflicts with DEANumber //$supervisorData['stateLicenseNumber'] = $provider->stateLicenseNumber; $supervisorData['fileId'] = $provider->personId; $supervisorData['clinicName'] = ''; $identifierType = $provider->identifierType; if (strlen($identifierType) > 0) { // $prescriberData[$identifierType] = $provider->identifier; } $phoneNumber = new PhoneNumber(); $phoneNumber->personId = $provider->personId; $supervisorData['phones'] = $phoneNumber->phoneNumbers; $supervisorData['lastName'] = $provider->person->lastName; $supervisorData['firstName'] = $provider->person->firstName; $supervisorData['middleName'] = $provider->person->middleName; $supervisorData['suffix'] = $provider->person->suffix; $supervisorData['prefix'] = ''; $supervisorData['email'] = $provider->person->email; $supervisorData['specialtyCode'] = $provider->specialty; $specialtyQualifier = ''; if (strlen($provider->specialty) > 0) { $specialtyQualifier = 'AM'; } $supervisorData['specialtyQualifier'] = $specialtyQualifier; $supervisorData['addressLine1'] = $building->line1; $supervisorData['addressLine2'] = $building->line2; $supervisorData['city'] = $building->city; $supervisorData['state'] = $building->state; $supervisorData['zip'] = $building->zipCode; $supervisorData['phones'] = $building->phoneNumbers; $data['Supervisor'] = $supervisorData; WebVista::log('supervisor data: ' . print_r($supervisorData, true)); } return $data; }
<?php use fedemotta\datatables; use yii\grid\GridView; ?> <?php $searchModel = new ModelSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); echo DataTables::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => 'yii\\grid\\ActionColumn']]]);
public function action_paginate() { if (!$this->user->can('Admin_Item_Paginate')) { throw HTTP_Exception::factory('403', 'Permission denied to view admin item paginate'); } if (DataTables::is_request()) { $orm = ORM::factory('Item'); $paginate = Paginate::factory($orm)->columns(array('item.id', 'item.name', 'image', 'status', 'type.name'))->search_columns(array('item.name', 'status', 'type.name')); $datatables = DataTables::factory($paginate)->execute(); foreach ($datatables->result() as $item) { $datatables->add_row(array($item->img(), $item->name, $item->status, $item->type->name, $item->id)); } $datatables->render($this->response); } else { throw HTTP_Exception::factory(500, 'Internal server error'); } }