<?php
$companies = $queries -> getPayment("EXEC Getpayment_sp @p1= saba, @p2= saba ");
 
$companies = $companies[0]['getpayment'];
$companyname = '';
if(is_array($companies) && (sizeof($companies) > 0)){
    
    
    for($i=0; $i<sizeof($companies);$i++){
        
        $w_id = $companies[$i]['id_payment'];
        $w_name = $companies[$i]['store_nam'];
        
        $companyname .= '<option class=" py-4" value="'.$w_id.'">'.$w_name.'</option> ';
        
    }
    
    
    
 
    
}

if($_SESSION['alslaksdjpAydaq'] == "laskd23#*(%kj23(sSMq"){
            

         if(isset($_POST['logindashboadsubmit'])){
            
            $pa= $_POST['logindashboardpass']; 
            $so= $pa;
            $ci= $_POST['logindashboardcompany']; 
            
            if(!empty(trim($so)) && !empty(trim($pa)) && !empty(trim($ci))){
                
                
                $fstchar = $so[0];
				if($fstchar == '0'){
					 $so = substr($so, 1);
					 $pa = $so;
				}
                
                
                $rez = $queries -> getuser("EXEC GetUsers_sp   @p1 =  '$so' , @p2 = '$pa' ,@p3= '$ci' ");
                
                if ($rez){
                    
                    $res = $queries -> getCodeCast("EXEC Getcod_cast @p1='$so', @p2='$pa',@p3 = '$ci'");
                     
                    if($res !== 'none'){
                     
                      $c = strlen(trim($res));                    
                      if($c > 0){
 
                        
                        $_SESSION['uzi'] = $so;
                        $_SESSION['pzi'] = $pa;
                        $_SESSION['czi'] = $res;
                        $_SESSION['ucid'] = $ci;
                                            
                        header("Location: index.php");
                      }else{
                           $checkstateoflogin = false;
                      }
                        
                        
                    }else{
                        $checkstateoflogin = false;
                    }
                    }else{
                      $checkstateoflogin = false;
                   }
 
                
            }else{
                $checkstateoflogin = false;
            }
            
        }else{
              $checkstateoflogin=true;
         }
            
        }
        else{
            $checkstateoflogin=true;
        }
           





?>
