<?php

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

class Common extends MY_Controller
{
	public function see_password($type = null)
	{
		
		$data['title'] = lang('see_password');
		$data['ids'] = null;
		$data['password'] = null;
		if (!empty($type) && !is_numeric($type)) {
			$ex = explode('_', $type);
			if ($ex[0] == 'c') {
				$data['password'] = get_row('tbl_client', array('client_id' => $ex[1]), 'password');
			} elseif ($ex[0] == 'smtp') {
				$data['password'] = config_item('smtp_pass');
			} elseif ($ex[0] == 'emin') {
				$data['password'] = config_item('config_password');
			} elseif ($ex[0] == 'timap') {
				$data['password'] = get_row('tbl_departments', array('departments_id' => $ex[1]), 'password');
				$data['ids'] = $ex[1];
			} elseif ($ex[0] == 'paypalpassword') {
				$data['password'] = config_item('paypal_api_password');
			} else {
				$data['password'] = config_item($type);
			}
		}
		$this->load->view('admin/settings/see_password', $data, FALSE);
		// $this->load->view('admin/_layout_modal', $data);
	}
}
