Number Lockers!

Pyth, 66 bytes

A.[Y2m+.rKXJr6j" | "++km.[\02`kdkjkUT;" -|+"+*3]KJ_.T_McSQ2js[GHhH

Test suite.


Python 2, 201 191 185 175 171 166 164 163 bytes

n=input()
for j in 0,1:c=n/2+n%2*j;m='+----'*c+'+\n';print['\n',m+('|    '*c+'|\n')*3+''.join('| %02d '%-~i for i in range(j,n-n%2,2)+n%2*j*[~-n])+'|\n'+m*j][c>0],

Try it Online!


PHP, 191 Bytes

for(;a&$k="01112344453"[$i++];print"$l\n")for($l="",$b="+||"[$k%3],$n=0;$n++<$a=$argn;)$l.=$i<6&$n%2&$n!=$a|$i>5&($n%2<1|$n==$a)?($l?"":"$b").["----+","    |",sprintf(" %02d |",$n)][$k%3]:"";

Try it online!

PHP, 235 Bytes

for(;$i++<$a=$argn;)$r[$i==$a|1-$i&1][]=($p=str_pad)($i,2,0,0);for(;$j<6;)$l[]=($a<2&$j<3?"":[$p("+",$c=($j<3?floor:ceil)($a/2)*5+1,"----+"),$p("|",$c,"    |"),"| ".join(" | ",$r[$j/3])." |"])[$j++%3]."\n";echo strtr("01112344453",$l);

Case 1 with optional newlines

Try it online!

Expanded

for(;$i++<$a=$argn;)
  $r[$i==$a|1-$i&1][]=($p=str_pad)($i,2,0,0); # make an 2D array 0:odd values 1:even values and last value  
for(;$j<6;) # create 6 strings for each different line
  $l[]=($a<2&$j<3 # if last value =1 and line number under 3 
    ?"" # make an empty string empty [] as alternative
    :[$p("+",$c=($j<3 # else make the 0 or 3 line and store the count for next line
      ?floor # if line number =0 count=floor ($a/2)  multiply 5 and add 1
      :ceil)($a/2)*5+1,"----+") # else count= ceil($a/2) multiply 5 and add 1
    ,$p("|",$c,"    |") # make lines 1 and 4
    ,"| ".join(" | ",$r[$j/3])." |"])[$j++%3]."\n"; #make lines 2 odd values and 5 even values and last value
echo strtr("01112344453",$l); # Output after replace the digits with the 6 strings

PHP, 300 Bytes

for(;$i++<$a=$argn;)$r[$i==$a||!($i%2)][]=($p=str_pad)($i,2,0,0);echo strtr("01112344453",($a>1?[$p("+",$c=($a/2^0)*5+1,"----+")."\n",$p("|",$c,"    |")."\n","| ".join(" | ",$r[0])." |\n"]:["","",""])+[3=>$p("+",$c=ceil($a/2)*5+1,"----+")."\n",$p("|",$c,"    |")."\n","| ".join(" | ",$r[1])." |\n"]);

replace ["","",""] with ["\n","\n","\n"] if you want newlines for case 1

Try it online!