Created
October 4, 2011 17:44
-
-
Save masom/1262281 to your computer and use it in GitHub Desktop.
Best Peer Review
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 | |
public function pin(Array $params=array()) | |
{ | |
$pin=""; | |
$options = array(); | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$q = "SELECT grv.ip_address,grs.printing_pin FROM guest_room_view grv INNER JOIN guest_room_settings grs on grv.room_id=grs.guest_room_id"; | |
$dbo = Dbo::getInstance(); | |
$result = $dbo->query($this->connectionName,$q,$options); | |
$arr = pg_fetch_all($result); | |
foreach ($arr as $a){ | |
if ($a['ip_address']==$ip){ | |
$pin=$a['printing_pin']; | |
} | |
} | |
echo $pin; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment