public function delete(Gyuser_Model_PriorOperations $obj)
 {
     try {
         $table = $this->getDbTable();
         $set = array('status' => 0);
         $where = array('id = ?' => $obj->getId());
         $result = $table->update($set, $where);
         return $result;
     } catch (Exception $e) {
         echo $e;
     }
 }
 public function userpriorformajaxAction()
 {
     try {
         $request = $this->getRequest();
         if ($this->getRequest()->isPost()) {
             $mapper = new Gyuser_Model_PriorOperationsDataMapper();
             $Obj = new Gyuser_Model_PriorOperations();
             if ($request->date) {
                 list($Day, $Month, $Year) = explode('/', $request->date);
                 $stampeddate = mktime(12, 0, 0, $Month, $Day, $Year);
                 $next_check_date = date("Y-m-d", $stampeddate);
             } else {
                 $next_check_date = null;
             }
             $Obj->setDate($next_check_date);
             $Obj->setIs_operation_completed($request->is_operation_completed);
             $Obj->setCave_name($request->cave_name);
             $Obj->setAmount($request->amount);
             $Obj->setNext_check_date($request->next_check_date);
             $Obj->setPending_checks($request->pending_checks);
             $Obj->setIs_last_operation($request->is_last_operation);
             if ($request->next_check_date) {
                 list($Day, $Month, $Year) = explode('/', $request->next_check_date);
                 $stampeddate = mktime(12, 0, 0, $Month, $Day, $Year);
                 $next_check_date = date("Y-m-d", $stampeddate);
             } else {
                 $next_check_date = null;
             }
             $Obj->setNext_check_date($next_check_date);
             $Obj->setClient_id($request->client_id);
             if ($request->id) {
                 $Obj->setId($request->id);
             }
             $this->_helper->layout->disableLayout();
             $this->_helper->viewRenderer->setNoRender();
             $id = $mapper->save($Obj);
             if ($id) {
                 echo $id;
             } else {
                 echo "f";
             }
         }
     } catch (Exception $e) {
         echo $e;
     }
 }