//to be edited: ensure lrCategory, lrEnvelopeNumber and lrNumericID are unique if supplied if($lrCategory && $lrEnvelopeNumber && $lrEnvelopeNumber!="Envelope #" && $lrNumericID) { if(getDetailedTableInfo2("vl_samples","lrCategory='$lrCategory' and lrEnvelopeNumber='$lrEnvelopeNumber' and lrNumericID='$lrNumericID' and id!='$modify' limit 1","id")) { $error.="<br /><strong>Duplicate ".($lrCategory=="V"?"Location":"Rejection")." ID '$lrCategory"."$lrEnvelopeNumber/$lrNumericID'.</strong><br />The ".($lrCategory=="V"?"Location":"Rejection")." ID <strong>$lrCategory"."$lrEnvelopeNumber/$lrNumericID</strong> was entered on <strong>".getFormattedDate(getDetailedTableInfo2("vl_samples","lrCategory='$lrCategory' and lrEnvelopeNumber='$lrEnvelopeNumber' and lrNumericID='$lrNumericID' and id!='$modify' limit 1","created"))."</strong> by <strong>".getDetailedTableInfo2("vl_samples","lrCategory='$lrCategory' and lrEnvelopeNumber='$lrEnvelopeNumber' and lrNumericID='$lrNumericID' and id!='$modify' limit 1","createdby")."</strong> <a href=\"#\" onclick=\"iDisplayMessage('/verify/preview/".getDetailedTableInfo2("vl_samples","lrCategory='$lrCategory' and lrEnvelopeNumber='$lrEnvelopeNumber' and lrNumericID='$lrNumericID' and id!='$modify' limit 1","id")."/1/noedit/')\">Click here to see the entry</a>.<br /> Kindly input this record with an alternative ".($lrCategory=="V"?"Location":"Rejection")." ID.<br />"; } } //to be activated: ensure lrCategory, lrEnvelopeNumber and lrNumericID are supplied if(!$lrCategory && (!$lrEnvelopeNumber || $lrEnvelopeNumber==$default_envelopeNumber) && !$lrNumericID) { $error.="<br /><strong>".($lrCategory=="V"?"Location":"Rejection")." ID is Missing</strong><br />Kindly provide a ".($lrCategory=="V"?"Location or Rejection":"Rejection or Location")." ID<br />"; } //to be edited: ensure envelope number is valid if($lrCategory && $lrEnvelopeNumber && $lrEnvelopeNumber!="Envelope #" && $lrNumericID) { if(!preg_match("/^[0-9]{4}[\-]{1}[0-9]{1,5}$/",$lrEnvelopeNumber)) { $error.="<br /><strong>Incorrect Envelope Number '$lrEnvelopeNumber'.</strong><br />Correct Envelope Number Format is ".getFormattedDateYearShort($datetime).getFormattedDateMonth($datetime)."-00001.<br /> Kindly resubmit with a Valid Envelope Number.<br />"; } } //ensure form number is unique if(getDetailedTableInfo2("vl_samples","formNumber='$formNumber' and id!='$modify' limit 1","id")) { $error.="<br /><strong>Duplicate Form Number '$formNumber'.</strong><br />The Form Number <strong>$formNumber</strong> was entered on <strong>".getFormattedDate(getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","created"))."</strong> by <strong>".getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","createdby")."</strong> <a href=\"#\" onclick=\"iDisplayMessage('/verify/preview/".getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","id")."/1/noedit/')\">Click here to see the entry</a>.<br /> Kindly input this record with an alternative Form Number.<br />"; } //ensure form number is numeric if(!is_numeric($formNumber)) { $error.="<br /><strong>Form Number '$formNumber' is Not Numeric.</strong><br />The Form Number should be Numeric i.e it should not contain alphanumeric characters e.g A-Z.<br />"; } //ensure form number is valid if(!getDetailedTableInfo2("vl_forms_clinicalrequest","formNumber='$formNumber' or formNumber='".($formNumber/1)."' limit 1","id")) {
/** * function to generate a unique print number for abbott */ function generateWorksheetReferenceNumber() { global $trailSessionUser,$datetime; //get the user's names $names=0; $names=getDetailedTableInfo2("vl_users","email='$trailSessionUser' limit 1","names"); $namesArray=array(); $namesArray=explode(" ",$names); $initials=0; if(count($namesArray)>1) { //get the first letter of each name $initials=substr(trim($namesArray[0]),0,1); $initials.=substr(trim($namesArray[1]),0,1); $initials=strtoupper($initials); } else { //get the first 2 letters of the email $initials=substr(trim($trailSessionUser),0,2); $initials=strtoupper($initials); } //variables $number=0; $number=getDetailedTableInfo3("vl_samples_worksheetcredentials","year(created)='".getCurrentYear()."' and month(created)='".getCurrentMonth()."'","count(id)","num"); $number+=1; $reference=0; $reference=getFormattedDateYearShort($datetime).getFormattedDateMonth($datetime); switch(strlen($number)) { case 1: $reference.=$initials."00$number"; break; case 2: $reference.=$initials."0$number"; break; default: $reference.=$initials.$number; break; } return $reference; }
<tr> <td class="toplinks" style="padding:0px 0px 10px 0px"><a class="toplinks" href="/dashboard/">HOME</a> <a class="toplinks" href="/samples/">SAMPLES</a> <a class="toplinks" href="/samples/capture/">Samples Capture</a></td> </tr> <tr> <td> </td> </tr> <tr> <td> <fieldset style="width: 100%"> <legend><strong>FORM/FACILITY CREDENTIALS</strong></legend> <div style="padding:5px 0px 0px 0px"> <table width="100%" border="0" class="vl"> <tr> <td></td> <td><span id="envelopeInfoID" class="hint-down" style="margin-top: -50px; width: 310px; display:none">Incorrect Envelope # Format. Correct Format is <?php echo getFormattedDateYearShort($datetime) . getFormattedDateMonth($datetime) . "-001"; ?> . <span class="hint-down-pointer"></span></span></td> </tr> <tr> <td width="20%">Location/Rejection ID</td> <td width="80%"> <table width="10%" border="0" cellspacing="0" cellpadding="0" class="vl"> <tr> <td><select name="lrCategory" id="lrCategory" class="search" style="height:21px"> <? if($lrCategory) { echo "<option value=\"$lrCategory\" selected=\"selected\">$lrCategory</option> <option value=\"V\">V</option> <option value=\"R\">R</option>"; } else {
$datetime=0; //$datetime=getDualInfoWithAlias("convert_tz(now(),'$default_GMTtimezone:00','".getDetailedTableInfo2("vl_timezones",($c?"lower(country)='".strtolower($c)."'":"country='$default_country'"),"timezone")."')","datetime"); $datetime=getDualInfoWithAlias("now()","datetime"); $date=0; $date=getRawFormattedDateLessDay($datetime); $icurDate=0; $icurDate=getRawFormattedDateLessDay($datetime); $curTime=0; $curTime=getFormattedTime($datetime); /* * default envelope number * added 27/Feb/15 to aid staff in the entry of the Location/Rejection ID */ $default_envelopeNumber=0; $default_envelopeNumber=getFormattedDateYearShort($datetime).getFormattedDateMonth($datetime)."-"; //if the user has been idle for a certain period ($default_systemIdleWait mins), require them to login afresh. /* if($_SESSION["VLEMAIL"] && !$directlogin) { //get time since last activity hh:mm:ss 00:00:00 $time=0; $time=getDetailedTableInfo2("vl_logs_pagehits","createdby='$trailSessionUser' order by created desc limit 1","timediff(now(),created)"); //split this variable $timeA=array(); $timeA=explode(":",trim($time)); $tHour=0; $tMinute=0; $tSecond=0; $tHour=$timeA[0]/1; $tMinute=$timeA[1]/1;
/** * function to generate a credit application reference */ function generateFormNumberDeprecated($number,$batch) { global $datetime,$trailSessionUser; //variables $reference=0; $reference=getFormattedDateYearShort($datetime).getFormattedDateMonth($datetime)."-"; switch(strlen($number)) { case 1: $reference.="000$number"; break; case 2: $reference.="00$number"; break; case 3: $reference.="0$number"; break; default: $reference.=$number; break; } //log this entry into the db mysqlquery("insert into vl_forms_clinicalrequest (formNumber,refNumber,created,createdby) values ('$reference','$batch','$datetime','$trailSessionUser')"); return $reference; }