-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.php
4521 lines (4166 loc) · 330 KB
/
script.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
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
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/*----------------------------------------------------------------------------------| www.vdm.io |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 1.0.4
@build 11th December, 2020
@created 13th August, 2020
@package eClinic Portal
@subpackage script.php
@author Oh Martin <https://vdm.io>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.modal');
/**
* Script File of Eclinic_portal Component
*/
class com_eclinic_portalInstallerScript
{
/**
* Constructor
*
* @param JAdapterInstance $parent The object responsible for running this script
*/
public function __construct(JAdapterInstance $parent) {}
/**
* Called on installation
*
* @param JAdapterInstance $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function install(JAdapterInstance $parent) {}
/**
* Called on uninstallation
*
* @param JAdapterInstance $parent The object responsible for running this script
*/
public function uninstall(JAdapterInstance $parent)
{
// [Interpretation 8043] Get Application object
$app = JFactory::getApplication();
// [Interpretation 8048] Get The Database object
$db = JFactory::getDbo();
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Payment alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.payment') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$payment_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($payment_found)
{
// [Interpretation 8285] Since there are load the needed payment type ids
$payment_ids = $db->loadColumn();
// [Interpretation 8293] Remove Payment from the content type table
$payment_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.payment') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($payment_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Payment items
$payment_done = $db->execute();
if ($payment_done)
{
// [Interpretation 8318] If successfully remove Payment add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.payment) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Payment items from the contentitem tag map table
$payment_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.payment') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($payment_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Payment items
$payment_done = $db->execute();
if ($payment_done)
{
// [Interpretation 8353] If successfully remove Payment add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.payment) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Payment items from the ucm content table
$payment_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.payment') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($payment_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Payment items
$payment_done = $db->execute();
if ($payment_done)
{
// [Interpretation 8388] If successfully removed Payment add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.payment) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Payment items are cleared from DB
foreach ($payment_ids as $payment_id)
{
// [Interpretation 8407] Remove Payment items from the ucm base table
$payment_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $payment_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($payment_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Payment items
$db->execute();
// [Interpretation 8431] Remove Payment items from the ucm history table
$payment_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $payment_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($payment_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Payment items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where General_medical_check_up alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.general_medical_check_up') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$general_medical_check_up_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($general_medical_check_up_found)
{
// [Interpretation 8285] Since there are load the needed general_medical_check_up type ids
$general_medical_check_up_ids = $db->loadColumn();
// [Interpretation 8293] Remove General_medical_check_up from the content type table
$general_medical_check_up_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.general_medical_check_up') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove General_medical_check_up items
$general_medical_check_up_done = $db->execute();
if ($general_medical_check_up_done)
{
// [Interpretation 8318] If successfully remove General_medical_check_up add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.general_medical_check_up) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove General_medical_check_up items from the contentitem tag map table
$general_medical_check_up_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.general_medical_check_up') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove General_medical_check_up items
$general_medical_check_up_done = $db->execute();
if ($general_medical_check_up_done)
{
// [Interpretation 8353] If successfully remove General_medical_check_up add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.general_medical_check_up) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove General_medical_check_up items from the ucm content table
$general_medical_check_up_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.general_medical_check_up') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove General_medical_check_up items
$general_medical_check_up_done = $db->execute();
if ($general_medical_check_up_done)
{
// [Interpretation 8388] If successfully removed General_medical_check_up add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.general_medical_check_up) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the General_medical_check_up items are cleared from DB
foreach ($general_medical_check_up_ids as $general_medical_check_up_id)
{
// [Interpretation 8407] Remove General_medical_check_up items from the ucm base table
$general_medical_check_up_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $general_medical_check_up_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove General_medical_check_up items
$db->execute();
// [Interpretation 8431] Remove General_medical_check_up items from the ucm history table
$general_medical_check_up_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $general_medical_check_up_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($general_medical_check_up_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove General_medical_check_up items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Antenatal_care alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.antenatal_care') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$antenatal_care_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($antenatal_care_found)
{
// [Interpretation 8285] Since there are load the needed antenatal_care type ids
$antenatal_care_ids = $db->loadColumn();
// [Interpretation 8293] Remove Antenatal_care from the content type table
$antenatal_care_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.antenatal_care') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Antenatal_care items
$antenatal_care_done = $db->execute();
if ($antenatal_care_done)
{
// [Interpretation 8318] If successfully remove Antenatal_care add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.antenatal_care) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Antenatal_care items from the contentitem tag map table
$antenatal_care_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.antenatal_care') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Antenatal_care items
$antenatal_care_done = $db->execute();
if ($antenatal_care_done)
{
// [Interpretation 8353] If successfully remove Antenatal_care add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.antenatal_care) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Antenatal_care items from the ucm content table
$antenatal_care_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.antenatal_care') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Antenatal_care items
$antenatal_care_done = $db->execute();
if ($antenatal_care_done)
{
// [Interpretation 8388] If successfully removed Antenatal_care add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.antenatal_care) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Antenatal_care items are cleared from DB
foreach ($antenatal_care_ids as $antenatal_care_id)
{
// [Interpretation 8407] Remove Antenatal_care items from the ucm base table
$antenatal_care_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $antenatal_care_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Antenatal_care items
$db->execute();
// [Interpretation 8431] Remove Antenatal_care items from the ucm history table
$antenatal_care_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $antenatal_care_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($antenatal_care_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Antenatal_care items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Immunisation alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.immunisation') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$immunisation_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($immunisation_found)
{
// [Interpretation 8285] Since there are load the needed immunisation type ids
$immunisation_ids = $db->loadColumn();
// [Interpretation 8293] Remove Immunisation from the content type table
$immunisation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.immunisation') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($immunisation_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Immunisation items
$immunisation_done = $db->execute();
if ($immunisation_done)
{
// [Interpretation 8318] If successfully remove Immunisation add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.immunisation) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Immunisation items from the contentitem tag map table
$immunisation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.immunisation') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($immunisation_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Immunisation items
$immunisation_done = $db->execute();
if ($immunisation_done)
{
// [Interpretation 8353] If successfully remove Immunisation add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.immunisation) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Immunisation items from the ucm content table
$immunisation_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.immunisation') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($immunisation_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Immunisation items
$immunisation_done = $db->execute();
if ($immunisation_done)
{
// [Interpretation 8388] If successfully removed Immunisation add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.immunisation) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Immunisation items are cleared from DB
foreach ($immunisation_ids as $immunisation_id)
{
// [Interpretation 8407] Remove Immunisation items from the ucm base table
$immunisation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($immunisation_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Immunisation items
$db->execute();
// [Interpretation 8431] Remove Immunisation items from the ucm history table
$immunisation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $immunisation_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($immunisation_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Immunisation items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Vmmc alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.vmmc') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$vmmc_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($vmmc_found)
{
// [Interpretation 8285] Since there are load the needed vmmc type ids
$vmmc_ids = $db->loadColumn();
// [Interpretation 8293] Remove Vmmc from the content type table
$vmmc_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.vmmc') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($vmmc_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Vmmc items
$vmmc_done = $db->execute();
if ($vmmc_done)
{
// [Interpretation 8318] If successfully remove Vmmc add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.vmmc) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Vmmc items from the contentitem tag map table
$vmmc_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.vmmc') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($vmmc_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Vmmc items
$vmmc_done = $db->execute();
if ($vmmc_done)
{
// [Interpretation 8353] If successfully remove Vmmc add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.vmmc) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Vmmc items from the ucm content table
$vmmc_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.vmmc') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($vmmc_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Vmmc items
$vmmc_done = $db->execute();
if ($vmmc_done)
{
// [Interpretation 8388] If successfully removed Vmmc add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.vmmc) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Vmmc items are cleared from DB
foreach ($vmmc_ids as $vmmc_id)
{
// [Interpretation 8407] Remove Vmmc items from the ucm base table
$vmmc_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $vmmc_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($vmmc_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Vmmc items
$db->execute();
// [Interpretation 8431] Remove Vmmc items from the ucm history table
$vmmc_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $vmmc_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($vmmc_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Vmmc items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Prostate_and_testicular_cancer alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.prostate_and_testicular_cancer') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$prostate_and_testicular_cancer_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($prostate_and_testicular_cancer_found)
{
// [Interpretation 8285] Since there are load the needed prostate_and_testicular_cancer type ids
$prostate_and_testicular_cancer_ids = $db->loadColumn();
// [Interpretation 8293] Remove Prostate_and_testicular_cancer from the content type table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.prostate_and_testicular_cancer') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Prostate_and_testicular_cancer items
$prostate_and_testicular_cancer_done = $db->execute();
if ($prostate_and_testicular_cancer_done)
{
// [Interpretation 8318] If successfully remove Prostate_and_testicular_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.prostate_and_testicular_cancer) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Prostate_and_testicular_cancer items from the contentitem tag map table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.prostate_and_testicular_cancer') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Prostate_and_testicular_cancer items
$prostate_and_testicular_cancer_done = $db->execute();
if ($prostate_and_testicular_cancer_done)
{
// [Interpretation 8353] If successfully remove Prostate_and_testicular_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.prostate_and_testicular_cancer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Prostate_and_testicular_cancer items from the ucm content table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.prostate_and_testicular_cancer') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Prostate_and_testicular_cancer items
$prostate_and_testicular_cancer_done = $db->execute();
if ($prostate_and_testicular_cancer_done)
{
// [Interpretation 8388] If successfully removed Prostate_and_testicular_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.prostate_and_testicular_cancer) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Prostate_and_testicular_cancer items are cleared from DB
foreach ($prostate_and_testicular_cancer_ids as $prostate_and_testicular_cancer_id)
{
// [Interpretation 8407] Remove Prostate_and_testicular_cancer items from the ucm base table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $prostate_and_testicular_cancer_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Prostate_and_testicular_cancer items
$db->execute();
// [Interpretation 8431] Remove Prostate_and_testicular_cancer items from the ucm history table
$prostate_and_testicular_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $prostate_and_testicular_cancer_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($prostate_and_testicular_cancer_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Prostate_and_testicular_cancer items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Tuberculosis alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.tuberculosis') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$tuberculosis_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($tuberculosis_found)
{
// [Interpretation 8285] Since there are load the needed tuberculosis type ids
$tuberculosis_ids = $db->loadColumn();
// [Interpretation 8293] Remove Tuberculosis from the content type table
$tuberculosis_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.tuberculosis') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Tuberculosis items
$tuberculosis_done = $db->execute();
if ($tuberculosis_done)
{
// [Interpretation 8318] If successfully remove Tuberculosis add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.tuberculosis) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Tuberculosis items from the contentitem tag map table
$tuberculosis_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.tuberculosis') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Tuberculosis items
$tuberculosis_done = $db->execute();
if ($tuberculosis_done)
{
// [Interpretation 8353] If successfully remove Tuberculosis add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.tuberculosis) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Tuberculosis items from the ucm content table
$tuberculosis_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.tuberculosis') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Tuberculosis items
$tuberculosis_done = $db->execute();
if ($tuberculosis_done)
{
// [Interpretation 8388] If successfully removed Tuberculosis add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.tuberculosis) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Tuberculosis items are cleared from DB
foreach ($tuberculosis_ids as $tuberculosis_id)
{
// [Interpretation 8407] Remove Tuberculosis items from the ucm base table
$tuberculosis_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $tuberculosis_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Tuberculosis items
$db->execute();
// [Interpretation 8431] Remove Tuberculosis items from the ucm history table
$tuberculosis_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $tuberculosis_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($tuberculosis_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Tuberculosis items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Hiv_counseling_and_testing alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.hiv_counseling_and_testing') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$hiv_counseling_and_testing_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($hiv_counseling_and_testing_found)
{
// [Interpretation 8285] Since there are load the needed hiv_counseling_and_testing type ids
$hiv_counseling_and_testing_ids = $db->loadColumn();
// [Interpretation 8293] Remove Hiv_counseling_and_testing from the content type table
$hiv_counseling_and_testing_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.hiv_counseling_and_testing') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Hiv_counseling_and_testing items
$hiv_counseling_and_testing_done = $db->execute();
if ($hiv_counseling_and_testing_done)
{
// [Interpretation 8318] If successfully remove Hiv_counseling_and_testing add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.hiv_counseling_and_testing) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Hiv_counseling_and_testing items from the contentitem tag map table
$hiv_counseling_and_testing_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.hiv_counseling_and_testing') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Hiv_counseling_and_testing items
$hiv_counseling_and_testing_done = $db->execute();
if ($hiv_counseling_and_testing_done)
{
// [Interpretation 8353] If successfully remove Hiv_counseling_and_testing add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.hiv_counseling_and_testing) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Hiv_counseling_and_testing items from the ucm content table
$hiv_counseling_and_testing_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.hiv_counseling_and_testing') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Hiv_counseling_and_testing items
$hiv_counseling_and_testing_done = $db->execute();
if ($hiv_counseling_and_testing_done)
{
// [Interpretation 8388] If successfully removed Hiv_counseling_and_testing add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.hiv_counseling_and_testing) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Hiv_counseling_and_testing items are cleared from DB
foreach ($hiv_counseling_and_testing_ids as $hiv_counseling_and_testing_id)
{
// [Interpretation 8407] Remove Hiv_counseling_and_testing items from the ucm base table
$hiv_counseling_and_testing_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $hiv_counseling_and_testing_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Hiv_counseling_and_testing items
$db->execute();
// [Interpretation 8431] Remove Hiv_counseling_and_testing items from the ucm history table
$hiv_counseling_and_testing_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $hiv_counseling_and_testing_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($hiv_counseling_and_testing_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Hiv_counseling_and_testing items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Family_planning alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.family_planning') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$family_planning_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($family_planning_found)
{
// [Interpretation 8285] Since there are load the needed family_planning type ids
$family_planning_ids = $db->loadColumn();
// [Interpretation 8293] Remove Family_planning from the content type table
$family_planning_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.family_planning') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($family_planning_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Family_planning items
$family_planning_done = $db->execute();
if ($family_planning_done)
{
// [Interpretation 8318] If successfully remove Family_planning add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.family_planning) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Family_planning items from the contentitem tag map table
$family_planning_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.family_planning') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($family_planning_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Family_planning items
$family_planning_done = $db->execute();
if ($family_planning_done)
{
// [Interpretation 8353] If successfully remove Family_planning add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.family_planning) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Family_planning items from the ucm content table
$family_planning_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.family_planning') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($family_planning_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Family_planning items
$family_planning_done = $db->execute();
if ($family_planning_done)
{
// [Interpretation 8388] If successfully removed Family_planning add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.family_planning) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Family_planning items are cleared from DB
foreach ($family_planning_ids as $family_planning_id)
{
// [Interpretation 8407] Remove Family_planning items from the ucm base table
$family_planning_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $family_planning_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($family_planning_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Family_planning items
$db->execute();
// [Interpretation 8431] Remove Family_planning items from the ucm history table
$family_planning_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $family_planning_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($family_planning_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Family_planning items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Cervical_cancer alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.cervical_cancer') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$cervical_cancer_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($cervical_cancer_found)
{
// [Interpretation 8285] Since there are load the needed cervical_cancer type ids
$cervical_cancer_ids = $db->loadColumn();
// [Interpretation 8293] Remove Cervical_cancer from the content type table
$cervical_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.cervical_cancer') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Cervical_cancer items
$cervical_cancer_done = $db->execute();
if ($cervical_cancer_done)
{
// [Interpretation 8318] If successfully remove Cervical_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.cervical_cancer) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Cervical_cancer items from the contentitem tag map table
$cervical_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.cervical_cancer') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Cervical_cancer items
$cervical_cancer_done = $db->execute();
if ($cervical_cancer_done)
{
// [Interpretation 8353] If successfully remove Cervical_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.cervical_cancer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Cervical_cancer items from the ucm content table
$cervical_cancer_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.cervical_cancer') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Cervical_cancer items
$cervical_cancer_done = $db->execute();
if ($cervical_cancer_done)
{
// [Interpretation 8388] If successfully removed Cervical_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.cervical_cancer) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Cervical_cancer items are cleared from DB
foreach ($cervical_cancer_ids as $cervical_cancer_id)
{
// [Interpretation 8407] Remove Cervical_cancer items from the ucm base table
$cervical_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $cervical_cancer_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Cervical_cancer items
$db->execute();
// [Interpretation 8431] Remove Cervical_cancer items from the ucm history table
$cervical_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $cervical_cancer_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($cervical_cancer_condition);
$db->setQuery($query);
// [Interpretation 8447] Execute the query to remove Cervical_cancer items
$db->execute();
}
}
// [Interpretation 8255] Create a new query object.
$query = $db->getQuery(true);
// [Interpretation 8259] Select id from content type table
$query->select($db->quoteName('type_id'));
$query->from($db->quoteName('#__content_types'));
// [Interpretation 8266] Where Breast_cancer alias is found
$query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.breast_cancer') );
$db->setQuery($query);
// [Interpretation 8273] Execute query to see if alias is found
$db->execute();
$breast_cancer_found = $db->getNumRows();
// [Interpretation 8279] Now check if there were any rows
if ($breast_cancer_found)
{
// [Interpretation 8285] Since there are load the needed breast_cancer type ids
$breast_cancer_ids = $db->loadColumn();
// [Interpretation 8293] Remove Breast_cancer from the content type table
$breast_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.breast_cancer') );
// [Interpretation 8300] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__content_types'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// [Interpretation 8310] Execute the query to remove Breast_cancer items
$breast_cancer_done = $db->execute();
if ($breast_cancer_done)
{
// [Interpretation 8318] If successfully remove Breast_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.breast_cancer) type alias was removed from the <b>#__content_type</b> table'));
}
// [Interpretation 8329] Remove Breast_cancer items from the contentitem tag map table
$breast_cancer_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_eclinic_portal.breast_cancer') );
// [Interpretation 8335] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__contentitem_tag_map'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// [Interpretation 8345] Execute the query to remove Breast_cancer items
$breast_cancer_done = $db->execute();
if ($breast_cancer_done)
{
// [Interpretation 8353] If successfully remove Breast_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.breast_cancer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
// [Interpretation 8364] Remove Breast_cancer items from the ucm content table
$breast_cancer_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_eclinic_portal.breast_cancer') );
// [Interpretation 8370] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_content'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// [Interpretation 8380] Execute the query to remove Breast_cancer items
$breast_cancer_done = $db->execute();
if ($breast_cancer_done)
{
// [Interpretation 8388] If successfully removed Breast_cancer add queued success message.
$app->enqueueMessage(JText::_('The (com_eclinic_portal.breast_cancer) type alias was removed from the <b>#__ucm_content</b> table'));
}
// [Interpretation 8399] Make sure that all the Breast_cancer items are cleared from DB
foreach ($breast_cancer_ids as $breast_cancer_id)
{
// [Interpretation 8407] Remove Breast_cancer items from the ucm base table
$breast_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $breast_cancer_id);
// [Interpretation 8414] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_base'));
$query->where($breast_cancer_condition);
$db->setQuery($query);
// [Interpretation 8424] Execute the query to remove Breast_cancer items
$db->execute();
// [Interpretation 8431] Remove Breast_cancer items from the ucm history table
$breast_cancer_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $breast_cancer_id);
// [Interpretation 8437] Create a new query object.
$query = $db->getQuery(true);
$query->delete($db->quoteName('#__ucm_history'));
$query->where($breast_cancer_condition);
$db->setQuery($query);