-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_v.php
More file actions
66 lines (50 loc) · 1.88 KB
/
test_v.php
File metadata and controls
66 lines (50 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
include 'common_files/db_connect.php';
$ImageID = $_GET['number'];
$Lang = $_GET['id'];
$img_sql = "SELECT * FROM tme_image_table WHERE ImageID = '55' AND LanguageID = '1'";
$img_result = mysql_query($img_sql);
$row_img = mysql_fetch_array($img_result);
$image_link = $row_img['Name'];
echo ("$image_link, Hello");
?>
<?php
// This file returns the link to
include '../common_files/db_connect.php';
$AudString = array();
$ImgString = array();
$tp_number = $_GET['tp_number'];
$Lang_ID = $_GET['lang'];
$tp_rows = getResourceIDs($tp_number);
while ($row = mysql_fetch_array($tp_rows)) {
$tp_AudioID = $row['AudioID'];
$tp_ImageID = $row['ImageID'];
$aud_link = getAudioLink($tp_AudioID);
$img_link = getImageLink($tp_ImageID, $Lang_ID);
$AudString[] = $aud_link;
$ImgString[] = $img_link;
}
echo ("$AudString,$ImgString");
//This function takes in the Audio ID and return the CloudFront link to the resource.
function getAudioLink($AudioID) {
$aud_sql = "SELECT * FROM tme_audio_table WHERE AudioID = '$AudioID'";
$aud_result = mysql_query($aud_sql);
$row_aud = mysql_fetch_array($aud_result);
$audio_link = $row_aud['Name'];
return $audio_link;
}
//This function takes in the Teaching Point Number of the lesson and return the corresponding Resource IDs.
function getResourceIDs ($tp_number) {
$tp_sql = "SELECT * FROM tme_teaching_point WHERE tpname = '$tp_number'";
$res_rows = mysql_query($tp_sql);
return $res_rows;
}
//This function takes in the Image ID and return the CloudFront link to the resource.
function getImageLink($ImageID, $Lang) {
$img_sql = "SELECT * FROM tme_image_table WHERE ImageID = '$ImageID' AND LanguageID = '$Lang'";
$img_result = mysql_query($img_sql);
$row_img = mysql_fetch_array($img_result);
$image_link = $row_img['Name'];
return $image_link;
}
?>