forked from donnekgit/andika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rom_ar_orig.php
112 lines (94 loc) · 3.31 KB
/
rom_ar_orig.php
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
// Bring in the header.
include("includes/header.php");
// Highlight the current page's entry on the menu.
// Get the current page's name, add the relevant CSS to its line in the menu, and print the line.
$thispage=substr($_SERVER["SCRIPT_NAME"], 1);
$lines=file("includes/menu.php");
foreach ($lines as $line)
{
if (preg_match("/$thispage/", $line))
{
$line=preg_replace("/<li>/", "<li class=\"current\">", $line);
}
echo $line;
}
?>
<!--- Body holder --->
<div class="col_12">
<!--- Roman box input --->
<div class="col_5">
<h3>Convert Roman script ... </h3>
<form class="vertical" id="rom_ar_form">
<!--Absolutely essential for the form item(s) to be given a name - this is what the passed-on data will be known as.-->
<textarea name="rom_ar_in" id="rom_ar_in" placeholder="Enter Swahili text in Roman script here ..."></textarea>
<input type="checkbox" id="numbers" name="numbers"/>
<label for="numbers" class="inline">Convert numerals to Arabic-Indic forms</label>
<br />
<input type="checkbox" id="sakani" name="sakani"/>
<label for="sakani" class="inline">Do not show <em>sakani</em> (<em>sukun</em>) on consonants</label>
<br />
<input type="checkbox" id="longvowel" name="longvowel"/>
<label for="longvowel" class="inline">Show <em>sakani</em> (<em>sukun</em>) on <strong>و</strong> and <strong>ي</strong> as long vowels</label>
<br /><br />
<!--The dosubmit() calls the Javascript function below, which passes on the data and pastes the result back into this page.-->
<input type="button" onclick="dosubmit()" value="Convert to Arabic script">
</form>
<!--- Submit the Roman text for conversion --->
<script>
function dosubmit()
{
new Ajax.Updater
(
'converted_text', // The name of the <div> where the results will be shown.
'convert_rom_ar.php', // The script doing the processing.
{
method: 'post', // Submission method for the form data.
parameters: $('rom_ar_form').serialize() // Name of the form (id= this).
}
);
//$('rom_ar_form').reset(); // Uncomment to clear the input form on each submit.
}
</script>
</div><!--- End Roman box input --->
<!--- Arabic box output --->
<div class="col_7">
<h3>... to Arabic script</h3>
<div id="converted_text">
</div>
</div>
<hr />
<!-- Roman webpage input -->
<div class="col_5">
<!-- <form class="vertical" id="rom_ar_form" action="webtrans.php" method="POST"> -->
<form class="vertical" id="webtrans_form">
<input type="text" id="webtrans" name="webtrans" placeholder="Give the webpage address here"/>
<!-- <input type="submit" name="submit" value="Convert this webpage"> -->
<input type="button" onclick="dosubmit()" value="Convert this webpage to Arabic script">
</form>
<!-- Submit the Roman webpage for conversion -->
<script>
function dosubmit()
{
new Ajax.Updater
(
'webpage_link', // The name of the <div> where the results will be shown.
'webtrans.php', // The script doing the processing.
{
method: 'post', // Submission method for the form data.
parameters: $('webtrans_form').serialize() // Name of the form (id= this).
}
);
//$('rom_ar_form').reset(); // Uncomment to clear the input form on each submit.
}
</script>
</div><!--- End Roman webpage input --->
<!--- Arabic webpage output --->
<div class="col_7">
<div id="webpage_link">
</div>
</div>
<?php
// Bring in the footer.
include("includes/footer.php");
?>