<?php

/*
 * Copyright (c) 2018 Earworks.
 * Codeigniter Project Template Modification
 * Please contact our email for more information :
 * contact@earworks.co.id
 */
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Description of Migration_seeder
 *
 * @author andhy
 */
class Migration_seeder extends CI_Migration {

    public function up() {
        echo "Start Seeder Migration \n";
        $this->load->helper('hash');
        // roles
        $this->db->insert('roles', array('roleid' => 1, 'rolename' => 'Administrator', 'roledescription' => '', 'rolestatus' => '1', 'created' => time(), 'modified' => time()));
        $this->db->insert('roles', array('roleid' => 2, 'rolename' => 'Admin Mercedes-Benz', 'roledescription' => '', 'rolestatus' => '1', 'created' => time(), 'modified' => time()));
        $this->db->insert('roles', array('roleid' => 3, 'rolename' => 'User Antrian (Test Ride)', 'roledescription' => '', 'rolestatus' => '1', 'created' => time(), 'modified' => time()));
        $this->db->insert('roles', array('roleid' => 4, 'rolename' => 'User Registrasi', 'roledescription' => '', 'rolestatus' => '1', 'created' => time(), 'modified' => time()));
        $this->db->insert('roles', array('roleid' => 5, 'rolename' => 'User Test Drive', 'roledescription' => '', 'rolestatus' => '1', 'created' => time(), 'modified' => time()));
        // users
        $this->db->insert('users', array('userid' => 1, 'username' => 'admin', 'userpassword' => hash_data('demo123'), 'useremail' => 'admin@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 2, 'username' => 'usherantrian1', 'userpassword' => hash_data('usherantrian01'), 'useremail' => 'usherantrian1@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 3, 'username' => 'usherantrian2', 'userpassword' => hash_data('usherantrian02'), 'useremail' => 'usherantrian2@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 4, 'username' => 'usherantrian3', 'userpassword' => hash_data('usherantrian03'), 'useremail' => 'usherantrian3@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 5, 'username' => 'usherantrian4', 'userpassword' => hash_data('usherantrian04'), 'useremail' => 'usherantrian4@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 6, 'username' => 'usherregistrasi1', 'userpassword' => hash_data('usherregistrasi01'), 'useremail' => 'usherregistrasi1@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 7, 'username' => 'usherregistrasi2', 'userpassword' => hash_data('usherregistrasi02'), 'useremail' => 'usherregistrasi2@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 8, 'username' => 'usherregistrasi3', 'userpassword' => hash_data('usherregistrasi03'), 'useremail' => 'usherregistrasi3@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 9, 'username' => 'usherregistrasi4', 'userpassword' => hash_data('usherregistrasi04'), 'useremail' => 'usherregistrasi4@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 10, 'username' => 'ushertesdrive1', 'userpassword' => hash_data('ushertesdrive01'), 'useremail' => 'ushertestdrive1@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 11, 'username' => 'ushertesdrive2', 'userpassword' => hash_data('ushertesdrive02'), 'useremail' => 'ushertestdrive2@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('users', array('userid' => 12, 'username' => 'administrator', 'userpassword' => hash_data('admin123'), 'useremail' => 'administrator@mercedesbenz.com', 'userstatus' => 1, 'created' => time(), 'modified' => time()));
        // userrole
        $this->db->insert('userrole', array('userroleid' => 1, 'userid' => 1, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 2, 'userid' => 2, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 3, 'userid' => 3, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 4, 'userid' => 4, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 5, 'userid' => 5, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 6, 'userid' => 6, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 7, 'userid' => 7, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 8, 'userid' => 8, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 9, 'userid' => 9, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 10, 'userid' => 10, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 11, 'userid' => 11, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        $this->db->insert('userrole', array('userroleid' => 12, 'userid' => 12, 'roleid' => 1, 'created' => time(), 'modified' => time()));
        // profiles
        $this->db->insert('profiles', array('profileid' => 1, 'userid' => 1, 'profilename' => 'Mercedes-Benz', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 2, 'userid' => 2, 'profilename' => 'Usher Antrian 1', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 3, 'userid' => 3, 'profilename' => 'Usher Antrian 2', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 4, 'userid' => 4, 'profilename' => 'Usher Antrian 3', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 5, 'userid' => 5, 'profilename' => 'Usher Antrian 4', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 6, 'userid' => 6, 'profilename' => 'Usher Registrasi 1', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 7, 'userid' => 7, 'profilename' => 'Usher Registrasi 2', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 8, 'userid' => 8, 'profilename' => 'Usher Registrasi 3', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 9, 'userid' => 9, 'profilename' => 'Usher Registrasi 4', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 10, 'userid' => 10, 'profilename' => 'Usher Test Drive 1', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 11, 'userid' => 11, 'profilename' => 'Usher Test Drive 2', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
        $this->db->insert('profiles', array('profileid' => 12, 'userid' => 12, 'profilename' => 'Administrator', 'profileaddress' => 'Jakarta Barat', 'profilemobile' => '02123519350', 'created' => time(), 'modified' => time()));
    }
    public function down() {
        echo "cannot down this migration \n";
    }
}
