Hi Kevin,
I am sorry I will be posting all the include files.
conn_db.php
[php]<?PHP
$con=mysqli_connect(‘localhost’, ‘root’, ‘****’, ‘billing’);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>[/php]
p1_add_inv.php
[php]<?php
$cust_code=$_POST[‘customer’] ;
$cust_search = mysqli_query($con,“SELECT inv_code FROM customer_info WHERE rec_no=’$cust_code’”);
if(mysqli_num_rows($cust_search) != 0) {
//$cust_code2 = mysqli_fetch_array($cust_search);
$cust_company = mysqli_fetch_array($cust_search);
//$cust_company = $cust_code2['inv_code'];
$petsa_taon = date("Y");
$petsa_buwan = date("m");
mysqli_query($con,"INSERT INTO invoice_data (
cust_rec,
description,
part_number,
fob_price,
qty,
total_fob,
trading_price,
amount,
company_code,
taon,
buwan,
serye
)
VALUES (
'$_POST[customer]',
'$_POST[description]',
'$_POST[part_number]',
'$_POST[fob_price]',
'$_POST[qty]',
'$_POST[total_fob]',
'$_POST[trading_price]',
'$_POST[amount]',
'$cust_company['inv_code']',
'$petsa_taon',
'$petsa_buwan',
'$petsa_serye'
)");
$errorMessage = '<font color="green"><b>One record added! - </b>Record Number: ' . mysqli_insert_id($con) . ' (Please take note of this number)</font><br>';
}else {
$errorMessage = $errorMessage . '<font color="red">Customer record does not exist!</font><br>';
}
?>[/php]
p1_sidebar.php
[code]
Navigation
<li><a href="p1_add_inv_form.php">Create Invoice</a></li>
<li><a href="p1_view_record.php">View Invoice Record</a></li>
[/code]
nav.php
[code]
<a href="index.php">Home</a>
<a href="contactus.php">Contact us</a>
<a href="about.php">About</a>
[/code]
footer.php
[code]<?php include('variables/variables.php'); ?>
[/code]
header.php
[code]<?php include('variables/variables.php'); ?>
<h2><?php echo $heading ?></h2>
[/code]