<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
function getOccupation(){
    $ci=&get_instance();
    $ci->getoccupation=array(
       'Accountants',
        'Actuaries',
        'Architects',
        'Businessmen',
        'Clergymen',
        'Dentists',
        'Doctor',
        'Economists',
        'Engineers',
        'House Work',
        'Lawyers',
        'Nurses',
        'Pharmacists',
        'Physicians',
        'Physiotherapists',
        'Psychologists',
        'Service Holder',
        'Scientists',
        'Social workers',
        'Statisticians',
        'Surgeons',
        'Teachers' 
    );
    return $ci->getoccupation;
}

function getReligion(){
    $ci=&get_instance();
    $ci->religion_array=Array(
        '1'=>'Islam',
        '2'=>'Hindu',
        '3'=>'Buddo',
        '4'=>'khristan'
    );
    return $ci->religion_array;
}

//get paymentProcess

function getPaymentProcess(){
    $ci=&get_instance();
    $ci->paymentProcess=array(
        '1'=>'Cash',
        '2'=>'Check',
        '3'=>'DD',
        '4'=>'PayOrder'
        );
    return $ci->paymentProcess;
}

//get PaymentType

function getPaymentType(){
    $ci=&get_instance();
    $ci->paymentType=array(
        '1'=>'Installment',
        '2'=>'Downpayment',
        '3'=>'One Step',
        '4'=>'Other'
        
        );
    return $ci->paymentType;
}

//get gender
function getGender(){ 
    $ci=&get_instance();
    $ci->gender=array(
        '1'=>'Male',
        '2'=>'Female'
        );
    return $ci->gender;
}

//get plot Face 
function getPlotface(){ 
    $ci=&get_instance();
    $ci->plotface=array(
        '1'=>'South',
        '2'=>'North',
        '3'=>'East',
        '4'=>'West'
        );
    return $ci->plotface;
}

//get SalaryType
function getsalaryType(){ 
    $ci=&get_instance();
    $ci->salaryType=array(
        '1'=>'Hounarioum',
        '2'=>'Salary',
        '3'=>'Commission',
        '4'=>'Insentive',
        '5'=>'Other'
        );
    return $ci->salaryType;
}

// generate customerId
function customeridGenerate() {
    $ci = &get_instance();

    $datei = fopen("customeridcounter.txt", "r");
    $count = fgets($datei, 100);
    fclose($datei);
    $count = $count + 1;
    $datei = fopen("customeridcounter.txt", "w");
    fwrite($datei, $count);
    fclose($datei);
    return $count;
}

// userId generate 

function UseridGenerate() {
    $ci = &get_instance();

    $datei = fopen("useridcounter.txt", "r");
    $count = fgets($datei, 100);
    fclose($datei);
    $count = $count + 1;
    $datei = fopen("useridcounter.txt", "w");
    fwrite($datei, $count);
    fclose($datei);
    return $count;
}


// get UserType

function getUserType(){
    $ci=&get_instance();
    $ci->user=array(
        '1'=>'Admin',
        '2'=>'Employee',
        '3'=>'Director'
        );
    return $ci->user;
}

 function  getexpenseCategoryById($id){
    ini_set('memory_limit','-1');
    $ci = &get_instance();
    $ci->load->model('expencecategorymodel/expencecategorymodel','expencecategorymodel');
    return $ci->expencecategorymodel->getexpenseCategoryById($id);
 }

 function  getAllExpenseCategory(){
    ini_set('memory_limit','-1');
    $ci = &get_instance();
    $ci->load->model('expencecategorymodel/expencecategorymodel','expencecategorymodel');
    return $ci->expencecategorymodel->getAllExpenseCategory();
 }

 function  getCategoryInfo(){
    ini_set('memory_limit','-1');
    $ci = &get_instance();
    $ci->load->model('incomecategorymodel/incomecategorymodel','incomecategorymodel');
    return $ci->incomecategorymodel->getCategoryInfo();
 }

 function getincomeCategoryById($id){
    ini_set('memory_limit','-1');
    $ci = &get_instance();
    $ci->load->model('incomecategorymodel/incomecategorymodel','incomecategorymodel');
    return $ci->incomecategorymodel->getincomeCategoryById($id);
 }

 function getlandCustomerNameById($customerId){
    ini_set('memory_limit','-1');
    $ci=&get_instance();
    $ci->load->model('customerRegistrationmodel/customerRegistrationmodel', 'CREGModel');
    //$this->load->model('customerRegistrationmodel/customerRegistrationmodel', 'CREGModel');
    return $ci->CREGModel->getlandCustomerNameById($customerId);
 }

function getlandCustomerslIdById($customerId){
    ini_set('memory_limit','-1');
    $ci=&get_instance();
    $ci->load->model('notificationsetupmodel/notificationsetupmodel', 'notificationsetupmodel');
    return $ci->notificationsetupmodel->getlandCustomerslIdById($customerId);
}


 function  getkro_num(){
    ini_set('memory_limit','-1');
    $ci = &get_instance();
    $ci->load->model('customerRegistrationmodel/customerRegistrationmodel','CREGModel');
    return $ci->CREGModel->getkro_num();
 }

 function getEmployeeById($userId){
    ini_set('memory_limit','-1');
    $ci=&get_instance();
    $ci->load->model('employeemodel/employeemodel', 'employeemodel');
    //$this->load->model('customerRegistrationmodel/customerRegistrationmodel', 'CREGModel');
    return $ci->employeemodel->getEmployeeById($userId);
 }
 
 function getNotification(){
    ini_set('memory_limit','-1');
    $ci=&get_instance();
    $ci->load->model('notificationsetupmodel/notificationsetupmodel', 'notificationsetupmodel');
    return $ci->notificationsetupmodel->getNotification();
 }