A
download class.GraphModule.php
Language: PHP
LOC: 116
Project Info
FreeMED Project(freemed)
Server: SourceForge
Type: cvs
...reemed\freemed\freemed\lib\
   acl.php
   API.php
   bcadd.php
   calendar-functions.php
   class.AdminModule.php
   class.Agata.php
   class.Authorizations.php
   class.BaseModule.php
   class.BillingModule.php
   class.CalendarModule.php
   class.ClaimLog.php
   class.Coverage.php
   class.Debug.php
   class.diagnosis_set.php
   class.Djvu.php
   class.EMRModule.php
   class.Fax.php
   class.FixedFormEntry.php
   ...s.FixedFormRenderer.php
   class.FormRenderer.php
   class.FreeMEDSelfTest.php
   class.GeneralConfig.php
   class.GraphModule.php
   class.Guarantor.php
   class.Handler_HL7v2.php
   ...s.Handler_HL7v2_A04.php
   ...s.Handler_HL7v2_A08.php
   ...s.Handler_HL7v2_S12.php
   ...s.Handler_HL7v2_S15.php
   class.InsuranceCompany.php
   class.LanguageRegistry.php
   class.Ledger.php
   ...s.MaintenanceModule.php
   class.Messages.php
   class.OMBS_Patient.php
   class.OMBS_Wrapper.php
   class.Parser_HL7v2.php
   class.Patient.php
   class.Payer.php
   class.PHPlot.php
   class.Physician.php
   class.Procedure.php
   class.RecordLock.php
   class.Remitt.php
   class.ReportsModule.php
   class.rxlist.php
   class.Scheduler.php
   class.TeX.php
   class.User.php
   class.UtilityModule.php
   class.vCalendar.php
   class.vCalendarEvent.php
   error_handler.php
   freemed.php
   i18n.php
   iso-set.php
   macros.php
   mail-functions.php
   settings.php
   settings.php.tmpl
   xml.php
   xmlrpc_services.php

<?php
	// $Id: class.GraphModule.php,v 1.7 2005/02/14 17:41:26 rufustfirefly Exp $
	// $Author: rufustfirefly $

LoadObjectDependency('_FreeMED.ReportsModule');

class GraphModule extends ReportsModule {
	// contructor method
	function GraphModule () {
		// Call parent constructor
		$this->ReportsModule();
	} // end function GraphModule

	// override check_vars method
	function check_vars ($nullvar = "") {
		global $module;
		if (!isset($module))
		{
			trigger_error("No Module Defined", E_ERROR);
		}
		return true;
	} // end function check_vars

	// function main
	// - generic main function
	function main ($nullvar = "") {
		global $action, $submit;

		// Handle Cancel button
		if ($submit == __("Cancel")) {
			global $refresh; $refresh = 'reports.php';
			return false;
		}

		switch ($action) {
			case "display":
				$this->display();
				break;
			case "image":
				$this->image();
				break;
			case "view":
			default:
				$this->view();
				break;
		} // end switch action
	} // end function main

	// ********************** MODULE SPECIFIC ACTIONS *********************
	function header() {
		if ($_REQUEST['graphmode']) {
			// don't display the box top
			freemed::connect();
//------HIPAA Logging
// Dont see a need here...

			return;
		}
		BaseModule::header();
	} // end function header

	function footer() {
		global $display_buffer;

		// dont display the bottom
		if ($_REQUEST['graphmode']) {
			return;
		} else {
			template_display();
		}
	} // end function footer

	function _view () {
		global $display_buffer, $start_dt, $end_dt;

		if (!isset($start_dt)) {
			// Default to one year ago
			list ($y, $m, $d) = explode("-", date("Y-m-d"));
			$start_dt = date("Y-m-d", mktime(0,0,0,$m,$d,$y-1));
		}

		if (!isset($end_dt)) {
			// Default to current date
			$end_dt = date("Y-m-d");
		}

		$display_buffer .= $this->GetGraphOptions(
			$this->graph_text,
			$this->graph_opts
		);
	}
	function view() { $this->_view(); }

	function AssembleURL($opts='') {
		$__req = array_merge($_GET, $_POST);
		if (is_array($opts)) {
			foreach ($opts AS $k => $v) {
				if (is_integer($k)) {
					global $v;
					$__req["$v"] = ${$v};
				} else {
					$__req["$k"] = $v;
				}
			}
		}

		// Go through each one and make it all proper-like
		foreach ($__req AS $k => $v) {
			$___req[] = $k."=".urlencode($v);
		}
		
		// Form url
		return $this->page_name."?".join('&', $___req);
	}

	function GetGraphOptions($title, $_opts=array()) {
		global $action, $module, $start_dt, $end_dt;

		if (is_array($_opts)) {
			$opts = $_opts;
		} else {
			$opts = array();
		}

		// Add defaults
		$opts = array_merge(
			array(
			__("Start Date") =>
			fm_date_entry("start_dt"),

			__("End Date") => 
			fm_date_entry("end_dt")
			), $opts);

		$buffer = "
		<div ALIGN=\"CENTER\">
		<b>".$title."</b>
		</div>

	        <form ACTION=\"".$this->page_name."\" METHOD=\"POST\">
        	<input TYPE=\"HIDDEN\" NAME=\"action\" VALUE=\"display\"/>
        	<input TYPE=\"HIDDEN\" NAME=\"module\" VALUE=\"".prepare($module)."\"/>

		<div align=\"CENTER\">
		".html_form::form_table($opts)."
		</div>

		<div align=\"CENTER\">
		<input class=\"button\" TYPE=\"SUBMIT\" NAME=\"submit\"
			value=\"".__("Graph")."\"/>
		<input class=\"button\" type=\"SUBMIT\" name=\"submit\"
			value=\"".__("Cancel")."\"/>
		</form>
		</div>
        ";
		return $buffer;

	} // end function GetGraphOptions

} // end class GraphModule

?>

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us