<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

	
	public function index()
	{
		$q = $this->db->query("select a.id_karyawan, b.id_wali_kelas, b.id_siswa 
							from ref_mapping_kelas a, 
								 ref_siswa b 
						  where a.id = b.id_mapping_kelas");
		$data = $q->result_array();
		foreach ($data as $value) {
			$update['id_wali_kelas'] = $value['id_wali_kelas'];
			$this->db->where("id_siswa",$value['id_siswa']);
			$this->db->update("ref_siswa",$update);
		}
			
	}
}
