SHARE
TWEET

Untitled

a guest Jun 17th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function audioplayer($id)
  2. {
  3.     $r_hostname = "192.***.**.***";
  4.     $r_username = "c**";
  5.     $r_password = "*******";
  6.     $link = mysql_connect($r_hostname,$r_username,$r_password);
  7.  
  8.     $a_hostname = "192.168.***.***";
  9.  
  10.  
  11.     $db = mysql_select_db('asterisk', $link);
  12.  
  13.     $result = mysql_query("SELECT * FROM recording_log WHERE start_time LIKE '".date("Y-m-d")."%' AND filename LIKE 'IL_%-%". $id ."' LIMIT 3",$link);
  14.  
  15.  
  16.     #$result = mysql_query("select * from recording_log WHERE filename LIKE 'IL_%-%".$id."'",$link);
  17.  
  18.     if (!$result) {
  19.             die('Invalid query: ' . mysql_error());
  20.     }  
  21.     if($result != '')
  22.     {
  23.         while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
  24.             foreach($row as $column => $value) {
  25.                 $array[type] ="wav";    
  26.                 $array[$column]= $value;
  27.             }
  28.         }
  29.     }
  30.     else {
  31.         $linktwo = mysql_connect($a_hostname,$r_username,$r_password);
  32.  
  33.         $dbtwo = mysql_select_db('asterisk', $linktwo);
  34.  
  35.         $resulttwo = mysql_query("SELECT * FROM recording_log WHERE start_time LIKE '".date("Y-m-d")."%' AND filename LIKE 'IL_%-%". $id ."' LIMIT 3",$linktwo);
  36.  
  37.         while($row = mysql_fetch_array($resulttwo, MYSQL_ASSOC)){
  38.             foreach($row as $column => $value) {
  39.                 $array[type] ="mp3";
  40.                 $array[$column]= $value;
  41.             }
  42.         }
  43.     }
  44.     return json_encode($array);
  45. }
  46.      
  47. $array[type] ="mp3";
  48.      
  49. $array[$type] ="mp3";
  50. $array["type"] ="mp3";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top