voip_cdr call rating by day and time, RT#4763
[freeside.git] / httemplate / edit / rate_time.cgi
1 <% include("/elements/header.html","$action Time Period", menubar(
2       'Rate plans' => "${p}browse/rate.cgi",
3     ) )
4 %>
5
6 <% include('/elements/error.html') %>
7
8 <FORM METHOD="POST" ACTION="<% "${p}edit/process/rate_time.cgi" %>">
9 <INPUT TYPE="hidden" NAME="ratetimenum" VALUE="<% $ratetimenum %>">
10 <% ntable('#cccccc',2) %>
11 <TABLE>
12   <TR>
13     <TH ALIGN="right">Period name</TH>
14     <TD><INPUT TYPE="text" NAME="ratetimename" VALUE="<% $rate_time ? $rate_time->ratetimename : '' %>"></TD>
15   </TR>
16 </TABLE>
17 <% include('/elements/auto-table.html', 
18                       header => [ 'Start', 'End' ],
19                       fields => [ 'stime', 'etime' ],
20                       size   => [ 18, 18 ],
21                       maxl   => [ 15, 15 ],
22                       align  => [ 'right', 'right' ],
23                       data   => \@data,
24    ) %>
25 <INPUT TYPE="submit" VALUE="<% $rate_time ? 'Apply changes' : 'Add period'%>">
26 </FORM>
27 <BR>
28 <A HREF="<% "${p}edit/process/rate_time.cgi?ratetimenum=$ratetimenum;delete=1" %>">Delete this period</A>
29 <% include('/elements/footer.html') %>
30
31 <%init>
32 my $ratetimenum = ($cgi->keywords)[0] || '';
33 my $action = 'Add';
34 my $rate_time;
35 my @data = ();
36
37 if($ratetimenum) {
38   $action = 'Edit';
39   $rate_time = qsearchs('rate_time', {ratetimenum => $ratetimenum})
40     or die "ratetimenum $ratetimenum not found";
41   @data = $rate_time->description;
42 }
43
44 </%init>