HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/public_html/api.beatleanalytics.com/corporate/live/get_notification.php
<?php
/*
 * Following code will get single department details
 * A industry is identified by dept_id
 */
 
// array for JSON response
$response = array();
 
// include db connect class
require_once 'db_connect.php';
 
// connecting to db
$db = new DB_CONNECT();


//lowrating notification



if(isset($_GET["orgid"],$_GET["branchid"],$_GET["indid"])){

    $orgid = $_GET["orgid"];
    $branchid = $_GET["branchid"];
    $indid = $_GET["indid"];

    if($branchid == "0" and $indid == "0"){
        //owner
        $result = mysql_query("SELECT * FROM app_notification WHERE IsActive  LIKE 'Y' and  orgid = '$orgid' and type = 'lowfeedback' ")or die(mysql_error());
        
    }elseif($branchid != "0" and $indid == "0"){
        //branch
        $result = mysql_query("SELECT * FROM app_notification WHERE IsActive  LIKE 'Y' and  orgid = '$orgid' and branchid = '$branchid' and type = 'lowfeedback' ")or die(mysql_error());
    }elseif($branchid != "0" and $indid != "0"){
        //industry
                $result = mysql_query("SELECT * FROM app_notification WHERE IsActive  LIKE 'Y' and  orgid = '$orgid' and branchid = '$branchid' and indid = '$indid' and type = 'lowfeedback' ")or die(mysql_error());
    }
 
  // $result = mysql_query("SELECT * FROM app_notification WHERE IsActive  LIKE 'Y' ")or die(mysql_error());

   if (!empty($result)) {
	   
	   if (mysql_num_rows($result) > 0) {
 
			 $response["notificationDetail"] = array();
			  while ($row = mysql_fetch_array($result)) {
				  
				$notificationDetail = array();
				$notificationDetail["nid"] = $row["nid"];
				$notificationDetail["title"] = $row["title"];
				$notificationDetail["description"] = $row["description"];
				$notificationDetail["orgid"] = $row["orgid"];
				$notificationDetail["branchid"] = $row["branchid"];
				$notificationDetail["indid"] = $row["indid"];
				$notificationDetail["type"] = $row["type"];
				$notificationDetail["created_date"] = $row["created_date"];
			
				// push single product into final response array
				array_push($response["notificationDetail"], $notificationDetail);
			}
          
            // success
            $response["success"] = 1;
            $response["ncount"] = mysql_num_rows($result);
            // echoing JSON response
            echo json_encode($response);
        } else {
            // no product found
            $response["success"] = 0;
            $response["message"] = "No offers found";
 
            // echo no users JSON
            echo json_encode($response);
        }
		
   }  else {

        $response["success"] = 0;
        $response["message"] = "No Notification found.";
 
        // echo no users JSON
        echo json_encode($response);
    }
}elseif(isset($_GET["org_id"])){
    $orgid = $_GET["org_id"];
    $result = mysql_query("UPDATE app_notification set IsActive = 'N' WHERE orgid = '$orgid' and type = 'lowfeedback' ")or die(mysql_error());

     if (!empty($result)) {
                        
        // success
        $response["success"] = 1;
        $response["message"] = "Notification has been edited successfully.";
 
        // echoing JSON response
        echo json_encode($response);
     
        
    }  else {
        // no industry found
        $response["success"] = 0;
        $response["message"] = "No Notification updated.";
 
        // echo no users JSON
        echo json_encode($response);
    }


}else{
            
    $response["success"] = 0;
    $response["message"] = "Required field(s) is missing";
 
    echo json_encode($response);
}

?>