<td class="cell">&nbsp;</td>
	<td class="cell"><a href="admin.php?pagetoload=application_form.php&resident_id=<?php 
    echo $arrData[resident_id];
    ?>
&from=applications_list_accepted.php" class="table_link2"><?php 
    echo $arrData[name] . " " . $arrData[surname];
    ?>
</a></td>	
	<td class="cell">&nbsp;</td>
	<td class="cell"><?php 
    echo mostrar_fecha(substr($arrData[arrival], 0, 10));
    ?>
&nbsp;</td>
	<td class="cell">&nbsp;</td>
	<td class="cell"><?php 
    echo mostrar_fecha(substr($arrData[planned_departure], 0, 10));
    ?>
&nbsp;</td>
	<td class="cell">&nbsp;</td>
	<td class="cell"><?php 
    echo $room;
    ?>
&nbsp;</td>
	<td class="cell">&nbsp;</td>
	<td class="cell"><?php 
    echo $telephone;
    ?>
&nbsp;</td>
	<td class="cell">&nbsp;</td>
	<td class="cell"><?php 
    echo $arrData[city];
Пример #2
0
    while ($arrData = mysql_fetch_assoc($r)) {
        ?>
		<tr class="row1" onMouseOver="this.className='row_selected'" onMouseOut="this.className='row1'">	
		<td class="cell"><a href="admin.php?pagetoload=groups_members.php&group_id=<?php 
        echo $arrData[group_id];
        ?>
" class="table_link2"><?php 
        echo $arrData[name];
        ?>
</a></td>			
		<td class="cell"><?php 
        echo mostrar_fecha($arrData[arrival]);
        ?>
</td>
		<td class="cell"><?php 
        echo mostrar_fecha($arrData[departure]);
        ?>
</td>
		<td class="cell"><a href="javascript:delete_group(<?php 
        echo $arrData[group_id];
        ?>
,'<?php 
        echo $arrData[name];
        ?>
')"><img src="imgs/trash_16x16.gif" border="0"></a></td>
		</tr>		
		<?php 
    }
    ?>
	</table>
	<?php 
&from=residents_list.php" class="table_link2" <?php 
            echo $birthday;
            ?>
><?php 
            echo $arrData[surname] . ", " . $arrData[name];
            ?>
</a></td>
			  <td valign="middle" class="cell" <?php 
            echo $birthday;
            ?>
>&nbsp;</td>
			  <td valign="middle" class="cell" align="left" <?php 
            echo $birthday;
            ?>
><?php 
            echo mostrar_fecha(substr($arrData[date_of_birth], 0, 10));
            ?>
</td>
			  <td valign="middle" class="cell" <?php 
            echo $birthday;
            ?>
>&nbsp;</td>			  
			</tr>
			<?php 
        }
        ?>
	
		</table>	
		<?php 
    }
}
$arrClasses = array();
//The purpose of this page should only be to keep track of the residents who are currently in Netherhall.
$today = date('Y-m-d');
$r = mysql_query("SELECT residents.resident_id, NAME, surname " . "FROM residents LEFT JOIN bookings ON residents.resident_id = bookings.resident_id " . "WHERE bookings.status='accepted' AND bookings.done=0 AND bookings.arrival <= '{$today}' " . "GROUP BY residents.resident_id ORDER BY surname, NAME");
if (mysql_num_rows($r)) {
    ?>
	<table align="center" border="1" cellpadding="4" cellspacing="0">
	<?php 
    while ($arrInfo = mysql_fetch_assoc($r)) {
        $total_outstanding = 0;
        $r2 = mysql_query("SELECT * FROM residents LEFT JOIN bookings ON residents.resident_id = bookings.resident_id " . "WHERE bookings.status='accepted' AND residents.resident_id={$arrInfo[resident_id]} " . "ORDER BY NAME, surname, bookings.arrival");
        while ($arrData = mysql_fetch_assoc($r2)) {
            //ver_array("arrData",$arrData);
            $date_from = mostrar_fecha($arrData['arrival']);
            $date_to = mostrar_fecha($arrData['planned_departure']);
            $days = subtract_dates($date_from, $date_to);
            $total_rent = $days * ($arrData['weekly_rate'] / 7);
            $total_rent = round($total_rent, 2);
            $due = $total_rent + $arrData['laundry'] + $arrData['hc'] + $arrData['printing'] + $arrData['extra'];
            //$outstanding = $due - $arrData['deposit'] - $arrData['received'];
            $outstanding = $due - $arrData['received'];
            $outstanding = round($outstanding, 2);
            $name = "";
            if ($arrData[surname] != "") {
                $name = $arrData[surname] . ", ";
            }
            $name .= $arrData[name];
            if (mysql_num_rows($r2) < 2) {
                ?>
			<tr class="row1">
							<?
						}
						?>
                   	</table>
                  	</div>
					</td>
                	</tr>
                	<?					
					$div_num++;
					}																
						
				$r=mysql_query("SELECT * FROM bookings WHERE resident_id=$resident_id AND status='finished' ORDER BY arrival DESC");
				while ($arrAccomodation=mysql_fetch_assoc($r)) {		
					$date_from       = mostrar_fecha($arrAccomodation['arrival']);
					$date_to_planned = mostrar_fecha($arrAccomodation['departure']);
					$date_to         = mostrar_fecha($arrAccomodation['actual_departure']);
		
					$days=subtract_dates($date_from, $date_to_planned);
		
					// Search the name of the room
					if ($arrAccomodation[room_id]) {
						$r2=mysql_query("SELECT * FROM rooms WHERE room_id={$arrAccomodation[room_id]}");
						$room = "";
						if (mysql_numrows($r2))
							$room=mysql_result($r2,0,"room");				
					}
					
					//ver_array("arrAccomodation",$arrAccomodation);					
					$total_rent = $days * ($arrAccomodation['weekly_rate']/7);
					$total_rent = round($total_rent,2);					
					$due = $total_rent + $arrAccomodation['laundry'] + $arrAccomodation['hc'] + $arrAccomodation['printing'] + $arrAccomodation['extra'];
        ?>
		<TABLE width="900" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF">
		<TR><TD align="center" class="question">This room is booked for:</td></tr>
		<?php 
        while ($arrData = mysql_fetch_assoc($r2)) {
            ?>
			<TR>
			<TD align="center"><a href="admin.php?pagetoload=application_form.php&resident_id=<?php 
            echo $arrData[resident_id];
            ?>
&from=residents_list.php" class="table_link2"><?php 
            echo $arrData["name"] . " " . $arrData["surname"];
            ?>
</a>
			<?php 
            echo "<br>(Arrival: " . mostrar_fecha($arrData[arrival]) . " Departure: " . mostrar_fecha($arrData[planned_departure]) . ")";
            ?>
			</TD>
			</TR>
			<?php 
        }
        ?>
		</table>
		<br>
		<?php 
    } else {
        ?>
<p align="center" class="question">This room is free</p><?php 
    }
    button("admin.php?pagetoload=booking_busy_list.php", "Find again");
} else {
    echo $arrData[resident_id];
    ?>
" <? if ($arrData[interview]) echo 'checked'; ?>></td>
	<td class="cell">&nbsp;</td>
	<td class="cell">
	<input type="checkbox" name="off<?php 
    echo $arrData[resident_id];
    ?>
" <? if ($arrData[offered]) echo 'checked'; ?>>
	<?php 
    $offered_date = $request['odate' . $arrData[resident_id]];
    //echo "rules_date=($rules_date)<br>";
    if ($offered_date != "" && !valid_date($offered_date)) {
        echo "<br><font color=red>Invalid Date!</font>";
    } else {
        $offered_date = mostrar_fecha(substr($arrData[offered_date], 0, 10));
    }
    ?>
	<input type="text" name="odate<?php 
    echo $arrData[resident_id];
    ?>
" value="<?php 
    echo $offered_date;
    ?>
" size="8">
	</td>
	<td class="cell">&nbsp;</td>
	</tr>
	<?php 
}
if (mysql_num_rows($r)) {
$pdf->Cell(15, $high, "Due", $border, 0, 'R', true);
$pdf->Cell(15, $high, "Received", $border, 0, 'R', true);
$pdf->Cell(18, $high, "Outstanding", $border, 0, 'R', true);
$pdf->Ln();
//################################################################################################################
$total_outstanding = 0;
if ($resident_id) {
    $r = mysql_query("SELECT * FROM bookings WHERE resident_id={$resident_id} AND (status='' OR status IS NULL OR status='accepted') ORDER BY arrival DESC");
    $num_of_accounts = mysql_num_rows($r);
    $accounts = 0;
    $total_outstanding = 0;
    while ($arrAccomodation = mysql_fetch_assoc($r)) {
        $accounts++;
        //ver_array("arrAccomodation",$arrAccomodation);
        $date_from = mostrar_fecha($arrAccomodation['arrival']);
        $date_to = mostrar_fecha($arrAccomodation['planned_departure']);
        $days = subtract_dates($date_from, $date_to);
        // Search the name of the room
        if ($arrAccomodation[room_id]) {
            $r2 = mysql_query("SELECT * FROM rooms WHERE room_id={$arrAccomodation[room_id]}");
            $room = "";
            if (mysql_numrows($r2)) {
                $room = mysql_result($r2, 0, "room");
            }
        }
        $total_rent_pre = $days * ($arrAccomodation['weekly_rate'] / 7);
        $total_rent = round($total_rent_pre, 2);
        $due = $total_rent + $arrAccomodation['laundry'] + $arrAccomodation['hc'] + $arrAccomodation['printing'] + $arrAccomodation['extra'];
        $invoice_number = "NO BILL";
        $outstanding = $due - $arrAccomodation['deposit'] - $arrAccomodation['received'];
        $total_outstanding = $total_outstanding + $outstanding;
$pdf->Cell(55, 4, "Subject", $border, 0, '', true);
$pdf->Ln();
$pdf->SetFillColor(255, 255, 255);
$i = 0;
while ($arrData = mysql_fetch_assoc($r)) {
    $i++;
    $surname = $arrData[surname];
    $name = $arrData[name];
    if ($surname == "") {
        $surname = $arrData[name];
        $name = "";
    }
    $pdf->Cell(35, 4, $surname, $border);
    $pdf->Cell(30, 4, $name, $border);
    $pdf->Cell(20, 4, mostrar_fecha(substr($arrData[arrival], 0, 10)), $border);
    $pdf->Cell(20, 4, mostrar_fecha(substr($arrData[departure], 0, 10)), $border);
    $pdf->Cell(9, 4, $arrData[room], $border);
    $pdf->Cell(9, 4, $arrData[telephone], $border);
    $pdf->Cell(25, 4, $arrData[city], $border);
    $pdf->Cell(25, 4, $arrData[country], $border);
    $pdf->Cell(55, 4, substr($arrData[college], 0, 56), $border);
    $pdf->Cell(55, 4, substr($arrData[subject], 0, 56), $border);
    $pdf->Ln();
}
$pdf->Output();
function mostrar_fecha($fecha)
{
    if ($fecha != "" && $fecha != "0000/00/00") {
        return substr($fecha, 8, 2) . "/" . substr($fecha, 5, 2) . "/" . substr($fecha, 0, 4);
        //return substr($fecha,8,2)."-".substr($fecha,5,2)."-".substr($fecha,0,4);
    } else {
Пример #10
0
function escribe_formulario_fecha_vacio($nombrecampo,$nombreformulario,$date,$resident_id,$booking_id,$return_page){
	global $raiz;
	/*echo '
	<INPUT name="'.$nombrecampo.'" size="10" value="'.date("d",time())."/".date("m",time())."/".date("Y",time()).'"><br>
	<input type=button value="Buscar Fecha" onclick="muestraCalendario(\''. $raiz.'\',\''. $nombreformulario .'\',\''.$nombrecampo.'\')">
	';	
	*/	
	$date=mostrar_fecha($date);
	echo '
	<INPUT name="'.$nombrecampo.'" size="8" value="'.$date.'">
	<img src="imgs/date_16x16.gif" align="absmiddle" onclick="muestraCalendario(\''. $raiz.'\',\''. $nombreformulario .'\',\''.$nombrecampo.'\',\''. $resident_id .'\',\''. $booking_id .'\',\''. $return_page .'\')">
	';
}
		  <td valign="middle" class="cell">&nbsp;</td>
		  <td valign="middle" class="cell" align="left"><a href="admin.php?pagetoload=application_form.php&resident_id=<?php 
echo $arrData[resident_id];
?>
&from=residents_list.php" class="table_link2"><?php 
echo $arrData[surname];
?>
</a></td>
		  <td valign="middle" class="cell">&nbsp;</td>
		  <td valign="middle" class="cell" align="left"><?php 
echo mostrar_fecha(substr($arrData[barrival], 0, 10));
?>
</td>
		  <td valign="middle" class="cell">&nbsp;</td>
		  <td valign="middle" class="cell" align="left"><?php 
echo mostrar_fecha(substr($arrData[bdeparture], 0, 10));
?>
</td>	
		  <td valign="middle" class="cell">&nbsp;</td>
		  <td valign="middle" class="cell" align="left"><?php 
echo $arrData[room];
?>
</td>
		  <td valign="middle" class="cell">&nbsp;</td>
		  <td valign="middle" class="cell" align="left"><?php 
echo $arrData[telephone];
?>
</td>
		  <td valign="middle" class="cell">&nbsp;</td>
		  <td valign="middle" class="cell" align="left"><?php 
echo $arrData[city];
$pdf->Ln();
$pdf->SetFillColor(230, 230, 230);
$pdf->Cell(55, $high, "Course (BA, MSc, PhD, etc)", $border, 0, '', true);
$pdf->SetFillColor(255, 255, 255);
$pdf->Cell(125, $high, $arrResident[course], $border, 0, '', true);
$pdf->Ln();
$pdf->SetFillColor(230, 230, 230);
$pdf->Cell(55, $high, "Academic Year", $border, 0, '', true);
$pdf->SetFillColor(255, 255, 255);
$pdf->Cell(125, $high, $arrResident[academic_year], $border, 0, '', true);
$pdf->Ln();
$pdf->SetFillColor(230, 230, 230);
$pdf->Cell(55, $high, "Accommodation Dates", $border, 0, '', true);
$pdf->SetFillColor(255, 255, 255);
$arr = mostrar_fecha($arrResident[arrival]);
$dep = mostrar_fecha($arrResident[departure]);
$pdf->Cell(63, $high, "From: " . $arr, $border, 0, '', true);
$pdf->Cell(62, $high, "To: " . $dep, $border, 0, '', true);
$pdf->Ln();
$pdf->Ln();
$pdf->SetFillColor(230, 230, 230);
$pdf->Cell($width2, $high, "Schools attended (with dates)", $border, 0, '', true);
$pdf->Cell($width2, $high, "School examinations passed (with grades)", $border, 0, '', true);
$pdf->Ln();
$pdf->SetWidths(array($width2, $width2));
$pdf->Row(array($arrResident[school_attended], $arrResident[school_examinations]));
$pdf->SetFillColor(230, 230, 230);
$pdf->Cell($width2, $high, "Universities attended", $border, 0, '', true);
$pdf->Cell($width2, $high, "Qualifications obtained (with grades)", $border, 0, '', true);
$pdf->Ln();
$pdf->SetFillColor(255, 255, 255);