? Fallagassrini

Fallagassrini Bypass Shell

echo"
Fallagassrini
";
Current Path : /home1/savoy/public_html/savoyglobal.net/drafthr/system/application/controllers/

Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
Upload File :
Current File : /home1/savoy/public_html/savoyglobal.net/drafthr/system/application/controllers/hr.php

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

class HR extends BaseController {

	function HR()
	{
		parent::BaseController();
                $this->load->model('mastermodel');
                $this->load->model('settingsmodel');
                $this->load->model('customermodel');
                $this->load->model('accountingsmodel');
                $this->load->model('documentsmodel');
                $this->load->model('hrmodel');
                $this->load->library('Fpaginate');
               
	}

	function index($menuid="",$modid="")
	{       if(empty($modid))
                {
		$data['modname']='Home';
                }
                else
                {
                $mod_id=$this->mastermodel->get_data('modules',$modid,'module_id','sort');
                foreach($mod_id as $id)
                {
                 $modname=$id['module_name'];
                }
                 $data['modname']=$modname;
                }
                if(empty ($menuid))
                {
                    $tart='index';
                     $data['menuname']='';
                }
                else
                {
                $tar=$this->mastermodel->get_data('menu',$menuid,'menu_id');

                foreach($tar as $target)
                {
                $tart=$target['target'];

                $data['menuname']=$target['caption'];


                }

                }

                $data['modules']=$this->settingsmodel->buildModule();
                $data['menus']=$this->settingsmodel->buildMenu($modid);



                $this->load->view(''.$data['modname'].'/'.$tart.'',$data);
	}
        
        function adddesignation()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('designation','Designation Name','required');

         if ($this->form_validation->run() == FALSE )
        {
            redirect('master/index/31/11');
          // $this->index('31', '11');
        }
        else
        {

           $res = $this->mastermodel->add('designation');
           redirect('master/index/31/11');
           //$this->index('31', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }
     function adddepartment()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('departmentname','Department Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/32/11');
          // $this->index('32', '11');
        }
        else
        {

          $res =  $this->mastermodel->add('department');
          redirect('master/index/32/11');
           //$this->index('32', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }
     function addassignleave()
        {
       

          $res =  $this->hrmodel->addassignleave();
          redirect('master/index/48/11');
           //$this->index('48', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
    
        }
    function addgrade()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('gradename','Grade Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/33/11');
          // $this->index('33', '11');

        }
        else
        {

          $res =  $this->mastermodel->add('grade');
          redirect('master/index/33/11');
           //$this->index('33', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }
    function addstatus()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('statusname','Status Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/34/11');
           //$this->index('34', '11');
        }
        else
        {

         $res =   $this->mastermodel->add('status');
         redirect('master/index/34/11');
          // $this->index('34', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }

    function addallowdeduc()
        {
        

        $res =    $this->hrmodel->addallowdeduction();
        redirect('master/index/37/11');
           //$this->index('37', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        
        }
    function addsalarypayment()
        {
        
        $res = $this->hrmodel->insertsalarypayment();
        redirect('master/index/47/11');
          // $this->index('47', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

          
            }
        }
     function addcommissionpayment()
        {

        $res = $this->hrmodel->insertcommissionpayment();
        redirect('master/index/50/11');
           //$this->index('50', '11');
            if($res==1)
           {
           $this->load->view('HR/success');


        }
        }
    function addleavetype()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('leavename','Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/38/11');
           //$this->index('38', '11');
           
        }
        else
        {

         $res =   $this->mastermodel->add('leavetype');
         redirect('master/index/38/11');
          // $this->index('38', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }
    function addleaveallocation()
        {

         $res =   $this->hrmodel->insertleaveallocation('leaveallocation');
          // $this->index('49', '11');
         redirect('master/index/49/11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        
   function addholidays()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('date','Date','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/39/11');
           //$this->index('39', '11');


        }
        else
        {

        $res =    $this->mastermodel->add('holidays');
        redirect('master/index/39/11');
           //$this->index('39', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }

        function addweeklyholidays()
        {

            $res =    $this->hrmodel->addweeklyholiday();
             redirect('master/index/111/11');
             $this->load->view('HR/success');
            if($res==1)
            {
                
            }
        
        }

        function addworkshifts()
        {
           $this->load->library('form_validation');
           $this->form_validation->set_rules('work_shift_name','Work Shift Name','required');
            if ($this->form_validation->run() == FALSE )
            {
                 redirect('master/index/112/11');
             }
            else
            {
                $res = $this->hrmodel->addworkshift();
                redirect('master/index/112/11');
                if($res==1)
               {
               $this->load->view('HR/success');

               }
            }
        }

        function addbulkattendance()
        {

            $res =    $this->hrmodel->insertbulkattendance();
             redirect('master/index/113/11');
             
            if($res==1)
            {
                $this->load->view('HR/success');
            }

        }

        function addupdateattendance()
        {
            $res =    $this->hrmodel->insertupdateattendance();
             redirect('master/index/114/11');
             $this->load->view('HR/success');
            if($res==1)
            {
                $this->load->view('HR/success');
            }
        }

        function addmarkattendance()
        {
            $res =    $this->hrmodel->insertmarkattendance();
             redirect('master/index/116/11');
             $this->load->view('HR/success');
            if($res==1)
            {
                $this->load->view('HR/success');
            }
        }

    function addstaffsalary()
        {
       

        $res =  $this->hrmodel->insertstaffsalary('staffsalary');
        redirect('master/index/45/11');
          // $this->index('45', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        
        }
    function addstaff()
        
        {
                
                $res =  $this->hrmodel->insertstaff();
                redirect('master/index/40/11');
           //$this->index('40', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        
        }
     function addcommissionsettings()
        {

           $res = $this->hrmodel->insertcommissionsettings('commissionsettings');
           redirect('master/index/46/11');
           //$this->index('46', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
      
        }
        function view($type="")
        {
            if($type=='ajax')
            {
                $this->load->view('refinesearch');
            }
        }
    function addresumemanagement()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('name','Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/44/11');
           //$this->index('44', '11');


        }
        else
        {


                //$data=$_FILES['userfile']['name'];
                //echo $data;
                $config['upload_path'] = './resume/';
                $config['allowed_types'] = 'gif|jpg|png|doc|pdf|txt|xls|csv|docx'; // by extension, will check for whether it is an image
                $config['max_size']    = '100000'; // in kb
             
                $this->load->library('upload',$config);

       if ( ! $this->upload->do_upload())
		{

      

           $error = array('error' => $this->upload->display_errors());


		}
		else
		{
		
                    $data = array('upload_data' => $this->upload->data());


		}
       // var_dump($files);
        $res =    $this->hrmodel->addresume('resumemanagement');
        redirect('master/index/44/11');
        //$this->index('44', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }
    function addofferletter()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('name','Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/51/11');
           //$this->index('51', '11');


        }
        else
        {

       

                //$data=$_FILES['userfile']['name'];
                //echo $data;
                $config['upload_path'] = './offerletter/';
                $config['allowed_types'] = 'gif|jpg|png|doc|pdf|txt|xls|csv|docx'; // by extension, will check for whether it is an image
                $config['max_size']    = '100000'; // in kb
             
                $this->load->library('upload',$config);

       if ( ! $this->upload->do_upload())
		{

      

           $error = array('error' => $this->upload->display_errors());


		}
		else
		{
		
                    $data = array('upload_data' => $this->upload->data());


		}
       // var_dump($files);
        $res =    $this->hrmodel->addoffer('offerletter');
           
         redirect('master/index/51/11');
           //$this->index('51', '11');
            if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }


        function LoadWeeklyHoliday($page)
        {
            $this->load->view('HR/'.$page);
        }
   
        
         function ajaxload($page,$table,$pagenum="",$selectsearch="",$search="")
        {

            $data['nooflist']='4';
            $data['perpage']='10';
            $data['pagenum']=$pagenum;


            if($data['pagenum']==1 ||$data['pagenum']=="")
                $data['no']=1;
            else
                $data['no']= (($data['pagenum']-1)*$data['perpage'])+1;
            if($search == "")
                {
                    $data['property']='view';

                    $data['count']=$this->mastermodel->count_all(''.$table.'');
                    $data['pages']= ceil($data['count']/$data['perpage']);
                    $arr=$this->fpaginate->paginate( $data['pagenum'], $data['pages'],$data['nooflist']);
                    $data['startpage']=$arr[0];
                    $data['endpage']=$arr[1];
                    $data['inscompany']=$this->mastermodel->getdatas('insurance_company');
                    $data['methods']=$this->mastermodel->getdatas('payment_methods','sort');
                    $data['segment']=$this->mastermodel->getdatas('segment_insurances');
                    $data['cover_insurance']=$this->mastermodel->getdatas('covers');
                    $data['viewinfo']=$this->mastermodel->view(''.$table.'',$data['pagenum'],$data['perpage']);
                   

                    $data['searchinfo']= "";
                    $data['searchtxt']= "";
                    $data['searchoption']= "";
                }
            else
              {
                    $search=str_replace("~"," ",$search);
                    $search=str_replace("_","/",$search);

                    $data['searchoption']=$selectsearch;

              if($selectsearch == 'date' || $selectsearch == 'joiningdate')
                    {
                          $qdate=$this->mastermodel->convdatformat($search);
                          $search=$qdate;

                      }

                           $data['searchtxt']=$search;
                    $data['property']='search';
                
                if($table == "staffpersonaldetails")
                    {
                        $data['searchinfo']=$this->hrmodel->get_data_search($table,$search,$selectsearch,$data['pagenum'],$data['perpage']);
                        $data['count']=$this->hrmodel->get_data_search_all($table,$search,$selectsearch);
                        $data['pages']= ceil($data['count']/$data['perpage']);
                    }
                else
                    {
                        $data['searchinfo']=$this->hrmodel->get_data_search_others($table,$search,$selectsearch,$data['pagenum'],$data['perpage']);
                        $data['count']=$this->hrmodel->get_data_search_others_all($table,$search,$selectsearch);
                        $data['pages']= ceil($data['count']/$data['perpage']);
                    }

                        $arr=$this->fpaginate->paginate( $data['pagenum'], $data['pages'],$data['nooflist']);
                        $data['startpage']=$arr[0];
                        $data['endpage']=$arr[1];
                        $data['selectsearch'] = $selectsearch;
                        $data['search'] = $search;
                        $data['viewinfo']= "";
                        
                 }
                $data['action']='add';
                $data['norecords']=$this->hrmodel->norecords(''.$table.'');
                $data['directory']=$this->mastermodel->getdatas('directory');
                 
                $this->load->view('HR/'.$page.'',$data);
        }

        
        function loadWorkshift($page,$table,$pagenum="",$searchoption="",$searchtxt="")
        {
             $data['viewinfo']=$this->mastermodel->getdatas(''.$table.'');
             $data['searchoption'] = $searchoption;
             $data['searchtxt'] = $searchtxt;
             $data['pagenum'] = $pagenum;
             $data['count']=$this->mastermodel->count_alldata(''.$table.'');
             $data['pages']=ceil($data['count']/10);
             $arr=$this->fpaginate->paginate( $pagenum, $data['pages'] ,4);
             $data['startpage']=$arr[0];
             $data['endpage']=$arr[1];
             $this->load->view('HR/'.$page.'',$data);
        }






        function loadallemp($page,$table)
        {
             $data['viewinfo']=$this->mastermodel->getdatas(''.$table.'');    
             $this->load->view('HR/'.$page.'',$data);
        }
        function ajaxloadnew($page,$table,$pagenum="",$selectsearch="",$search="")
        {

            $data['nooflist']='4';
            $data['perpage']='10';
            $data['pagenum']=$pagenum;
            $_SESSION['pagenum']=$pagenum;
            $_SESSION['searchoption']=$selectsearch;
            $_SESSION['searchtxt']=$search;

            if($data['pagenum']==1 ||$data['pagenum']=="")
                $data['no']=1;
            else
                $data['no']= (($data['pagenum']-1)*$data['perpage'])+1;
            if($search == "")
                {
                    $data['property']='view';

                    $data['count']=$this->mastermodel->count_alldata(''.$table.'');
                    $data['pages']= ceil($data['count']/$data['perpage']);
                    $arr=$this->fpaginate->paginate( $data['pagenum'], $data['pages'],$data['nooflist']);
                    $data['startpage']=$arr[0];
                    $data['endpage']=$arr[1];
                    $data['inscompany']=$this->mastermodel->getdatas('insurance_company');
                    $data['methods']=$this->mastermodel->getdatas('payment_methods');
                    $data['segment']=$this->mastermodel->getdatas('segment_insurances');
                    $data['cover_insurance']=$this->mastermodel->getdatas('covers');
                    $data['viewinfo']=$this->mastermodel->viewnew(''.$table.'',$data['pagenum'],$data['perpage']);

                    $data['searchinfo']= "";
                    $data['searchtxt']= "";
                    $data['searchoption']= "";
                }
            else
              {
                    $search=str_replace("~"," ",$search);
                    $search=str_replace("_","/",$search);

                    $data['searchoption']=$selectsearch;

              if($selectsearch == 'date' || $selectsearch == 'joiningdate')
                    {
                          $qdate=$this->mastermodel->convdatformat($search);
                          $search=$qdate;

                      }

                           $data['searchtxt']=$search;
                    $data['property']='search';
                
                if($table == "staffpersonaldetails")
                    {
                        $data['searchinfo']=$this->hrmodel->get_data_searchnew($table,$search,$selectsearch,$data['pagenum'],$data['perpage']);
                        $data['count']=$this->hrmodel->get_data_search_allnew($table,$search,$selectsearch);
                        $data['pages']= ceil($data['count']/$data['perpage']);
                    }
                else
                    {
                        $data['searchinfo']=$this->hrmodel->get_data_search_othersnew($table,$search,$selectsearch,$data['pagenum'],$data['perpage']);
                        $data['count']=$this->hrmodel->get_data_search_others_allnew($table,$search,$selectsearch);
                        $data['pages']= ceil($data['count']/$data['perpage']);
                    }

                        $arr=$this->fpaginate->paginate( $data['pagenum'], $data['pages'],$data['nooflist']);
                        $data['startpage']=$arr[0];
                        $data['endpage']=$arr[1];
                        $data['selectsearch'] = $selectsearch;
                        $data['search'] = $search;
                        $data['viewinfo']= "";
                 }
                $data['action']='add';
                $data['norecords']=$this->hrmodel->norecords(''.$table.'');
                $data['directory']=$this->mastermodel->getdatas('directory');
                $this->load->view('HR/'.$page.'',$data);
        }
       
     function edit($page,$table,$field,$id)
             {
            
                $data['viewinfo']=$this->mastermodel->get_data($table,$id,$field);
                $data['action']='update';
                $data['id']=$id;
                $data['design']=$this->mastermodel->getdatas('designation');
                $data['viewedu']=$this->mastermodel->get_data('staffeduquali',$id,'staffid');
                $data['viewcert']=$this->mastermodel->get_data('staffaddcert',$id,'staffid');
                $data['viewprof']=$this->mastermodel->get_data('staffproffexp',$id,'staffid');
                $data['directory']=$this->mastermodel->getdatas('directory');
                $data['medical']=$this->mastermodel->get_data('staffsalarymedical',$id,'staffsalaryid');
                $data['staff_files']=$this->mastermodel->get_data('staff_files',$id,'staffid');
                $data['methods']=$this->mastermodel->getdatas('payment_methods');
                $this->load->view('HR/'.$page.'',$data);
            }
     function editcomstaff($page,$table,$field,$id)
         {
         
            $data['viewinfo']=$this->mastermodel->get_data($table,$id,$field);
            $data['action']='update';
            $data['staffid']=$id;
            $this->load->view('HR/'.$page.'',$data);
        }
    function single($page,$table,$field,$id)
        {
            
            $data['viewinfo']=$this->mastermodel->get_data($table,$id,$field);
            //$data['action']='update';
            $data['id']=$id;
            $data['tablename']='staff_files';
            $data['fieldname']='staffid';
            $data['viewedu']=$this->mastermodel->get_data('staffeduquali',$id,'staffid');
            $data['viewcert']=$this->mastermodel->get_data('staffaddcert',$id,'staffid');
            $data['viewprof']=$this->mastermodel->get_data('staffproffexp',$id,'staffid');
            $data['directory']=$this->mastermodel->getdatas('directory');
            $data['staff_files']=$this->mastermodel->get_data('staff_files',$id,'staffid');
            $data['viewactivity']=$this->mastermodel->get_data('staffsalarymedical',$id,'staffsalaryid');
            $data['viewactivity1']=$this->mastermodel->get_data('staffsalarytickets',$id,'staffsalaryid');

            $this->load->view('HR/'.$page.'',$data);
        }

        function single_report($table,$page,$repgen="",$selectsearch="",$search="",$fromdate="",$todate="")
        {
             $data['segment']=$this->mastermodel->getdatas('segment_insurances');
            $data['cover_insurance']=$this->mastermodel->getdatas('covers');
            $this->load->view('HR/'.$page.'',$data);
        }

    function singlecomstaff($page,$table,$field,$staffid)
        {
             $data['viewinfo']=$this->hrmodel->getcomset($table,$staffid,$field);
             $data['staffid']=$staffid;
             $this->load->view('HR/'.$page.'',$data);
        }
    function leavestaff($page,$table,$field,$id)
        {
             $data['leavalloc']=$this->hrmodel->getstfleavalloc($table,$id,$field);
             $data['leaveapply']=$this->hrmodel->getstfleavapply($id);
             $this->load->view('HR/'.$page.'',$data);
        }
    function editdesignation()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('designation','Designation Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/31/11');
           //$this->index('31', '11');
        }
        else
        {

           $this->hrmodel->updatedesignation('designation');
           redirect('master/index/31/11');
          // $this->index('31', '11');
        }
        }
     function editdepartment()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('departmentname','Department Name','required');

         if ($this->form_validation->run() == FALSE )
        {
         redirect('master/index/32/11');
           //$this->index('32', '11');
        }
        else
        {

           $this->hrmodel->updatedepartment('department');
           redirect('master/index/32/11');
          // $this->index('32', '11');
        }
        }
     function editassignleave()
        {
        

           $this->hrmodel->updateassignleave('assignleave');
           redirect('master/index/48/11');
          // $this->index('48', '11');
        }

      function editassignleavepermit()
      {
           $this->hrmodel->updateassignleavepermit('assignleave');
           redirect('master/index/48/11');
      }
     function editleaveallocation()
        {


           $this->hrmodel->updateleaveallocation('leaveallocation');
           redirect('master/index/49/11');
          // $this->index('49', '11');
        }
     function editofferletter()
        {


           $this->hrmodel->updateofferletter('offerletter');
           redirect('master/index/51/11');
          // $this->index('51', '11');
        }
        
     function editcommissionsettings()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('cover_id','Cover Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/46/11');
           //$this->index('46', '11');
        }
        else
        {

           $res=$this->hrmodel->updatecommissionsettings('commissionsettings');
           redirect('master/index/46/11');
           //$this->index('46', '11');
           if($res==1)
           {
           $this->load->view('HR/success');

           }
        }
        }
     function editgrade()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('gradename','Grade Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/33/11');
           //$this->index('33', '11');
        }
        else
        {

           $this->hrmodel->updategrade('grade');
           redirect('master/index/33/11');
           //$this->index('33', '11');
        }
        }
    function editstatus()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('statusname','Status Name','required');

         if ($this->form_validation->run() == FALSE )
        {
             redirect('master/index/34/11');
           //$this->index('34', '11');
        }
        else
        {

           $this->hrmodel->updatestatus('status');
           redirect('master/index/34/11');
           //$this->index('34', '11');
        }
        }
     function editstaffsalary()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('staffid','Employee Name','required');

         if ($this->form_validation->run() == FALSE )
        {
              redirect('master/index/45/11');
           //$this->index('45', '11');
        }
        else
        {

             $this->hrmodel->updatestaffsalary('staffsalary');
             redirect('master/index/45/11');
          // $this->index('45', '11');
        }
        }
     function editallowdeduc()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('allowdeducname','Name','required');

         if ($this->form_validation->run() == FALSE )
        {
              redirect('master/index/37/11');
           //$this->index('37', '11');
        }
        else
        {

             $this->hrmodel->updateallowdeduc('allowdeduc');
             redirect('master/index/37/11');
           //$this->index('37', '11');
        }
        }
    function editleavetype()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('leavename','Name','required');

         if ($this->form_validation->run() == FALSE )
        {
              redirect('master/index/38/11');
          // $this->index('38', '11');
        }
        else
        {

           $this->hrmodel->updateleavetype('leavetype');
             redirect('master/index/38/11');
          // $this->index('38', '11');
        }
        }
        function editholidays()
        {
            $this->load->library('form_validation');
            $this->form_validation->set_rules('occasion','Occasion','required');
            if ($this->form_validation->run() == FALSE )
            {
                  redirect('master/index/39/11');
               //$this->index('39', '11');
            }
            else
            {
               $this->hrmodel->updateholidays('holidays');
               redirect('master/index/39/11');
            }
        }

        function editworkshifts()
        {
            
            $this->load->library('form_validation');
            $this->form_validation->set_rules('work_shift_name','Shift Name','required');
            if ($this->form_validation->run() == FALSE )
            {
                  redirect('master/index/112/11');
               
            }
            else
            {
                
               $this->hrmodel->updateworkshifts();
               redirect('master/index/112/11');
            }
        }

    function get_employee_attendance_info($device_no,$from_date,$to_date)
    {
        $data=array();
        $data['viewinfo']=$this->hrmodel->get_employee_attendance($device_no,$from_date,$to_date);
        $this->load->view('HR/employee_attendance_info',$data);
    }

        function editresumemanagement()
        {
        $this->load->library('form_validation');
        $this->form_validation->set_rules('name','Name','required');

         if ($this->form_validation->run() == FALSE )
        {
              redirect('master/index/44/11');
          // $this->index('44', '11');
        }
        else
        {

            $this->hrmodel->updateresumemanagement('resumemanagement');
             redirect('master/index/44/11');
          // $this->index('44', '11');
        }
        }
        function editstaff()
        {

                // $data=array_filter($_FILES['userfile']['name']);
                $config['allowed_types'] = 'gif|jpg|png|doc|pdf|txt|xls|csv|docx'; // by extension, will check for whether it is an image
                $config['max_size']    = '100000'; // in kb
                $config['max_width']  = '1024';
                $config['max_height']  = '768';

                $this->load->library('upload', $config);
                $this->load->library('Multi_upload');

                $files = $this->multi_upload->go_upload();
                $files = $this->multi_upload->go_upload();
                $this->hrmodel->updatestaff();
                redirect('master/index/40/11');
                //$this->index('40', '11');
       
        }
    function updatecomstaff()
        {
       

            $this->hrmodel->updatecomstafffin('staffcommissionsettings');
            redirect('master/index/40/11');
            // $this->index('40', '11');
        }
        
    function delete($table,$id,$menu)
        {

        $data=$this->mastermodel->check_permissions(2);
        if(!$data)
        {

            $this->index($menu, '11');
            $this->load->view('Master/nopermission');
        }
        else
        {

                try
                       {
                        $res=$this->mastermodel->deletedata($table,$id);;

                        if($res!=1)
                        {
                        throw new Exception("Error");
                        }
                         $this->index($menu, '11');
                       }

                       catch(Exception $exception)
                       {

                        $this->index($menu, '11');
                        $this->load->view('Master/checkexist');

                       }
        }
        }
        
     function liststaff($staffname="")
        {

            $data['viewinfo']=$this->hrmodel->employeelist($staffname);
            $this->load->view('HR/loadstafflist',$data);
        }
 function getleavedata($id)
        {
            $gender= $this->customermodel->getSingleFieldValue('staffpersonaldetails ','gender','id',$id);
            $data['leavetype']=$this->mastermodel->getleavedata($gender);
            $this->load->view('HR/loadleave',$data);
        }
    function ajaxloadcovercom($page,$arg1)
        {
            $data['covercom']=$this->mastermodel->get_data('covers',$arg1,'segment_id');
            $this->load->view('HR/'.$page.'',$data);
        }
     function ajaxloadsalpay($page,$arg1,$arg2)
        {
             $salcount = $this->hrmodel->numcount_data_sal('staffsalary',$arg1,$arg2) ;
             if($salcount== 0)
                    {

                    echo "<script>alert('Salary not set');</script>";

                    }
             else
                 {
                    $data['salpay']=$this->hrmodel->get_sal_data('staffsalary',$arg1,$arg2);
                    // $data['comset']=$this->hrmodel->get_com_data('settarget',$arg1,$arg2);
                    $data['premiumgen']=$this->hrmodel->get_com_premgen($arg1,$arg2);
                    $data['premiumpay']=$this->hrmodel->get_com_prempay($arg1,$arg2);
                    $data['staffid'] = $arg1;
                    $data['saldate'] = $arg2;
                    $this->load->view('HR/'.$page.'',$data);
                 }
        }
     function ajaxloadcompay($page,$arg1,$arg2)
        {
           
           
            $data['premiumgen']=$this->hrmodel->get_com_premgen($arg1,$arg2);
            $data['premiumpay']=$this->hrmodel->get_com_prempay($arg1,$arg2);
            $data['staffid'] = $arg1;
            $data['date'] = $arg2;
            $this->load->view('HR/'.$page.'',$data);
        }

     function filecheck($table,$file)
     {
      $exist = $this->hrmodel->filecheck($file,$table);
      echo $exist;
     }
     function checksalarymonth()
        {
            $data=array();
            $data['info']=$_POST;

             $salcount = $this->hrmodel->numcount_data_sal('staffsalary',$data['info']['id'],$data['info']['date']) ;
             if($salcount== 0)
                    {

                    echo "no";

                    }
                    else
                    {

            $slexist= $this->hrmodel->checksalarymonth($data['info']['id'],$data['info']['date']);
            echo $slexist;
                    }
        }

        function multiplesalarypayment()
        {
            $res = $this->hrmodel->multiplesalarypayment();
        }

        function loadsalary($page,$post,$date)
        {

         $data['viewinfo']=   $this->hrmodel->loademployeesalary($post,$date);
         $this->load->view('HR/'.$page.'',$data);
        }

        function loadunpostedsalary($page,$salid)
        {

            $data['salpay']=   $this->mastermodel->get_data('emp_salary_slip',$salid,'id');
            $this->load->view('HR/'.$page.'',$data);
        }

        function postsalarypayment()
        {
            $res = $this->hrmodel->postsalarypayment();
        }

        function multiplepostsalarypayment()
        {
            $res = $this->hrmodel->multiplepostsalarypayment();
        }

        function quickeditassignleave_permit($id)
        {
            $data['leaveid']=$id;
            $this->load->view('HR/quickeditassignleave_permit',$data);
        }

        function updateleavestatus()
        {
                $res=$this->hrmodel->updateleavestatus();
               if($res>=1)
               {
                   echo "Leave status updated";
               }
               else
               {
                   echo "Error While Adding";
               }
        }

        function monthlyattendancereport()
        {
          $output = $this->hrmodel->get_monthly_attendance_report();

           $this->load->plugin('to_pdf');
          if(!empty ($output))
         {
             $data['report']=$output;
             $data['month']=$_POST['month'];
             $data['year']=$_POST['year'];
             $page=$_POST['report_type'].'_monthly_attendance_report';
             $this->load->view('HR/'.$page.'',$data);
         }
         else
         {
             redirect('master/index/'.$_SESSION['current_mode'].'/11');
         }
        }

        function monthlytimereport()
        {
          $output = $this->hrmodel->get_monthly_attendance_report();

           $this->load->plugin('to_pdf');
          if(!empty ($output))
         {
             $data['report']=$output;
             $data['month']=$_POST['month'];
             $data['year']=$_POST['year'];
             $page=$_POST['report_type'].'_monthly_time_report';
             $this->load->view('HR/'.$page.'',$data);
         }
         else
         {
             redirect('master/index/'.$_SESSION['current_mode'].'/11');
         }
        }

        function latereport()
        {
          $output = $this->hrmodel->get_monthly_attendance_report();

           $this->load->plugin('to_pdf');
         if(!empty ($output))
         {
             $data['report']=$output;
             $data['month']=$_POST['month'];
             $data['year']=$_POST['year'];
             $page=$_POST['report_type'].'_late_report';
             $this->load->view('HR/'.$page.'',$data);
         }
         else
         {
             redirect('master/index/'.$_SESSION['current_mode'].'/11');
         }
        }
        
        function employeetimesheetreport()
        {
          $output = $this->hrmodel->get_employee_timesheet_report();

          $this->load->plugin('to_pdf');
          if(!empty ($output))
         {
             $data['report']=$output;
             $data['month']=$_POST['month'];
             $data['year']=$_POST['year'];
             $page=$_POST['report_type'].'_employee_timesheet_report';
             $this->load->view('HR/'.$page.'',$data);
         }
         else
         {
             redirect('master/index/'.$_SESSION['current_mode'].'/11');
         }
        }


		
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net