public function getdatafromajaxcallAction()
 {
     $taskallocation_model = new Default_Model_Tasksallocation();
     $methodKey = $this->_getParam('methodKey', null);
     if ($methodKey == "1") {
         //Get Project Tasks
         $projectid = $this->_getParam('projectid', null);
         $options_data = "";
         $options_data .= sapp_Global::selectOptionBuilder('0', 'Select Task');
         if ($projectid != '') {
             $dept_data = $taskallocation_model->getProjectTasks($projectid);
             foreach ($dept_data as $dept) {
                 $options_data .= sapp_Global::selectOptionBuilder($dept['id'], $dept['name']);
             }
         }
         $this->_helper->json(array('options' => $options_data));
     } else {
         if ($methodKey == "2") {
             //Get Tasks Planned Activities
             $taskid = $this->_getParam('taskid', null);
             $this->_helper->json(array('options' => sapp_Global::_convertArrayToHTMLTable("leavecardtablegrid", "Task Details", $taskallocation_model->getTaskDetails($taskid))));
         } else {
             if ($methodKey == "3") {
                 //Get Tasks Planned Activities
                 $taskid = $this->_getParam('taskid', null);
                 $taskActivityDetails = $taskallocation_model->getTaskActivityDetails($taskid);
                 $this->_helper->json(array('options' => $this->getActivitesEditableGrid($taskActivityDetails)));
                 //$this->_helper->json(array('options' => sapp_Global::_convertArrayToHTMLTable("leavecardtablegrid", "Task Activity Details", $taskActivityDetails)));
             } else {
                 if ($methodKey == "4") {
                     //Get Project resources
                     $projectid = $this->_getParam('projectid', null);
                     $options_data = "";
                     //$options_data .= sapp_Global::selectOptionBuilder('0', 'Select Task');
                     if ($projectid != '') {
                         $dept_data = $taskallocation_model->getEmployeesByProject($projectid);
                         foreach ($dept_data as $dept) {
                             $options_data .= sapp_Global::selectOptionBuilder($dept['id'], $dept['name']);
                         }
                     }
                     $this->_helper->json(array('options' => $options_data));
                 }
             }
         }
     }
 }
 public function getdatafromajaxcallAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
         $loginuserGroup = $auth->getStorage()->read()->group_id;
     }
     $taskallocation_model = new Default_Model_Tasksallocation();
     $methodKey = $this->_getParam('methodKey', null);
     if ($methodKey == "1") {
         //Get Project Tasks
         $projectid = $this->_getParam('projectid', null);
         $options_data = "";
         $options_data .= sapp_Global::selectOptionBuilder('0', 'Select Task');
         if ($projectid != '') {
             $dept_data = $taskallocation_model->getCurrentUserProjectTasks($projectid, $loginUserId, $loginuserGroup);
             foreach ($dept_data as $dept) {
                 $options_data .= sapp_Global::selectOptionBuilder($dept['id'], $dept['name']);
             }
         }
         $this->_helper->json(array('options' => $options_data));
     } else {
         if ($methodKey == "2") {
             //Get Tasks Details for View
             $taskid = $this->_getParam('taskid', null);
             $this->_helper->json(array('options' => sapp_Global::_convertArrayToHTMLTable("leavecardtablegrid", "Task Details", $taskallocation_model->getTaskDetails($taskid))));
         } else {
             if ($methodKey == "3") {
                 //Get Tasks Planned Activities
                 $taskid = $this->_getParam('taskid', null);
                 $this->_helper->json(array('options' => sapp_Global::implode2DArray($taskallocation_model->getTaskActivityDetails($taskid))));
             } else {
                 if ($methodKey == "4") {
                     //Get Project resources
                     $projectid = $this->_getParam('projectid', null);
                     $options_data = "";
                     //$options_data .= sapp_Global::selectOptionBuilder('0', 'Select Resource');
                     if ($projectid != '') {
                         $dept_data = $taskallocation_model->getEmployeesByProject($projectid);
                         foreach ($dept_data as $dept) {
                             $options_data .= sapp_Global::selectOptionBuilder($dept['id'], $dept['name']);
                         }
                     }
                     $this->_helper->json(array('options' => $options_data));
                 } else {
                     if ($methodKey == "5") {
                         //get TaskAllocated data based on Task and Activity
                         $taskid = $this->_getParam('taskid', null);
                         $taskactivityid = $this->_getParam('taskactivityid', null);
                         $this->_helper->json(array('options' => sapp_Global::implode2DArray($taskallocation_model->getAllocatedTasks($taskid, $taskactivityid))));
                     } else {
                         if ($methodKey == "6") {
                             //Get Tasks Planned Activities
                             $taskid = $this->_getParam('taskid', null);
                             $this->_helper->json(array('options' => sapp_Global::implode2DArray($taskallocation_model->getTaskActivityMasterDetails($taskid))));
                         } else {
                             if ($methodKey == "7") {
                                 //Get Tasks Planned Activities
                                 $taskid = $this->_getParam('taskid', null);
                                 $options_data = "";
                                 $options_data .= sapp_Global::selectOptionBuilder('0', 'Select Activity');
                                 if ($taskid != '') {
                                     $dept_data = $taskallocation_model->getTaskActivityDetails($taskid);
                                     foreach ($dept_data as $dept) {
                                         $options_data .= sapp_Global::selectOptionBuilder($dept['activityid'], $dept['Activity']);
                                     }
                                 }
                                 $this->_helper->json(array('options' => $options_data));
                             } else {
                                 if ($methodKey == "8") {
                                     //Get Tasks Planned Activities
                                     $taskid = $this->_getParam('taskid', null);
                                     $this->_helper->json(array('options' => sapp_Global::implode2DArray($taskallocation_model->getTaskActivityAllocationByTaskID($taskid))));
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }