Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
iamakram22 committed Jul 11, 2024
1 parent a0b160e commit 36900eb
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions generate_worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,10 @@
$include_subtraction = isset($_POST['include_subtraction']) ?? false;
$generate_pdf = isset($_POST['generate_pdf']) ?? false;

// change HTML code to text
// if($worksheet_type === 'vm') {
// switch ($operator) {
// case 'cr':
// $operator = '∛'; // cube root
// break;

// case 'sr':
// $operator = '√'; // square root
// break;

// default:
// $operator;
// break;
// }
// }

// if ($operator === '/') $operator = '÷';
// Set worksheet type
$worksheet_type = $worksheet_type === 'ab' ? 'Abacus' : 'Vedic Maths';

// Assign operator Text
$operatorTitles = [
'+' => 'Addition',
'-' => 'Subtraction',
Expand All @@ -42,6 +27,11 @@
];
$title = isset($operatorTitles[$operator]) ? $operatorTitles[$operator] : 'Unknown Operator';

/**
* Generate random number
* @param int $digits
* @return int
*/
function generateRandomNumber($digits) {
return rand(1, 10 ** $digits);
}
Expand Down Expand Up @@ -89,10 +79,9 @@ function generateRandomNumber($digits) {

$mpdf->SetAuthor('Hashtagweb.in');
$mpdf->SetCreator('Hashtagweb.in');
$mpdf->SetTitle('Abacus Worksheet');
$mpdf->SetSubject('Abacus Worksheet');

$header = 'Abacus Worksheet | | <a href="https://iiva.in">AVAS IIVA</a>';
$mpdf->SetTitle( $worksheet_type . ' Worksheet');
$mpdf->SetSubject($worksheet_type .' Worksheet');
$header = $worksheet_type . ' Worksheet | | <a href="https://iiva.in">AVAS IIVA</a>';
$footer = 'Developed by <a href="https://hashtagweb.in">Hashtagweb.in</a> | | {PAGENO}';

$mpdf->SetHeader($header);
Expand Down

0 comments on commit 36900eb

Please sign in to comment.