<?php 
function reaseedSALFsmak($account_number){
  $servername = "localhost";
  $username = "marsalog_mahran";
  $password = "gX-;hjZN-B*u";
  $dbname = "marsalog_shipping_clearance_db";
  
  $conn = new mysqli($servername, $username, $password, $dbname);
  if ($conn->connect_error) {
      die("Connection failed: " . $conn->connect_error);
  }
  $daenn = 0;
  $madenn = 0;
  $rasedd = 0;
$sql_daily_restt="SELECT account_number,daen,maden FROM daily_restriction_tbl where account_number='".$row_cw["account_number"]."'";
    $result_daily_ress = $conn->query($sql_daily_restt);
        if ($result_daily_ress->num_rows > 0) {
            while($row_daily_restt = $result_daily_ress->fetch_assoc()) {
                 $daenn = $daenn + $row_daily_restt["daen"];
                 $madenn = $madenn + $row_daily_restt["maden"];
                 $rasedd = $madenn - $daenn;
            }}
        return $rasedd;
}
function coonect_employ_with_solfacount_tn($employ_id){
    $servername = "localhost";
    $username = "marsalog_mahran";
    $password = "gX-;hjZN-B*u";
    $dbname = "marsalog_shipping_clearance_db";
    
    $conn = new mysqli($servername, $username, $password, $dbname);
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
   
  $sql_connect="SELECT * FROM coonect_employ_with_solfacount_tn where employ_id='".$employ_id."'";
      $result_connect = $conn->query($sql_connect);
          if ($result_connect->num_rows > 0) {
              while($row_connect = $result_connect->fetch_assoc()) {
                $account_number = $row_connect["account_number"];
              }}
          return $account_number;
  }
?>