<?php
session_start();
//include '../Control/sales.php';
class statusctrl{
public $companyname;
public $adminemailid;
public $createby;
public $createtype;
     function __construct() {
     }
    public function salesselectstatus(){
        session_start();
        $companyname=$_SESSION['companyname'];
        $companytype=$_SESSION['companytype'];
        $companymailid=$_SESSION['companymailid'];
        $adminemailid=$_SESSION['emailid'];
        $responsible=$_SESSION['responsible_employee'];
        $createby=$_SESSION['emailid'];
        $createtype=$_SESSION['employeetype'];
        require_once ('../Model/status.php');
        $dbobj=new statusdb();
        $result1=$dbobj->sales_select_status($companyname, $companymailid);  
        return $result1;
    }

}
?>

<?php
if(isset($_POST['updatestatus'])){
    $companyname=$_SESSION['companyname'];
    $companytype=$_SESSION['companytype'];
    $companymailid=$_SESSION['companymailid'];
    $adminemailid=$_SESSION['emailid'];
    $responsible=$_SESSION['responsible_employee'];
    $createby=$_SESSION['emailid'];
    $createtype=$_SESSION['employeetype'];
    require_once ('../Model/status.php');
    $dbobj=new statusdb();
    date_default_timezone_set("Asia/Kolkata");
    $DateandTime=date("Y-m-d H:i:s");
    $statusid=$_POST['updatestatus'];
    $cont=$_POST['cont'];
    $cont_array=array();
    $cont_array=explode("@#", $cont);
    for($i=0;$i<count($cont_array);$i++){
        $contid=$cont_array[$i];
        $result1=$dbobj->sales_update_status_contact($contid, $statusid, $createby, $createtype, $DateandTime);  
    }
    return $result1;
}
?>