-
Notifications
You must be signed in to change notification settings - Fork 0
/
editLists.php
137 lines (135 loc) · 7.09 KB
/
editLists.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
include_once('header.php');
include_once('lists.inc.php');
if ($values['listId']) {
$row = query("select{$check}list",$config,$values,$sort);
if (!$row) {
echo "<p class='error'>That {$check}list does not exist</p>\n";
include_once('footer.php');
exit();
}
foreach (array('title','categoryId','premiseA','premiseB','conclusion','behaviour','standard','conditions','metaphor','hyperlink','sortBy','frequency','effort','scored','menu','prioritise','thrs_score','thrs_obs') as $field)
$values[$field]=$row[0][$field];
$values['score_total'] = scoreCL($config, $values, $sort);
$action='listedit';
$urlVars = "?listId=" . $values['listId'] . "&type=". $type;
$urlInst = "&instanceId=". $values['instanceId'];
} else {
$values['title']='';
$values['categoryId']='';
$values['premiseA']='';
$values['premiseB']='';
$values['conclusion']='';
$values['behaviour']='';
$values['standard']='';
$values['conditions']='';
$values['metaphor']='';
$values['hyperlink']='';
$values['sortBy']='';
$values['frequency']='';
$values['effort']='';
$values['scored']='';
$values['menu']='';
$values['prioritise']='';
$values['thrs_score']='';
$values['thrs_obs']='';
$action='listcreate';
}
$cashtml = categoryselectbox($config,$values,$sort);
require_once("headerHtml.inc.php");
?>
<h2><?php echo ($values['listId'])?'Edit':'Create'," $check"; ?>list <?php
echo " [ <a href=\"reportLists.php". $urlVars . $urlInst . "\">Show List</a> ] "; ?> [ <a href="listCatCodes.php">cat codes</a> ]</h2>
<form action='processLists.php' method='post' onsubmit="return validate(this);">
<div class='form'>
<div class='formrow'><span class="error" id='errorMessage'></span></div>
<div class='formrow'>
<input type='hidden' name='required' value='title:notnull:Title cannot be blank' />
<input type='hidden' name='dateformat' value='ccyy-mm-dd' />
<label for='title' class='left first'>List Title:</label>
<input class="JKPadding" type='text' id='title' name='title' value='<?php echo makeclean($values['title']); ?>' />
</div>
<div class='formrow'>
<label for='categoryId' class='left first'>Category:</label>
<select name='categoryId' id='categoryId'>
<?php echo $cashtml; ?>
</select>
<span class='label'>
Prioritise: <input class="JKPadding" type='text' id='prioritise' name='prioritise' size='3' value='<?php echo makeclean($values['prioritise']); ?>' />
Sort: <input class="JKPadding" type='text' id='sortBy' name='sortBy' size='4' value='<?php echo makeclean($values['sortBy']); ?>' />
<?php
if (isset($check) && $check == 'check') { ?>
Frequency / Year:<input class="JKPadding" type='text' id='frequency' name='frequency' size='4' value='<?php echo makeclean($values['frequency']); ?>' />
Effort / Year: <?php echo $values['effort']; ?> Hours
<input type='hidden' name='effort' value='<?php echo $values['effort']; ?>' />
<?php } ?>
</span>
</div>
<div class='formrow'>
<label for='premiseA' class='left first'>Premise A:</label>
<input class="JKPadding" type="text" name="premiseA" id="conclusion" value="<?php echo makeclean($values['premiseA']); ?>" />
</div>
<div class='formrow'>
<label for='premiseB' class='left first'>Premise B:</label>
<input class="JKPadding" type="text" name="premiseB" id="conclusion" value="<?php echo makeclean($values['premiseB']); ?>" />
</div>
<div class='formrow'>
<label for='conclusion' class='left first'>Conclusion:</label>
<input class="JKPadding" type="text" name="conclusion" id="conclusion" value="<?php echo makeclean($values['conclusion']); ?>" />
</div>
<div class='formrow'>
<label for='outcome' class='left first'>Behaviour:</label>
<input class="JKPadding" type="text" name="behaviour" id="outcome" value="<?php echo makeclean($values['behaviour']); ?>" />
</div>
<div class='formrow'>
<label for='standards' class='left first'>Standards:</label>
<input class="JKPadding" type="text" name="standard" id="outcome" value="<?php echo makeclean($values['standard']); ?>" />
</div>
<div class='formrow'>
<label for='conditions' class='left first'>Conditions:</label>
<input class="JKPadding" type="text" name="conditions" id="outcome" value="<?php echo makeclean($values['conditions']); ?>" />
</div>
<div class='formrow'>
<label for='metaphor' class='left first'>Metaphor:</label>
<input class="JKPadding" type="text" name='metaphor' id='metaphor' value='<?php echo makeclean($values["metaphor"]); ?>' />
</div>
<div class='formrow'>
<label for='hyperlink' class='left first'>Hyperlink:</label>
<input class="JKPadding" type='text' id='hyperlink' name='hyperlink' value='<?php echo makeclean($values['hyperlink']); ?>' />
</div>
</div>
<div class='formbuttons'>
<input type="submit" value="<?php echo ($values['listId'])?'Update':'Create'; ?>" name="submit" />
<input type="checkbox" name="menu" id='menu' class='notfirst' title="" value="y" <?php if ($values['menu']==='y') echo " checked='checked'";?>/>
<label for='menu'>Menu</label>
<?php if ($values['listId']) { ?>
<input type="checkbox" name="delete" id='delete' class='notfirst' title="ALL items will be deleted!" value="y" />
<label for='delete'>Delete List</label>
<input type="submit" value="Up Priorities" name="up_priorities" />
<input type="submit" value="Down Priorities" name="down_priorities" />
<?php }
if ($check) { ?>
<br>
<br>
<input type="checkbox" name="scored" id='scored' class='notfirst' title="" value="y" <?php if ($values['scored']==='y') echo " checked='checked'";?>/>
<label for='scored'>Scored</label>
<?php
$values['urlInst'] = $urlVars . $urlBulk . '&instanceId=';
echo instanceselectbox($config,$values,$sort);
?>
<input type="submit" value="Reset Scores" name="reset" />
<br>
<br>
<span class='label'>
Score total / obs: <?php echo $values['score_total']; ?>.
Item threshold score (%): <input class="JKPadding" type='text' id='thrs_score' name='thrs_score' size='3' value='<?php echo makeclean($values['thrs_score']); ?>' />
Item threshold observations: <input class="JKPadding" type='text' id='thrs_obs' name='thrs_obs' size='3' value='<?php echo makeclean($values['thrs_obs']); ?>' />
</span>
<?php } ?>
<input type='hidden' name='instanceId' value='<?php echo $values['instanceId']; ?>' />
<input type='hidden' name='type' value='<?php echo $type; ?>' />
<input type='hidden' name='listId' value='<?php echo $values['listId']; ?>' />
<input type='hidden' name='action' value='<?php echo $action; ?>' />
</div>
</form>
<?php include_once('footer.php'); ?>