4
'intervention_A1_develop_recruitment',
5
'intervention_A1_edu_support',
6
'intervention_A1_management',
7
'intervention_A1_other',
8
'intervention_A1_recruit',
9
'intervention_A1_stipend',
10
'intervention_A2_construct',
11
'intervention_A2_furnish_dorms',
12
'intervention_A2_furnish_health_facility',
13
'intervention_A2_furnish_school',
14
'intervention_A2_maintenance',
15
'intervention_A2_management',
16
'intervention_A2_other',
17
'intervention_A3_design_plan',
18
'intervention_A3_management',
19
'intervention_A3_other',
20
'intervention_A3_student_support',
21
'intervention_A3_training',
22
'intervention_A4_develop_curricula',
23
'intervention_A4_dissemination',
24
'intervention_A4_edu_materials',
25
'intervention_A4_other',
26
'intervention_A5_new_edu_program',
27
'intervention_A5_other',
28
'intervention_A5_support_hws',
29
'intervention_A5_training_delivery',
30
'intervention_B1_design_scope',
31
'intervention_B1_other',
32
'intervention_B1_prepare_training',
33
'intervention_B1_training_delivery',
34
'intervention_B1_training_supervisors',
35
'intervention_B2_conduct',
36
'intervention_B2_consult',
37
'intervention_B2_design',
38
'intervention_B2_develop',
39
'intervention_B2_other',
40
'intervention_B2_supervisor',
41
'intervention_B2_support',
42
'intervention_B3_compliance',
43
'intervention_B3_cump',
44
'intervention_B3_management',
45
'intervention_B3_other',
46
'intervention_B3_relocation',
47
'intervention_B3_support',
48
'intervention_B3_train',
49
'intervention_B4_compliance',
50
'intervention_B4_design',
51
'intervention_B4_management',
52
'intervention_B4_other',
53
'intervention_B4_tuition',
54
'intervention_C1_consultations',
55
'intervention_C1_financial_incentives',
56
'intervention_C1_other',
57
'intervention_D1_electric',
58
'intervention_D1_housing',
59
'intervention_D1_other',
60
'intervention_D1_repair',
61
'intervention_D1_school',
62
'intervention_D1_telecomm',
63
'intervention_D1_water',
64
'intervention_D2_medicine',
65
'intervention_D2_other',
66
'intervention_D2_repair',
67
'intervention_D2_routine',
68
'intervention_D2_support',
69
'intervention_D2_train',
70
'intervention_D2_upgrade',
71
'intervention_D3_grants',
72
'intervention_D3_management',
73
'intervention_D3_other',
74
'intervention_D3_outreach_support',
75
'intervention_D3_rural',
76
'intervention_D4_conduct',
77
'intervention_D4_consult',
78
'intervention_D4_design',
79
'intervention_D4_other',
80
'intervention_D4_training',
81
'intervention_D5_conference',
82
'intervention_D5_journal',
83
'intervention_D5_networking',
84
'intervention_D5_other',
85
'intervention_D6_conference',
86
'intervention_D6_design',
87
'intervention_D6_dis_awards',
88
'intervention_D6_health_days',
89
'intervention_D6_nat_awards',
90
'intervention_D6_other'
98
function simple_prompt ($message, $show = null) {
101
$show_message = "/{$red}S{$black}how";
106
$message = trim($message) . "\n({$red}Y{$black}es/{$red}N{$black}o$show_message): ";
110
$c = strtolower(fread(STDIN,1));
118
echo $show . "\n" . $message;
131
function prompt ($message,&$universal, $show=null) {
133
if ($universal === true) {
136
if ($universal === false) {
139
$message = trim($message);
141
echo "$message\n({$red}Y{$black}es/{$red}N{$black}o/{$red}A{$black}lways/ne{$red}V{$black}er/{$red}S{$black}how): ";
143
echo "$message\n({$red}Y{$black}es/{$red}N{$black}o/{$red}A{$black}lways/ne{$red}V{$black}er): ";
147
$c = strtolower(fread(STDIN,1));
165
echo "\n" . $show . "\n";
166
echo "$message\n({$red}Y{$black}es/{$red}N{$black}o/{$red}A{$black}lways/ne{$red}V{$black}er): ";
181
<div class="editRecord">
184
<li role="planner"><span type="form" name="{{FORM}}:id" href="{{PAGE}}?redirect=view&id=" >Edit this Information</span></li>
185
<li><span href="{{PAGE}}?toggle&id=" type="form" name="{{FORM}}:id" >Enable/Disable</span></li>
188
</div> <!-- editRecord -->
189
<div class="dataTable">
190
<table border="0" cellspacing="0" cellpadding="0">
192
<th colspan="2">{{ACTIVITY}}</th>
196
<span type="form" name="{{FORM}}:pool" showhead="default" ></span>
197
<span type="form" name="{{FORM}}:enabled" showhead="default" ></span>
201
</div> <!-- dataTable -->
203
<br style="clear: both;" />
210
foreach ($forms as $form ) {
211
$in = $form . '.html';
212
$out = 'view_' . $form . '.html';
213
if (!file_exists($in)) {
214
echo "Could not find $in\n";
216
if (file_exists($out) && prompt("Skip generating $out as it already exists?",$skip)) {
219
$src = file_get_contents($in);
220
//<th colspan="2">Activity:Develop rural recruitment plan <span title="Input any activity costs to be paid during the duration of implementing the intervention; recurrent costs" class="fieldhelp">(?)</span></th>
222
if (! preg_match('/Activity\s*:\s*(.*?)</',$src,$matches)) {
223
echo "No activity found in $in\n";
226
$activity = $matches[1];
228
if (! preg_match('/<h2>(.*?)<\\/h2>/',$src,$matches)) {
229
echo "No intervention found in $in\n";
232
$intervention = $matches[1];
234
//page: interventionA1develop_recruitment
237
$replacements = array(
239
'PAGE'=>preg_replace('/_/','',$form, 2),
240
'ACTIVITY'=>$intervention . ' - <i>' . $activity . '</i>'
244
foreach ($replacements as $key=>$val) {
245
$html = preg_replace('/{{' . $key . '}}/',$val,$html);
247
file_put_contents($out, $html);
b'\\ No newline at end of file'