function insert_language_log($lang_desc, $lang_code, $cons_name, $def) { // set up the mysql collation string to ensure case is sensitive in the mysql queries if (!$disable_utf8_flag) { $case_sensitive_collation = "COLLATE utf8_bin"; } else { $case_sensitive_collation = "COLLATE latin_bin"; } if ($cons_name == '') { // NEW LANGUAGE // (ensure not a repeat log entry) $sql = "SELECT * FROM lang_custom WHERE constant_name='' AND lang_description=? " . $case_sensitive_collation; $res_test = SqlStatement($sql, array($lang_desc)); if (!SqlFetchArray($res_test)) { $sql = "INSERT INTO lang_custom SET lang_code=?, lang_description=?"; SqlStatement($sql, array($lang_code, $lang_desc)); } } elseif ($lang_desc == '') { // NEW CONSTANT // (ensure not a repeat entry) $sql = "SELECT * FROM lang_custom WHERE lang_description='' AND constant_name=? " . $case_sensitive_collation; $res_test = SqlStatement($sql, array($cons_name)); if (!SqlFetchArray($res_test)) { $sql = "INSERT INTO lang_custom SET constant_name=?"; SqlStatement($sql, array($cons_name)); } } else { // FULL ENTRY // (ensure not a repeat log entry) $sql = "SELECT * FROM lang_custom WHERE lang_description=? " . $case_sensitive_collation . " AND constant_name=? " . $case_sensitive_collation . " AND definition=? " . $case_sensitive_collation; $res_test = SqlStatement($sql, array($lang_desc, $cons_name, $def)); if (!SqlFetchArray($res_test)) { // either modify already existing log entry or create a new one $sql = "SELECT * FROM lang_custom WHERE lang_description=? " . $case_sensitive_collation . " AND constant_name=? " . $case_sensitive_collation; $res_test2 = SqlStatement($sql, array($lang_desc, $cons_name)); if (SqlFetchArray($res_test2)) { // modify existing log entry(s) $sql = "UPDATE lang_custom SET definition=? WHERE lang_description=? " . $case_sensitive_collation . " AND constant_name=? " . $case_sensitive_collation; SqlStatement($sql, array($def, $lang_desc, $cons_name)); } else { // create new log entry $sql = "INSERT INTO lang_custom (lang_description,lang_code,constant_name,definition) VALUES (?,?,?,?)"; SqlStatement($sql, array($lang_desc, $lang_code, $cons_name, $def)); } } } }
function xl($constant,$mode='r',$prepend='',$append='') { // set language id if (!empty($_SESSION['language_choice'])) { $lang_id = $_SESSION['language_choice']; } else { $lang_id = 1; } if ($lang_id == 1 && !empty($GLOBALS['skip_english_translation'])) { // language id = 1, so no need to translate // -- remove comments $string = preg_replace('/\{\{.*\}\}/', '', $constant); } else { // TRANSLATE // first, clean lines // convert new lines to spaces and remove windows end of lines $patterns = array ('/\n/','/\r/'); $replace = array (' ',''); $constant = preg_replace($patterns, $replace, $constant); // second, attempt translation $sql="SELECT * FROM lang_definitions JOIN lang_constants ON " . "lang_definitions.cons_id = lang_constants.cons_id WHERE " . "lang_id=? AND constant_name = ? LIMIT 1"; $res = sqlStatementNoLog($sql,array($lang_id,$constant)); $row = SqlFetchArray($res); $string = $row['definition']; if ($string == '') { $string = "$constant"; } // remove dangerous characters and remove comments $patterns = array ('/\n/','/\r/','/"/',"/'/",'/\{\{.*\}\}/'); $replace = array (' ','','`','`',''); $string = preg_replace($patterns, $replace, $string); } $string = "$prepend" . "$string" . "$append"; if ($mode=='e') { echo $string; } else { return $string; } }
function xl($constant, $mode = 'r', $prepend = '', $append = '') { // set language id if (!empty($_SESSION['language_choice'])) { $lang_id = $_SESSION['language_choice']; } else { $lang_id = 1; } if ($lang_id == 1 && !empty($GLOBALS['skip_english_translation'])) { // language id = 1, so no need to translate $string = $constant; } else { // TRANSLATE // first, clean lines // convert new lines to spaces and remove windows end of lines $patterns = array('/\\n/', '/\\r/'); $replace = array(' ', ''); $constant = preg_replace($patterns, $replace, $constant); // second, attempt translation $sql = "SELECT * FROM lang_definitions JOIN lang_constants ON " . "lang_definitions.cons_id = lang_constants.cons_id WHERE " . "lang_id='{$lang_id}' AND constant_name = '" . add_escape_custom($constant) . "' LIMIT 1"; $res = SqlStatement($sql); $row = SqlFetchArray($res); $string = $row['definition']; if ($string == '') { $string = "{$constant}"; } // remove dangerous characters $patterns = array('/\\n/', '/\\r/', '/"/', "/'/"); $replace = array(' ', '', '`', '`'); $string = preg_replace($patterns, $replace, $string); } $string = "{$prepend}" . "{$string}" . "{$append}"; if ($mode == 'e') { echo $string; } else { return $string; } }
echo $rootdir; ?> /forms/individual_treatment_plan/save.php?mode=new" name="my_form"> <br> <span class="title"><center>Individual Treatment Plan</center></span><br><br> <center><a href="javascript:top.restoreSession();document.my_form.submit();" class="link_submit">[Save]</a> <img src="../../../images/space.gif" width="5" height="1"> <a href="<?php echo $GLOBALS['form_exit_url']; ?> " class="link_submit" onclick="top.restoreSession()">[Don't Save]</a></center> <br> <?php $res = sqlStatement("SELECT fname,mname,lname,ss,street,city,state,postal_code,phone_home,DOB FROM patient_data WHERE pid = {$pid}"); $result = SqlFetchArray($res); ?> <b>Date of Referral:</b> <input type="text" name="date_of_referal"> <img src="../../../images/space.gif" width="260" height="1"> <b>Date of Plan:</b> <?php print date('m/d/y'); ?> <br><br> <img src="../../../images/space.gif" width="28" height="1"> <b>Client Name:</b> <?php echo $result['fname'] . ' ' . $result['mname'] . ' ' . $result['lname']; ?> <img src="../../../images/space.gif" width="292" height="1">
$def = $row['definition']; } $stringTemp .= '<td>' . htmlspecialchars($def, ENT_NOQUOTES) . '</td>'; $row = SqlFetchArray($res); // jump one to get the second language selected if ($row['def_id'] == '' or $row['def_id'] == 'NULL') { $cons_name = "cons_id[" . $row['cons_id'] . "]"; if ($lang_filter_def == '%') { $isShow = true; } // if there is a previous definition } else { $cons_name = "def_id[" . $row['def_id'] . "]"; $sql = "SELECT definition FROM lang_definitions WHERE def_id=? AND definition LIKE ?"; $res2 = SqlStatement($sql, array($row['def_id'], $lang_filter_def)); if (SqlFetchArray($res2)) { $isShow = true; } } $stringTemp .= '<td><INPUT TYPE="text" size="50" NAME="' . htmlspecialchars($cons_name, ENT_QUOTES) . '" value="' . htmlspecialchars($row['definition'], ENT_QUOTES) . '">'; $stringTemp .= '</td></tr>'; if ($isShow) { //definition filter passed, so show echo $stringTemp; $isResults = true; } } echo '<INPUT TYPE="hidden" name="lang_id" value="' . htmlspecialchars($lang_id, ENT_QUOTES) . '">'; } if ($isResults) { echo '<tr><td colspan=3><INPUT TYPE="submit" name="load" Value="' . htmlspecialchars(xl('Load Definitions'), ENT_NOQUOTES) . '"></td></tr>';
$language_id = $row2['lang_id']; // collect constant id $sql = "SELECT cons_id FROM lang_constants WHERE constant_name=? " . $case_sensitive_collation . " LIMIT 1"; $res2 = SqlStatement($sql, array($row['constant_name'])); $row2 = SqlFetchArray($res2); $constant_id = $row2['cons_id']; // collect definition id (if it exists) $sql = "SELECT def_id FROM lang_definitions WHERE cons_id=? AND lang_id=? LIMIT 1"; $res2 = SqlStatement($sql, array($constant_id, $language_id)); $row2 = SqlFetchArray($res2); $def_id = $row2['def_id']; if ($def_id) { //definition exist, so check to see if different $sql = "SELECT * FROM lang_definitions WHERE def_id=? AND definition=? " . $case_sensitive_collation; $res_test = SqlStatement($sql, array($def_id, $row['definition'])); if (SqlFetchArray($res_test)) { //definition not different continue; } else { //definition is different echo htmlspecialchars(xl('Following is a new definition (Language, Constant, Definition):'), ENT_NOQUOTES) . " " . htmlspecialchars($row['lang_description'], ENT_NOQUOTES) . " " . htmlspecialchars($row['constant_name'], ENT_NOQUOTES) . " " . htmlspecialchars($row['definition'], ENT_NOQUOTES) . "<BR>"; if (!$checkOnly) { //add new definition $sql = "UPDATE `lang_definitions` SET `definition`=? WHERE `def_id`=? LIMIT 1"; SqlStatement($sql, array($row['definition'], $def_id)); echo htmlspecialchars(xl('Synchronized new definition (Language, Constant, Definition):'), ENT_NOQUOTES) . " " . htmlspecialchars($row['lang_description'], ENT_NOQUOTES) . " " . htmlspecialchars($row['constant_name'], ENT_NOQUOTES) . " " . htmlspecialchars($row['definition'], ENT_NOQUOTES) . "<BR><BR>"; } $difference = 1; } } else { echo htmlspecialchars(xl('Following is a new definition (Language, Constant, Definition):'), ENT_NOQUOTES) . " " . htmlspecialchars($row['lang_description'], ENT_NOQUOTES) . " " . htmlspecialchars($row['constant_name'], ENT_NOQUOTES) . " " . htmlspecialchars($row['definition'], ENT_NOQUOTES) . "<BR>";
// // // A copy of the GNU General Public License is included along with this program: // openemr/interface/login/GnuGPL.html // For more information write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // // Author: Eldho Chacko <*****@*****.**> // Jacob T Paul <*****@*****.**> // // +------------------------------------------------------------------------------+ //SANITIZE ALL ESCAPES $sanitize_all_escapes = true; // //STOP FAKE REGISTER GLOBALS $fake_register_globals = false; // include_once '../../interface/globals.php'; $sql = "select distinct tu_user_id from template_users"; $rs = SqlStatement($sql); while ($row = SqlFetchArray($rs)) { $sql = "select * from template_users join customlists on cl_list_slno=tu_template_id where\n cl_deleted=0 and tu_user_id=?"; $rs2 = SqlStatement($sql, array($row['tu_user_id'])); while ($row2 = SqlFetchArray($rs2)) { $sql = "select cl_list_slno from customlists where cl_deleted=0 and cl_list_id=?"; $rs3 = SqlStatement($sql, array($row2['cl_list_slno'])); while ($row3 = SqlFetchArray($rs3)) { SqlStatement("insert into template_users (tu_template_id,tu_user_id) values(?,?)", array($row3['cl_list_slno'], $row['tu_user_id'])); } } }