/**
* function to randomly encrypt a string
* generate random string
* append to vl encrypted string
* base64_encrypt the string
*/
function vlRencrypt($string) {
	//return encrypted string
	return generateRandomString().vlEncrypt($string);
}
                          <td class="vl_tdsub" width="10%"><strong>Other&nbsp;ID</strong></td>
                          <td class="vl_tdsub" width="5%" align="center"><strong>Samples</strong></td>
                          <td class="vl_tdsub" width="70%"><strong>Facility</strong></td>
                          <td class="vl_tdsub" width="4%"><strong>Options</strong></td>
                        </tr>
                    	<?
                        $count=0;
                        $count=$offset;
                        $q=array();
                        while($q=mysqlfetcharray($query)) {
                            $count+=1;
							$numberSamples=0;
							$numberSamples=getDetailedTableInfo3("vl_samples","patientID='$q[id]'","count(id)","num");
							$sampleURL=0;
							if($numberSamples==1) {
								$sampleURL="href=\"/samples/find.and.edit/search/".vlEncrypt(getDetailedTableInfo2("vl_samples","patientID='$q[id]'","vlSampleID"))."/\"";
							} elseif($numberSamples>1) {
								$sampleURL="href=\"#rn\" onclick=\"iDisplayMessage('/samples/preview/$q[id]/')\"";
							}
                        ?>
                            <tr onMouseover="this.bgColor='#f0e6dd'" onMouseout="this.bgColor='#FFFFFF'">
                                <td class="<?php 
echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder";
?>
"><?php 
echo $count;
?>
</td>
                                <td class="<?php 
echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder";
?>
                          <tr>
                            <td style="padding:5px 0px 0px 0px"><a href="#" onclick="sendPassword(this)" class="vl_brown_link">Forgotten password?</a></td>
                          </tr>
                        </table>
                      </td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#cccccc" style="padding:20px; border-top: 1px #b3b3b3 solid; background-image:url(/images/login.bg.prelogin.jpg); background-repeat: no-repeat; background-position: center right"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="vl">
              <tr>
                <td><input type="submit" name="Submit" value="login" class="button" />
                  <input name="redirect" type="hidden" id="redirect" value="<?php 
echo $redirect ? $redirect : vlEncrypt($_SERVER['REQUEST_URI']);
?>
" />
                  <input name="login" type="hidden" id="login" value="1" />
                  </td>
              </tr>
            </table></td>
          </tr>
        </table>
        			</form>
        </td>
        <td background="/images/bg.right.gif"><img src="/images/spacer.gif" width="11" height="11"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
Beispiel #4
0
											go("/samples/manage.patients/search/".vlEncrypt($searchQuery)."/");
										break;
										case "VerifySamples":
											go("/verify/search/".vlEncrypt($searchQuery)."/");
										break;
										case "unVerifySamples":
											go("/verify/search.unverified/".vlEncrypt($searchQuery)."/");
										break;
										case "Worksheets":
											go("/worksheets/manage/search/".vlEncrypt($searchQuery)."/");
										break;
										case "GeneratedForms":
											go("/generateforms/search/".vlEncrypt($searchQuery)."/1/");
										break;
										case "Results":
											go("/results/search/".vlEncrypt($searchQuery)."/");
										break;
										case advanced:
											include "tpl.search.advanced.php";
										break;
									}
								}
                            break;
                            case generateforms:
                                include "tpl.generateforms.php";
                            break;
                            case worksheets:
                                include "tpl.worksheets.php";
                            break;
							case reports:
                                include "tpl.reports.php";
		$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 
echo mysqlnumrows($xquery) != 1 ? "s" : "";
?>
 found while searching for <strong><?php 
echo $searchQuery;
?>
</strong></td>
            </tr>
                <tr>
                                ?>
                                  </div>
                  			</td>
                        </tr>
                    </table>
                    <!-- End Printed/Not Printed Items -->
              </td>
            </tr>
            <tr>
              <td style="padding:10px 0px 10px 0px">
              	<input type="hidden" name="rawQuery" id="rawQuery" value="<?php 
echo vlEncrypt($rawQuery);
?>
" />
              	<input type="hidden" name="xRawQuery" id="xRawQuery" value="<?php 
echo vlEncrypt($xRawQuery);
?>
" />
              	<input type="hidden" name="machineType" id="machineType" value="<?php 
echo $machineType;
?>
" />
              	<input type="hidden" name="sampleIDField" id="sampleIDField" value="<?php 
echo $sampleIDField;
?>
" />
              	<input type="submit" name="printResults" id="printResults" class="button" value="  Print Selected Results  " onclick="document.pressed=this.value" /> 
                <input type="submit" name="dispatchResults" id="dispatchResults" class="button" value="  Dispatch Selected Results  " onclick="document.pressed=this.value" /> 
				<? if(($facilityID || $worksheetID) && $numberPages>1) { ?><input type="submit" name="dispatchResults" id="dispatchResults" class="button" value="  Dispatch All <?php 
echo number_format((double) $numberRecords);
?>
Beispiel #7
0
									'$machineType','".preg_replace("/,/s","",preg_replace("/&lt;/is","<",$result))."','".(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Accepted' and created!='' limit 1","id")?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Accepted' limit 1","created")):"")." ".(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Accepted' and created!='' limit 1","id")?getFormattedTimeLessS(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Accepted' limit 1","created")):"")."',
									'".(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' and created!='' limit 1","id")?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' limit 1","created")):"")." ".(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' and created!='' limit 1","id")?getFormattedTimeLessS(getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' limit 1","created")):"")."',
									'".preg_replace("/'/s","\'",preg_replace("/,/s","",getDetailedTableInfo2("vl_appendix_samplerejectionreason","id='".getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]' and outcome='Rejected' limit 1","outcomeReasonsID")."' limit 1","appendix")))."','".(getDetailedTableInfo2("vl_samples_worksheet","sampleID='$q[id]' and created!='' limit 1","id")?getRawFormattedDateLessDay(getDetailedTableInfo2("vl_samples_worksheet","sampleID='$q[id]' order by created desc limit 1","created")):"")." ".(getDetailedTableInfo2("vl_samples_worksheet","sampleID='$q[id]' and created!='' limit 1","id")?getFormattedTimeLessS(getDetailedTableInfo2("vl_samples_worksheet","sampleID='$q[id]' order by created desc limit 1","created")):"")."',
									'".($dateLatestResultsUploaded?getRawFormattedDateLessDay($dateLatestResultsUploaded):"")." ".($dateLatestResultsUploaded?getFormattedTimeLessS($dateLatestResultsUploaded):"")."','".($dateLatestResultsPrinted?getRawFormattedDateLessDay($dateLatestResultsPrinted):"")." ".($dateLatestResultsPrinted?getFormattedTimeLessS($dateLatestResultsPrinted):"")."',
									'".getRawFormattedDateLessDay($q["receiptDate"])." 10:00','".($dateFirstPrinted?getRawFormattedDateLessDay($dateFirstPrinted):"")." ".($dateFirstPrinted?getFormattedTimeLessS($dateFirstPrinted):"")."','".getRawFormattedDateLessDay($q["created"])." ".getFormattedTimeLessS($q["created"])."')");
			}
		}

		//to avoid conflicts, remove file if exists
		if(file_exists("$path"."$downloadFileName")) {
			unlink("$path"."$downloadFileName");
		}
		//export the file
		mysqlquery("select distinct * into outfile '$path"."$downloadFileName' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' from vl_output_samplescsv");

		go("/reports/downloads/success/".vlEncrypt("$pathURL"."$downloadFileName")."/");
	break;
	case "samplesreceivedexcel":
		//filename of the excel file to be downloaded
		$filename=0;
		$filename="excel.samplesreceived.".getFormattedDateCRB($datetime).".xls";

		//create an instance of the class
		$xls = new ExportXLS($filename);

		//period
		$from=0;
		$from="$fromYear-$fromMonth-$fromDay";
		$to=0;
		$to="$toYear-$toMonth-$toDay";
		
		$result=0;
		$rawResult=0;
		if($type=="roche") {
			$rawResult=getDetailedTableInfo2("vl_results_roche","worksheetID='$worksheetID' and SampleID='$sampleNumber' order by created desc limit 1","Result");
		} elseif($type=="abbott") {
			$rawResult=getDetailedTableInfo2("vl_results_abbott","worksheetID='$worksheetID' and sampleID='$sampleNumber' order by created desc limit 1","result");
		}
		$result=getVLResult($type,$worksheetID,$sampleNumber,$factor);
		
		$contents[]="<div align=\"center\" class=\"vls\">$i</div>
						<div align=\"center\" class=\"vls\" style=\"padding:3px 0px 0px 0px\">Patient ART #: $patientART</div> 
						<div align=\"center\" class=\"vls\" style=\"padding:3px 0px 0px 0px\">Other ID: $otherID</div> 
						<div align=\"center\" class=\"vls\" style=\"padding:1px 0px 0px 0px\">Sample #: $sampleNumber</div> 
						".($locationID?"<div align=\"center\" class=\"vls\" style=\"padding:1px 0px 0px 0px\">Location ID: $locationID</div> ":"")."
						<div align=\"center\" class=\"vls\" style=\"padding:1px 0px 0px 0px\">Form #: $formNumber</div> 
						<div align=\"center\" style=\"padding:5px 0px\"><img src=\"/worksheets/image/".vlEncrypt($sampleNumber)."/\" /></div>
						".($rawResult?"<div align=\"center\" class=\"vls\" style=\"padding:5px 0px 0px 0px; border-top: 1px dashed #cccccc\">Result: $result</div>":"");

		//log printed status
		if(!getDetailedTableInfo2("vl_logs_worksheetsamplesviewed","sampleID='$sampleID' and worksheetID='$worksheetID' limit 1","id")) {
			mysqlquery("insert into vl_logs_worksheetsamplesviewed 
							(sampleID,worksheetID,created,createdby) 
							values 
							('$sampleID','$worksheetID','$datetime','$trailSessionUser')");
		}
	}
}
?>
<div class="vl" style="padding:0px 0px 10px 0px; border-bottom: 1px dashed #cccccc">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="vls">
      <!--
								'".($viralLoadTestingIndication=="vlTestingSuspectedTreatmentFailure"?$suspectedTreatmentFailureLastVLDate:"")."',
								'".($viralLoadTestingIndication=="vlTestingSuspectedTreatmentFailure"?$suspectedTreatmentFailureValue:"")."',
								'".($viralLoadTestingIndication=="vlTestingSuspectedTreatmentFailure"?$suspectedTreatmentFailureSampleTypeID:"")."',
								
								'$lrCategory','$lrEnvelopeNumber','$lrNumericID',
								
								'$datetime','$trailSessionUser')");
			
			if(mysqlerror())
				die("3: ".mysqlerror());

			//review logs and fix any duplicates
			fixDuplicateSampleIDs();
			
			//redirect accordingly
			go("/samples/success/".vlEncrypt(getDetailedTableInfo2("vl_samples","createdby='$trailSessionUser' order by created desc limit 1","vlSampleID"))."/");
		} else {
			$error.="<br /><strong>Duplicate Data Entry</strong><br /> Patient with ART Number <strong>$artNumber</strong> from <strong>".getDetailedTableInfo2("vl_facilities","id='$facilityID' limit 1","facility")."</strong> has already been entered with Form Number <strong>$formNumber</strong>.<br /> Kindly input this record with an alternative Form or ART Number.<br />";
		}
	}
}
?>
<script Language="JavaScript" Type="text/javascript">
<!--
function validate(samples) {
	//check for missing information
	if(!document.samples.lrCategory.value) {
		alert('Missing Mandatory Field: Location/Rejection ID');
		document.samples.lrCategory.focus();
		return (false);
	}