Jump to content

Text data problem- please help!


eramge11

Recommended Posts

I have a data textbox area that our employees type an incident report into. When we hit print, it generates a PDF report including other information and the text field (the report). The only problem is if the report is lenghty it will shift the entire text area to a seperate page leaving a good portion of the first page blank. I have attached a report showing what I'm talking about. Is this something that can be fixed by adding something to the code? I really would like to keep a portion of the narritave on one page and have it flow to the second page. ANYONE who can figure out a way to do this please let me know!

 

 

StundentFinalView.pdf

Link to comment
https://forums.phpfreaks.com/topic/294790-text-data-problem-please-help/
Share on other sites

  • 2 weeks later...

Here is the code:

<style>
	table{
		display: table;
		border-collapse: collapse;
		border:1.5px solid #74b9f0;
		font-size: 12.5px;
		width:100%;
	}
	.no_border tr,td{
		border:none;
		border:hidden;
		/* background:none; */
		border:1.5px solid white; 
	}
	table tr:nth-child(even) { /*(even) or (2n 0)*/
		background: #f1f6ff;
	}
	table tr:nth-child(odd) { /*(odd) or (2n 1)*/
		background: white;
	}
	th{text-align:left;font-weight:normal;color:#990a10;width:110px;border:0.4px solid #74b9f0;height:24px;}
	.title{color:black;}
	td{border:0.4px solid #74b9f0;height:24px;}
	.label{text-align:left;font-weight:normal;color:#990a10;width:110px;height:24px;}
	
	
	
</style>
<?php
$StudentInfo = StudentInfo::model()->findByPk($student_transaction[0]->student_transaction_student_id);
$AcademicTermPeriod = AcademicTermPeriod::model()->findByPk($student_transaction[0]->academic_term_period_id);
$AcademicTerm = AcademicTerm::model()->findByPk($student_transaction[0]->academic_term_id);
if($student_transaction[0]->student_transaction_nationality_id != null)
$Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id);
else
$Nationality = new Nationality;
$Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id);
$Course = Course::model()->findByPk($student_transaction[0]->course_id);
if($student_transaction[0]->student_transaction_languages_known_id != null)
$LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id);
if($student_transaction[0]->student_transaction_student_address_id != null)
$StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id);
else
$StudentAddress = new StudentAddress;
if($student_transaction[0]->student_transaction_parent_id != null || $student_transaction[0]->student_transaction_parent_id != 0)
$parent = ParentLogin::model()->findByPk($student_transaction[0]->student_transaction_parent_id);
else
$parent = new ParentLogin;
?>
<h3 class="title">CALL RECORDS SUMMARY</h3>

<table class="no_border">


</table>
<h4 class="title">ADMINISTRATIVE</h4>
<table>
<tr>

         <td class="label">DATE</label></td><td><?php echo $StudentInfo->student_adm_date;?></td>
         <td class="label">DISPATCH TIME</label></td><td><?php echo $StudentInfo->student_guardian_qualification;?></td>
</tr>	
<tr>
	  <td class="label">ARRIVAL TIME</label></td><td><?php echo $StudentInfo->student_guardian_relation;?></td>
          <td class="label">CLEARANCE</label></td><td><?php echo $StudentInfo->student_guardian_occupation;?></td>

</tr>	
<tr>
	
	
</tr>
</table>



<h4 class="title">INCIDENT</h4>
<table>

<tr>
	<td class="label">TYPE OF INCIDENT</td><td><?php 
		if($Nationality)
		echo $Nationality->nationality_name;
		else
		echo "";
		?>
         <td class="label">REPORT NUMBER</label></td><td><?php echo $StudentInfo->student_guardian_name;?></td>
</tr>
<tr>
         <td class="label">PRIMARY OFFICER</label></td><td><?php echo $StudentInfo->student_guardian_home_address;?></td>
         <td class="label">JUVENILE Y/N</td><td><?php echo $StudentInfo->emergency_cont_no;?></td>
</tr>
<!--tr>
	<!--td class="label">Semester</td><td><?php echo (empty($AcademicTerm->academic_term_name) ? "Not Set" : $AcademicTerm->academic_term_name);?></td>
</tr-->

</table>

</br></br>

<h4 class="title">INCIDENT ADDRESS</h4>
<table>
<tr>	
	<td class="label">STREET</td><td colspan="3"><?php echo $StudentAddress->student_address_p_line1;?></td>
        <td class="label">APT/LOCATION</td><td colspan="3"><?php echo $StudentAddress->student_address_p_line2;?></td>
</tr>
<tr>
	<td class="label">CITY</td><td colspan="3"><?php echo $StudentAddress->student_p_house_no;?></td>
        <td class="label">ZIP CODE</td><td colspan="3"><?php echo $StudentAddress->student_address_p_pin;?></td>
        </tr>
</table>
<h4 class="title">REPORT COMPLAINANT</h4>
<table>
<tr>
<td class="label">COMPLAINANT</td><td colspan="3"><?php echo $StudentAddress->student_c_house_no;?></td>
<td class="label">PHONE NUMBER</td><td colspan="3"><?php echo $StudentAddress->student_address_c_phone;?></td>
</tr>
</table>

<h4 class="title">REPORT NARRATIVE</h4>
<table>
<tr>	
<td colspan="3"><?php echo nl2br($StudentInfo->student_guardian_occupation_address);?></td>
</tr>
</table>
</br></br>
<?php echo "</br></br>"; ?>
<h4 class="title">DOCUMENTS ATTACHED TO REPORT</h4>

<?php $k=0;

if ($student_docs != null){
?>
<table>

	<tr>
		<th>
		      LOCAL NUMBER		
		</th>
		<th>
		      TITLE
		</th>
		<th>
		      DOCUMENT CATEGORY
		</th>
		<th width="70px">
		      DESCRIPTION		
		</th>
		<th>
		      DATE SUBMITTED
		</th>
 		
 	</tr>
	<?php 
	
	foreach($student_docs as $m=>$v) {
		
		$StudentDocs = StudentDocs::model()->findByPk($v['student_docs_trans_stud_docs_id']);
            ?>	<tr>
			<td>
			      <?php echo ++$k; ?>		
			</td>
			<td>
			      <?php echo $StudentDocs->title;?>
			</td>
			<td>
			      <?php echo DocumentCategoryMaster::model()->findByPk($StudentDocs->doc_category_id)->doc_category_name; ?>
			</td>
			<td width="70px">
			      <?php echo $StudentDocs->student_docs_desc; ?>		
			</td>
			<td>
			      <?php $docdate = date_create($StudentDocs->student_docs_submit_date);
				echo date_format($docdate,'d-m-Y');?>
			</td>
 		</tr> 
       <?php
    
     }// end for loop
	
?>
</table>
<?php }
	else 
		echo "NO DOCUMENTS AVAILABLE";
	

 ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.