https-bitbucket.org-bityvip-alpes /administrator/components/com_breezingforms/admin/integrator.html.php

Language PHP Lines 630
MD5 Hash 863f589b090aee3cc396c00a863f3269 Estimated Cost $5,668 (why?)
Repository https://bitbucket.org/izubizarreta/https-bitbucket.org-bityvip-alpes.git View Raw File View Project SPDX
  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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
<?php
/**
* BreezingForms - A Joomla Forms Application
* @version 1.8
* @package BreezingForms
* @copyright (C) 2008-2012 by Markus Bopp
* @license Released under the terms of the GNU General Public License
**/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');

class BFIntegratorHtml{
	
	public static function listRules($rules){
		
?>
<script>
function listItemTask( id, task ) {
    var f = document.adminForm;
    id.split('cb');
    f.task.value = task;
    f.publish_id.value = id.split('cb')[1];
    submitbutton(task);
    return false;
}
</script>

<form action="index.php" method="post">
<input type="hidden" name="option" value="com_breezingforms" />
<input type="hidden" name="act" value="integrate" />
<input type="hidden" name="task" value="" />
</form>

<?php
if(count($rules) == 0){
?>

<?php echo JText::_('No rules found');?>

<?php	 
}

?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<div id="editcell">
    <table class="adminlist table table-striped">
    <thead>
        <tr>
            <th width="5">
                <input type="checkbox" name="toggle" value="" onclick="<?php $version = new JVersion(); echo version_compare($version->getShortVersion(), '3.0', '>=') ? 'Joomla.checkAll(this);' : 'checkAll('.count($rules).');'; ?>" />
            </th>
            <th>
                <?php echo JText::_( 'Rulename' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Type' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Form' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Table' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'published' ); ?>
            </th>
        </tr>            
    </thead>
    <?php
    $k = 0;
    $cnt = count( $rules );
	for($i=0; $i < $cnt; $i++){
		$rule        = $rules[$i];
		$published   = JHTML::_('grid.published', $rule, $rule->id );
        $link = JRoute::_( 'index.php?option=com_breezingforms&act=integrate&task=edit&cid[]='. $rule->id );
        $checked     = JHTML::_( 'grid.id', $i, $rule->id );
    ?>
        <tbody>
    	<tr class="<?php echo "row$k"; ?>">
    		
    		<td><?php echo $checked; ?></td>
    		
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=edit&id=<?php echo $rule->id; ?>"><?php echo htmlentities($rule->name, ENT_COMPAT, 'UTF-8') ?></a></td>
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=edit&id=<?php echo $rule->id; ?>"><?php echo htmlentities($rule->type, ENT_COMPAT, 'UTF-8') ?></a></td>
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=edit&id=<?php echo $rule->id; ?>"><?php echo htmlentities($rule->form_name, ENT_COMPAT, 'UTF-8') ?></a></td>
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=edit&id=<?php echo $rule->id; ?>"><?php echo htmlentities($rule->reference_table, ENT_COMPAT, 'UTF-8') ?></a></td>
    		<td><?php echo $published; ?></td>
    			
    	</tr>
    <?php
    	$k = 1 - $k;
	}
    ?>
        </tbody>
    </table>
</div>
 
<input type="hidden" name="option" value="com_breezingforms" />
<input type="hidden" name="act" value="integrate" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="publish_id" value="-1" />

</form>

<br/>
<br/>

<?php	
		
	}
	
	public static function edit($rule, $items, $tables, $forms, $formElements, $criteriaForm, $criteriaJoomla, $criteriaFixed){
?> 

<h3><?php echo JText::_('Base Data') ?></h3>

<form action="index.php" method="post" name="adminForm" id="adminForm">
<div id="editcell">
    <table class="adminlist table table-striped">
    <thead>
        <tr>
            <th width="300">
                <?php echo JText::_( 'Rulename' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Form' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Table' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Type' ); ?>
            </th>
        </tr> 
       </thead>
        <tr class="row0">
    		
    		<td><input type="text" <?php echo $rule != null ? ' disabled="disabled" ' : '' ?> name="rule_name" value="<?php echo $rule != null ? htmlentities($rule->name, ENT_COMPAT, 'UTF-8') : '' ?>"/></td>
    		<td>
    		<?php
    		$disabled = '';
			foreach($forms As $form){
				if(isset($rule) && $form->id == $rule->form_id){
					$disabled = ' disabled="disabled" ';
					break;
				}
			}
    		?>
    		<select name="form_id" <?php echo $disabled ?>>
    		<?php
			foreach($forms As $form){
				$selected = '';
				if(isset($rule) && $form->id == $rule->form_id){
					$selected = ' selected="selected"';
				}
				?>
				<option <?php echo $selected ?> value="<?php echo htmlentities($form->id, ENT_COMPAT, 'UTF-8') ?>"><?php echo htmlentities($form->name, ENT_COMPAT, 'UTF-8') ?></option>
				<?php
			}
    		?>
    		</select>
    		</td>
    		<td>
    		<?php
    		$disabled = '';
    		$settings = array();
			foreach($tables As $tableName => $tableSettings){
				$selected = '';
				if(isset($rule) && $tableName == $rule->reference_table){
					$settings = $tableSettings;
					$disabled = ' disabled="disabled" ';
					break;
				}
			}
    		?>
    		<select name="reference_table" <?php echo $disabled ?>>
    		<?php
    		$refTable = '';
			foreach($tables As $tableName => $tableSettings){
				$selected = '';
				if(isset($rule) && $tableName == $rule->reference_table){
					$refTable = $tableName;
					$selected = ' selected="selected"';
				}
				?>
				<option <?php echo $selected ?> value="<?php echo htmlentities($tableName, ENT_COMPAT, 'UTF-8') ?>"><?php echo htmlentities($tableName, ENT_COMPAT, 'UTF-8') ?></option>
				<?php
			}
    		?>
    		</select>
    		</td>
    		<td>
    			<?php 
    			if(isset($rule)){
    				echo $rule->type;
    			} else {
    				echo JText::_('Insert') . ' <input checked="checked" type="radio" name="type" value="insert"/> ' . JText::_('Update') . ' <input type="radio" name="type" value="update"/>';	
    			}
    			?>
    		</td>
    	</tr>           
    
   </table>
  </div>
  
  <input type="hidden" name="option" value="com_breezingforms" />
  <input type="hidden" name="act" value="integrate" />
  <input type="hidden" name="task" value="update" />
  
 </form>

<?php 

if($rule != null){

?>

<br/>
<h3><?php echo JText::_('Data Integration') ?></h3>

<script>
function listItemTask( id, task ) {
    var f = document.addItemForm;
    id.split('cb');
    f.publish_id.value = id.split('cb')[1];
    
    if(task == 'publish' || task== 'unpublish'){
    	f.task.value = 'pub';
    	f.pub.value = task;
    	task = 'edit';
    }
    
    //f.task.value = task;
    f.submit();
    return false;
}
</script>

<form action="index.php?option=com_breezingforms&act=integrate" method="post" name="addItemForm">
<input type="hidden" name="publish_id" value="-1" />
<input type="hidden" name="task" value="addItem" />
<input type="hidden" name="id" value="<?php echo $rule->id ?>" />
<input type="hidden" name="pub" value="" />
<table class="adminlist table table-striped">
    <thead>
        <tr>
            <th width="300">
                <?php echo JText::_( 'Form Element (incoming)' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Copy To' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Database Field (outgoing)' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( '' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Publish' ); ?>
            </th>
        </tr> 
       </thead>

	<tr class="<?php echo "row0"; ?>">
		<td>
		<select name="element_id">
		<?php 
		foreach($formElements As $formElement){
			if($formElement->name != 'bfFakeName' && $formElement->name != 'bfFakeName2' && $formElement->name != 'bfFakeName3' && $formElement->name != 'bfFakeName4'){
			?>
			<option value="<?php echo $formElement->id ?>"><?php echo htmlentities($formElement->name, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($formElement->type, ENT_COMPAT, 'UTF-8') ?>)</option>
			<?php
			}
		}
		?>
		</select>
		</td>
	    <td align="center"><?php echo htmlentities('=>') ?></td>
	    <td>
	    <select name="reference_column">
		<?php 
		foreach($tables[$refTable] As $fieldName => $fieldSettings){
			?>
			<option value="<?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?>"><?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($fieldSettings, ENT_COMPAT, 'UTF-8') ?>)</option>
			<?php
		}
		?>
		</select>
	    </td>
	    <td colspan="2"><a href="javascript:document.addItemForm.submit();"><?php echo JText::_('add') ?></a></td>
    </tr>

	<?php
	$k = 1;
	
	foreach($items As $item){
		$published   = JHTML::_('grid.published', $item, $item->id );
	?>
		<tr class="<?php echo "row$k"; ?>">
    		
    		<td><?php echo htmlentities($item->element_name, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($item->element_type, ENT_COMPAT, 'UTF-8') ?>)</td>
    		<td align="center"><?php echo htmlentities('=>') ?></td>
    		<td><?php echo htmlentities($item->reference_column, ENT_COMPAT, 'UTF-8') ?> (<?php echo $settings[$item->reference_column] ?>)</td>
    		<td>
    		<span id="code<?php echo $item->id ?>" style="display:none">
    			<textarea id="codeText<?php echo $item->id ?>" style="width:100%;height:200px;" name="code"><?php echo htmlentities($item->code, ENT_COMPAT, 'UTF-8') ?></textarea>
    			<br/>
    			<a href="javascript:document.saveCodeForm.itemId.value=<?php echo $item->id ?>;document.saveCodeForm.code.value=document.getElementById('codeText<?php echo $item->id ?>').value;document.saveCodeForm.submit();"><?php echo JText::_('Save') ?></a> |
    		</span>
    		<a href="javascript:showCode(<?php echo $item->id ?>)"><?php echo JText::_('Code') ?></a>
    		|
    		<a href="index.php?option=com_breezingforms&act=integrate&task=removeItem&itemId=<?php echo $item->id ?>&id=<?php echo $rule->id ?>"><?php echo JText::_('Remove') ?></a></td>
    		<td><?php echo $published; ?></td>
    	</tr>
	<?php
		$k = 1 - $k;
	}
	?>
</table>
</form>

<form action="index.php?option=com_breezingforms&act=integrate" method="post" name="saveCodeForm">
<input type="hidden" name="task" value="saveCode" />
<input type="hidden" name="code" value="" />
<input type="hidden" name="itemId" value="-1" />
<input type="hidden" name="id" value="<?php echo $rule->id ?>" />
</form>

<script>
function showCode(id){
	if(document.getElementById('code'+id).style.display == 'none')
		document.getElementById('code'+id).style.display='';
	else
		document.getElementById('code'+id).style.display='none';
}
</script>

<?php
if($rule->type == 'update'){
?>

<br/>
<h3><?php echo JText::_('Update Criteria - Form') ?></h3>

<form action="index.php?option=com_breezingforms&act=integrate" method="post" name="addCriteriaForm">
<input type="hidden" name="publish_id" value="-1" />
<input type="hidden" name="task" value="addCriteria" />
<input type="hidden" name="id" value="<?php echo $rule->id ?>" />
<table class="adminlist table table-striped">
    <thead>
        <tr>
            <th width="300">
            	<?php echo JText::_( 'Database Field Value' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Operation' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Form Element Value' ); ?>
            </th>
            <th width="100">
                <?php echo JText::_( 'And/Or' ); ?>
            </th>
            <th>
                <?php echo JText::_( '' ); ?>
            </th>
        </tr> 
       </thead>

	<tr class="<?php echo "row0"; ?>">
		<td>
		<select name="reference_column">
		<?php 
		foreach($tables[$refTable] As $fieldName => $fieldSettings){
			?>
			<option value="<?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?>"><?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($fieldSettings, ENT_COMPAT, 'UTF-8') ?>)</option>
			<?php
		}
		?>
		</select>
		
		</td>
	    <td align="center">
	    
	    	<select name="operator">
	    		<option value="<?php echo htmlentities('=') ?>">equals</option>
	    		<option value="<?php echo htmlentities('<>') ?>">not equal</option>
	    		<option value="<?php echo htmlentities('>') ?>">greater than</option>
	    		<option value="<?php echo htmlentities('<') ?>">less than</option>
	    		<option value="<?php echo htmlentities('>=') ?>">equals or greater than</option>
	    		<option value="<?php echo htmlentities('<=') ?>">equals or less than</option>
	    		<option value="<?php echo htmlentities('%...%') ?>">in value</option>
	    		<option value="<?php echo htmlentities('%...') ?>">starts with</option>
	    		<option value="<?php echo htmlentities('...%') ?>">ends with</option>	    		
	    	</select>
	    
	    </td>
	    <td>
	    <select name="element_id">
		<?php 
		foreach($formElements As $formElement){
			if($formElement->name != 'bfFakeName' && $formElement->name != 'bfFakeName2' && $formElement->name != 'bfFakeName3' && $formElement->name != 'bfFakeName4'){
			?>
			<option value="<?php echo $formElement->id ?>"><?php echo htmlentities($formElement->name, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($formElement->type, ENT_COMPAT, 'UTF-8') ?>)</option>
			<?php
			}
		}
		?>
		</select>
	    </td>
	    <td><?php echo JText::_('A N D') ?> <input type="radio" name="andor" value="AND" checked="checked" /> <?php echo JText::_('O R') ?> <input type="radio" name="andor" value="OR" /></td>
	    <td colspan="2"><a href="javascript:document.addCriteriaForm.submit();"><?php echo JText::_('add') ?></a></td>
    </tr>

	<?php
	$k = 1;
	
	foreach($criteriaForm As $criteria){
	?>
		<tr class="<?php echo "row$k"; ?>">
    		
    		<td><?php echo htmlentities($criteria->reference_column, ENT_COMPAT, 'UTF-8') ?> (<?php echo $settings[$criteria->reference_column] ?>)</td>
    		<td align="center"><?php echo htmlentities($criteria->operator, ENT_COMPAT, 'UTF-8') ?></td>
			<td><?php echo htmlentities($criteria->element_name, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($criteria->element_type, ENT_COMPAT, 'UTF-8') ?>)</td>    		
    		<td><?php echo htmlentities($criteria->andor, ENT_COMPAT, 'UTF-8') ?> </td>
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=removeCriteria&criteriaId=<?php echo $criteria->id ?>&id=<?php echo $rule->id ?>"><?php echo JText::_('Remove') ?></a></td>
    	</tr>
	<?php
		$k = 1 - $k;
	}
	?>
</table>
</form>

<br/>
<h3><?php echo JText::_('Update Criteria - Joomla!') ?></h3>

<form action="index.php?option=com_breezingforms&act=integrate" method="post" name="addCriteriaJoomlaForm">
<input type="hidden" name="publish_id" value="-1" />
<input type="hidden" name="task" value="addCriteriaJoomla" />
<input type="hidden" name="id" value="<?php echo $rule->id ?>" />
<table class="adminlist table table-striped">
    <thead>
        <tr>
            <th width="300">
            	<?php echo JText::_( 'Database Field Value' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Operation' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Joomla Object Value' ); ?>
            </th>
            <th width="100">
                <?php echo JText::_( 'And/Or' ); ?>
            </th>
            <th>
                <?php echo JText::_( '' ); ?>
            </th>
        </tr> 
       </thead>

	<tr class="<?php echo "row0"; ?>">
		<td>
		<select name="reference_column">
		<?php 
		foreach($tables[$refTable] As $fieldName => $fieldSettings){
			?>
			<option value="<?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?>"><?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($fieldSettings, ENT_COMPAT, 'UTF-8') ?>)</option>
			<?php
		}
		?>
		</select>
		
		</td>
	    <td align="center">
	    
	    	<select name="operator">
	    		<option value="<?php echo htmlentities('=') ?>">equals</option>
	    		<option value="<?php echo htmlentities('<>') ?>">not equal</option>
	    		<option value="<?php echo htmlentities('>') ?>">greater than</option>
	    		<option value="<?php echo htmlentities('<') ?>">less than</option>
	    		<option value="<?php echo htmlentities('>=') ?>">equals or greater than</option>
	    		<option value="<?php echo htmlentities('<=') ?>">equals or less than</option>
	    		<option value="<?php echo htmlentities('%...%') ?>">in value</option>
	    		<option value="<?php echo htmlentities('%...') ?>">starts with</option>
	    		<option value="<?php echo htmlentities('...%') ?>">ends with</option>	    		
	    	</select>
	    
	    </td>
	    <td>
	    <select name="joomla_object">

			<option value="Userid"><?php echo JText::_('Userid') ?></option>
			<option value="Username"><?php echo JText::_('Username') ?></option>
			<option value="Language"><?php echo JText::_('Language') ?></option>
			<option value="Date"><?php echo JText::_('Date') ?></option>

		</select>
	    </td>
	    <td><?php echo JText::_('A N D') ?> <input type="radio" name="andor" value="AND" checked="checked" /> <?php echo JText::_('O R') ?> <input type="radio" name="andor" value="OR" /></td>
	    <td colspan="2"><a href="javascript:document.addCriteriaJoomlaForm.submit();"><?php echo JText::_('add') ?></a></td>
    </tr>

	<?php
	$k = 1;
	
	foreach($criteriaJoomla As $criteria){
	?>
		<tr class="<?php echo "row$k"; ?>">
    		
    		<td><?php echo htmlentities($criteria->reference_column, ENT_COMPAT, 'UTF-8') ?> (<?php echo $settings[$criteria->reference_column] ?>)</td>
    		<td align="center"><?php echo htmlentities($criteria->operator, ENT_COMPAT, 'UTF-8') ?></td>
			<td><?php echo htmlentities($criteria->joomla_object, ENT_COMPAT, 'UTF-8') ?></td>    		
    		<td><?php echo htmlentities($criteria->andor, ENT_COMPAT, 'UTF-8') ?> </td>
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=removeCriteriaJoomla&criteriaId=<?php echo $criteria->id ?>&id=<?php echo $rule->id ?>"><?php echo JText::_('Remove') ?></a></td>
    	</tr>
	<?php
		$k = 1 - $k;
	}
	?>
</table>
</form>

<br/>
<h3><?php echo JText::_('Update Criteria - Fixed') ?></h3>

<form action="index.php?option=com_breezingforms&act=integrate" method="post" name="addCriteriaFixedForm">
<input type="hidden" name="publish_id" value="-1" />
<input type="hidden" name="task" value="addCriteriaFixed" />
<input type="hidden" name="id" value="<?php echo $rule->id ?>" />
<table class="adminlist table table-striped">
    <thead>
        <tr>
            <th width="300">
            	<?php echo JText::_( 'Database Field Value' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Operation' ); ?>
            </th>
            <th width="300">
                <?php echo JText::_( 'Fixed Value' ); ?>
            </th>
            <th width="100">
                <?php echo JText::_( 'And/Or' ); ?>
            </th>
            <th>
                <?php echo JText::_( '' ); ?>
            </th>
        </tr> 
       </thead>

	<tr class="<?php echo "row0"; ?>">
		<td>
		<select name="reference_column">
		<?php 
		foreach($tables[$refTable] As $fieldName => $fieldSettings){
			?>
			<option value="<?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?>"><?php echo htmlentities($fieldName, ENT_COMPAT, 'UTF-8') ?> (<?php echo htmlentities($fieldSettings, ENT_COMPAT, 'UTF-8') ?>)</option>
			<?php
		}
		?>
		</select>
		
		</td>
	    <td align="center">
	    
	    	<select name="operator">
	    		<option value="<?php echo htmlentities('=') ?>">equals</option>
	    		<option value="<?php echo htmlentities('<>') ?>">not equal</option>
	    		<option value="<?php echo htmlentities('>') ?>">greater than</option>
	    		<option value="<?php echo htmlentities('<') ?>">less than</option>
	    		<option value="<?php echo htmlentities('>=') ?>">equals or greater than</option>
	    		<option value="<?php echo htmlentities('<=') ?>">equals or less than</option>
	    		<option value="<?php echo htmlentities('%...%') ?>">in value</option>
	    		<option value="<?php echo htmlentities('%...') ?>">starts with</option>
	    		<option value="<?php echo htmlentities('...%') ?>">ends with</option>	    		
	    	</select>
	    
	    </td>
	    <td>
	    	<input style="width:100%" type="text" name="fixed_value" value=""/>
	    </td>
	    <td><?php echo JText::_('A N D') ?> <input type="radio" name="andor" value="AND" checked="checked" /> <?php echo JText::_('O R') ?> <input type="radio" name="andor" value="OR" /></td>
	    <td colspan="2"><a href="javascript:document.addCriteriaFixedForm.submit();"><?php echo JText::_('add') ?></a></td>
    </tr>

	<?php
	$k = 1;
	
	foreach($criteriaFixed As $criteria){
	?>
		<tr class="<?php echo "row$k"; ?>">
    		
    		<td><?php echo htmlentities($criteria->reference_column, ENT_COMPAT, 'UTF-8') ?> (<?php echo $settings[$criteria->reference_column] ?>)</td>
    		<td align="center"><?php echo htmlentities($criteria->operator, ENT_COMPAT, 'UTF-8') ?></td>
			<td><?php echo htmlentities($criteria->fixed_value, ENT_COMPAT, 'UTF-8') ?> </td>    		
    		<td><?php echo htmlentities($criteria->andor, ENT_COMPAT, 'UTF-8') ?> </td>
    		<td><a href="index.php?option=com_breezingforms&act=integrate&task=removeCriteriaFixed&criteriaId=<?php echo $criteria->id ?>&id=<?php echo $rule->id ?>"><?php echo JText::_('Remove') ?></a></td>
    	</tr>
	<?php
		$k = 1 - $k;
	}
	?>
</table>
</form>

<?php
}	
		}
if($rule != null){
?>

<br/>
<h3><?php echo JText::_('Finalize Code') ?></h3>

<form action="index.php?option=com_breezingforms&act=integrate" method="post" name="saveFinalizeCodeForm">
<input type="hidden" name="publish_id" value="-1" />
<input type="hidden" name="task" value="saveFinalizeCode" />
<input type="hidden" name="id" value="<?php echo $rule->id ?>" />
<textarea id="finalizeCodeText" style="width:100%;height:100px;" name="finalizeCode"><?php echo htmlentities($rule->finalize_code, ENT_COMPAT, 'UTF-8') ?></textarea>
<br/>
<a href="javascript:document.saveFinalizeCodeForm.submit();"><?php echo JText::_('Save') ?></a>
</form>

<?php
}
	}
}
Back to Top