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

class treemenu extends MY_Controller {
	
	function __construct()
	{
		parent::__construct();
		
		$this->modul="treemenu";
		$view="treemenu2";
	}
	
	public function index()	{
		// $this->load->view($this->modul.'/'.$view);		
		// $this->load->view($this->modul.'/'.$this->modul.'.cjs.php');
	}
	
	function getTreeData(){
		if ($this->session->userdata('grup') == "ADM"){
			echo '
		[{  
			"text":"Master Data",  
			"state":"closed",  
			"children":[{
		    "text":"<a href=\"'.site_url('company').'\" target=\"content\">Master Perusahaan</a>"
			},{
			"text":"<a href=\"'.site_url('bahanbaku').'\" target=\"content\">Item Master</a>"
			},{
				"text":"<a href=\"'.site_url('line').'\" target=\"content\">Production Line</a>"
			},{  
				"text":"<a href=\"'.site_url('matcons').'\" target=\"content\">BOM</a>"
			}]
		},{  
			"id":1,  
			"text":"Transaction",
				"state":"closed",  
				"children":[{  
						"text":"<a href=\"'.site_url('po').'\" target=\"content\">Purchase Order</a>"
					},{
						"text":"Incoming",
						"state":"closed",  
						"children":[{  
								"text":"<a href=\"'.site_url('matin').'\" target=\"content\">Material</a>"
							},{ 			 
								"text":"<a href=\"'.site_url('fgin').'\" target=\"content\">Finished Goods</a>"
							},{ 
								"text":"<a href=\"'.site_url('macin').'\" target=\"content\">Machine and Equipment</a>"
							},{ 
								"text":"<a href=\"'.site_url('scin').'\" target=\"content\">Scrap</a>"							
							}
						]
					},{  
						"text":"<a href=\"'.site_url('so').'\" target=\"content\">Sales Order</a>"
					},{	
						"text":"Outgoing",
						"state":"closed",  
						"children":[{  
								"text":"<a href=\"'.site_url('matout').'\" target=\"content\">Material</a>"
							},{ 			 
								"text":"<a href=\"'.site_url('fgout').'\" target=\"content\">Finished Goods</a>"				
							},{ 
								"text":"<a href=\"'.site_url('macout').'\" target=\"content\">Machine and Equipment</a>"				
							},{ 
								"text":"<a href=\"'.site_url('scout').'\" target=\"content\">Scrap</a>"						
							}					
						]
					},{ 
						"text":"Stok Opname",
						"state":"closed",  
						"children":[{ 
								"text":"<a href=\"'.site_url('matopn').'\" target=\"content\">Material</a>"
							},{ 
								"text":"<a href=\"'.site_url('fgopn').'\" target=\"content\">Finished Goods</a>"
							},{ 
								"text":"<a href=\"'.site_url('macopn').'\" target=\"content\">Machine and Equipment</a>"
							},{ 
								"text":"<a href=\"'.site_url('scopn').'\" target=\"content\">Scrap</a>"
							},{ 
								"text":"<a href=\"'.site_url('wipopn').'\" target=\"content\">WIP</a>"
							}
						]
					}]
			},{  
				"text":"Report",  
				"state":"closed",  
				"children":[{ 
						"text":"Stock Card",
						"state":"closed",  
						"children":[{ 
								"text":"<a href=\"'.site_url('ksmat').'\" target=\"content\">Material</a>"
							},{ 
								"text":"<a href=\"'.site_url('ksfg').'\" target=\"content\">Finished Goods</a>"
							},{ 
								"text":"<a href=\"'.site_url('ksmac').'\" target=\"content\">Machine and Equipment</a>"
							},{ 
								"text":"<a href=\"'.site_url('kssc').'\" target=\"content\">Scrap</a>"
							},{ 
								"text":"<a href=\"'.site_url('kswip').'\" target=\"content\">WIP</a>"
							}
						]
					},{ 
						"text":"Mutation",
						"state":"closed",  
						"children":[{ 
								"text":"<a href=\"'.site_url('mumat').'\" target=\"content\">Material</a>"
							},{ 
								"text":"<a href=\"'.site_url('mufg').'\" target=\"content\">Finished Goods</a>"
							},{ 
								"text":"<a href=\"'.site_url('mumac').'\" target=\"content\">Machine and Equipment</a>"
							},{ 
								"text":"<a href=\"'.site_url('musc').'\" target=\"content\">Scrap</a>"
							},{ 
								"text":"<a href=\"'.site_url('muwip').'\" target=\"content\">WIP</a>"
							}
						]
					},{ 
						"text":"Bea Cukai Report",
						"state":"closed",  
						"children":[{ 
								"text":"<a href=\"'.site_url('brpt_masukrm').'\" target=\"content\">Pemasukan Barang</a>"
							},{ 
								"text":"<a href=\"'.site_url('brpt_keluarbarang').'\" target=\"content\">Pengeluaran Barang</a>"
							},{ 
								"text":"<a href=\"'.site_url('mumat').'\" target=\"content\">Mutasi Bahan Baku dan Bahan Penolong</a>"
							},{ 
								"text":"<a href=\"'.site_url('rmonwip').'\" target=\"content\">WIP</a>"
							},{ 
								"text":"<a href=\"'.site_url('mufg').'\" target=\"content\">Finished Goods</a>"
							},{ 
								"text":"<a href=\"'.site_url('musc').'\" target=\"content\">Scrap</a>"
							},{
								"text":"<a href=\"'.site_url('mumac').'\" target=\"content\">Machine and Equipment</a>"
							},{
								"text":"<a href=\"'.site_url('brpt_rekapbcp').'\" target=\"content\">Rekapitulasi BCP</a>"
							}
						]
					}
				]  
		},{  
			"id":1,  
			"text":"Integration",
				"state":"closed",  
				"children":[{
						"text":"From Ceisa TPB",
						"state":"closed",  
						"children":[{  
								"text":"<a href=\"'.site_url('ceisa_tpb/bc23').'\" target=\"content\">BC 2.3</a>"
							},{ 			 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc25').'\" target=\"content\">BC 2.5</a>"
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc261').'\" target=\"content\">BC 2.6.1</a>"
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc262').'\" target=\"content\">BC 2.6.2</a>"							
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc27i').'\" target=\"content\">BC 2.7 (In)</a>"							
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc27o').'\" target=\"content\">BC 2.7 (Out)</a>"							
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc30').'\" target=\"content\">BC 3.0</a>"							
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc40').'\" target=\"content\">BC 4.0</a>"							
							},{ 
								"text":"<a href=\"'.site_url('ceisa_tpb/bc41').'\" target=\"content\">BC 4.1</a>"							
							}
						]
					}]
			},{  
			"text":"User Administration",  
			"state":"closed",  
			"children":[{  
				"text":"<a href=\"'.site_url('user').'\" target=\"content\">User</a>"
			},{  
				"text":"<a href=\"'.site_url('log').'\" target=\"content\">User Activity History</a>"
			}]
		},{ 
			"text":"<a href=\"'.site_url('main/logout').'\">Logout</a>"  
		}]

		';
		} else {
			echo '
		[{  
				"text":"Report",  
				"state":"closed",  
				"children":[{ 
						"text":"Mutation",
						"state":"closed",  
						"children":[{ 
								"text":"<a href=\"'.site_url('mumat').'\" target=\"content\">Material</a>"
							},{ 
								"text":"<a href=\"'.site_url('mufg').'\" target=\"content\">Finished Goods</a>"
							},{ 
								"text":"<a href=\"'.site_url('mumac').'\" target=\"content\">Machine and Equipment</a>"
							},{ 
								"text":"<a href=\"'.site_url('musc').'\" target=\"content\">Scrap</a>"
							},{ 
								"text":"<a href=\"'.site_url('muwip').'\" target=\"content\">WIP</a>"
							}
						]
					},{
						"text":"<a href=\"'.site_url('rmonwip').'\" target=\"content\">Monitoring WIP</a>"
					}
				]  
		},{  
			"text":"User Administration",  
			"state":"closed",  
			"children":[{  
				"text":"<a href=\"'.site_url('user').'\" target=\"content\">User</a>"
			},{  
				"text":"<a href=\"'.site_url('log').'\" target=\"content\">User Activity History</a>"
			}]
		},{ 
			"text":"<a href=\"'.site_url('main/logout').'\">Logout</a>"  
		}]

		';
		}
		
	}
	
}