UpdateTable("ar_activity", "pid", $otherPID, $masterPID); UpdateTable("billing", "pid", $otherPID, $masterPID); UpdateTable("drug_sales", "pid", $otherPID, $masterPID); UpdateTable("issue_encounter", "pid", $otherPID, $masterPID); UpdateTable("lists", "pid", $otherPID, $masterPID); UpdateTable("payments", "pid", $otherPID, $masterPID); UpdateTable("pnotes", "pid", $otherPID, $masterPID); UpdateTable("transactions", "pid", $otherPID, $masterPID); UpdateTable("chart_tracker", "ct_pid", $otherPID, $masterPID); UpdateTable("openemr_postcalendar_events", "pc_pid", $otherPID, $masterPID); UpdateTable("documents", "foreign_id", $otherPID, $masterPID); // update all the forms* tables $sqlstmt = "show tables like 'form%'"; $qResults = sqlQ($sqlstmt); while ($row = sqlFetchArray($qResults)) { UpdateTable($row['Tables_in_' . $sqlconf["dbase"] . ' (form%)'], "pid", $otherPID, $masterPID); } // How to handle the data that should be unique to each patient: // Demographics, Employment, Insurance, and History ?? // //UpdateTable("patient_data", "pid", $otherID, $$parameters['masterid']); //UpdateTable("employer_data", "pid", $otherPID, $masterPID); //UpdateTable("history_data", "pid", $otherPID, $masterPID); //UpdateTable("insurance_data", "pid", $otherPID, $masterPID); // alter the patient's last name to indicate they have been merged into another record $newlname = "~~~MERGED~~~" . $orow['lname']; $sqlstmt = "update patient_data set lname='" . $newlname . "' where pid='" . $otherPID . "'"; if ($commitchanges == true) { $qResults = sqlQ($sqlstmt); } echo "<li>Altered last name of PID " . $otherPID . " to '" . $newlname . "'</li>";
function wassup_install() { global $wpdb; $table_name = $wpdb->prefix . "wassup"; $table_tmp_name = $wpdb->prefix . "wassup_tmp"; //### Add/update wassup settings in Wordpress options table $wassup_options = new wassupOptions; //#settings initialized here //# set hash $whash = $wassup_options->get_wp_hash(); if (!empty($whash)) { $wassup_options->whash = $whash; } //# Add timestamp to optimize table once a day $wassup_options->wassup_optimize = wassup_get_time(); //# set wmark and wip to null $wassup_options->wmark = 0; //#no preservation of delete/mark $wassup_options->wip = null; //### For upgrade of Wassup, manually initialize new settings //# initialize settings for 'spamcheck', 'refspam', and 'spam' if (!isset($wassup_options->wassup_spamcheck)) { $wassup_options->wassup_spamcheck = "0"; //#set wassup_spamcheck=0 if wassup_refspam=0 and wassup_spam=0 if (!isset($wassup_options->wassup_spam) && !isset($wassup_options->wassup_refspam)) { $wassup_options->wassup_spam = "1"; $wassup_options->wassup_refspam = "1"; } elseif ( $wassup_options->wassup_spam == "0" && $wassup_options->wassup_refspam == "0" ) { $wassup_options->wassup_spamcheck = "0"; } } //# update wassup settings for 'savepath' (default is null) //$wassup_options->wassup_savepath = "/fakedirectory"; //#debug if (!isset($wassup_options->wassup_savepath)) { $wassup_options->wassup_savepath = null; } //# display google chart by default for upgrades from 1.4.4 if (!isset($wassup_options->wassup_chart)) { $wassup_options->wassup_chart = 1; } //# assign top ten items for upgrades from 1.4.9 or less if (empty($wassup_options->wassup_top10)) { $wassup_options->wassup_top10 = serialize(array("topsearch"=>"1", "topreferrer"=>"1", "toprequest"=>"1", "topbrowser"=>"1", "topos"=>"1", "toplocale"=>"0", "topfeed"=>"0", "topcrawler"=>"0", "topvisitor"=>"0", "topreferrer_exclude"=>"")); } //#upgrade from 1.6: new options wassup_time_format and wassup_hack if (!isset($wassup_options->wassup_time_format)) { $wassup_options->wassup_time_format = 24; } if (!isset($wassup_options->wassup_hack)) { $wassup_options->wassup_hack = 1; } $wassup_options->saveSettings(); //### Detect problems with WassUp install and show warning //# //#Check for problems with 'session_savepath' and disable //# recording, if found. -Helene D. 2/24/08 /* $sessionpath = $wassup_options->wassup_savepath; if (empty($sessionpath)) { $sessionpath = getSessionpath(); } //default to "/tmp" if no sessionpath value if (empty($sessionpath)) { $sessionpath = "/tmp"; $wassup_options->wassup_savepath = $sessionpath; } if ($wassup_options->isWritableFolder($sessionpath) == false) { if ($wassup_options->wassup_active == "1") { $wassup_options->wassup_active = "0"; $wassup_options->wassup_alert_message = __('WassUp has detected a problem with "session.save_path" setting in your Wordpress/PHP configuration. Statistics logging has been disabled as a result. To fix, go to admin menu, "Wassup-->Options-->Manage Files & Database" and modify "Temporary files location folder".','wassup'); } else { $wassup_options->wassup_alert_message = __('WassUp has detected a problem with "session.save_path" setting in your Wordpress/PHP configuration. Please fix by modifying "Temporary files location folder" in admin menu, "Wassup-->Options-->Manage Files & Database".','wassup'); } } $wassup_options->saveSettings(); unset($sessionpath); //because "install" works in global scope */ //# TODO: //###Detect known incompatible plugins like "wp_cache" and disable //# recordings and show warning message... //### Create/upgrade wassup MAIN table if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { CreateTable($table_name); CreateTable($table_tmp_name); } else { UpdateTable(); //<== wassup_tmp is added here, if missing } } //#end function wassup_install
mysql_query($insert . implode(',', $inserts)); unset($list); } } else { if (strcmp($table, 'botnet_reports') == 0) { if ($error = !CreateTable($table)) { break; } $rlist = listReportTables($pd_mysql_db); foreach ($rlist as $rtable) { if ($error = !UpdateTableEx($rtable, 'botnet_reports')) { break; } } } else { $error = !($is_update ? UpdateTable($table) : CreateTable($table)); } } if ($error) { break; } } } if (!$error) { //Создание директории для отчетов. if (!$error) { $error = !CreatePath($pd_reports_path, isset($config['reports_path']) ? $config['reports_path'] : 0); } //Обновление файла конфигурации. if (!$error) { ShowProgress("Writing config file");
<?php /* * Handling the form data for the update user page > update_userindex.php * Project : Secure Login Module - Udemy PHP Basics * Date : Feb 2016 * Author : Carl Simpson * Version : 1.0 * */ include '_includes/db_connect.php'; include '_includes/db_functions.php'; if (isset($_POST['submit'])) { UpdateTable(); echo '<br />'; echo '<a href="userindex.php">see updated users entries</a>'; } else { echo 'there has been an error'; }