Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI08
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
Dodi Agustin Refansius Pakpahan
PA1-1617-D3TI08
Commits
0b634848
Commit
0b634848
authored
May 17, 2017
by
Eirene Hutasoit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menambahkan fungsi
parent
8c475bc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
0 deletions
+101
-0
fungsi.php
fungsi.php
+101
-0
No files found.
fungsi.php
0 → 100644
View file @
0b634848
<?php
global
$conn
;
$conn
=
mysql_connect
(
"localhost"
,
"root"
,
""
);
if
(
!
$conn
){
die
(
"database connect problem"
);
}
$db_use
=
mysql_select_db
(
"proyek"
,
$conn
)
or
die
(
"select db problem!!"
);
function
execQ
(
$strQ
){
global
$conn
;
$res
=
mysql_query
(
$strQ
,
$conn
);
return
$res
;
}
function
getUser
(
$username
,
$password
){
$strQ
=
"select * from user where username = '
$username
' AND password='
$password
'"
;
$resUsr
=
execQ
(
$strQ
);
if
(
mysql_num_rows
(
$resUsr
)
>
0
)
{
return
$resUsr
;
}
else
{
return
NULL
;
}
}
function
getAllKeluhan
(){
$strQ
=
"SELECT * FROM keluhan"
;
$resItem
=
execQ
(
$strQ
);
if
(
mysql_num_rows
(
$resItem
)
!=
0
){
$ret
=
array
();
while
(
$data
=
mysql_fetch_assoc
(
$resItem
)){
array_push
(
$ret
,
array
(
'id'
=>
$data
[
'ID'
],
'nama_pengunjung'
=>
$data
[
'namapengunjung'
],
'email_pengunjung'
=>
$data
[
'emailpengunjung'
],
'isi_keluhan'
=>
$data
[
'isikeluhan'
]
));
}
return
$ret
;
}
else
{
return
false
;
}
}
function
getProfil
(){
$strQ
=
"SELECT * FROM profil"
;
$resItem
=
execQ
(
$strQ
);
if
(
mysql_num_rows
(
$resItem
)
!=
0
){
$ret
=
array
();
while
(
$data
=
mysql_fetch_assoc
(
$resItem
)){
array_push
(
$ret
,
array
(
'id'
=>
$data
[
'id'
],
'gambar'
=>
$data
[
'gambar'
],
'konten'
=>
$data
[
'konten'
]
));
}
return
$ret
;
}
else
{
return
false
;
}
}
function
getDaftar
(){
$strQ
=
"SELECT * FROM kamar"
;
$resItem
=
execQ
(
$strQ
);
if
(
mysql_num_rows
(
$resItem
)
!=
0
){
$ret
=
array
();
while
(
$data
=
mysql_fetch_assoc
(
$resItem
)){
array_push
(
$ret
,
array
(
'id'
=>
$data
[
'id'
],
'nama'
=>
$data
[
'nama kamar'
],
'kapasitas'
=>
$data
[
'kapasitas kamar'
],
'harga'
=>
$data
[
'harga'
],
'gambar'
=>
$data
[
'gambar'
]
));
}
return
$ret
;
}
else
{
return
false
;
}
}
function
redirect
(
$_location
){
header
(
'Location: '
.
$_location
);
}
\ 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