load->model('Physician_model'); //$this->load->library('formLibrary/drag-n-drop-form-builder/FormGenerator'); //$this->load->model('Physician_permission_model'); // if (!$this->ion_auth->in_group(array('admin'))) { // if(!$this->ion_auth->physician_permission('coordinator_management_menu')) // redirect('home/permission'); // } } public function index() { // $data['invoice']=array( // 'TxnDate'=> "2014-09-19", // 'domain'=>"QBO", // 'PrintStatus'=> "NeedToPrint" // ); // $inv_data = json_encode($data); // echo '
'; print_r($inv_data); echo '';die; // $inv = invoice_checking($inv_data); // echo '
'; print_r($inv); echo '';die; $data = array(); $data['data'] = $this->Physician_model->getPhysician(); $this->load->view('home/dashboard'); // just the header file $this->load->view('physician',$data); $this->load->view('home/footer'); // just the header file } public function addNewView() { // $npi = npinumber_checking('1467586115'); // echo '
'; print_r($npi); echo '';die; $data['phyid'] = 0; $this->load->view('home/dashboard'); // just the header file $this->load->view('add_new',$data); $this->load->view('home/footer'); // just the header file } function checkNpi(){ $npi_no=$this->input->get("npi"); $phyid=$this->input->get("phyid"); $response=npinumber_checking($npi_no); if($response->result_count>0){ $result=$this->Physician_model->checkNPIexist($npi_no,$phyid); if($result){ $data=array( 'name'=>$response->results[0]->basic->first_name." ".$response->results[0]->basic->middle_name." ".$response->results[0]->basic->last_name, 'address'=>$response->results[0]->addresses[0]->address_1." ".$response->results[0]->addresses[0]->address_2, 'country'=>$response->results[0]->addresses[0]->country_name, 'city'=>$response->results[0]->addresses[0]->city, 'phone'=>$response->results[0]->addresses[0]->telephone_number, 'zipcode'=>$response->results[0]->addresses[0]->postal_code, 'result_count'=>$response->result_count, 'primary'=>$response->results[0]->taxonomies[0]->primary, 'license'=>$response->results[0]->taxonomies[0]->license, 'status'=>'success', 'message'=>'available' ); }else{ $data=array( 'status'=>'failed', 'message'=>'This NPI no is already exist.' ); } }else{ $data=array( 'status'=>'failed', 'message'=>'This NPI no is not valid.' ); } echo json_encode($data); } public function addNew() { $id = $this->input->post('id'); $npi = $this->input->post('npi'); $name = $this->input->post('name'); $password = $this->input->post('password'); $email = $this->input->post('email'); $address = $this->input->post('address'); $phone = $this->input->post('phone'); $country = $this->input->post('country'); $city = $this->input->post('city'); // $primary = $this->input->post('isPrimary'); $licenses = $this->input->post('licenses'); $isPrimary = $this->input->post('isPrimary'); if($isPrimary == 'true'){ $primary = 1; }else{ $primary = 0; } $affiliation = $this->input->post('affiliation'); $zipcode = $this->input->post('zipcode'); $notes = $this->input->post('notes'); $fax = $this->input->post('fax'); $this->load->library('form_validation'); $this->form_validation->set_error_delimiters('
'; print_r($datas); echo '';die; $this->Physician_model->insertUser($datas); $user_id_cooardinator_q = $this->db->get_where('physician', array('email' => $email)); $user_id = $user_id_cooardinator_q->result()[0]->id; $id_info = array('ion_user_id' => $ion_user_id); $this->Physician_model->updatePhysician($user_id, $id_info); $name=$name; $from = array( 'name' => 'HMS Admin', 'email' => 'admin@hms.com' ); $subject ='Physician created successfully'; $emaildata['emaildata'] = array( 'name' =>$name ); $to = $email; $message= $this->load->view('email_template_management/physician_created',$emaildata,TRUE); send_email($from,$to,$subject,$message); $this->session->set_flashdata('feedback_success', 'Added'); } } else { // Updating // die('uu'); $ion_user_id = $this->db->get_where('physician', array('id' => $id))->row()->ion_user_id; if (empty($password)) { $password = $this->db->get_where('users', array('id' => $ion_user_id))->row()->password; } else { $password = $this->ion_auth_model->hash_password($password); } $this->Physician_model->updateIonUser($username, $email, $password, $ion_user_id); $this->Physician_model->updatePhysician($id, $datas); $this->session->set_flashdata('feedback_success', 'Updated'); } // Loading View redirect('physician'); } } function editPhysician() { $data = array(); $data['phyid']=$id = $this->input->get('id'); $data['user'] = $this->Physician_model->getPhysicianById($id); $this->load->view('home/dashboard'); // just the header file $this->load->view('add_new', $data); $this->load->view('home/footer'); // just the footer file } function getUsers() { $requestData = $_REQUEST; $start = $requestData['start']; $limit = $requestData['length']; $search = $this->input->post('search')['value']; if ($limit == -1) { if (!empty($search)) { $data['users'] = $this->Physician_model->getPhysicianBysearch($search); } else { $data['users'] = $this->Physician_model->getPhysician(); } } else { if (!empty($search)) { $data['users'] = $this->Physician_model->getPhysicianByLimitBySearch($limit, $start, $search); } else { $data['users'] = $this->Physician_model->getPhysicianByLimit($limit, $start); } } //$data['users'] = $this->Physician_model->getUsers(); foreach ($data['users'] as $user) { if ($this->ion_auth->in_group(array('admin'))) { $options1 = ' ' . lang('edit') . ''; } $info[] = array( $user->npi, $user->email, $user->name, $user->phone, $options1.' '.$options2, ); } if (!empty($data['users'])) { $output = array( "draw" => intval($requestData['draw']), "recordsTotal" => count($data['users']), "recordsFiltered" => count($data['users']), "data" => $info ); } else { $output = array( // "draw" => 1, "recordsTotal" => 0, "recordsFiltered" => 0, "data" => [] ); } echo json_encode($output); } public function checkEmail(){ $phyid=$this->input->get("phyid"); $ion_user_id = $this->db->get_where('physician', array('id' => $phyid))->row()->ion_user_id; $email=$this->input->get('email'); $result=$this->Physician_model->checkEmail($email,$ion_user_id); echo $result; } } /* End of file doctor.php */ /* Location: ./application/modules/doctor/controllers/doctor.php */