CDR Module: Incorporated restore session in admin gui scripts.
[openemr.git] / interface / super / rules / controllers / edit / view / intervals.php
blobcbe642ca2bbea58490f70fcffd08a143fbe31753
1 <?php require_once( $GLOBALS["srcdir"] . "/../interface/super/rules/controllers/edit/helper/common.php" ); ?>
2 <?php $rule = $viewBean->rule ?>
3 <?php $intervals = $rule->reminderIntervals ?>
4 <script language="javascript" src="<?php js_src('edit.js') ?>"></script>
5 <script type="text/javascript">
6 var edit = new rule_edit( {});
7 edit.init();
8 </script>
10 <table class="header">
11 <tr>
12 <td class="title"><?php echo out( xl( 'Rule Edit' ) ); ?></td>
13 <td>
14 <a href="index.php?action=detail!view&id=<?php echo out( $rule->id ); ?>" class="iframe_medium css_button" onclick="top.restoreSession()">
15 <span><?php echo out( xl( 'Cancel' ) ); ?></span>
16 </a>
17 <a href="javascript:;" class="iframe_medium css_button" id="btn_save" onclick="top.restoreSession()"><span><?php echo out( xl( 'Save' ) ); ?></span></a>
18 </td>
19 </tr>
20 </table>
22 <div class="rule_detail edit text">
23 <p class="header"><?php echo out( xl( 'Reminder intervals' ) ); ?> </p>
25 <form action="index.php?action=edit!submit_intervals" method="post" id="frm_submit" onsubmit="return top.restoreSession()">
26 <input type="hidden" name="id" value="<?php echo out( $rule->id ); ?>"/>
28 <div class="intervals">
29 <p>
30 <span class="left_col colhead"><u><?php echo out( xl( 'Type' ) ); ?></u></span>
31 <span class="end_col colhead"><u><?php echo out( xl( 'Detail' ) ); ?></u></span>
32 </p>
34 <?php foreach( ReminderIntervalType::values() as $type ) { ?>
35 <?php foreach( ReminderIntervalRange::values() as $range ) { ?>
36 <?php $first = true; $detail = $intervals->getDetailFor( $type, $range ); ?>
37 <p>
38 <span class="left_col <?php echo $first ? "req" : ""?>" data-grp="<?php echo out( $type->code ); ?>"><?php echo out( $type->lbl ); ?></span>
39 <span class="mid_col"><?php echo out( xl( $range->lbl ) ); ?></span>
40 <span class="mid_col">
41 <input data-grp-tgt="<?php echo out( $type->code ) ?>"
42 type="text"
43 name="<?php echo out( $type->code ); ?>-<?php echo out( $range->code ); ?>"
44 value="<?php echo is_null( $detail ) ? "" : out( $detail->amount ); ?>" />
45 </span>
46 <span class="end_col">
47 <?php echo timeunit_select( array( "context"=>"rule_reminder_intervals", "target"=>$type->code, "name"=>$type->code."-".$range->code."-timeunit", "value" => $detail->timeUnit ) ); ?>
48 </span>
49 </p>
50 <?php $first = false; ?>
51 <?php } ?>
52 <?php } ?>
54 </div>
56 </form>
58 </div>
60 <div id="required_msg" class="small">
61 <span class="required">*</span><?php echo out( xl( 'Required fields' ) ); ?>
62 </div>