<?php $markDetailId = $_GET['markId']; if (!isset($_GET['f'])) { removeFromSession('treeFillingArray'); removeFromSession('treeConversionArray'); } /*echo '<pre>'; print_r($_SESSION); echo '</pre>'; */ $treeFillingArray = getArrayFromSession('treeFillingArray'); /* start code update by priyanka 9/2/2011*/ if (!isset($treeFillingArray)) { $treeDetail = new TreeDO(); $treeFillingArray = $treeDetail->getfillingDetail($markDetailId); $_SESSION['treeFillingArray'] = serialize($treeFillingArray); } $treeConversionArray = getArrayFromSession('treeConversionArray'); if (empty($treeConversionArray)) { foreach ($treeFillingArray as $treeFilling) { if ($treeFilling->treetype_id > 0) { $timberDetail = new TimberDO(); $timberDetailArray = $timberDetail->getTimberDetail($treeFilling->treetype_id, $markDetailId); $treeConversionArray[$treeFilling->treetype_id] = $timberDetailArray; } $_SESSION['treeConversionArray'] = serialize($treeConversionArray); } } /*echo '<pre>'; print_r(serialize($treeFillingArray));
<?php $treeDO = new TreeDO(); $list = $treeDO->getTreeList(); $catDO = new CategoryDO(); $catList = $catDO->getCategoryList(); $markDetailId = $_REQUEST['markId']; $treetype_id = "2"; $previousCount = 0; $previousVolume = 0; $currentCount = 0; $currentVolume = 0; //print_r($_REQUEST); if (isset($_POST['update'])) { extract($_POST); $treeFilling = new TreeFillingVO(); $treeFilling->currentCount = $currentCount; $treeFilling->currentVolume = $currentVolume; $treeFilling->previousCount = $previousCount; $treeFilling->previousVolume = $previousVolume; $treeFilling->treetype_id = $treetype_id; $treeFillingArray = (array) unserialize($_SESSION['treeFillingArray']); if (isset($treeFillingArray)) { $treeFillingArray[$treetype_id] = $treeFilling; //count($treeFillingArray); $_SESSION['treeFillingArray'] = serialize($treeFillingArray); $treeFillingArray = (array) unserialize($_SESSION['treeFillingArray']); } else { $treeFillingArray = arary(); $treeFillingArray[$treetype_id] = $treeFilling; $_SESSION['treeFillingArray'] = serialize($treeFillingArray);