Highway to PSR2
[openemr.git] / interface / super / rules / controllers / edit / view / intervals.php
blobdb9661b291a8d44c1c36d3fddebe1e20f5936c70
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;
37 $detail = $intervals->getDetailFor($type, $range); ?>
38 <p>
39 <span class="left_col <?php echo $first ? "req" : ""?>" data-grp="<?php echo out($type->code); ?>"><?php echo out($type->lbl); ?></span>
40 <span class="mid_col"><?php echo out(xl($range->lbl)); ?></span>
41 <span class="mid_col">
42 <input data-grp-tgt="<?php echo out($type->code) ?>"
43 type="text"
44 name="<?php echo out($type->code); ?>-<?php echo out($range->code); ?>"
45 value="<?php echo is_null($detail) ? "" : out($detail->amount); ?>" />
46 </span>
47 <span class="end_col">
48 <?php echo timeunit_select(array( "context"=>"rule_reminder_intervals", "target"=>$type->code, "name"=>$type->code."-".$range->code."-timeunit", "value" => $detail->timeUnit )); ?>
49 </span>
50 </p>
51 <?php $first = false; ?>
52 <?php } ?>
53 <?php } ?>
55 </div>
57 </form>
59 </div>
61 <div id="required_msg" class="small">
62 <span class="required">*</span><?php echo out(xl('Required fields')); ?>
63 </div>