Exemplo n.º 1
0
/**
* 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;
}
                                          <option value="06">Jun</option>
                                          <option value="07">Jul</option>
                                          <option value="08">Aug</option>
                                          <option value="09">Sept</option>
                                          <option value="10">Oct</option>
                                          <option value="11">Nov</option>
                                          <option value="12">Dec</option>
                                          </select></td>
                                        <td style="padding:0px 0px 0px 5px"><select name="suspectedTreatmentFailureLastVLDateYear" id="suspectedTreatmentFailureLastVLDateYear" class="search">
                                          		<?
												if($suspectedTreatmentFailureLastVLDate) {
													echo "<option value=\"".getFormattedDateYear($suspectedTreatmentFailureLastVLDate)."\" selected=\"selected\">".getFormattedDateYear($suspectedTreatmentFailureLastVLDate)."</option>";
												} else {
													echo "<option value=\"\" selected=\"selected\">Select Year</option>";
												}
												for($j=getFormattedDateYear(getDualInfoWithAlias("last_day(now())","lastmonth"));$j>=(getCurrentYear()-10);$j--) {
                                                    echo "<option value=\"$j\">$j</option>";
                                                }
                                                ?>
                                          </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">
Exemplo n.º 3
0
 public function newEvaluation()
 {
     $programId = $this->input->post('programId');
     $startYear = $this->input->post('evaluation_start_year');
     $endYear = $this->input->post('evaluation_end_year');
     $currentYear = getCurrentYear();
     $evaluation = array('id_program' => $programId, 'start_year' => $startYear, 'end_year' => $endYear);
     if ($currentYear !== FALSE) {
         $evaluation['current_year'] = $currentYear;
     }
     $this->load->model('program_evaluation_model', 'evaluation');
     $evaluationId = $this->evaluation->saveProgramEvaluation($evaluation);
     if ($evaluationId !== FALSE) {
         $dimensionsOk = $this->initiateDimensionsToEvaluation($evaluationId);
         if ($dimensionsOk) {
             $status = "success";
             $message = "Avaliação salva com sucesso.";
         } else {
             $status = "danger";
             $message = "Não foi possível salvar algumas dimensões da avaliação. Tente novamente.";
         }
     } else {
         $status = "danger";
         $message = "Não foi possível salvar a avaliação. Tente novamente.";
     }
     $this->session->set_flashdata($status, $message);
     redirect('coordinator/coordinator_programs');
 }
                                          <option value="07">Jul</option>
                                          <option value="08">Aug</option>
                                          <option value="09">Sept</option>
                                          <option value="10">Oct</option>
                                          <option value="11">Nov</option>
                                          <option value="12">Dec</option>
                                          </select></td>
                                        <td style="padding:0px 0px 0px 5px"><select name="assayDateYear" id="assayDateYear" class="search">
                                          <?
											if($assayDate) {
												echo "<option value=\"".getFormattedDateYear($assayDate)."\" selected=\"selected\">".getFormattedDateYear($assayDate)."</option>";
											} else {
												echo "<option value=\"\" selected=\"selected\">Select Year</option>"; 
											}
											
											for($j=getFormattedDateYear($datetime);$j<=(getCurrentYear()+10);$j++) {
												echo "<option value=\"$j\">$j</option>";
											}
                                            ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                        </tr>
                        <tr>
                          <td style="padding:10px 0px 5px 0px">Include&nbsp;Calibrators&nbsp;in&nbsp;Worksheet</td>
                          <td style="padding:10px 0px 5px 0px"><input name="includeCalibrators" id="includeCalibrators" type="checkbox" value="1" <?php 
echo $includeCalibrators ? "checked=\"checked\"" : "";
?>
 /></td>
                        </tr>
                      </table>
Exemplo n.º 5
0
                                <td background="/images/bg.bottom.gif" width="100%"><img src="/images/spacer.gif" width="11" height="11"></td>
                                <td background="/images/bg.bottom.right.gif"><img src="/images/spacer.gif" width="11" height="11"></td>
                              </tr>
                            </table></td>
                          </tr>
                        </table>
                        <!-- End Center Table -->
                        </td>
                      </tr>
					<!-- Begin Footer -->
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="50%" class="vls" style="padding:10px 0px 0px 0px"><strong>Viral Load</strong></td>
                            <td width="50%" class="vl" align="right" style="padding:10px 7px 0px 0px">Ministry of Health, The Republic of Uganda &copy; Copyright <?php 
echo getCurrentYear();
?>
</td>
                          </tr>
                        </table>
                        </td>
                      </tr>
					<!-- End Footer -->
                    </table>
</td>
      </tr>
    </table>
    </body>
<? } else { ?>
    <style type="text/css">
    <!--
Exemplo n.º 6
0
 protected function isMenuValid()
 {
     // We have the following pattern to search for the menu validity:
     // Du [day_number] au [day_number] [month_name]
     $keys = findRegExpFromTextFile('pdf_texts/' . $this->getSimpleName() . '.txt', "/Du\\s+\\d*\\sau\\s+\\d*\\s+.+/");
     $rangeCheck = true;
     if ($keys) {
         $first = current(array_filter($keys));
         if ($first) {
             $line = current(array_filter($first));
         }
     }
     if ($line) {
         // [0] = Du, [1] = startDay number, [2] = au, [3] enDay number, [4] = month name
         $parts = preg_split('/\\s+/', trim($line));
         if (count($parts) == 5) {
             $startDayNumber = intval($parts[1]);
             $endDayNumber = intval($parts[3]);
             $monthNumber = convertMonthNameToNumber(strtolower($parts[4]));
             $startDate = $startDayNumber . '-' . $monthNumber . '-' . getCurrentYear() . ' 00:01';
             $endDate = $endDayNumber . '-' . $monthNumber . '-' . getCurrentYear() . ' 23:59';
             $currentDate = getCurrentDate();
             $rangeCheck = false;
             $rangeCheck = checkInRange($startDate, $endDate, intval($currentDate->format('U')));
         }
     }
     return $rangeCheck;
 }
Exemplo n.º 7
0
                                          <option value="02">Feb</option>
                                          <option value="03">Mar</option>
                                          <option value="04">Apr</option>
                                          <option value="05">May</option>
                                          <option value="06">Jun</option>
                                          <option value="07">Jul</option>
                                          <option value="08">Aug</option>
                                          <option value="09">Sept</option>
                                          <option value="10">Oct</option>
                                          <option value="11">Nov</option>
                                          <option value="12">Dec</option>
                                          </select></td>
                                        <td style="padding:0px 0px 0px 5px"><select name="receivedDateYear" id="receivedDateYear" class="search">
                                          <?
										  		echo "<option value=\"".getFormattedDateYear($created)."\" selected=\"selected\">".getFormattedDateYear($created)."</option>";
                                                for($j=getFormattedDateYear($datetime);$j>=(getCurrentYear()-10);$j--) {
                                                    echo "<option value=\"$j\">$j</option>";
                                                }
                                                ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                        </tr>
                      </table>
                    </fieldset>
                </td>
            </tr>
            <tr>
              <td style="padding:10px 0px 0px 0px"><input type="submit" name="saveEnvelope" id="saveEnvelope" class="button" value="     Save Changes to Envelope     " /></td>
            </tr>
            <tr>
Exemplo n.º 8
0
                                          <option value="01">Jan</option>
                                          <option value="02">Feb</option>
                                          <option value="03">Mar</option>
                                          <option value="04">Apr</option>
                                          <option value="05">May</option>
                                          <option value="06">Jun</option>
                                          <option value="07">Jul</option>
                                          <option value="08">Aug</option>
                                          <option value="09">Sept</option>
                                          <option value="10">Oct</option>
                                          <option value="11">Nov</option>
                                          <option value="12">Dec</option>
                                          </select></td>
                                        <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>";
Exemplo n.º 9
0
<?php 
require_once APPPATH . 'controllers/program.php';
$programName = array("name" => "program_name", "id" => "program_name", "type" => "text", "class" => "form-campo", "class" => "form-control", "maxlength" => "40");
$programAcronym = array("name" => "program_acronym", "id" => "program_acronym", "type" => "text", "class" => "form-campo", "class" => "form-control", "maxlength" => "6");
$submitBtn = array("id" => "sregister_new_program", "class" => "btn bg-olive btn-block", "content" => "Cadastrar programa", "type" => "submit");
$program = new Program();
$programArea = $program->getAllProgramAreas();
if ($programArea === FALSE) {
    $programArea = array("Nenhuma área cadastrada.");
}
$openingYear = array();
$currentYear = getCurrentYear();
if ($currentYear !== FALSE) {
    for ($i = 1990; $i <= $currentYear + 2; $i++) {
        $openingYear[$i] = $i;
    }
} else {
    $openingYear[] = "Ocorreu um erro ao ler o ano do banco de dados";
    $submitBtn['disabled'] = TRUE;
}
?>

<div class="form-box" id="login-box">
	<div class="header">Cadastrar um novo Programa</div>
	<?php 
echo form_open("program/newProgram");
?>
		<div class="body bg-gray">
			<div class="form-group">	
				<?php 
           <option value="01">January</option>
           <option value="02">February</option>
           <option value="03">March</option>
           <option value="04">April</option>
           <option value="05">May</option>
           <option value="06">June</option>
           <option value="07">July</option>
           <option value="08">August</option>
           <option value="09">September</option>
           <option value="10">October</option>
           <option value="11">November</option>
           <option value="12">December</option>
         </select></td>
         <td style="padding:0px 0px 0px 5px"><select name="toYear" id="toYear" class="search">
           <?
                 for($j=(getFormattedDateYear($datetime)-5);$j<=(getCurrentYear()+50);$j++) {
                     echo "<option value=\"$j\"".($j==getFormattedDateYear($datetime)?" selected=\"selected\"":"").">$j</option>";
                 }
                 ?>
         </select></td>
       </tr>
     </table></td>
   </tr>
   <tr>
     <td>&nbsp;</td>
     <td style="padding:0px 0px 0px 0px">
         <input type="submit" name="downloadXLS" id="downloadXLS" onclick="document.pressed=this.value" value="   Download Excel   " class="button" />
         <!--<input type="submit" name="downloadCSV" id="downloadCSV" onclick="document.pressed=this.value" value="   Download CSV   "    class="button" />-->
     </td>
   </tr>
 </table>
Exemplo n.º 11
0
			<div class="form-group">
				<?php 
echo form_label("Natureza da despesa", "nature");
?>
				<?php 
echo form_dropdown('type', $types);
?>
			</div>

			<div class="form-group">
				<?php 
echo form_label("Ano", "year");
?>
				<?php 
echo form_input(array("name" => "year", "id" => "year", "type" => "number", "class" => "form-campo", "value" => getCurrentYear()));
?>
			</div>

			<div class="form-group">
				<?php 
echo form_label("Mês da liberação", "month");
?>
<br>
				<?php 
echo form_dropdown('month', $months);
?>
			</div>

			<div class="footer body bg-gray">
				<div class="row">
Exemplo n.º 12
0
 static function getProximoAnoPorMesReferencia($mesReferencia)
 {
     $proximoMes = getProximoMes($mesReferencia);
     $ano = getCurrentYear();
     if ($proximoMes == 1) {
         ++$ano;
     }
     return $ano;
 }
Exemplo n.º 13
0
 function getFilter($selectedPeriod = "x")
 {
     // get flash message from CI instance
     $range = null;
     switch ($selectedPeriod) {
         case '01':
             $range = getRange_for_month('01');
             break;
         case '02':
             $range = getRange_for_month('02');
             break;
         case '03':
             $range = getRange_for_month('03');
             break;
         case '04':
             $range = getRange_for_month('04');
             break;
         case '05':
             $range = getRange_for_month('05');
             break;
         case '06':
             $range = getRange_for_month('06');
             break;
         case '07':
             $range = getRange_for_month('07');
             break;
         case '08':
             $range = getRange_for_month('08');
             break;
         case '09':
             $range = getRange_for_month('09');
             break;
         case '10':
             $range = getRange_for_month('10');
             break;
         case '11':
             $range = getRange_for_month('11');
             break;
         case '12':
             $range = getRange_for_month('12');
             break;
         case '1q':
             $range = getRange_for_quarter('1q');
             break;
         case '2q':
             $range = getRange_for_quarter('2q');
             break;
         case '3q':
             $range = getRange_for_quarter('3q');
             break;
         case '4q':
             $range = getRange_for_quarter('4q');
             break;
         case 'year':
             $range = getCurrentYear();
             break;
         default:
             $range = getRange_for_quarter(getCurrentQuarter());
             break;
     }
     return $range;
 }