1
1
<?php
2
2
ob_start ();
3
3
include ('../General.php ' );
4
+
4
5
$ general =new Deforay_Commons_General ();
5
6
//global config
6
7
$ cSampleQuery ="SELECT * FROM global_config " ;
7
8
$ cSampleResult =$ db ->query ($ cSampleQuery );
8
- $ arr = array ();
9
+ $ gconfig = array ();
9
10
// now we create an associative array so that we can easily create view variables
10
11
for ($ i = 0 ; $ i < sizeof ($ cSampleResult ); $ i ++) {
11
- $ arr [$ cSampleResult [$ i ]['name ' ]] = $ cSampleResult [$ i ]['value ' ];
12
+ $ gconfig [$ cSampleResult [$ i ]['name ' ]] = $ cSampleResult [$ i ]['value ' ];
12
13
}
13
- if ($ arr ['sample_code ' ]=='auto ' || $ arr ['sample_code ' ]=='alphanumeric ' ){
14
+ if ($ gconfig ['sample_code ' ]=='auto ' || $ gconfig ['sample_code ' ]=='alphanumeric ' ){
14
15
$ numeric = '' ;
15
16
$ maxLength = '' ;
16
- if ($ arr ['max_length ' ]!='' && $ arr ['sample_code ' ]=='alphanumeric ' ){
17
- $ maxLength = $ arr ['max_length ' ];
17
+ if ($ gconfig ['max_length ' ]!='' && $ gconfig ['sample_code ' ]=='alphanumeric ' ){
18
+ $ maxLength = $ gconfig ['max_length ' ];
18
19
$ maxLength = "maxlength= " .$ maxLength ;
19
20
}
20
21
}else {
21
22
$ numeric = 'checkNum ' ;
22
23
$ maxLength = '' ;
23
- if ($ arr ['max_length ' ]!='' ){
24
- $ maxLength = $ arr ['max_length ' ];
24
+ if ($ gconfig ['max_length ' ]!='' ){
25
+ $ maxLength = $ gconfig ['max_length ' ];
25
26
$ maxLength = "maxlength= " .$ maxLength ;
26
27
}
27
28
}
131
132
<input type="text" class="form-control sampleCode isRequired <?php echo $ numeric ;?> " id="sampleCode" name="sampleCode" <?php echo $ maxLength ;?> placeholder="Enter Sample Code" title="Please enter sample code" style="width:100%;" onblur="checkNameValidation('vl_request_form','sample_code',this,null,'This sample code already exists.Try another number',null)" />
132
133
</div>
133
134
</div>
135
+
136
+
137
+ <!-- BARCODESTUFF START -->
138
+ <?php
139
+ if (isset ($ global ['bar_code_printing ' ]) && $ global ['bar_code_printing ' ] != "off " ){
140
+ ?>
141
+ <div class="col-xs-3 col-md-3 pull-right">
142
+ <div class="form-group">
143
+ <label for="sampleCode">Print Barcode Label<span class="mandatory">*</span> </label>
144
+ <input type="checkbox" class="" id="printBarCode" name="printBarCode" checked/>
145
+ </div>
146
+ </div>
147
+ <?php
148
+ }
149
+ ?>
150
+ <!-- BARCODESTUFF END -->
151
+
134
152
</div>
135
153
<div class="row">
136
154
<div class="col-xs-3 col-md-3">
331
349
?>
332
350
</select>
333
351
</td>
334
- <td><?php if (isset ($ arr ['sample_type ' ]) && trim ($ arr ['sample_type ' ]) == "enabled " ){ ?> <label for="specimenType">Specimen type</label><?php } ?> </td>
352
+ <td><?php if (isset ($ gconfig ['sample_type ' ]) && trim ($ gconfig ['sample_type ' ]) == "enabled " ){ ?> <label for="specimenType">Specimen type</label><?php } ?> </td>
335
353
<td>
336
- <?php if (isset ($ arr ['sample_type ' ]) && trim ($ arr ['sample_type ' ]) == "enabled " ){ ?>
354
+ <?php if (isset ($ gconfig ['sample_type ' ]) && trim ($ gconfig ['sample_type ' ]) == "enabled " ){ ?>
337
355
<select name="specimenType" id="specimenType" class="form-control" title="Please choose Specimen type">
338
356
<option value=""> -- Select -- </option>
339
357
<?php
417
435
<td colspan="3"><textarea class="form-control" name="labComments" id="labComments" title="Enter lab comments" style="width:100%"></textarea></td>
418
436
</tr>
419
437
</table>
438
+
439
+
440
+
420
441
</div>
421
442
</div>
422
443
</div>
423
444
<!-- /.box-body -->
424
445
<div class="box-footer">
446
+
447
+
448
+ <!-- BARCODESTUFF START -->
449
+ <?php
450
+ if (isset ($ global ['bar_code_printing ' ]) && $ global ['bar_code_printing ' ] == 'zebra-printer ' ){
451
+ ?>
452
+
453
+ <div id="printer_data_loading" style="display:none"><span id="loading_message">Loading Printer Details...</span><br/>
454
+ <div class="progress" style="width:100%">
455
+ <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
456
+ </div>
457
+ </div>
458
+ </div> <!-- /printer_data_loading -->
459
+ <div id="printer_details" style="display:none">
460
+ <span id="selected_printer">No printer selected!</span>
461
+ <button type="button" class="btn btn-success" onclick="changePrinter()">Change/Retry</button>
462
+ </div><br /> <!-- /printer_details -->
463
+ <div id="printer_select" style="display:none">
464
+ Zebra Printer Options<br />
465
+ Printer: <select id="printers"></select>
466
+ </div> <!-- /printer_select -->
467
+
468
+ <?php
469
+ }
470
+ ?>
471
+ <!-- BARCODESTUFF END -->
472
+
425
473
<a class="btn btn-primary" href="javascript:void(0);" onclick="validateNow();return false;">Save</a>
426
474
<input type="hidden" name="saveNext" id="saveNext"/>
427
475
<input type="hidden" name="formId" id="formId" value="4"/>
428
- <?php if ($ arr ['sample_code ' ]=='auto ' ){ ?>
476
+ <?php if ($ gconfig ['sample_code ' ]=='auto ' ){ ?>
429
477
<input type="hidden" name="sampleCodeFormat" id="sampleCodeFormat" value="<?php echo $ sFormat ;?> "/>
430
478
<input type="hidden" name="sampleCodeKey" id="sampleCodeKey" value="<?php echo $ sKey ;?> "/>
431
479
<?php } ?>
444
492
<!-- /.content -->
445
493
</div>
446
494
495
+
496
+ <!-- BARCODESTUFF START -->
497
+
498
+ <?php
499
+ if (isset ($ global ['bar_code_printing ' ]) && $ global ['bar_code_printing ' ] != "off " ){
500
+ if ($ global ['bar_code_printing ' ] == 'dymo-labelwriter-450 ' ){
501
+ ?>
502
+ <script src="../assets/js/DYMO.Label.Framework.2.0.2.js"></script>
503
+ <script src="../assets/js/dymo-print.js"></script>
504
+ <?php
505
+ }else if ($ global ['bar_code_printing ' ] == 'zebra-printer ' ){
506
+ ?>
507
+ <script src="../assets/js/BrowserPrint-1.0.4.min.js"></script>
508
+ <script src="../assets/js/zebra-print.js"></script>
509
+ <?php
510
+ }
511
+ }
512
+ ?>
513
+
514
+ <!-- BARCODESTUFF END -->
515
+
447
516
<script type="text/javascript">
448
517
449
518
provinceName = true;
450
519
facilityName = true;
451
520
machineName = true;
452
- $(document).ready(function() {
521
+ $(document).ready(function() {
522
+
523
+ // BARCODESTUFF START
524
+
525
+ <?php
526
+ if (isset ($ _GET ['barcode ' ]) && $ _GET ['barcode ' ] == 'true ' ){
527
+ echo "printBarcodeLabel(' " .$ _GET ['s ' ]."',' " .$ _GET ['f ' ]."'); " ;
528
+ }
529
+ ?>
530
+ // BARCODESTUFF END
531
+
453
532
$('.date').datepicker({
454
533
changeMonth: true,
455
534
changeYear: true,
479
558
});
480
559
});
481
560
function validateNow(){
482
- var format = '<?php echo $ arr ['sample_code ' ];?> ';
561
+ var format = '<?php echo $ gconfig ['sample_code ' ];?> ';
483
562
var sCodeLentgh = $("#sampleCode").val();
484
- var minLength = '<?php echo $ arr ['min_length ' ];?> ';
563
+ var minLength = '<?php echo $ gconfig ['min_length ' ];?> ';
485
564
if((format == 'alphanumeric' || format =='numeric') && sCodeLentgh.length < minLength && sCodeLentgh!=''){
486
565
alert("Sample code length atleast "+minLength+" characters");
487
566
return false;
@@ -504,9 +583,9 @@ function validateNow(){
504
583
}
505
584
}
506
585
function validateSaveNow(){
507
- var format = '<?php echo $ arr ['sample_code ' ];?> ';
586
+ var format = '<?php echo $ gconfig ['sample_code ' ];?> ';
508
587
var sCodeLentgh = $("#sampleCode").val();
509
- var minLength = '<?php echo $ arr ['min_length ' ];?> ';
588
+ var minLength = '<?php echo $ gconfig ['min_length ' ];?> ';
510
589
if((format == 'alphanumeric' || format =='numeric') && sCodeLentgh.length < minLength && sCodeLentgh!=''){
511
590
alert("Sample code length atleast "+minLength+" characters");
512
591
return false;
@@ -548,7 +627,7 @@ function(data){
548
627
});
549
628
}
550
629
<?php
551
- if ($ arr ['sample_code ' ]=='auto ' ){
630
+ if ($ gconfig ['sample_code ' ]=='auto ' ){
552
631
?>
553
632
pNameVal = pName.split("##");
554
633
sCode = '<?php echo date ('Ymd ' );?> ';
0 commit comments