JezK
Edit File: applicationApp2.php
<?php session_start(); include("main.php"); //echo "<pre>";print_r($_POST);print_r($_FILES);exit; if(!isset($_SESSION['bcUserID'])) { echo '<script>location.replace("../index.php")</script>'; } $applicationType = $_POST['applicationType']; $expiry = ($applicationType == 1)?'+2 years':'+3 years'; $userID = $_SESSION['bcUserID']; //bank details $bankID = $_POST['bankID']; $bankName = $_POST['bankName']; $branch = $_POST['branch']; $accountNumber = $_POST['accountNumber']; $ifsc = $_POST['ifsc']; $files = $_FILES['bFile']; $bankFile = $_POST['bankFile']; $bankFiles = array(); $flag = 1; //authorisedDetails $authorisedID = isset($_POST['authorisedID'])?$_POST['authorisedID']:array(); $managementID = isset($_POST['managementID'])?$_POST['managementID']:array(); $authorisedName = isset($_POST['authorisedName'])?$_POST['authorisedName']:array(); $authorizedFathersName = isset($_POST['authorizedFathersName'])?$_POST['authorizedFathersName']:array(); $authorisedDesignation = isset($_POST['authorisedDesignation'])?$_POST['authorisedDesignation']:array(); $authorisedAge = isset($_POST['authorisedAge'])?$_POST['authorisedAge']:array(); $authorisedQualification = isset($_POST['authorisedQualification'])?$_POST['authorisedQualification']:array(); $authorisedExperience = isset($_POST['authorisedExperience'])?$_POST['authorisedExperience']:array(); $authorisedLanguages = isset($_POST['authorisedLanguages'])?$_POST['authorisedLanguages']:array(); $authorisedAddress = isset($_POST['authorisedAddress'])?$_POST['authorisedAddress']:array(); $authorisedContact = isset($_POST['authorisedContact'])?$_POST['authorisedContact']:array(); //uploading bank files for($i=0;$i<count($bankID);$i++) { $userFile = $files; if($userFile['name'][$i] != "") { $file = $userFile['name'][$i]; $file = str_replace(' ','_',$file); $path = '../../BC-BF-Forms/'; $targetDirectory = 'uploads/'; $fileName1=time().$i.$file; $fileName = $targetDirectory.$fileName1; if(move_uploaded_file($userFile['tmp_name'][$i], $path.$fileName)) { $bankFiles[$i] = $fileName1; } else { $_SESSION['fileUploadFailed'] = 1; $flag = 0; echo "<script>location.replace('../application.php');</script>"; break; } } else { $bankFiles[$i] = $bankFile[$i]; } } if($flag == 1) { $result = $bdc->saveBankDetails($userID,$bankID,$bankName,$branch,$accountNumber,$ifsc,$bankFiles); if($result == -3) { $_SESSION['bankSaveFailed'] = 1; echo "<script>location.replace('../application2.php');</script>"; } elseif($result == -4) { $_SESSION['bankUpdateFailed'] = 1; echo "<script>location.replace('../application2.php');</script>"; } else { $result = $bdc->saveAuthorisedDetails($userID,$managementID,$authorisedID,$authorisedName,$authorizedFathersName,$authorisedDesignation,$authorisedAge,$authorisedQualification,$authorisedExperience,$authorisedLanguages,$authorisedAddress,$authorisedContact); if($result == -3) { $_SESSION['authorisedSaveFailed'] = 1; echo "<script>location.replace('../application2.php');</script>"; } elseif($result == -4) { $_SESSION['authorisedUpdateFailed'] = 1; echo "<script>location.replace('../application2.php');</script>"; } else { //success //$bdc->updateExpiry($userID,$expiry); $_SESSION['renewalSuccess'] = 1; echo "<script>location.replace('../dashboard.php');</script>"; } } } else { echo "<script>location.replace('../dashboard.php');</script>"; }