/    Sign up×
Community /Pin to ProfileBookmark

Really need your help!!!!(to create a function)

I need a script (to create a function) that automatically gives all information about product when we write the name of the product.I was in the process build a system inventory. So, what i want is:when i sales product.I just write the product’s name,and what i want is:when i write the product’s name,it will automatically gives all information about the product such as price.Im working with php and mySQL.So, may be someone can help me???May be we can use php or javacript.Ive used javascript doing a calculation-(sales price).Ive to pages of codes that related to each other-which are stock and sales.Please help me dude!!!!!

Here is the codes of sales:

[code=php]
<? $jualan=$_POST[‘jualan’];
?>

<html>
<head>
<title>Terminal Computer Services :: JUALAN</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>

<script type=”text/javascript”>
function CalcPercnt(f) {
var val=f.peratuskeuntungan.options[f.peratuskeuntungan.selectedIndex].text
if (val == “”)return false
var daTotal=(f.hargaseunit.value * (val / 100 + 1)).toFixed(2)
f.hargajualan.value = daTotal
f.profit.value=(daTotal-f.hargaseunit.value).toFixed(2)
}
</script>
<style type=”text/css”>
.ro{
background-color: royalblue;
color: white;
border: 2px solid skyblue;
}
</style>

<body>

<a href=”paparjualan.php”><strong><font face=”Verdana, Arial, Helvetica, sans-serif”><font color =”black”></font></font>
<h1><p align=”center”>JUALAN</h1></strong></a></p>

<form action=”insertjualan.php” name=”Imp” method=”post”>
<table width=”40%” height=”292″ border=”0″ align=”center” bgcolor=”#000000″>

<tr>
<td width=”41%”><font color=”#FFFFFF”><h3>Nama Produk:</h3></font></td>
<td width=”29%”> <input name=”namaproduk” type=”text” size=”25″></td>
</tr>

<tr>
<td width=”29%”><font color=”#FFFFFF”><h3>Harga Seunit:</h3><td width=”71%”><input name=”hargaseunit” type=”text” size=”25″></td>
</tr>
<tr>

<td width=”29%”><font color=”#FFFFFF”><h3>Peratus Keuntungan:</h3></td><td><select name=”peratuskeuntungan” id=”peratus”>
<option>5</option>
<option>10</option>
<option>15</option>
<option>20</option>
<option>25</option>
<option>30</option>
</select></td>
</tr>
<tr>
<td width=”41%”><font color=”#FFFFFF”><h3>Harga Jualan:</h3><td width=”30%”><input name=”hargajualan” type=”text” readonly class=”ro” size=”25″></td>
</tr>

<td width=”41%”><font color=”#FFFFFF”><h3>Profit:</h3><td width=”30%”><input name=”profit” type=”text” readonly class=”ro” size=”25″></td>
</tr>
<tr><td height=”45″>&nbsp;</td>
<td><input onClick=”CalcPercnt(this.form)” type=”button” value=”Calculate”>
<input type=”reset” value=”Clear”></td>
</tr>

<tr><td width=”29%”><font color=”#FFFFFF”>
<h3>Bil Jualan:</h3></font></td>
<td width=”71%”><input name=”biljualan” type=”text” size=”25″></td>
</tr>

<tr><td height=”45″>&nbsp;</td>
<td><input type=”submit” name=”Submit” value=”Submit”>
<input type=”reset” name=”Submit2″ value=”Reset”></td>
</tr>
</form></table>

<a href=”produk.php”><strong><font face=”Verdana, Arial, Helvetica, sans-serif”><font color =”black”></font></font>
<h2><p align=”center”>PRODUK</h2></strong></a></p>
</td>
</tr>
</table>
</body>
</html>
[/code]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYJun 12.2005 — Do yo already have a MySQL database(and/or your product-catalogue) all set up?

personal interest:

What does "Jualan" mean?What is your tongue?
Copy linkTweet thisAlerts:
@SpectreReturnsJun 12.2005 — And.. uh, how come you have no PHP in that posted code (except the useless variable)
×

Success!

Help @inventive spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...