Ejemplo n.º 1
0
 public function chequesformajaxAction()
 {
     try {
         $request = $this->getRequest();
         if ($this->getRequest()->isPost()) {
             $mapper = new Gyuser_Model_ChequesDataMapper();
             $Obj = new Gyuser_Model_Cheques();
             if ($request->operation_id) {
                 $Obj->setOperation_id($request->operation_id);
             }
             list($Day, $Month, $Year) = explode('/', $request->date);
             $stampeddate = mktime(12, 0, 0, $Month, $Day, $Year);
             $realDate = date("Y-m-d", $stampeddate);
             $Obj->setDate($realDate);
             $Obj->setCheck_n($request->check_n);
             $Obj->setAmount($request->amount);
             //$Obj->setStatus($request->status);
             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;
     }
 }