Skip to content

Instantly share code, notes, and snippets.

@worstn8mare
Created February 17, 2018 01:52
Show Gist options
  • Select an option

  • Save worstn8mare/3bcec0d2ce488009a373cc1c8a6e5f83 to your computer and use it in GitHub Desktop.

Select an option

Save worstn8mare/3bcec0d2ce488009a373cc1c8a6e5f83 to your computer and use it in GitHub Desktop.
if($divcounter <= 29){
$counter = 29 - $divcounter;
for ($i=0; $i < $counter; $i++) {
$printcommanddetail1 .="\n";
}
$printCommand .= $printcommandhead1."1".$printcommandhead2.$printcommanddetail1.$printcommandfooter1."\n";
}
else{
if($divcounter > 29 && $divcounter <= 47){
$addSpace = '';
for ($i=1; $i < (47 - $divcounter); $i++) {
$printcommanddetail1 .="\n";
}
for ($i=1; $i < 29 $i++) {
$addSpace .="\n";
}
$printCommand .= $printcommandhead1."1".$printcommandhead2.$printcommanddetail1.$printcommandfooter2."\n";
$printCommand .= $printcommandhead1."2".$printcommandhead2.$addSpace.$printcommandfooter1."\n";
}
else{
for($page = 1; $page<=$pageTotal; $page++){
$inPage = 1;
$b = 0;
$printCommand .= $printcommandhead1.$page.$printcommandhead2;
for ($i=1; $i <= $divcounter; $i++) {
if($inPage == $page){
if($b == 0){
$printCommand .= $printcommanddetail1.$printcommandfooter2."\n";
if($page == $pageTotal){
$printCommand .= $printcommanddetail1.$addSpace.$printcommandfooter1."\n";
}
}
$b++;
}
if($i%47 == 0){
$inPage++;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment