Jump to content

realeez

Members
  • Posts

    14
  • Joined

  • Last visited

realeez's Achievements

Member

Member (2/5)

0

Reputation

  1. Dear Friends, I am alot before doing the mixed content of php and HTML in single variable in PHP.. I could not get the data even though there is not SYNTAX error.. please look my code and advise $htmlcontent .=" <tr> <td colspan=\"8\">".$details."></td> </tr>"; for($k=0;$k<count($reg_years[$details]);$k++) { $year = (int)($reg_years[$details][$k]); $singlecount[$year] = array_filter($result[$details],function($details1) use ($year){ return ($details1['reg_year'] == $year && $details1['bench_type'] == 1); }); $divisioncount[$year] = array_filter($result[$details],function($details2) use ($year){ return ($details2['reg_year'] == $year && $details2['bench_type'] == 2); }); $fullcount[$year] = array_filter($result[$details],function($details3) use ($year){ return ($details3['reg_year'] == $year && $details3['bench_type'] >= 3); }); $rpcount[$year] = array_filter($result[$details],function($rp) use ($year){ return ($rp['reg_year'] == $year && $rp['bench_type'] == 'RP'); }); $mjccount[$year] = array_filter($result[$details],function($mjc) use ($year){ return ($mjc['reg_year'] == $year && $mjc['bench_type'] == 'MJC'); }); $cocount[$year] = array_filter($result[$details],function($co) use ($year){ return ($co['reg_year'] == $year && $co['bench_type'] == 'X'); }); $total = 0; $total = (int)(count($singlecount[$year])+count($divisioncount[$year])+count($fullcount[$year])+count($rpcount[$year])+count($mjccount[$year])+count($cocount[$year])); $htmlcontent .=" <tr> <td>".$year."</td> <td align=\"center\"> if(count($singlecount[$year])>0) { echo (count($singlecount[$year])); } else { echo "-"; } </td> <td align=\"center\"> if(count($divisioncount[$year])>0) { ".count($divisioncount[$year])." } else { "-" } </td> <td align=\"center\"> if (count($fullcount[$year]) > 0) { echo (count($fullcount[$year])); } else { echo "-"; } </td > < td align =\"center\"> if(count($rpcount[$year])>0) { echo (count($rpcount[$year])); } else { echo " - "; } </td> <td align=\"center\"> if(count($mjccount[$year])>0) { echo (count($mjccount[$year])); } else { echo " - "; } </td> <td align=\"center\"> if(count($cocount[$year])>0) { echo (count($cocount[$year])); } else { echo " - "; } </td> <td align=\"center\"> echo $total; </td> </tr>"; } } $htmlcontent .= "</tbody></table>"; $mpdf = new \Mpdf\Mpdf(); $mpdf->WriteHTML($htmlcontent); $mpdf->Output(); Waiting for FAST reply Thanks Anes
  2. Dear Friends , I am working on a simple python instantiation program given below. I got name error. class adder: result = 0 def __init__(self, number1, number2): #self.result = int( number1 ) + int( number2 ) self.number1 = number1 self.number2 = number2 def giveResult(self): #return str(self.result) return self.number1 + self.number2 endIt = False while ( endIt == False ): print "Please input two intergers you wish to add: " number1 = raw_input( "Enter the first number: " ) number2 = raw_input( "Enter the second number: " ) print number1 print number2 try: thistime=adder(int(number1),int(number2)) except NameError: print "Some error" print "Sorry, one of your values was not a valid integer." continue print "Your result is: " + thistime.giveResult() goagain = raw_input( "Do you want to eXit or go again? ('X' to eXit, anything else to continue): " ) if ( goagain == "x" or goagain == "X" ): endIt = True I got error as Enter the first number: 90 Enter the second number: 78 90 78 Some error Sorry, one of your values was not a valid integer. Please input two intergers you wish to add: Please advise Thanks Anes
×
×
  • 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.