Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI107
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Franciskus Partogu Hamonangan Napitupulu
PA1-1617-D3TI107
Commits
10a97dda
Commit
10a97dda
authored
Jun 13, 2017
by
Franciskus Partogu Hamonangan Napitupulu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fungsi pemesanan
parent
1a21e489
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
savebook.php
savebook.php
+7
-1
savebook_process.php
savebook_process.php
+18
-0
No files found.
savebook.php
View file @
10a97dda
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
if
(
isset
(
$_SESSION
[
'items'
]))
{
if
(
isset
(
$_SESSION
[
'items'
]))
{
foreach
(
$_SESSION
[
'items'
]
as
$key
=>
$val
)
{
foreach
(
$_SESSION
[
'items'
]
as
$key
=>
$val
)
{
$query
=
mysqli_query
(
$koneksi
,
"SELECT * FROM t_buku WHERE isbn = '
$key
'"
);
$query
=
mysqli_query
(
$koneksi
,
"SELECT * FROM t_buku WHERE isbn = '
$key
'"
);
$data
=
mysqli_fetch_array
(
$query
);
$data
=
mysqli_fetch_array
(
$query
);
$jumlah_harga
=
$data
[
'harga'
]
*
$val
;
$jumlah_harga
=
$data
[
'harga'
]
*
$val
;
$total
+=
$jumlah_harga
;
$total
+=
$jumlah_harga
;
...
@@ -33,6 +33,12 @@
...
@@ -33,6 +33,12 @@
<?php
<?php
}
}
?>
?>
<form
action=
"savebook_process.php"
method=
"POST"
>
<input
type=
"hidden"
name=
"id_user"
value=
"
<?php
$_GET
[
'id_user'
];
?>
"
>
<input
type=
"hidden"
name=
"isbn"
value=
"
<?php
$_GET
[
'isbn'
];
?>
"
>
<input
type=
"hidden"
name=
"total"
value=
"
<?php
$_GET
[
'total'
];
?>
"
>
<input
type=
"submit"
name=
"pesan"
value=
"Pesan Sekarang"
>
</form>
</div>
</div>
<div
class=
"col-md-8"
>
<div
class=
"col-md-8"
>
Pembayaran dapat dilakukan dengan menghubungi kontak dibawah ini :
Pembayaran dapat dilakukan dengan menghubungi kontak dibawah ini :
...
...
savebook_process.php
0 → 100644
View file @
10a97dda
<?php
session_start
();
include
'koneksi.php'
;
$user
=
$_POST
[
'id_user'
];
$buku
=
$_POST
[
'isbn'
];
$total
=
$_POST
[
'total'
];
$tambah
=
mysqli_query
(
$koneksi
,
"INSERT INTO t_pemesanan VALUES('
$buku
', '
$user
', '
$total
', NOW())"
);
if
(
$tambah
)
{
echo
"<script>alert('Data pesanan berhasil disimpan'); window.location = 'savebook.php'</script>"
;
}
else
{
echo
"<script>alert('Gagal menyimpan pesanan !'); window.location = 'checkout.php'</script>"
;
}
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment