
PK 
<?php
session_start();
require_once 'common/common.php';
require_once 'common/secure.php';
include("connexion.php");
include("head.php");
/*echo '<pre>';
print_r($_GET);
echo '</pre>';
exit;*/
?>
<h2 id="icon_pick">Payment Added</h2>
<?php
///include("connexion2.php");
$dat=date("Y-m-d");
if($_GET['act']=='paybybill')
{
$sql="INSERT INTO payments(invoice,pmode,pamount,tds,pdetail,pdate,branch)
VALUES('$_GET[invoice]','$_GET[pmode]', '$_GET[pamount]','$_GET[tds]','$_GET[pdetail]','$dat','$_SESSION[city]')";
$result=mysql_query($sql) or die('error');
}else
{
$limit=count($_GET['invid']);
for($a=0;$a<$limit;$a++)
{
$sql="INSERT INTO payments(invoice,pmode,pamount,tds,pdetail,pdate,branch)
VALUES('$invid[$a]','$_GET[pmode]', '$amount[$a]','$_GET[tds]','$_GET[pdetail]','$dat','$_SESSION[city]')";
$result=mysql_query($sql) or die('error');
}
}
/*$sql="INSERT INTO payments(invoice,pmode,pamount,tds,pdetail,pdate,branch)
VALUES('$_GET[invoice]','$_GET[pmode]', '$_GET[pamount]','$_GET[tds]','$_GET[pdetail]','$dat','$_SESSION[city]')";
$result=mysql_query($sql) or die('error');*/
echo "<table>
<tr>
<td>
Payment Added Sucessfully,<a href=billing.php>Click here</a> to Add Another Payment.
<br><br>
<a href=statement.php?clnt=".$_GET['frm_url'].">Click here to be back at Payment</a><br></center>
</td>
</tr>
</table>";
//include("connexion2.php");
if($_GET['srchby_inve']=='tureid')
{
for($b=0;$b<$limit;$b++)
{
$sql2="UPDATE invoices SET invstatus='paid' WHERE invid='$invid[$b]' AND clnid='".$clnid[$b]."' ";
$result2=mysql_query($sql2) or die('problems upodating invoice status');
}
}
elseif($_GET['serh_by_ajt']=='true')
{
for($b=0;$b<$limit;$b++)
{
//$sql2="UPDATE invoices SET invstatus='paid' WHERE invid='$invid[$a]' AND clnid='".$clnid[$a]."' ";
$sql2="UPDATE invoices SET invstatus='paid' WHERE invid='".$invid[$b]."' AND ajtid='".$ajtid[$b]."' ";
$result2=mysql_query($sql2) or die('problems upodating invoice status');
}
//$sql2="UPDATE invoices SET invstatus='paid' WHERE invid='".$_GET['invoice']."' AND ajtid='".$_GET['get_ids']."' ";
}
else
{
for($b=0;$b<$limit;$b++)
{
$sql2="UPDATE invoices SET invstatus='paid' WHERE clnid='".$clnid[$b]."' ";
$result2=mysql_query($sql2) or die('problems upodating invoice status');
}
//$sql2="UPDATE invoices SET invstatus='paid' WHERE clnid='$_GET[invoice]'";
}
if($_GET['act']=='paybybill')
{
$sql2="UPDATE invoices SET invstatus='paid' WHERE clnid='".$_GET['clnid_by_bill']."' AND invid='".$_GET['invoice']."' ";
//$result2=mysql_query($sql2) or die('problems upodating invoice status');
}
$result2=mysql_query($sql2) or die('problems upodating invoice status');
?>
<br><br><br>
<?php
include "foot.php";
?>


PK 99