Compact css tweak
[openemr.git] / interface / language / lang_constant.php
blobd0fb547cb22f81a9d4045cb6696ad87ffb0014ef
1 <?php
2 require_once("language.inc.php");
5 if ($_POST['add']) {
6 //validate
7 if ($_POST['constant_name'] == "") {
8 echo htmlspecialchars(xl('Constant name is blank'), ENT_NOQUOTES).'<br>';
9 $err='y';
12 $sql="SELECT * FROM lang_constants WHERE constant_name=? limit 1" ;
13 $res=SqlQuery($sql, array($_POST['constant_name']));
14 if ($res) {
15 echo htmlspecialchars(xl('Data Alike is already in database, please change constant name'), ENT_NOQUOTES).'<br>';
16 $err='y';
19 if ($err=='y') {
20 $val_constant=$_POST['constant_name'];
21 } else {
22 //insert into the main table
23 $sql="INSERT INTO lang_constants SET constant_name=?";
24 SqlStatement($sql, array($_POST['constant_name']));
26 //insert into the log table - to allow persistant customizations
27 insert_language_log('', '', $_POST['constant_name'], '');
29 echo htmlspecialchars(xl('Constant', '', '', ' ') . $_POST['constant_name'] . xl('added', '', ' '), ENT_NOQUOTES).'<br>';
34 // echo "$sql here ";
39 <TABLE>
40 <FORM name="cons_form" METHOD=POST ACTION="?m=constant" onsubmit="return top.restoreSession()">
41 <TR>
42 <TD><?php echo htmlspecialchars(xl('constant name'), ENT_NOQUOTES); ?></TD>
43 <TD><INPUT TYPE="text" NAME="constant_name" size="100" value="<?php echo htmlspecialchars($val_constant, ENT_QUOTES); ?>"></TD>
44 </TR>
45 <TR>
46 <TD></TD>
47 <TD><INPUT TYPE="submit" name="add" value="<?php echo htmlspecialchars(xl('Add'), ENT_QUOTES); ?>"></TD>
48 </TR>
49 </FORM>
50 </TABLE>
51 <span class="text"><?php echo htmlspecialchars(xl('Please Note: constants are case sensitive and any string is allowed.'), ENT_NOQUOTES); ?></span>