<?php

use Phalcon\Mvc\Model\Migration;

class InsertIndikatorPancekMigration_544 extends Migration {
    public function up() {
        self::$connection->execute("
            UPDATE jaga.pancek_indikator SET code = 'R.3', view_order = 25 WHERE code = 'R.1' AND formulir_type = 2;
            UPDATE jaga.pancek_komponen_indikator SET code = 'R.3.a', view_order = 63, bobot = 30 WHERE code = 'R.1.a' AND formulir_type = 2;
            UPDATE jaga.pancek_komponen_indikator SET code = 'R.3.b', view_order = 64, bobot = 30 WHERE code = 'R.1.b' AND formulir_type = 2;
            
            INSERT INTO jaga.pancek_indikator (konsep_sistem_pencegahan_id, code, label, view_order, formulir_type, label_en) VALUES ((SELECT id FROM jaga.pancek_konsep_sistem_pencegahan WHERE code = 'R' AND formulir_type = 2), 'R.1', '<p>Tunjukkan bahwa korporasi tergabung dalam asosiasi bisnis/perkumpulan profesi.</p>', 23, 2, '<p>Indicate that the corporation belongs to a business association/professional society</p>');
            INSERT INTO jaga.pancek_indikator (konsep_sistem_pencegahan_id, code, label, view_order, formulir_type, label_en) VALUES ((SELECT id FROM jaga.pancek_konsep_sistem_pencegahan WHERE code = 'R' AND formulir_type = 2), 'R.2', '<p>Tunjukkan bahwa korporasi terlibat dalam aksi kolektif kolaborasi antikorupsi.</p>', 24, 2, '<p>Whether or not the business association/professional association has an agenda that addresses corruption issues.</p>');
            
            
            INSERT INTO jaga.pancek_komponen_indikator (indikator_id, code, label, is_header, view_order, bobot, formulir_type, label_en) VALUES ((SELECT id FROM jaga.pancek_indikator WHERE code = 'R.1' AND formulir_type = 2), 'R.1.a', '<p>Bukti keanggotaan korporasi dalam asosiasi bisnis/perkumpulan profesi.</p>', 'f', 59, 10, 2, '<p>Proof of corporate membership in a business association/professional association.</p>');
            INSERT INTO jaga.pancek_komponen_indikator (indikator_id, code, label, is_header, view_order, bobot, formulir_type, label_en) VALUES ((SELECT id FROM jaga.pancek_indikator WHERE code = 'R.1' AND formulir_type = 2), 'R.1.b', '<p>Asosiasi bisnis/perkumpulan profesi tersebut memiliki agenda yang membahas isu korupsi atau tidak.</p>', 'f', 60, 10, 2, '<p>Whether or not the business association/professional association has an agenda that addresses corruption issues.</p>');
            
            INSERT INTO jaga.pancek_komponen_indikator (indikator_id, code, label, is_header, view_order, bobot, formulir_type, label_en) VALUES ((SELECT id FROM jaga.pancek_indikator WHERE code = 'R.2' AND formulir_type = 2), 'R.2.a', '<p>Bukti adanya keterlibatan aktif korporasi dalam forum komunikasi antarpemangku kepentingan dalam suatu kelompok kerja antikorupsi (contoh: laporan, workshop, dokumentasi, dll).</p>', 'f', 61, 10, 2, '<p>Evidence of the corporation''s active involvement in a communication forum between stakeholders in an anticorruption working group (for example: reports, workshops, documentation, etc.)</p>');
            INSERT INTO jaga.pancek_komponen_indikator (indikator_id, code, label, is_header, view_order, bobot, formulir_type, label_en) VALUES ((SELECT id FROM jaga.pancek_indikator WHERE code = 'R.2' AND formulir_type = 2), 'R.2.b', '<p>Bukti adanya keterlibatan aktif korporasi dalam forum komunikasi lintas sektoral meliputi lembaga nonpemerintah, yayasan, akademisi, instansi pemerintah, dan lain-lain yang mengangkat isu antikorupsi.</p>', 'f', 62, 10, 2, '<p>Evidence of active corporate involvement in crosssectoral communication forums including nongovernmental organizations, foundations, academics, government agencies, and others that raise anticorruption issues.</p>');
        ");
    }
    public function down() {
        self::$connection->execute("
            DELETE FROM jaga.pancek_komponen_indikator WHERE indikator_id = (SELECT id FROM jaga.pancek_indikator WHERE code = 'R.1' AND formulir_type = 2);
            DELETE FROM jaga.pancek_komponen_indikator WHERE indikator_id = (SELECT id FROM jaga.pancek_indikator WHERE code = 'R.2' AND formulir_type = 2);
            DELETE FROM jaga.pancek_indikator WHERE code = 'R.1' AND formulir_type = 2;
            DELETE FROM jaga.pancek_indikator WHERE code = 'R.2' AND formulir_type = 2;

            UPDATE jaga.pancek_indikator SET code = 'R.1', view_order = 23 WHERE code = 'R.3' AND formulir_type = 2;
            UPDATE jaga.pancek_komponen_indikator SET code = 'R.1.a', view_order = 59, bobot = 50 WHERE code = 'R.3.a' AND formulir_type = 2;
            UPDATE jaga.pancek_komponen_indikator SET code = 'R.1.b', view_order = 60, bobot = 50 WHERE code = 'R.3.b' AND formulir_type = 2;
        ");
    }
}
