コード例 #1
0
ファイル: addpayment.php プロジェクト: amitjoy/other-php
$limit=10;

	if($_POST['page']){
		$page=$_POST['page'];
	}else{
		$page=1;
	}
	$pages=$page-1;	
	if($_POST['action']=='delete'){
		mysql_query("delete from payments where id='".$_POST['id']."'")or die(mysql_error());
	}
	
	$res=mysql_query("select * from payments");
	$count=mysql_num_rows($res);
	
	$pagination=smart_pagination($_POST['page'],$count,$limit,'da')	
	
?>
	<table width='100%' cellspacing='0' cellpadding='0'>
				<tr style='background:#5c8c00; color:#fff;'>
					<td class='tdhead' width='20'>ID</td>
					<td class='tdhead' width='320'>From</td>
					<td class='tdhead'>Amount</td>
					<td class='tdhead' width='100'>Invoice No.</td>
					<td class='tdhead' width='180'>Payment Method</td>
					<td class='tdhead' width='100'>Date</td>
					<td class='tdhead' width='60'>Actions</td>
				</tr>
				<?
					$i=1;
				$res=mysql_query("select * from payments order by id desc LIMIT " . ($pages*$limit) . "," . $limit)or die(mysql_error());
コード例 #2
0
ファイル: invoices.php プロジェクト: amitjoy/other-php
	
	if(isset($_POST['addpay'])){
		if($_POST['value']!=''){
			mysql_query("insert into payments(`from`,`amount`,`invoice`,`pmethod`,`date`) values('".$_POST['from']."','".$_POST['value']."','".$_POST['id']."','".$_POST['pmethod']."','".time()."')")or die(mysql_error());
		}
	}
	
		if(isset($_GET['delete'])){
			mysql_query("delete from invoices where id='".$_GET['delete']."'")or die(mysql_error());
			mysql_query("delete from products where invoice='".$_GET['delete']."'")or die(mysql_error());
			mysql_query("delete from payments where invoice='".$_GET['delete']."'")or die(mysql_error());
		}
	
	$res		=	mysql_query("select * from invoices");
	$count		=	mysql_num_rows($res);
	$pagination	=	smart_pagination(1,$count,10,'da')
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head> 
	<title>Invoice List | Pro Invoice Maker</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script language="javascript" type="text/javascript" src="js/jquery.js"></script>
	<script language="javascript" type="text/javascript" src="js/jquery.boxshadow.js"></script>
	<script language="javascript" type="text/javascript" src="js/script.js"></script>
	<link rel="stylesheet" media="screen" href="style/style.css" /> 
 </head>
 <body>
	<div id='container'>
	<?include "inc/header.php"?>
		<div class='title'>View All Invoices</div>