Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
340CTResit/frontend.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
73 lines (55 sloc)
1.36 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class frontend | |
{ | |
public function getlocation() | |
{ | |
$query="SELECT * FROM location ORDER BY location"; | |
$result=mysql_query($query); | |
$testing=array(); | |
while ($row=mysql_fetch_array($result)) | |
{ | |
$location=array(); | |
$location=array('id' => $row['id'],'name'=>$row['location'] ); | |
array_push($testing, $location); | |
} | |
return $testing; | |
} | |
public function movies() | |
{ | |
$query="SELECT * FROM movies ORDER BY id"; | |
$result=mysql_query($query); | |
$testing=array(); | |
while ($row=mysql_fetch_array($result)) | |
{ | |
$location=array(); | |
$location=array('id' => $row['id'],'name'=>$row['name'] ); | |
array_push($testing, $location); | |
} | |
return $testing; | |
} | |
public function slider() | |
{ | |
$query=mysql_query("SELECT * FROM slider"); | |
$slider= array(); | |
while($row=mysql_fetch_array($query)) | |
{ | |
$testing=array(); | |
$testing=array('id' => $row['id'],'image'=>$row['image']); | |
array_push($slider, $testing); | |
} | |
return $slider; | |
} | |
public function recent() | |
{ | |
$query=mysql_query("SELECT * FROM movies order by id desc limit 20"); | |
$slider= array(); | |
while($row=mysql_fetch_array($query)) | |
{ | |
$testing=array(); | |
$testing=array('id' => $row['id'],'image'=>$row['image']); | |
array_push($slider, $testing); | |
} | |
return $slider; | |
} | |
} | |
?> |