G:
/
PleskVhosts
/
seeonsoft.com
/
hp.thefalconunited.com
/
up file
home
<?php session_start(); $empid = $_SESSION['empids']; include("config.php"); $nw = '1501'; $resultzze = $js->prepare('SELECT * FROM `invoicepayments` ORDER BY `id` '); $resultzze->execute(array(':invoice' => $invoice)); $cc = $resultzze->rowCount(); if($cc == '0') { $payid = 'FETRPT'.$nw; } else { while($rowzze = $resultzze->fetch(PDO::FETCH_ASSOC)) { $ids = $rowzze['id'] + $nw; } $payid = 'FETRPT'.$ids; } date_default_timezone_set('Asia/Muscat'); $de = date('d-m-Y H:i:s'); $invoice = $_POST['invoice']; $mode = $_POST['r_mode']; if($mode == 'Cash') { $branch = $_POST['branch']; $banks = ''; } else { $banks = $_POST['banks']; $branch =''; } $invdate = $_POST['invdate']; $payingamt = $_POST['payingamt']; $invamt = $_POST['invamt']; $currency = $_POST['currency']; $resultzz = $js->prepare('SELECT * FROM `invoicepayments` WHERE `invoiceid` = :invoice '); $resultzz->execute(array(':invoice' => $invoice)); $cc = $resultzz->rowCount(); if($cc > '0') { while($rowzz = $resultzz->fetch(PDO::FETCH_ASSOC)) { $payamount = $rowzz['balance']; } $balance = $payamount - $payingamt; } else { $balance = $invamt - $payingamt; } $remarks = $_POST['remarks']; $sql = $js->prepare('INSERT INTO `invoicepayments` (`invoiceid`, `payid`, `paydate`, `payamount`, `currency`, `balance`, `remarks`, `mode`, `banks`, `branch`, `enteredby`, `enteredat`) VALUES (:invoice, :payid, :invdate, :payingamt, :currency, :balance, :remarks, :mode, :banks, :branch, :empid, :de)'); $status = $sql->execute(array(':invoice' => $invoice, ':invdate' => $invdate, ':payid' => $payid, ':payingamt' => $payingamt, ':currency' => $currency, ':balance' => $balance, ':remarks' => $remarks, ':mode' => $mode, ':banks' => $banks, ':branch' => $branch, ':empid' => $empid, ':de' => $de)); ?> <script type="text/javascript"> alert("Have Successfully Updated The Invoice Payment"); window.location = "invoicepayments.php"; </script>