JezK
Edit File: page4App.php
<?php session_start(); include("main.php"); if(!isset($_SESSION['bcFormUserID'])) { echo "<script>location.replace('../page1.php');</script>"; } //echo "<pre>";print_r($_POST);print_r($_FILES);exit; $userID = $_SESSION['bcFormUserID']; $currentUserID = $userID; $structuralDetails = $_POST['structuralDetails']; $financialYear1 = $_POST['financialYear1']; $totalStaff1 = $_POST['totalStaff1']; $staffLeft1 = $_POST['staffLeft1']; $attributionRate1 = $_POST['attributionRate1']; $financialYear2 = $_POST['financialYear2']; $totalStaff2 = $_POST['totalStaff2']; $staffLeft2 = $_POST['staffLeft2']; $attributionRate2 = $_POST['attributionRate2']; $financialYear3 = $_POST['financialYear3']; $totalStaff3 = $_POST['totalStaff3']; $staffLeft3 = $_POST['staffLeft3']; $attributionRate3 = $_POST['attributionRate3']; $headOfficeDescription = $_POST['headOfficeDescription']; $headOfficeRemarks = $_POST['headOfficeRemarks']; $fieldOfficeDescription = $_POST['fieldOfficeDescription']; $fieldOfficeRemarks = $_POST['fieldOfficeRemarks']; $trainingCenterDescription = $_POST['trainingCenterDescription']; $trainingCenterRemarks = $_POST['trainingCenterRemarks']; $numberOfStaff = isset($_POST['numberOfStaff'])?$_POST['numberOfStaff']:""; $staffRemarks = isset($_POST['staffRemarks'])?$_POST['staffRemarks']:""; $vehiclesOwned = $_POST['vehiclesOwned']; $vehiclesRemarks = $_POST['vehiclesRemarks']; $totalComputers = $_POST['totalComputers']; $computersRemarks = $_POST['computersRemarks']; $otherID = isset($_POST['otherID'])?$_POST['otherID']:array(); $otherName = isset($_POST['otherName'])?$_POST['otherName']:array(); $otherDescription = isset($_POST['otherDescription'])?$_POST['otherDescription']:array(); $otherRemarks = isset($_POST['otherRemarks'])?$_POST['otherRemarks']:array(); //staffingDetails $staffID = $_POST['staffID']; $name = $_POST['name']; $designation = $_POST['designation']; $experience = $_POST['experience']; $appointmentDate = $_POST['appointmentDate']; $result = $bc->savePage4($userID,$structuralDetails,$financialYear1,$totalStaff1,$staffLeft1,$attributionRate1,$financialYear2,$totalStaff2,$staffLeft2,$attributionRate2,$financialYear3,$totalStaff3,$staffLeft3,$attributionRate3,$headOfficeDescription,$headOfficeRemarks,$fieldOfficeDescription,$fieldOfficeRemarks,$trainingCenterDescription,$trainingCenterRemarks,$numberOfStaff,$staffRemarks,$vehiclesOwned,$vehiclesRemarks,$totalComputers,$computersRemarks); //print_r($result); exit; if($result == -3) { $_SESSION['page4SaveFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } else { /*$userFile = $_FILES['structuralFile']; if(isset($userFile['name'])) { if($userFile['size'] > 0) { $file = $userFile['name']; $file = str_replace(' ','_',$file); $path = '../'; $targetDirectory = 'uploads/'; $fileName1=time().$file; $fileName = $targetDirectory.$fileName1; if(move_uploaded_file($userFile['tmp_name'], $path.$fileName)) { $result = $bc->saveBCUserFiles($userID,4,$fileName1); if($result == -3) { $_SESSION['structuralFileSaveFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } } else { $_SESSION['structuralFileUploadFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } } }*/ //save staffingDetails $result = $bc->saveStaffingDetails($userID,$staffID,$name,$designation,$experience,$appointmentDate); if($result == -3) { $_SESSION['staffingSaveFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } elseif($result == -4) { $_SESSION['staffingUpdateFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } else { //success $result = $bc->saveOtherDetails($userID,$otherID,$otherName,$otherDescription,$otherRemarks); if($result == -3) { $_SESSION['otherSaveFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } elseif($result == -4) { $_SESSION['otherUpdateFailed'] = 1; echo "<script>location.replace('../page4.php');</script>"; } else { $_SESSION['saveSuccess'] = 1; echo "<script>location.replace('../page5.php');</script>"; } } } echo $result; ?>