public function servicesAction()
 {
     if ($this->getRequest()->isXmlHttpRequest()) {
         $request = $this->getRequest();
         $model = new Practitioners();
         $session = new Container('frontend');
         $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];
         $action = $request->getPost('action');
         if ($action == 'change_status') {
             $ids = $request->getPost('ids') != '' ? $request->getPost('ids') : '';
             $status_id = $request->getPost('status_id') != '' ? $request->getPost('status_id') : '1';
             echo json_encode($model->changeServiceStatus($api_url, $session->userid, array_filter($ids), $status_id));
             exit;
         } else {
             $request->getPost('service_id') != '' ? $service_id = $request->getPost('service_id') : ($service_id = '');
             $request->getPost('duration') != '' ? $duration = $request->getPost('duration') : ($duration = '');
             $request->getPost('price') != '' ? $price = $request->getPost('price') : ($price = '');
             $request->getPost('sp_edit_id') != '' ? $id = $request->getPost('sp_edit_id') : ($id = '');
             $sp_edit_id = $request->getPost('sp_edit_id');
             $error = false;
             if (is_numeric($duration) && is_numeric($price)) {
                 echo json_encode($model->updateServices($api_url, $session->userid, $service_id, $duration, $price, $action, $sp_edit_id));
             } else {
                 echo json_encode(array('status' => 0, 'msg' => 'Duration and price must be in numeric form..!!'));
             }
         }
     }
     exit;
 }