Ejemplo n.º 1
0
	public function ajaxdeleteAction()
	{
		$this->_helper->layout()->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);
		$recordId = $this->_getParam('id',0);
		if($recordId > 0)
		{
			$drirecords = new Vehicle_Models_DrirecordMapper();
			try{
				$drirecords->delete($recordId);
				echo "s";
				}
				catch(Exception $e)
				{
					echo "f";
					}
			}
			else
			{
				$this->_redirect('/vehicle/drirecord');
				}
		}
Ejemplo n.º 2
0
	public function displayAction()
	{
		$vehicles = new Vehicle_Models_VehicleMapper();
		$veId = $this->_getParam('id',0);
		if($veId >0)
		{
			$vehicle = new Vehicle_Models_Vehicle();
			$vehicles->find($veId,$vehicle);
			
			$condition = 'veId';
			$drirecords = new Vehicle_Models_DrirecordMapper();
			$repairs = new Vehicle_Models_RepairMapper();
			$mtncs = new Vehicle_Models_MtncMapper();
			$verecords = new Vehicle_Models_VerecordMapper();
			
			$arrayDrirecords = $drirecords->fetchAllJoin($veId,$condition);
			$arrayRepairs = $repairs->fetchAllJoin($veId,$condition);
			$arrayMtncs = $mtncs->fetchAllJoin($veId,$condition);
			
			$conditionVar[0] = '0';
			$conditionVar[1] = 'veId';
			$arrayVerecords = $verecords->fetchAllJoin($veId,$conditionVar);
			if(count($arrayDrirecords) != 0)
			{
				$pageNumber = $this->_getParam('page');
				$arrayDrirecords->setCurrentPageNumber($pageNumber);
				$arrayDrirecords->setItemCountPerPage('20');
			}
			$this ->view->vehicle = $vehicle;
			$this ->view->arrayDrirecords = $arrayDrirecords;
			if(count($arrayRepairs) != 0)
			{
				$pageNumber = $this->_getParam('page');
				$arrayRepairs->setCurrentPageNumber($pageNumber);
				$arrayRepairs->setItemCountPerPage('20');
			}
			$this ->view->arrayRepairs = $arrayRepairs;
			if(count($arrayMtncs) != 0)
			{
				$pageNumber = $this->_getParam('page');
				$arrayMtncs->setCurrentPageNumber($pageNumber);
				$arrayMtncs->setItemCountPerPage('20');
			}
			$this ->view->arrayMtncs = $arrayMtncs;
			if(count($arrayVerecords) != 0)
		{
			$pageNumber = $this->_getParam('page');
			$arrayVerecords->setCurrentPageNumber($pageNumber);
			$arrayVerecords->setItemCountPerPage('20');
			}
			$this ->view->arrayVerecords = $arrayVerecords;
			}
			else
			{
				$this->_redirect('/vehicle');
				}
		}