public function editassetAction()
 {
     $this->view->title = $this->view->translate('Edit Livingasset details');
     //Base line data
     $familycommon = new Familycommonview_Model_familycommonview();
     $this->view->memberid = $this->_getParam('id');
     $this->view->membername = $familycommon->getfamily($this->_getParam('id'));
     // // // //         $revvillageid = $this->view->membername[0]['rev_village_id'];
     // // // //         if ($revvillageid) {
     // // // //             $revvillagename = $this->view->adm->editRecord("ourbank_master_villagelist",$revvillageid);
     // // // //             $this->view->revvillagename=$revvillagename[0]['name'];
     // // // //         }
     //getting module id and submodule id
     $module = $familycommon->getmodule('Family');
     foreach ($module as $module_id) {
     }
     $this->view->mod_id = $module_id['parent'];
     $this->view->sub_id = $module_id['module_id'];
     $this->view->insurance = $familycommon->getinsurance($this->_getParam('id'));
     //edit assets
     $this->view->memberid = $member_id = $this->_getParam('id');
     //load form for living assets
     $this->view->submoduleid = $this->_getParam('subId');
     //dynamically change the path name
     //get all type of living assets
     $this->view->liveasset_details = $this->view->adm->viewRecord("ourbank_master_liveassets", "id", "DESC");
     //update contact details
     if ($this->_request->isPost() && $this->_request->getPost('Submit')) {
         $id = $this->_getParam('id');
         $submoduleid = $this->_getParam('subid');
         $asset_db = new Livingassets_Model_livingassets();
         $editAsset = $asset_db->getAssetdetails($id);
         for ($j = 0; $j < count($editAsset); $j++) {
             $this->view->adm->addRecord("ourbank_liveassetdetails_log", $editAsset[$j]);
         }
         $asset_db->deleteasset($id);
         $number = $this->_getParam('number');
         $value = $this->_getParam('value');
         $date = $this->_getParam('date');
         $dateconvert = new App_Model_dateConvertor();
         $i = 0;
         foreach ($this->_getParam('assettype') as $val) {
             if ($date[$i]) {
                 if ($date[$i] == "00/00/0000" or $date[$i] == NULL) {
                     $dates = date("y/m/d H:i:s");
                 } else {
                     $dates = $dateconvert->mysqlformat($date[$i]);
                 }
             } else {
                 $dates = date("y/m/d H:i:s");
             }
             if ($value[$i]) {
                 $values = $value[$i];
             } else {
                 $values = 0;
             }
             $assettype = array('submodule_id' => $submoduleid, 'family_id' => $id, 'liveasset_id' => $val, 'number' => $number[$i], 'date_of_value' => $dates, 'value' => $values);
             $i++;
             $this->view->adm->addRecord("ourbank_liveassetdetails", $assettype);
         }
         $this->_redirect('/familycommonview/index/commonview/id/' . $id);
     } else {
         //set the contact details in the contact form...
         $sub_id = $this->_getParam('subId');
         $id = $this->_getParam('id');
         $individualcommon = new Familycommonview_Model_familycommonview();
         $this->view->editAsset = $individualcommon->getlivingassetsdetails($id);
         //$form->populate($editContact[0]);
     }
 }
 public function commonviewAction()
 {
     // //         //Acl
     // //         //$access = new App_Model_Access();
     // //         //$checkaccess = $access->accessRights('Individual',$this->view->globalvalue[0]['name'],'commonviewAction');
     // //         //if (($checkaccess != NULL)) {
     $id = $this->_request->getParam('id');
     $this->view->memberid = $id;
     $familycommon = new Familycommonview_Model_familycommonview();
     $member_name = $familycommon->getfamily($id);
     $villageid = $member_name[0]['rev_village_id'];
     $parentid = $member_name[0]['parentoffice_id'];
     $talukname = $familycommon->gettalukname($villageid);
     if ($talukname) {
         $this->view->villagename = $talukname[0]['name'];
     }
     $kootaname = $familycommon->getkoota($parentid);
     if ($kootaname) {
         $this->view->kootaname = $kootaname[0]['name'];
     }
     //getting module id and submodule id
     $module = $familycommon->getmodule('Family');
     $this->view->mod_id = $module[0]['parent'];
     $this->view->sub_id = $module[0]['module_id'];
     $officemodule = $familycommon->getmodule('Office');
     //print_r($officemodule);
     $officesub_id = $officemodule[0]['module_id'];
     $pincode1 = $familycommon->getpincode($officesub_id, $villageid);
     if ($pincode1) {
         $this->view->pincode1 = $pincode1[0]['zipcode'];
     }
     $this->view->insurance = $familycommon->getinsurance($id);
     //         //geting family details, family details, health, economic, education details
     $this->view->membername = $member_name;
     // //      $this->view->family =$familycommon->getfamilydetails($id);
     $this->view->agriculture = $edit_agriculture = $familycommon->getagriculturedetails($id);
     $this->view->acretotal = $familycommon->getacretotal($id);
     $this->view->guntatotal = $familycommon->getguntatotal($id);
     $this->view->family = $familycommon->getfamilydetails($id);
     // //        $this->view->getentitlement=$familycommon->getentitlement();
     $this->view->crop = $familycommon->getcrop($id);
     $this->view->loandetails = $familycommon->getloandetails($id);
     $this->view->savingsdetails = $familycommon->getsavingsdetails($id);
     $this->view->gethabithealth = $familycommon->gethabithealth($id);
     $this->view->gethabitchallenge = $familycommon->gethabitphychallenge($id);
     $this->view->getchronicdisease = $familycommon->getchronicdisease($id);
     $this->view->getfamilymembers = $familycommon->getfamilyname($id);
     $this->view->livingassets = $familycommon->getlivingassetsdetails($id);
     $this->view->nonlivingassets = $familycommon->getnonlivingassetsdetails($id);
     // 	//PRA Based Services
     $this->view->praservice = $familycommon->praservice($id);
     $this->view->expense = $familycommon->getexpense($id);
     // 	// Basic Infrastructure
     $this->view->housingtype = $familycommon->housingtype($id);
     $this->view->ownership = $familycommon->ownership($id);
     $this->view->cookfuel = $familycommon->cookfuel($id);
     // 	//Annual income details
     $this->view->incomedetails = $familycommon->getincomedetails($id);
     $this->view->incometotal = $familycommon->getincometotal($id);
     // /*
     // // 	$this->view->loandtotal=$individualcommon->getloantotal($id);
     // //         $this->view->servicedetails=$individualcommon->servicedetails($id);
     // //         $this->view->family =$individualcommon->getfamilydetails($id);
     // //        $this->view->activities=$individualcommon->getactivities($id);
     //         //}
     //         //else {
     //         //$this->_redirect('index/index');
     //         //}*/
 }