<?php
//require_once ('configuration.php');
class salesdb{
   
    
    public function sales_contact_update_closedate($cid, $date1,  $uby, $utype){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_contact_update_closedate("'.$cid.'", "'.$date1.'","'.$uby.'", "'.$utype.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_contact_update_closecomment($cid, $comment,  $uby, $utype, $date1){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_contact_update_closecomment("'.$cid.'", "'.$comment.'","'.$uby.'", "'.$utype.'", "'.$date1.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_select_actionstream($companyname, $na_assign, $searchboolean, $searchvalue, $filterboolean, $filtersubtype, $filtervalue, $value, $admin, $actiontype){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_select_actionstream("'.$companyname.'", "'.$na_assign.'", "'.$searchboolean.'", "'.$searchvalue.'", "'.$filterboolean.'", "'.$filtersubtype.'", "'.$filtervalue.'", "'.$value.'", "'.$admin.'", "'.$actiontype.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_employee_emailiid_name($companyname, $tablename){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_employee_emailiid_name("'.$companyname.'", "'.$tablename.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_employee_nextaction_pending($contid, $emailid){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_employee_nextaction_pending("'.$contid.'", "'.$emailid.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_employee_select_all($companyname, $emailid, $tablename, $deleted){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_employee_select_all("'.$companyname.'", "'.$emailid.'", "'.$tablename.'", "'.$deleted.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_select_all($companyname, $emailid, $tablename, $deleted){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_select_all("'.$companyname.'", "'.$emailid.'", "'.$tablename.'", "'.$deleted.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
   
    
    public function sales_select_all_employee($companyname, $emailid, $tablename, $deleted){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_select_all_employee("'.$companyname.'", "'.$emailid.'", "'.$tablename.'", "'.$deleted.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_selected_id($table, $id){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_selected_id("'.$table.'", "'.$id.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_select_cont_id($table, $id){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_select_cont_id("'.$table.'", "'.$id.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_select_status_tag_leadsource_teamstream($column, $id){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_select_status_tag_leadsource_teamstream("'.$column.'", "'.$id.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_employee_select_status_tag_leadsource_teamstream($column, $id, $email_id){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_employee_select_status_tag_leadsource_teamstream("'.$column.'", "'.$id.'", "'.$email_id.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_insert_status_tag_leadsource($tablename, $companyname, $adminemailid, $name, $desc1, $color, $createby, $createtype, $dt, $tabletype, $id12){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_insert_status_tag_leadsource("'.$tablename.'", "'.$companyname.'", "'.$adminemailid.'", "'.$name.'", "'.$desc1.'", "'.$color.'", "'.$createby.'", "'.$createtype.'", "'.$dt.'", "'.$tabletype.'", "'.$id12.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_delete_status_tag_leadsource($table, $id){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_delete_status_tag_leadsource("'.$table.'", "'.$id.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function sales_view($table){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_view("'.$table.'")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function salesperselect($companyname,$stage,$per_mon,$per_year){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_percentage_select("'.$companyname.'","'.$stage.'","'.$per_mon.'","'.$per_year.'","percent_select")');
        $em->execute();
        $pdo=null;
        return $em;
    }
    
    public function salesperyearlyselect($companyname,$stage,$per_year){
        include 'configuration.php';
        $em=$pdo->prepare('call sales_percentage_select("'.$companyname.'","'.$stage.'","","'.$per_year.'","percent_yearly_select")');
        $em->execute();
        $pdo=null;
        return $em;
    }
}

?>