Cs Cart 3 Admin Report

I've created an addon for CS Cart 3 that adds a custom admin report for my client. Functionality-wise it works perfectly, the page loads on the correct url and outputs the data it's supposed to, I've even managed to add it to the menu.



However, I'm using the standard period selector form and I'm having a couple of problems. Firstly, the dates don't auto-fill in the form after submitting. I got the period to autofill by specifically assigning the post value to $period but no other controllers using the form that I looked at seemed to need that.



The second issue is that the main menu items completely disappear when the form is submitted. I've tried just an empty form and it does the same.



This is my template code

```php

{capture name=“section”}










{include file="common_templates/period_selector.tpl" period=$period form_name="ecs_report_search_form" display="form" but_name="dispatch[ecs_reports]"}



{/capture}
{include file="common_templates/section.tpl" section_content=$smarty.capture.section}

{if $states}

State Sales


{foreach from=$states key=s item=c}

{$s}



{foreach from=$c item=p key=i}

{/foreach}
{$i} {$p}

{/foreach}

Totals



{foreach from=$totals key=i item=n}

{/foreach}


{$i} {$n}
Shipping ${$shippings|number_format:2}
Sales Total ${$sales_total|number_format:2}

{/if}
```