/**
* function to get the status of the invite sent to the user
* @param: $contact
*/
function getMailMessage($name) {
	$query=0;
	$query=mysqlquery("select * from vl_emails_outgoing where lower(name)='".strtolower($name)."'");
	if(mysqlnumrows($query)) {
		return mysqlresult($query,0,'description');
	}
}
Exemplo n.º 2
0
function logError($name,$description,$url,$user) {
	global $datetime;
	mysqlquery("insert into vl_errors 
		(name,description,url,user,created) 
		values 
		('$name','$description','$url','$user','$datetime')");
}
Exemplo n.º 3
0
/**
* OPERATIONS STAFF FUNCTIONS
*/

function getSubordinateOperationsStaff($supervisor) {
	$query=0;
	$query=mysqlquery("select id from vl_users where reportsTo='$supervisor'");
	if(mysqlnumrows($query)) {
		$staff=array();
		while($q=mysqlfetcharray($query)) {
			$staff[]=$q["id"];
		}
		return $staff;
	}
}
function insertVLResults($machineType="", $values="", $repeats="", $merged_values=""){
	$values = trim($values, ",");
	$repeats = trim($repeats, ",");
	$merged_values = trim($merged_values, ",");

	if($machineType=="roche"){
		mysqlquery("insert into vl_results_roche
			(worksheetID,PatientName,PatientID,OrderNumber,OrderDateTime,
			 SampleID,SampleType,BatchID,Test,Result,Unit,Flags,AcceptedOp,
			 AcceptedDateTime,Comment,GeneralLotNumber,GeneralLotExpirationDate,
			 SamplePrepKitLotNumber,SamplePrepKitLotExpirationDate,PCRKitLotNumber,PCRKitExpirationDate,
			 LPCLowLimit,LPCHighLimit,MPCLowLimit,MPCHighLimit,
			 HPCLowLimit,HPCHighLimit,PreparationInstrumentID,PreparationStartDateTime,
			 PreparationEndDateTime,PreparationRackPos,PreparationRackID,PreparationRackType,
			 PreparationTubeID,PreparationTubeType,PreparationTubePos,PreparationBatchID,
			 AmplificationInstrumentID,AmplificationStartDateTime,AmplificationEndDateTime,AmplificationTCID,
			 AmplificationRackID,AmplificationRackType,AmplificationTubeID,AmplificationTubeType,
			 AmplificationTubePos,AmplificationBatchID,DetectionInstrumentID,DetectionStartDateTime,
			 DetectionEndDateTime,DetectionRackPos,DetectionRackID,DetectionRackType,
			 DetectionTubeID,DetectionTubeType,DetectionTubePos,DetectionBatchID,
			 IngredientCH1,IngredientCH2,IngredientCH3,IngredientCH4,
			 CTMElbowCH1,CTMElbowCH2,CTMElbowCH3,CTMElbowCH4,CTMRFICH1,CTMRFICH2,CTMRFICH3,
			 CTMRFICH4,CTMAFICH1,CTMAFICH2,CTMAFICH3,CTMAFICH4,CTMCalibCoeffa,CTMCalibCoeffb,
			 CTMCalibCoeffc,CTMCalibCoeffd,CASampleValue,QSCopy,CATarget1,CATarget2,
			 CATarget3,CATarget4,CATarget5,CATarget6,CAQS1,CAQS2,CAQS3,CAQS4,created,createdby)
			 values  $values");
	}elseif($machineType=="abbott"){
		mysqlquery("insert into vl_results_abbott
			(worksheetID, sampleLocation,sampleID,sampleType,assayName,
			 assayVersion,result,interpretation,flags,targetCycleNumber,icCycleNumber,
			 errorCodeDescription,assayCalibrationTime, reagentLotNumber,reagentLotExpirationDate,
			 controlLotNumber,controlExpirationDate, controlRange,calibratorLotNumber,
			 calibratorExpirationDate,calibratorLogConcentration, resultComment,targetMR,icMR,
			 created,createdby) values $values");
	}

	if(!empty($repeats)){
		mysqlquery("insert into vl_logs_samplerepeats 
			(sampleID,oldWorksheetID,created,createdby) 
			values $repeats");
	}

	if(!empty($merged_values)){
		mysqlquery("insert ignore into vl_results_merged 
			(machine,worksheetID,vlSampleID,resultAlphanumeric,
			resultNumeric,suppressed,created,createdby) 
			values $merged_values ");
	}
									
}
                                                ?>
                                          </select></td>
                                        </tr>
                                    </table>
                              </td>
                              <td style="padding: 0px 0px 0px 10px" align="right">Value:</td>
                              <td style="padding:0px 0px 0px 5px"><input type="text" name="suspectedTreatmentFailureValue" id="suspectedTreatmentFailureValue" value="<?php 
echo $suspectedTreatmentFailureValue;
?>
" class="search_pre" size="7" maxlength="10" /></td>
                              <td align="right">Sample&nbsp;Type:</td>
                              <td style="padding:0px 0px 0px 5px">
								<select name="suspectedTreatmentFailureSampleTypeID" id="suspectedTreatmentFailureSampleTypeID" class="search">
                                <?
								$query=0;
								$query=mysqlquery("select * from vl_appendix_sampletype order by position");
								if($suspectedTreatmentFailureSampleTypeID) {
									echo "<option value=\"$suspectedTreatmentFailureSampleTypeID\" selected=\"selected\">".getDetailedTableInfo2("vl_appendix_sampletype","id='$suspectedTreatmentFailureSampleTypeID' limit 1","appendix")."</option>";
								} else {
									echo "<option value=\"\" selected=\"selected\">Select Sample Type</option>";
								}
								if(mysqlnumrows($query)) {
									while($q=mysqlfetcharray($query)) {
										echo "<option value=\"$q[id]\">$q[appendix]</option>";
									}
								}
								?>
                                </select>
                              </td>
                            </tr>
						</table>
<?php

$GLOBALS['vlDC'] = true;
include "conf.php";
$sql = " SELECT s.id AS s_id, lrCategory, lrEnvelopeNumber, lrNumericID, vlSampleID, formNumber  \n\t   FROM vl_samples AS s\n\t   WHERE (formNumber LIKE '%{$q}%') \n\t   LIMIT 10";
$res = mysqlquery($sql);
$str = "<table width=100%>";
$str .= "<tr><th>VL Testing #</th><th> Form Number</th><th>Location ID</th></tr>";
while ($row = mysqlfetcharray($res)) {
    extract($row);
    $link = "href=\"javascript:windPop('/sample_results/print/{$s_id}/')\"";
    $l_smpl_id = "<a {$link}>{$vlSampleID}</a>";
    $l_form = "<a {$link}>{$formNumber}</a>";
    $l_locator = "<a {$link}>{$lrCategory}{$lrEnvelopeNumber}{$lrNumericID}</a>";
    $str .= "<tr><td>{$l_smpl_id}</td><td>{$l_form}</td><td>{$l_locator}</td></tr>";
}
$str .= "</table>";
echo $str;
Exemplo n.º 7
0
/**
* function to log result overrides
*/
function logResultOverride($sampleID,$worksheetID,$result) {
	global $datetime,$trailSessionUser;
	
	//validate
	$sampleID=validate($sampleID);
	$worksheetID=validate($worksheetID);
	$result=validate($result);
	
	$id=0;
	$id=getDetailedTableInfo2("vl_results_override","sampleID='$sampleID' and worksheetID='$worksheetID'","id");
	//avoid duplicates
	if(!$id) {
		//insert into vl_results_override
		mysqlquery("insert into vl_results_override 
				(sampleID,worksheetID,result,created,createdby) 
				values 
				('$sampleID','$worksheetID','$result','$datetime','$trailSessionUser')");
	} else {
		//log table change
		logTableChange("vl_results_override","result",$id,getDetailedTableInfo2("vl_results_override","id='$id'","result"),$result);
		//update vl_results_override
		mysqlquery("update vl_results_override set result='$result' where id='$id'");
	}
}
        ?>
                  <tr>
                    <td><strong>Total Data Removals since March-2014: </strong></td>
                  </tr>
                  <tr>
                    <td><strong>Removals per Month: </strong></td>
                  </tr>
                  <tr>
                    <td><table width="100%"  border="1" class="vl">
                        <tr bgcolor="#ECECFF">
                          <td width="74%"><strong>Month, Year</strong></td>
                          <td width="26%"><strong>Removals</strong></td>
                        </tr>
                        <?
                $squery=0;
                $squery=mysqlquery("select monthname(created) theMonth, year(created) theYear, count(*) stat from vl_logs_removals group by theMonth, theYear order by created");
                if(mysqlnumrows($squery)) {
                    $sq=array();
                    $stotal=0;
                    $scount=1;
                    while($sq=mysqlfetcharray($squery)) {
                        if($scount%2) {
                            $scolor="#FFFFFF";
                        } else {
                            $scolor="#F4F4F4";
                        }
                ?>
                        <tr bgcolor="<?php 
echo $scolor;
?>
">
Exemplo n.º 9
0
    function isDateInDB($date) {
		$query=0;
		$query=mysqlquery("select * from vl_calendar where eventDate='$date'");
		if(mysqlnumrows($query)) {
			return 1;
		}
    }
?>
"> 
              <? } ?>
              <input name="act" type="hidden" id="act" value="atbtreatmentphase">
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>

		<?
        $query=0;
        $query=mysqlquery("select * from vl_appendix_tbtreatmentphase order by position");
		$num=0;
		$num=mysqlnumrows($query);
        if($num) {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
                <td style="padding:5px 0px" align="center">
                	<div style="height: 200px; border: 1px solid #ccccff; overflow: auto">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
                        <tr>
                          <td class="vl_tdsub" width="1%"><strong>#</strong></td>
                          <td class="vl_tdsub" width="60%"><strong>Appendix</strong></td>
                          <td class="vl_tdsub" width="10%"><strong>Samples</strong></td>
                          <td class="vl_tdsub" width="29%">&nbsp;</td>
                        </tr>
Exemplo n.º 11
0
                                        <td style="padding:0px 0px 0px 5px"><select name="dispatchedDateYear" id="dispatchedDateYear" class="search">
                                          <?
                                                for($j=getFormattedDateYear($oldDispatchedDate?$oldDispatchedDate:$datetime);$j>=(getCurrentYear()-10);$j--) {
                                                    echo "<option value=\"$j\">$j</option>";
                                                }
                                                ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                        </tr>
                        <tr>
                          <td>To&nbsp;Facility&nbsp;(Destination)&nbsp;<font class="vl_red">*</font></td>
                          <td><select name="facilityID" id="facilityID" class="search">
                                            <?
                                            $query=0;
                                            $query=mysqlquery("select * from vl_facilities where facility!='' order by facility");
											if($facilityID) {
												echo "<option value=\"$facilityID\" selected=\"selected\">".getDetailedTableInfo2("vl_facilities","id='$facilityID' limit 1","facility")."</option>";
											} else {
												echo "<option value=\"\" selected=\"selected\"></option>";
											}
                                            if(mysqlnumrows($query)) {
                                                while($q=mysqlfetcharray($query)) {
                                                    echo "<option value=\"$q[id]\">$q[facility]</option>";
                                                }
                                            }
                                            ?>
                                        </select>
                                        <script>
                                            var z = dhtmlXComboFromSelect("facilityID");
                                            z.enableFilteringMode(true);
Exemplo n.º 12
0
              <input name="regionID" type="hidden" id="regionID" value="<?php 
echo $regionID;
?>
">
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>

		<?
        $query=0;
        $query=mysqlquery("select * from vl_districts where regionID='$regionID' order by district");
		$num=0;
		$num=mysqlnumrows($query);
        if($num) {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="vl_tdsub" style="padding-left:20px"><strong>Districts in <?php 
echo getDetailedTableInfo2("vl_regions", "id='{$regionID}'", "region");
?>
 Region</strong></td>
                        </tr>
					</table>
Exemplo n.º 13
0
"> 
              <? } ?>
              <input name="act" type="hidden" id="act" value="permissions">
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>
        <? } ?>

		<?
        $query=0;
        $query=mysqlquery("select * from vl_users order by names,email");
		$num=0;
		$num=mysqlnumrows($query);
        if($num && $task=="add") {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
              <td style="border-bottom:1px solid #cccccc; padding-bottom:10px">Select User Account</td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="vl_tdsub" style="padding-left:16px" width="58%"><strong>Names</strong></td>
                          <td class="vl_tdsub" width="42%"><strong>Permissions</strong></td>
                        </tr>
									date(created)>='2015-12-27' 
										group by vlSampleID having num=1");
if(mysqlnumrows($query)) {
	while($q=mysqlfetcharray($query)) {
		//get the id
		$id=0;
		$id=getDetailedTableInfo2("vl_results_override","sampleID='$q[vlSampleID]' and date(created)>='2015-12-27' order by created desc limit 1","id");
		//log and remove record
		logDataRemoval("delete from vl_results_override where id='$id'");
		mysqlquery("delete from vl_results_override where id='$id'");
	}
}
*/

//task 4: a procedure to override key abbott results
$query=0;
$query=mysqlquery("select sampleID, count(id) num, max(created) dateCreated from vl_results_abbott 
						where 
							result='3119 A no clot exit detected error was encountered by the Liquid Handler.' and 
								sampleID not in (select sampleID from vl_results_override) 
									group by sampleID having num>1 order by num desc");
if(mysqlnumrows($query)) {
	while($q=mysqlfetcharray($query)) {
		//log result override
		logResultOverride($q["sampleID"],getDetailedTableInfo2("vl_results_abbott","sampleID='$q[sampleID]' and created='$q[dateCreated]' limit 1","worksheetID"),$default_resultFailureNewSampleMessage);
	}
}

//task 5: fix a result typo
mysqlquery("update vl_results_override set result='There is No Result Given. The Test Failed the Quality Control Criteria. We advise you send a new sample.' where result='There is No Result Given. The Test Failed the Quality Control Criteria. We advise you send a a new sample.'");
?>
Exemplo n.º 15
0
/**
* function to change a user's setting
* @param: $userID
* @param: $setting
* @param: $value
*/
function alterUserSetting($userID,$setting,$value) {
	//globals
	global $datetime,$trailSessionUser;
	
	//does user have a setting account?
	$query=0;
	$query=mysqlquery("select * from vl_users_settings where userID='$userID'");
	if(mysqlnumrows($query)) {
		//log table change
		logTableChange("vl_users_settings","$setting",getDetailedTableInfo2("vl_users_settings","userID='$userID'","id"),getDetailedTableInfo2("vl_users_settings","userID='$userID'","$setting"),$value);
		//update
		mysqlquery("update vl_users_settings set $setting='$value' where userID='$userID'");
	} else {
		//insert
		mysqlquery("insert into vl_users_settings 
						(userID,$setting,created,createdby) 
						values 
						('$userID','$value','$datetime','$trailSessionUser')");
	}
}
              <td>
	<table width="100%" border="0" class="vl">
		<?
		//pages
		if(!$pg) {
			$pg=1;
		}
		
		$offset=0;
		$offset=($pg-1)*$rowsToDisplay;

		//proceed with query
        $query=0;
        $query=mysqlquery("select * from vl_forms_clinicalrequest where (formNumber='$searchQuery' or refNumber='$searchQuery') order by created limit $offset, $rowsToDisplay");
        $xquery=0;
        $xquery=mysqlquery("select * from vl_forms_clinicalrequest where (formNumber='$searchQuery' or refNumber='$searchQuery') order by created");
		//number pages
		$numberPages=0;
		$numberPages=ceil(mysqlnumrows($xquery)/$rowsToDisplay);
		
        if(mysqlnumrows($query)) {
			//how many pages are there?
			if($numberPages>1) {
				echo "<tr><td style=\"padding:0px 0px 10px 0px\" class=\"vls_grey\"><strong>Pages:</strong> ".displayPagesLinks("/generateforms/search/".vlEncrypt($searchQuery)."/",1,$numberPages,($pg?$pg:1),$default_radius)."</td></tr>";
			}
        ?>
            <tr>
	            <td style="padding:10px 0px 10px 0px" class="vls_grey"><strong><?php 
echo mysqlnumrows($xquery);
?>
</strong> form<?php 
			}
		}

		//then progress to abbott machines
		$query=0;
		$query=mysqlquery("select distinct sampleID, worksheetID from vl_results_abbott 
									where 
										trim(result)='-1.00' or 
											trim(result)='3153 There is insufficient volume in the vessel to perform an aspirate or dispense operation.' or 
												trim(result)='3109 A no liquid detected error was encountered by the Liquid Handler.' or 
													trim(result)='A no liquid detected error was encountered by the Liquid Handler.' or 
														trim(result)='Unable to process result, instrument response is invalid.' or 
															trim(result)='3118 A clot limit passed error was encountered by the Liquid Handler.' or 
																trim(result)='3130 A less liquid than expected error was encountered by the Liquid Handler.' or 
																	trim(result)='3131 A more liquid than expected error was encountered by the Liquid Handler.' or 
																		trim(result)='3152 The specified submerge position for the requested liquid volume exceeds the calibrated Z bottom' or 
																			trim(result)='4455 Unable to process result, instrument response is invalid.' or 
																				trim(result)='A no liquid detected error was encountered by the Liquid Handler.' or 
																					trim(result)='Failed          Internal control cycle number is too high. Valid range is [18.48, 22.48].' or 
																						trim(result)='Failed          Failed            Internal control cycle number is too high. Valid range is [18.48,' or 
																							trim(result)='Failed          Failed          Internal control cycle number is too high. Valid range is [18.48, 2' or 
																								trim(result)='OPEN' or 
																									trim(result)='There is insufficient volume in the vessel to perform an aspirate or dispense operation.' or 
																										trim(result)='Unable to process result, instrument response is invalid.' or 
																											trim(substr(flags,1,47))='4442 Internal control cycle number is too high.' or
																											   trim(result)='4459 Assay normalized fluorescence too high'");

		if(mysqlnumrows($query)) {
			while($q=mysqlfetcharray($query)) {
				$sampleArray[]=$q["sampleID"];
				$worksheetArray[]=$q["worksheetID"];
Exemplo n.º 18
0
?>
"> 
              <? } ?>
              <input name="act" type="hidden" id="act" value="regions">
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>

		<?
        $query=0;
        $query=mysqlquery("select * from vl_regions order by region");
		$num=0;
		$num=mysqlnumrows($query);
        if($num) {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="vl_tdsub" style="padding-left:20px"><strong>Region</strong></td>
                        </tr>
					</table>
                </td>
            </tr>
            <tr>
                	<div style="height: 200px; border: 1px solid #ccccff; overflow: auto">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
                        <tr>
                          <td class="vl_tdsub" width="30%" style="padding-left:16px"><strong>ART&nbsp;Number</strong></td>
                          <td class="vl_tdsub" width="30%"><strong>Other&nbsp;ID</strong></td>
                          <td class="vl_tdsub" width="40%"><strong>Sample Form Number(s)</strong></td>
                        </tr>
                    	<?
                        $count=0;
                        $q=array();
                        while($q=mysqlfetcharray($query)) {
                            $count+=1;
							$samples=0;
							$samples="";
							$squery=0;
							$squery=mysqlquery("select * from vl_samples where patientID='$q[id]'");
							if(mysqlnumrows($squery)) {
								while($sq=mysqlfetcharray($squery)) {
									$samples.="$sq[formNumber] ";
								}
							}
                        ?>
                            <tr>
                                <td class="<?php 
echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder";
?>
"><?php 
echo $q["artNumber"] ? $q["artNumber"] : "&nbsp;";
?>
</td>
                                <td class="<?php 
Exemplo n.º 20
0
function sendPlainEmail2Admins($from,$fromName,$subject,$title,$message) {
	global $home_url;
	global $mail;
	global $user;

	//query admins
	$query=0;
	$query=mysqlquery("select email from vl_admins");
	$q=array();
	while($q=mysqlfetcharray($query)) {
		queMail($fromName,$from,$q["email"],$subject,$message,0);
	}
}
              <td>
	<table width="100%" border="0" class="vl">
		<?
		//pages
		if(!$pg) {
			$pg=1;
		}
		
		$offset=0;
		$offset=($pg-1)*$rowsToDisplay;

		//proceed with query
        $query=0;
        $query=mysqlquery("select * from vl_patients ".($patientID?"where uniqueID like '%$patientID%' or artNumber like '%$patientID%' or otherID like '%$patientID%'":"")." order by created desc limit $offset, $rowsToDisplay");
        $xquery=0;
        $xquery=mysqlquery("select * from vl_patients ".($patientID?"where uniqueID like '%$patientID%' or artNumber like '%$patientID%' or otherID like '%$patientID%'":"")." order by created desc");
		//number pages
		$numberPages=0;
		$numberPages=ceil(mysqlnumrows($xquery)/$rowsToDisplay);
		
        if(mysqlnumrows($query)) {
			//how many pages are there?
			if($numberPages>1) {
				echo "<tr><td style=\"padding:0px 0px 10px 0px\" class=\"vls_grey\"><strong>Pages:</strong> ".displayPagesLinks("/samples/manage.patients/pg/",1,$numberPages,($pg?$pg:1),$default_radius)."</td></tr>";
			}
        ?>
            <tr>
	            <td style="padding:0px 0px 10px 0px" class="vls_grey"><strong><?php 
echo mysqlnumrows($xquery);
?>
</strong> Patient<?php 
Exemplo n.º 22
0
?>
"> 
              <? } ?>
              <input name="act" type="hidden" id="act" value="admins">
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>

		<?
        $query=0;
        $query=mysqlquery("select * from vl_admins order by username");
		$num=0;
		$num=mysqlnumrows($query);
        if($num) {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="vl_tdsub" width="21%" style="padding-left:16px"><strong>Username</strong></td>
                          <td class="vl_tdsub" width="38%"><strong>Email</strong></td>
                          <td class="vl_tdsub" width="39%"><strong>Last Login</strong></td>
                        </tr>
					</table>
                </td>
Exemplo n.º 23
0
/**
* function to get specific countries from a region
* @param: $region e.g. africa, south america etc
*/
function loadCountriesFromRegion($region,$companyID) {
	if($region) {
		global $user;
	
		$theUserID=0;
		//ensure $user is not a visitor
		if(substr($user,0,7)!="visitor") {
			$theUserID=getUserID($user);
		}
	
		//get the towns first
		$query=0;
		$query=mysqlquery("select distinct countryID,country from vl_countries where region='$region' order by country");
		if(mysqlnumrows($query)) {
			$return=0;
			$return="
				<table width=\"100%\" border=\"0\">
				  <tr>
					<td colspan=\"2\">Select the markets covered:</td>
				  </tr>";
			$q=array();
			while($q=mysqlfetcharray($query)) {
				$return.="
						<tr>
							<td width=\"1%\"><input type=\"checkbox\" name=\"marketscoveredUnique[]\" value=\"$q[countryID]\" ".(checkMarketAgainstProvider($theUserID,$q["countryID"],$companyID)?"checked":"")."></td>
							<td width=\"99%\">$q[country]</td>
						</tr>";
			}
			$return.="</table>";
	
			return $return;
		} else {
			$return=0;
			$return="No countries found in database!";
	
			return $return;
		}
	}
}
Exemplo n.º 24
0
	//authenticate
	$u=0;
	$u=mysqlquery("select * from vl_users where lower(email)='".strtolower($email)."'");
	if(mysqlnumrows($u)) {
		while($un=mysqlfetcharray($u)) {
			if(strtolower($email)==strtolower($un["email"])) {
				//email authentic
				if(vlSimpleDecrypt($un["xp"])==hash("sha256",$pass)) {
					//has this account been de-activated?
					if(!$un["active"]) {
						go("/login/in/");
					} else {
						//register session variables
						$_SESSION["VLEMAIL"]=$email;
						//log
						mysqlquery("update vl_users set lastLogin='******' where email='$_SESSION[VLEMAIL]'");
						//redirect
						go("/dashboard/welcome/");
					}
				} else {
					go("/login/er/");
				}
			}
		}
	} else {
		go("/login/er/");
	}
}
?>
<p><img src="/images/spacer.gif" width="5" height="5"></p>
<table width="45%" border="0" cellspacing="0" cellpadding="0" align="center">
<?
//register a globals variable for security
$GLOBALS['vlDC']=true;
include "conf.php";

//CSV File
$csv=0;
$csv="Query,RemovedData,Date,User\n";

//compile $from and $to
$from=0;
$from="$fromYear-$fromMonth-$fromDay";

$to=0;
$to="$toYear-$toMonth-$toDay";
	
$query=0;
$query=mysqlquery("select * from vl_logs_removals where date(created)>='$from' and date(created)<='$to'");
if(mysqlnumrows($query)) {
	$q=array();
	while($q=mysqlfetcharray($query)) {
		$csv.=preg_replace("/,/is","",$q["sqlQuery"]).",".preg_replace("/,/is","",$q["removedData"]).",".getFormattedDateLessDay($q["created"]).",$q[createdby]\n";
	}
}

//output
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=".($id?"$qFilename":"download.csv"));
print $csv;
?>
Exemplo n.º 26
0
              <input name="option" type="hidden" id="option" value="<?php 
echo $task;
?>
">
              </td>
            </tr>
          </table>
        </form>
		<?
		}
		
        $query=0;
		if($facilityName) {
	        $query=mysqlquery("select * from vl_facilities where facility like '%$facilityName%' order by facility");
		} else {
	        $query=mysqlquery("select * from vl_facilities where districtID='$districtID' order by facility");
		}
		$num=0;
		$num=mysqlnumrows($query);
        if($num) {
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="vl_tdsub" style="padding-left:20px"><? if($facilityName) { echo number_format((float)$num)." facilit".($num==1?"y":"ies")." matching the search phrase <strong>$facilityName</strong>"; } else { ?><strong>Facilities in <?php 
echo getDetailedTableInfo2("vl_districts", "id='{$districtID}'", "district");
?>
 District</strong><? } ?></td>
                        </tr>
		<script src="/js/jquery.qrcode.min.js" type="text/javascript"></script>
	</head>
	<body>
		<div id="print-btn-div" style='text-align:center; padding:20px;'><button id="print-btn" class='btn btn-primary' >PRINT</button></div>
	
		<?php 
$row = mysqlfetcharray($results);
extract($row, EXTR_PREFIX_ALL, "row");
$machine_type = $row_machineType;
$factor = $row_factor;
$signature_path = $row_signaturePATH;
include "_sample_print.php";
if ($row_verify_outcome == "Rejected") {
    mysqlquery("insert into vl_logs_printedrejectedresults \n\t\t\t\t\t    (sampleID, created, createdby ) \n\t\t\t\t\t    values ('{$row_id}', '{$datetime}', '{$trailSessionUser}') ");
} elseif (!empty($row_worksheetID)) {
    mysqlquery("insert into vl_logs_printedresults \n\t\t\t\t\t\t(sampleID,worksheetID,created,createdby) \n\t\t\t\t\t\tvalues ('{$row_id}','{$row_worksheetID}','{$datetime}','{$trailSessionUser}');");
}
?>

		<script type="text/javascript">
		jQuery(function(){
			jQuery('.qrcode-output').each(function (index){
				var val = $(this).attr("value");
				$(this).qrcode({
					text: val,
					width: 75,
					height:75
				});
			});			
		});
Exemplo n.º 28
0
* task 9: match the districtID and hubID within vl_samples to the facility within vl_facilities
* task 10: remove facilities with no samples
* task 11: populate vl_results_merged
*/

//task 11: populate vl_results_merged, begin with abbott
$query=0;
$query=mysqlquery("select * from vl_results_abbott");
if(mysqlnumrows($query)) {
	while($q=mysqlfetcharray($query)) {
		//factor
		$factor=0;
		$factor=getDetailedTableInfo2("vl_results_multiplicationfactor","worksheetID='$q[worksheetID]' limit 1","factor");
		if(!$factor) {
			$factor=1;
		}
		//alphanumeric result
		$resultAlphanumeric=0;
		$resultAlphanumeric=getVLResult("abbott",$q["worksheetID"],$q["sampleID"],$factor);
		//numeric result
		$resultNumeric=0;
		$resultNumeric=getVLNumericResultOnly($resultAlphanumeric);
		mysqlquery("insert ignore into vl_results_merged 
						(machine,worksheetID,vlSampleID,resultAlphanumeric,
							resultNumeric,created,createdby) 
						values 
						('abbott','$q[worksheetID]','$q[sampleID]','$resultAlphanumeric',
							'$resultNumeric','$q[created]','$q[createdby]')");
	}
}
?>
$methodUsed=0;
if($machineType=="abbott") {
	$resultsTable="vl_results_abbott";
	$resultsSampleType="sampleID";
	$resultField="result";
	$methodUsed="Abbott Real time HIV-1 PCR";
} elseif($machineType=="roche") {
	$resultsTable="vl_results_roche";
	$resultsSampleType="SampleID";
	$resultField="Result";
	$methodUsed="HIV-1 RNA PCR Roche";
}

//log the print of this form
mysqlquery("insert into vl_logs_printedresults 
				(sampleID,worksheetID,created,createdby) 
				values 
				('$sampleID','$worksheetID','$datetime','$trailSessionUser')");

$facilityID=0;
$facilityID=getDetailedTableInfo2("vl_samples","id='$sampleID'","facilityID");
$facilityName=0;
$facilityName=getDetailedTableInfo2("vl_facilities","id='$facilityID'","facility");

$districtID=0;
$districtID=getDetailedTableInfo2("vl_samples","id='$sampleID'","districtID");
$districtName=0;
$districtName=getDetailedTableInfo2("vl_districts","id='$districtID'","district");

$hubID=0;
$hubID=getDetailedTableInfo2("vl_samples","id='$sampleID'","hubID");
$hubName=0;
Exemplo n.º 30
0
/**
* log search query
* @param: $refNumber
*/
function logDownloadedVLClinicalForms($refNumber) {
	global $datetime,$trailSessionUser;
	if(!getDetailedTableInfo2("vl_logs_downloadedclinicalforms","refNumber='$refNumber' limit 1","id")) {
		mysqlquery("insert into vl_logs_downloadedclinicalforms 
						(refNumber,created,createdby) 
						values 
						('$refNumber','$datetime','$trailSessionUser')");
	}
}