} $limitCheck = $_POST['availLimit']; if ($noReward > 0) { for ($i = 0; $i < $numReward; $i++) { if ($limitCheck[$i] == true) { if ($limitAvail[$i] == '') { $limitAvailValue = 0; } else { $limitAvailValue = $limitAvail[$i]; } } elseif ($limitAvail[$i] == '') { $limitAvailValue = 0; } else { $limitAvailValue = 0; } $pledgeAmount[$i] = (double) remove_currency($pledgeAmount[$i]); $limitAvailValue = (int) $limitAvailValue; $rewardDescription[$i] = addslashes($rewardDescription[$i]); $inserReward = $con->insert("INSERT INTO projectrewards(`pledgeAmount`,`limitAvailable`,`description`,`estimateDeliveryMonth`, `estimateDeliveryYear`,`projectId`) \n\t\t\t\t\t\t\tVALUES(" . $pledgeAmount[$i] . "," . $limitAvailValue . ",'" . $rewardDescription[$i] . "', " . $rewardMonth[$i] . "," . $rewardYear[$i] . "," . $projectId . ")"); } } } elseif ($_POST['current'] == '5') { // save story //echo $_POST['current']; $projectStory1 = sanitize_string($_POST['projectStory1']); //echo $projectStory1; if (!empty($projectStory1)) { $updateStory = $con->update("UPDATE projectstory SET `projectDescription` = '" . $projectStory1 . "' where projectId = " . $projectId . " LIMIT 1"); } /* project video link -- jwg */ if (isset($_POST['video_url']) && !empty($_POST['video_url'])) {
$_POST = array(); } $noReward = isset($_POST['noReward']) ? (int) $_POST['noReward'] : 0; //Hiddent Field. if ($noReward > 0) { //print_r($_POST);exit; $rewardQr = $con->delete("delete from projectrewards where projectId=" . $projectId); } else { // jwg - logic fixup $pledgeAmount = isset($_POST['rewardAmount']) ? $_POST['rewardAmount'] : ''; if (is_array($pledgeAmount) && sizeof($pledgeAmount) > 0) { for ($i = 0; $i < sizeof($pledgeAmount); $i++) { $pledgeAmount[$i] = remove_currency($pledgeAmount[$i]); } } else { $pledgeAmount = remove_currency($pledgeAmount); } $rewardDescription = isset($_POST['rewardDescription']) ? $_POST['rewardDescription'] : ''; $rewardMonth = isset($_POST['rewardMonth']) ? $_POST['rewardMonth'] : ''; $rewardYear = isset($_POST['rewardYear']) ? $_POST['rewardYear'] : ''; $numReward = isset($_POST['countRewards']) ? $_POST['countRewards'] : ''; if ($numReward == 0) { $numReward = 1; } $limitCheck = isset($_POST['availLimit']) ? $_POST['availLimit'] : ''; $rewardAmount = isset($_POST['rewardAmount']) ? $pledgeAmount : ''; $limitAvail = isset($_POST['avail']) ? $_POST['avail'] : ''; //print_r($limitAvail);exit; for ($i = 0; $i < $numReward; $i++) { //if($limitCheck[$i]==true) { /*if($limitAvail[$i]=='') {*/