当前位置: 首页>>代码示例>>PHP>>正文


PHP show_var函数代码示例

本文整理汇总了PHP中show_var函数的典型用法代码示例。如果您正苦于以下问题:PHP show_var函数的具体用法?PHP show_var怎么用?PHP show_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了show_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: db_query

(SELECT * FROM `redcap_data_quality_status` WHERE project_id = '$project_id') `status`
LEFT JOIN
(SELECT * FROM redcap_data_quality_resolutions) res ON `status`.status_id = res.status_id
LEFT JOIN
(SELECT ui_id, user_firstname, user_lastname FROM redcap_user_information) users ON `status`.assigned_user_id = users.ui_id
LEFT JOIN
(SELECT ui_id, user_firstname, user_lastname FROM redcap_user_information) cur_users ON res.user_id = cur_users.ui_id
WHERE `status`.query_status != 'CLOSED'
ORDER BY `status`.status_id ASC, res.ts ASC";
$query_status_result = db_query($query_status_sql);
if ($query_status_result) {
	while ($query_status_row = db_fetch_assoc($query_status_result)) {
		/**
		 * initialize the working arrays
		 */
		$data_row = array();
		/**
		 * Freeze the query_id for future use and start the data row
		 */
		if (isset($query_status_row['query_id'])) {
			$query_id = $query_status_row['query_id'];
			$data_row['Query ID'] = $query_id;
		} else {
			$data_row['Query ID'] = '--';
		}
		$status_array[$query_id][] = $query_status_row['query_status'];
	}
}
if ($debug) {
	show_var($status_array);
}
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:query_report.php

示例2: redcap_data_quality_resolutions

					// Add new row to data_resolution_log
					$sql = "insert into redcap_data_quality_resolutions (status_id, ts, user_id, response_requested,
					response, comment, current_query_status, upload_doc_id)
					values ($status_id, '" . NOW . "', " . checkNull($userInitiator['ui_id']) . ",
					" . checkNull($response_requested) . ", " . checkNull($response) . ",
					" . checkNull($rule_info['name']) . ", " . checkNull($dr_status) . ", " . checkNull($_POST['upload_doc_id']) . ")";
					if (!$debug) {
						if (db_query($sql)) {
							// Success, so return content via JSON to redisplay with new changes made
							$res_id = db_insert_id();
							## Logging
							// Set data values as json_encoded
							$logDataValues = json_encode(array('res_id' => $res_id, 'record' => $result['record'], 'event_id' => $result['event_id'],
								'field' => $field, 'rule_id' => $rule_id));
							// Set event_id in query string for logging purposes only
							$_GET['event_id'] = $result['event_id'];
							// Log it
							log_event($sql, "redcap_data_quality_resolutions", "MANAGE", $result['record'], $logDataValues, $drw_log);
						} else {
							// ERROR!
							exit('0');
						}
					} else {
						show_var($sql, 'INSERT RESOLUTIONS', 'red');
					}
				}
			}
		}
	}
}
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:30,代码来源:std_lab_queries.php

示例3: derive_baseline_from_fields

/**
 * @param $prefix string
 * @param $lab_fields array 'Must include _supplb_lbdtbl, _lbblfl, _lborres or _lbstresn without prefix'
 * @param $date_field array 'Date field for this form / fields'
 * @param $debug
 * UNDER CONSTRUCTION
 */
function derive_baseline_from_fields($prefix, $lab_fields, $date_field, $debug)
{
	$project = new Project();
	$initial_event = $project->firstEventId;
	$lab_fields = array_merge($date_field, $lab_fields);
	if ($debug) {
		/*show_var($lab_fields);*/
	}
	/**
	 * find baselines for each lab test
	 */
	$data = REDCap::getData('array', '', $lab_fields);
	foreach ($data AS $subjid => $subject) {
		$lab_subject = array();
		if ($debug) {
			show_var($subjid, 'FIELD SUBJID', 'blue');
		}
		/**
		 * get refstdtc for this subject
		 */
		$tx_start_fields = array("dm_rfstdtc");
		$tx_start_data = REDCap::getData('array', $subjid, $tx_start_fields);
		$rfstdtc = $tx_start_data[$subjid][$initial_event]['dm_rfstdtc'];
		if ($debug) {
			show_var($subject, 'BEFORE', 'red');
		}
		/**
		 * if treatment has started
		 */
		if (isset($rfstdtc) || $rfstdtc != '') {
			/**
			 * iterate the lab events for this prefix
			 */
			foreach ($subject AS $lab_event_id => $lab_event) {
				/**
				 * if we have a value for the orres, then add to candidate events array
				 */
				if ($lab_event[$prefix . "_lborres"] != '') {
					$lab_subject[$lab_event_id] = $subject[$lab_event_id];
				}
			}
			if ($debug) {
				show_var($lab_subject, "AFTER {$prefix}", 'green');
			}
			/**
			 * if we have candidate events
			 */
			if (count($lab_subject) > 0) {
				/**
				 * fetch the baseline date and set baseline / flag pair
				 */
				$baseline_date = '';
				$this_data = get_baseline_date($lab_subject, $fragment, $rfstdtc);
				/**
				 * if the nearest date is prior or equal to rfstdtc, it's a baseline date
				 */
				if ($debug) {
					show_var($lab_subject, 'FIELD SUBJECT DATA', 'blue');
					show_var($this_data, 'FIELD BASELINE DATA', 'red');
					show_var($rfstdtc, 'TX start', 'red');
				}
				if ($this_data[$fragment . '_lbdtc'] != '' && $this_data[$fragment . '_lbdtc'] <= $rfstdtc) {
					$baseline_date = $this_data[$fragment . '_lbdtc'];
					/**
					 * Baseline date belongs in Baseline event
					 */
					update_field_compare($subjid, $project_id, $initial_event, $baseline_date, get_single_field($subjid, $project_id, $initial_event, $prefix . "_supplb_lbdtbl", null), $prefix . "_supplb_lbdtbl", $debug);
					if ($debug) {
						show_var($baseline_date, 'FIELD BASELINE DATE', 'red');
					}
					/**
					 * Now reset all other flags that have changed
					 */
					$flag_reset_data = REDCap::getData('array', $subjid, $prefix . "_lbblfl");
					$this_baseline_flag = get_single_field($subjid, $project_id, $this_data['event_id'], $prefix . "_lbblfl", null);
					foreach ($flag_reset_data AS $reset) {
						if ($debug) {
							show_var($reset, 'FIELD RESET FLAGS', 'red');
						}
						foreach ($reset AS $reset_event_id => $reset_event) {
							foreach ($reset_event as $reset_field => $reset_val) {
								if ($reset_event_id != $this_data['event_id']) {
									update_field_compare($subjid, $project_id, $reset_event_id, '', $reset_val, $prefix . "_lbblfl", $debug);
								}
							}
						}
					}
					/**
					 * Baseline flag belongs in the event where the date occurs
					 */
					if ($baseline_date != '') {
						update_field_compare($subjid, $project_id, $this_data['event_id'], 'Y', $this_baseline_flag, $prefix . "_lbblfl", $debug);
					}
//.........这里部分代码省略.........
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:101,代码来源:functions.php

示例4: dirname

$debug = true;
/**
 * includes
 */
$base_path = dirname(dirname(dirname(__FILE__)));
require_once $base_path . "/redcap_connect.php";
require_once $base_path . '/plugins/includes/functions.php';
require_once APP_PATH_DOCROOT . '/Config/init_project.php';
require_once APP_PATH_DOCROOT . '/ProjectGeneral/header.php';
/**
 * if data was submitted here...
 */
if ($_GET && $_POST) {
    if ($debug) {
        show_var($_GET, 'GET');
        show_var($_POST, 'POST');
    }
    /**
     * initialize variables
     */
    $project = new Project();
    $next_event_id = getNextEventId($_GET['event_id'], $_GET['page']);
    $original_action = APP_PATH_WEBROOT . "DataEntry/index.php?pid={$_GET['pid']}&event_id={$_GET['event_id']}&page={$_GET['page']}";
    $redirect_url = APP_PATH_WEBROOT . "DataEntry/index.php?pid={$_GET['pid']}&event_id={$next_event_id}&page={$_GET['page']}";
    /**
     * conditionally modify post and redirect
     */
    //	if ($_POST['submit-action'] == 'submit-btn-savenextevent' && $next_event_id !== false) {
    //		$_POST['save-and-redirect'] = $redirect_url;
    //	}
    //	header('Location: ' . $original_action);
开发者ID:hcv-target,项目名称:redcap_hooks,代码行数:31,代码来源:submit_router.php

示例5: show_var

}
if (isset($found_posts)) {
    show_var('found_posts', $found_posts);
}
?>
			</tbody>
		</table>
	</div>
	
	<div class="box double">
		<h2>Query Vars set</h2>
		<table>
			<tbody>
		<?php 
foreach ($wp_query->query_vars as $var => $val) {
    show_var($var, $val, true);
}
?>
			</tbody>
		</table>
	</div>

	<div class="box double">
		<h2>SQL Query</h2>
		<p><?php 
echo $wp_query->request;
?>
</p>
	</div>
<?php 
get_footer();
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:31,代码来源:index.php

示例6: set_dag

	/**
	 * @param $record
	 * @param $instrument
	 * @param $debug
	 */
	public static function set_dag($record, $instrument, $debug)
	{
		global $project_id;
		/**
		 * SET Data Access Group based upon dm_usubjid prefix
		 */
		$fields = array('dm_usubjid');
		$data = REDCap::getData('array', $record, $fields);
		foreach ($data AS $subject) {
			foreach ($subject AS $event_id => $event) {
				if ($event['dm_usubjid'] != '') {
					/**
					 * find which DAG this subject belongs to
					 */
					$site_prefix = substr($event['dm_usubjid'], 0, 3) . '%';
					$dag_query = "SELECT group_id, group_name FROM redcap_data_access_groups WHERE project_id = '$project_id' AND group_name LIKE '$site_prefix'";
					$dag_result = db_query($dag_query);
					if ($dag_result) {
						$dag = db_fetch_assoc($dag_result);
						if (isset($dag['group_id'])) {
							/**
							 * For each event in project for this subject, determine if this subject_id has been added to its appropriate DAG. If it hasn't, make it so.
							 * First, we need a list of events for which this subject has data
							 */
							$subject_events_query = "SELECT DISTINCT event_id FROM redcap_data WHERE project_id = '$project_id' AND record = '$record' AND field_name = '" . $instrument . "_complete'";
							$subject_events_result = db_query($subject_events_query);
							if ($subject_events_result) {
								while ($subject_events_row = db_fetch_assoc($subject_events_result)) {
									if (isset($subject_events_row['event_id'])) {
										$_GET['event_id'] = $subject_events_row['event_id']; // for logging
										/**
										 * The subject has data in this event_id
										 * does the subject have corresponding DAG assignment?
										 */
										$has_event_data_query = "SELECT DISTINCT event_id FROM redcap_data WHERE project_id = '$project_id' AND record = '$record' AND event_id = '" . $subject_events_row['event_id'] . "' AND field_name = '__GROUPID__'";
										$has_event_data_result = db_query($has_event_data_query);
										if ($has_event_data_result) {
											$has_event_data = db_fetch_assoc($has_event_data_result);
											if (!isset($has_event_data['event_id'])) {
												/**
												 * Subject does not have a matching DAG assignment for this data
												 * construct proper matching __GROUPID__ record and insert
												 */
												$insert_dag_query = "INSERT INTO redcap_data SET record = '$record', event_id = '" . $subject_events_row['event_id'] . "', value = '" . $dag['group_id'] . "', project_id = '$project_id', field_name = '__GROUPID__'";
												if (!$debug) {
													if (db_query($insert_dag_query)) {
														target_log_event($insert_dag_query, 'redcap_data', 'insert', $record, $dag['group_name'], 'Assign record to Data Access Group (' . $dag['group_name'] . ')');
													} else {
														error_log("SQL INSERT FAILED: " . db_error() . "\n");
														echo db_error() . "\n";
													}
												} else {
													show_var($insert_dag_query);
													error_log('(TESTING) NOTICE: ' . $insert_dag_query);
												}
											}
											db_free_result($has_event_data_result);
										}
									}
								}
								db_free_result($subject_events_result);
							}
						}
						db_free_result($dag_result);
					}
				}
			}
		}
	}
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:74,代码来源:Prioritize.php

示例7: array

		 * IMMUNOSUPPRESSANTS
		 */
		if (isset($event['cm_cmdecod']) && $event['cm_cmdecod'] != '') {
			$immun_flag = 'N';
			$immun_meds = array();
			$immun_meds_result = db_query("SELECT * FROM _target_meds_of_interest WHERE cm_cmcat != 'steroid' AND cm_cmtrt = '{$event['cm_cmdecod']}'");
			if ($immun_meds_result) {
				while ($immun_meds_row = db_fetch_assoc($immun_meds_result)) {
					$immun_meds[] = $immun_meds_row['cm_cmtrt'];
				}
				db_free_result($immun_meds_result);
			}
			if (count($immun_meds) != 0) {
				$immun_flag = 'Y';
				if ($debug) {
					show_var($immun_meds);
				}
			}
			update_field_compare($subject_id, $project_id, $event_id, $immun_flag, $event['cm_suppcm_cmimmuno'], 'cm_suppcm_cmimmuno', $debug);
		}
		/**
		 * CM_SUPPCM_INDCOD
		 */
		/**
		 * re-code all nutritional support to nutritional supplement
		 */
		if ($event['cm_oth_cmindc'] == 'Nutritional support') {
			$event['cm_oth_cmindc'] = 'Nutritional supplement';
		}
		code_llt($project_id, $subject_id, $event_id, fix_case($event['cm_cmindc']), fix_case($event['cm_oth_cmindc']), $event['cm_suppcm_indcod'], 'cm_suppcm_indcod', $debug, $recode_llt);
		/**
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:coding.php

示例8: db_error

						if (db_query($delete_query)) {
							target_log_event($delete_query, 'redcap_data', 'delete', $empty_row['record'], "{$empty_row['field_name']} = '{$empty_row['value']}'", 'Delete hidden blank value', '', $project_id, $empty_row['event_id']);
						} else {
							error_log("SQL DELETE FAILED: " . db_error() . ': ' . $delete_query);
							echo db_error() . "<br />" . $delete_query;
						}
					} else {
						echo "<div class='red'>NON-MATCHING value is shown. THIS value ({$empty_row['value']}) is hidden. DELETE row.</div>";
						show_var($history, "{$empty_row['record']}, {$empty_row['event_id']}, {$empty_row['field_name']}", 'red');
						show_var($most_recent_event['value'], 'MOST RECENT', 'red');
						show_var($delete_query);
					}
				} else {
					/**
					 * do nothing
					 */
					if ($debug) {
						echo "<div class='green'>THIS value ({$empty_row['value']}) is shown. DO NOTHING.</div>";
						show_var($history, "{$empty_row['record']}, {$empty_row['event_id']}, {$empty_row['field_name']}", 'green');
						show_var($most_recent_event['value'], 'MOST RECENT', 'green');
					}
				}
			}
		}
		db_free_result($empty_result);
	}
	echo $rows_deleted . " ROWS DELETED.<br />";
	$timer['main_end'] = microtime(true);
	$init_time = benchmark_timing($timer);
	echo $init_time;
}
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:delete_hidden_data.php

示例9: array

$fields = array('cm_cmoccur', 'cm_cmdecod', 'cm_cmindc', 'cm_oth_cmindc', 'cm_suppcm_indcmodf', 'cm_suppcm_indcod', 'cm_suppcm_indcsys', 'cm_suppcm_atcname', 'cm_suppcm_atc2name');
$data = REDCap::getData('array', $subjects, $fields);
foreach ($flush_data AS $subject_id => $flush_subject) {
	foreach ($flush_subject AS $event_id => $event) {
		foreach ($flush_fields as $flush_field) {
			if ($event[$flush_field] != '') {
				$flush_sql = "DELETE FROM redcap_data WHERE project_id = '$project_id' AND record = '$subject_id' AND event_id = '$event_id' AND field_name = '$flush_field'";
				if (!$debug) {
					if (db_query($flush_sql)) {
						target_log_event($flush_sql, 'redcap_data', 'delete', $subject_id, "$flush_field = ''", 'Delete record', $delete_message, $project_id, $event_id);
					} else {
						error_log(db_error() . ': ' . $flush_sql);
						echo db_error() . "<br />" . $flush_sql;
					}
				} else {
					show_var($flush_sql);
					error_log("DEBUG: " . $flush_sql);
				}

			}
		}
 	}
	foreach ($data[$subject_id] AS $subject) {
		foreach ($subject AS $event_id => $event) {
			if ($event['cm_cmoccur'] == 'Y') {
				code_pt($project_id, $subject_id, $event_id, $event['cm_suppcm_indcmodf'], $event['cm_suppcm_indcod'], 'cm_suppcm_indcod', $debug, $recode_pt, $message);
				if ($debug) {
					error_log("DEBUG: Coded INDC PT: subject=$subject_id, event=$event_id for INDICATION {$event['cm_suppcm_indcmodf']}");
				}
				code_bodsys($project_id, $subject_id, $event_id, $event['cm_suppcm_indcod'], $event['cm_suppcm_indcsys'], 'cm_suppcm_indcsys', $debug, $recode_soc, $message);
				if ($debug) {
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:derive_recode_atc.php

示例10: count

						}
					}
				}
				/**
				 * inside the stream, we know about new samples and don't know about samples removed from inventory
				 */
				foreach ($stream_array AS $dm_usubjid => $stream_event) {
					$record = $dm_usubjid_array[$dm_usubjid];
					/**
					 * if we don't have a $record, it's not a current PT in the study
					 */
					if (isset($record)) {
						$site_name = $site_array[substr($dm_usubjid, 0, 3)];
						ksort($stream_event);
						if ($debug) {
							show_var($stream_event, "$record ($dm_usubjid)", 'blue');
						}
						$event_count = 1;
						$next_event = count($state_array[$record]) + 1;
						foreach ($stream_event AS $stream_date => $stream_samples) {
							ksort($stream_samples);
							$sample_code = NULL;
							$sample_type = NULL;
							$sample_onhand = NULL;
							/**
							 * if this $stream_date is not found in the $state, it's a new event
							 */
							if (!array_key_exists_recursive($stream_date, $state_array[$record])) {
								/**
								 * new event, start with the first field group
								 */
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:process_samples.php

示例11: db_query

			}
		}
	}
	/**
	 * flush and log any '' values for $field_name
	 */
	$find_blank_values_query = "SELECT record, event_id FROM redcap_data WHERE project_id = '$project_id' AND field_name = '$field_name' AND value = ''";
	$find_blanks_result = db_query($find_blank_values_query);
	if ($find_blanks_result) {
		while ($found_blank_row = db_fetch_assoc($find_blanks_result)) {
			$delete_blank_values_query = "DELETE FROM redcap_data WHERE project_id = '$project_id' AND field_name = '$field_name' AND record = '{$found_blank_row['record']}' AND event_id = '{$found_blank_row['event_id']}' AND value = ''";
			if (!$debug) {
				if (db_query($delete_blank_values_query)) {
					//target_log_event($delete_blank_values_query, 'redcap_data', 'delete', $subject_id, "$field_name = ''", "Delete blank $field_name", '', $project_id);
					REDCap::logEvent("Delete blank $field_name", "$field_name = ''", $delete_blank_values_query, $found_blank_row['record'], $found_blank_row['event_id']);
				} else {
					error_log(db_error() . ': ' . $delete_blank_values_query);
					echo(db_error() . ": " . $delete_blank_values_query . "<br />");
				}
			} else {
				show_var($delete_blank_values_query);
			}
		}
		db_free_result($find_blanks_result);
	}
} else {
	print "<h3>You must select both a source (existing) and destination (new) field.</h3>";
}
$timer_stop = microtime(true);
$timer_time = number_format(($timer_stop - $timer_start), 2);
echo 'This page loaded in ', $timer_time / 60, ' minutes';
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:migrate_data_to_new_variable.php

示例12: microtime

    $timer['main_start'] = microtime(true);
}
/*if ($_GET) {
	show_var($_GET, '$_GET');
}*/
if ($_SERVER) {
    $refer_outer = explode('&', substr($_SERVER['HTTP_REFERER'], strpos($_SERVER['HTTP_REFERER'], '?') + 1));
    $refer_inner = array();
    foreach ($refer_outer as $refer) {
        $refer = explode('=', $refer);
        $refer_inner[$refer[0]] = $refer[1];
    }
    if ($testing) {
        show_var($refer_inner, 'post-process');
    }
    if (isset($refer_inner['page']) && isset($refer_inner['event_id']) && isset($refer_inner['id'])) {
        $next_event_id = getNextEventId($refer_inner['event_id'], $refer_inner['page']);
        if ($next_event_id !== false) {
            header('Location: ' . APP_PATH_WEBROOT . "DataEntry/index.php?pid={$project_id}&id=" . urlencode($refer_inner['id']) . "&event_id={$next_event_id}&page={$refer_inner['page']}");
        } else {
            show_var($next_event_id);
        }
    } else {
        echo "<h1>You must first select a subject and a form to use this plugin.</h1>";
    }
}
if ($testing) {
    $timer['main_end'] = microtime(true);
    $init_time = benchmark_timing($timer);
    echo $init_time;
}
开发者ID:hcv-target,项目名称:redcap_hooks,代码行数:31,代码来源:goto_next_event.php

示例13: json_decode

     $data = json_decode($var, true);
     foreach ($data as $name => $value) {
         if ($value != NULL) {
             $config->set($name, $value);
         }
     }
 } else {
     if ($action == "get") {
         if ($var == NULL) {
             $result = $config->getAll();
             if ($result != NULL) {
                 show_vars($result);
             }
         } else {
             $result = $config->get($var);
             show_var($var, $result);
         }
     } else {
         if ($action == "admin") {
             if ($var == NULL) {
                 $result = $users->getAllAdmins();
                 foreach ($result as $user) {
                     show_user($user);
                 }
             } else {
                 $user = $users->getByLogin($var);
                 if ($user != NULL) {
                     Audit::log('console', 'set user admin ' . $user->login . '(' . $user->id . ')');
                     $users->setAdmin($user->id, 1);
                 } else {
                     dbg('Login not found');
开发者ID:jnwatts,项目名称:credentials,代码行数:31,代码来源:configure.php

示例14: implode

					} else {
						$avail_incomplete++;
						if ($value != '') {
							$filled_incomplete++;
						}
					}
				}
			}
		}
		/**
		 * output row to table
		 */
		$data_row['Form Name'] = '"' . $form_name_row['form_menu_description'] . '"';
		$data_row['Filled Fields on Locked Forms'] = '"' . $filled_locked . '"';
		$data_row['Avail Fields on Locked Forms'] = '"' . $avail_locked . '"';
		$data_row['Filled Fields on Completed Forms'] = '"' . $filled_complete . '"';
		$data_row['Avail Fields on Completed Forms'] = '"' . $avail_complete . '"';
		$data_row['Filled Fields on Incomplete Forms'] = '"' . $filled_incomplete . '"';
		$data_row['Avail Fields on Incomplete Forms'] = '"' . $avail_incomplete . '"';
		$data_row['Filled Fields on All Forms'] = '"' . $filled_all . '"';
		$data_row['Avail Fields on All Forms'] = '"' . $avail_all . '"';
		$row_csv = implode(',', $data_row) . "\n";
		$table_csv .= $row_csv;
	}
}
$headers = implode(',', array_keys($data_row)) . "\n";
if (!$debug) {
	create_download($lang, $app_title, $userid, $headers, $user_rights, $table_csv, '', $parent_chkd_flds, $project_id, "LOCKED_FORMS", $debug);
} else {
	show_var($table_csv, 'TABLE', 'red');
}
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:report-locked-fields-completed.php

示例15: db_fetch_assoc

			$locked = db_fetch_assoc($locked_result);
			if (!isset($locked['ld_id'])) {
				$rows_deleted++;
				$delete_query = "DELETE FROM redcap_data WHERE record = '{$empty_row['record']}' AND project_id = '$project_id' AND event_id = '{$empty_row['event_id']}' AND field_name = '{$empty_row['field_name']}' AND value = '" . prep($empty_row['value']) . "' LIMIT 1";
				if (!$debug) {
					if (db_query($delete_query)) {
						target_log_event($delete_query, 'redcap_data', 'delete', $empty_row['record'], "{$empty_row['field_name']} = '{$empty_row['value']}'", 'Delete blank value', '', $project_id, $empty_row['event_id']);
					} else {
						error_log("SQL DELETE FAILED: " . db_error() . ': ' . $delete_query);
						echo db_error() . "<br />" . $delete_query;
					}
				} else {
					show_var($delete_query);
				}
			} else {
				$this_field_hidden = $my_branching_logic->allFieldsHidden($empty_row['record'], $empty_row['event_id'], array($empty_row['field_name']));
				$history = Form::getDataHistoryLog($empty_row['record'], $empty_row['event_id'], $empty_row['field_name']);
				if ($this_field_hidden) {
					$rows_deleted++;
					echo "<div class='red'>LOCKED with BLANK. Value is hidden. DELETE.</div>";
					show_var($history, "{$empty_row['record']}, {$empty_row['event_id']}, {$empty_row['field_name']}", 'red');
				} else {
					echo "<div class='green'>LOCKED with BLANK. Value is shown. Make no changes.</div>";
					show_var($history, "{$empty_row['record']}, {$empty_row['event_id']}, {$empty_row['field_name']}", 'green');
				}
			}
		}
	}
	db_free_result($empty_result);
}
echo $rows_deleted . " ROWS DELETED.<br />";
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:delete_empty_data.php


注:本文中的show_var函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。