Beispiel #1
0
<?php

//this is the function which places the comma, hyphen and period where-ever necessary
global $print_hal, $curhal, $pdf, $width, $height, $curdpt, $curtotal, $curdpt_no, $hall_no, $hallwise, $dptinc_glbl;
//global $w, $strmax, $tempreg, $printd_no, $firstloop, $symbol, $hyprint;
//$in, $n, $temp104;
$curdpt = dpt($dept);
//$dptinc_glbl;//1 represents new dept for hallwiser
$print_dpt = 1;
$tempreg;
$print = 0;
$islast = 0;
$first_line = 1;
$curtotal = $total - $a;
//echo 'total = '.$total.' a = '.$a.' & real total = <b>'.($total - $a).'</b><br>';//for check!!!!
$tmpcounter = 1;
//if this reaches 3 then the 3 reg nos are printed
$eq_b4 = -1;
//if -1 remains then only one number is being printed
for ($i = $a; $i < $total; $i++) {
    if (isset($reg[$i])) {
        //this block stores the register numbers in an array hallwise
        hallwiser($reg[$i], $dept);
        //$dp/tinc_glbl = 0;
        intval($reg[$i]);
        $p = $reg[$i];
        //present (current) used reg no.
        $in = $reg[$i] + 1;
        //imaginary next reg no. adds one to $p
        $wait = 1000;
        //echo 'entering at i='.$i.' '.$p.'<br>';// for check!!!!
Beispiel #2
0
function designer($nos, $hall, $hallname)
{
    global $pdf, $allhalls;
    $height = array(0, 7, 9, 10);
    $width = array(0, 4, 6, 9, 13, 30, 2);
    $width2 = array(0, 12, 27, 145);
    $height2 = array(0, 5, 7);
    $pdf->AddPage();
    $pdf->Cell(0, 2);
    $pdf->Ln();
    $pdf->SetFont('Times', 'BU', 17);
    $pdf->Cell(0, 6, 'Hall No: ' . $hallname, '', 0, 'C');
    $pdf->Ln();
    $pdf->SetFont('Helvetica', '', 11);
    //$pdf->Cell(width, height, data, border, 0, align)
    //set starts
    $pdf->Ln();
    $count = -1;
    for ($j = 0; $j < 5; $j++) {
        for ($i = 0; $i < 5; $i++) {
            $pdf->Cell($width[6], $height[1]);
            switch ($i) {
                case 0:
                    $tbl = 'A';
                    break;
                case 1:
                    $tbl = 'B';
                    break;
                case 2:
                    $tbl = 'C';
                    break;
                case 3:
                    $tbl = 'D';
                    break;
                case 4:
                    $tbl = 'E';
                    break;
            }
            $i1 = $i + 1;
            $j1 = $j + 1;
            $tableno = $tbl . '' . $j1;
            $pdf->Cell($width[1], $height[1]);
            $pdf->SetFont('', '');
            $pdf->Cell($width[4], $height[1], 'Table:', 'LT', 0, 'R');
            $pdf->SetFont('', 'B');
            $pdf->Cell($width[3], $height[1], $tableno, 'TR', 0, 'L');
            //$pdf->SetFont('', '');
            $pdf->Cell($width[1], $height[1]);
            $pdf->Cell($width[2], $height[1]);
        }
        //table ends
        $pdf->Ln();
        for ($i = 0; $i < 5; $i++) {
            if ($j % 2 == 0 && $i % 2 == 1) {
                $pdf->SetFont('', 'IU');
            } elseif ($j % 2 == 1 && $i % 2 == 0) {
                $pdf->SetFont('', 'IU');
            } else {
                $pdf->SetFont('', '');
            }
            $pdf->Cell($width[6], $height[1]);
            if (isset($nos[$count + 1])) {
                $count = $count + 1;
                $continue = $nos[$count];
            } else {
                $continue = '';
                $count = $count + 1;
            }
            //if($continue == 0)
            $pdf->Cell($width[5], $height[2], $continue, 'BLTR', 0, 'C');
            //else
            //$pdf->Cell($width[5], $height[2], '', 'BLTR', 0, 'C');
            $pdf->Cell($width[2], $height[1]);
        }
        //set ends
        $pdf->Ln();
        $pdf->Ln();
    }
    $pdf->Cell($width[6], $height[1]);
    $pdf->SetFont('', 'IU', 14);
    $pdf->Cell($width2[2], $height2[2], 'Deg./Dept.', 'LT', 0, 'C');
    $pdf->Cell($width2[1], $height2[2], 'Total', 'LT', 0, 'C');
    $pdf->Cell($width2[3], $height2[2], 'Reg Nos.', 'LTR', 0, 'C');
    $pdf->Ln();
    $pdf->SetFont('', '', 11);
    for ($i = 0; $i < count($hall); $i++) {
        $pdf->SetFont('', 'B');
        $dept = dpt($hall[$i][0]);
        $pdf->Cell($width[6], $height[1]);
        $pdf->Cell($width2[2], $height2[1], $dept, 'LT', 0, 'C');
        $pdf->Cell($width2[0], $height2[0]);
        $pdf->SetFont('', '');
        $pdf->Ln();
        $string = array(array());
        unset($string[0]);
        $nu = 0;
        $line = 0;
        $string[$line] = '  ';
        //$r = 0;
        for ($j = 1; $j < count($hall[$i]); $j++) {
            //norespect:
            $nu = $nu + 1;
            if ($j + 1 == count($hall[$i])) {
                $string[$line] .= $hall[$i][$j] . '.';
                $nu = 9;
            } else {
                $string[$line] .= $hall[$i][$j] . ', ';
            }
            if ($nu == 5) {
                $line = $line + 1;
                $string[$line] = '  ';
                $nu = 0;
            }
            /*
            		if($nu == 9){
            		}*/
        }
        for ($r = 0; $r < count($string); $r++) {
            if ($r == 0) {
                $bord = 'LTR';
            } elseif ($r == count($string) - 1) {
                $bord = 'BLR';
            } else {
                $bord = 'LR';
            }
            $pdf->Cell($width[6], $height2[2]);
            $pdf->Cell($width2[2], $height2[1], '', $bord);
            if ($r == 0) {
                $CHERE = ' ' . (count($hall[$i]) - 1);
                $pdf->Cell($width2[1], $height2[1], $CHERE, $bord, 0, 'R');
            } else {
                $pdf->Cell($width2[1], $height2[1], ' ', $bord);
            }
            $pdf->Cell($width2[3], $height2[1], $string[$r], $bord, 0, 'L');
            $pdf->Ln();
        }
        //print_r($string);
    }
    $pdf->Cell(0, 0);
    //to put border
    $pdf->Ln();
    $pdf->Cell($width[6], $height2[2]);
    $pdf->Cell($width2[1] + $width2[2] + $width2[3], 0, '', 'B');
    $dept_tot = count($hall);
    $ovrl_tot = 0;
    for ($i = 0; $i < $dept_tot; $i++) {
        $ovrl_tot = $ovrl_tot + count($hall[$i]) - 1;
    }
    //$desc = 'Overall: '.$ovrl_tot.' candidates from '.$dept_tot.' depts';
    //if($dept_tot != 1)
    //else
    //$desc = 'Overall Total: '.$ovrl_tot.' from '.$dept_tot.' dept';
    $pdf->SetFont('', 'I', 11);
    //$pdf->Cell(20, $height2[2]);
    //$pdf->Cell(20, 4, 'Overall //');
    $pdf->Cell(0, 1);
    $pdf->Ln();
    $pdf->Cell(10, $height2[2]);
    $pdf->SetFont('', 'IU');
    if ($dept_tot != 1) {
        $pdf->Cell(13, 4, 'Depts:');
    } else {
        $pdf->Cell(15, 4, 'Dept(s):');
    }
    $pdf->SetFont('', 'B');
    $pdf->Cell(10, 4, $dept_tot);
    $pdf->SetFont('', 'IU');
    $pdf->Cell(12, 4, 'Total:');
    $pdf->SetFont('', 'B');
    $pdf->Cell(20, 4, $ovrl_tot);
    //$pdf->Ln();
    //$pdf->Cell(20, $height2[2]);
    $pdf->Cell(5, 15);
    $pdf->Ln();
    $pdf->SetFont('', '', 13);
    $pdf->Cell($width[6], $height2[2]);
    $pdf->Cell(170, 7, 'Chief Superintendent', '', 0, 'R');
}
function disp_rqd($a, $c, $d)
{
    global $b, $totalb, $pdf, $height, $width, $printdpt, $curdpt, $curhal, $newpage;
    $k = $d - $c;
    if (!empty($b[$a])) {
        //ec1ho"<b>".dpt($a)." ".$k." Students</b><br>";
        $curdpt = dpt($a);
        /*if($newpage == 1)
        		{
        			$pdf->myCell($width[0], $height[1], $curhal, 'LR');
        			$pdf->myCell($width[1], $height[1], $curdpt, 'LR');
        			$pdf->SetFont('Arial', '', 7);
        			$pdf->myCell($width[2], $height[1], '  '.$k, 'LR');
        			$pdf->SetFont('Arial', '', 14);
        		}*/
        if ($printdpt == 0 && $newpage != 1) {
            $pdf->myCell($width[0], $height[1], '', 'LR');
        }
        if ($printdpt == 0 && $newpage != 0 && $d - $c == 13) {
            $pdf->myCell($width[0], $height[1], '', 'LR');
        }
        $pdf->myCell($width[1], $height[1], $curdpt, 'LR');
        $pdf->SetFont('Arial', '', 7);
        $pdf->myCell($width[2], $height[1], '  ' . $k, 'LR');
        $pdf->SetFont('Arial', '', 14);
        $newpage = 0;
        disp_dpt($b[$a], $c, $d);
        //ec1ho"<br><br>";
    }
}