ok

Mini Shell

Direktori : /home2/selectio/public_html/tnpsctestbatch.com/admin/old/api/backups/
Upload File :
Current File : /home2/selectio/public_html/tnpsctestbatch.com/admin/old/api/backups/drop-down-list.php

<?php include"../config/config.php";

if($_POST['type']=="branch_based_role"){
    $branch_id = $_POST['branch_id'];
    $role_id=0;
    if(isset($_POST['role_id'])){
        $role_id=$_POST['role_id'];
    }
    
        $statement = $pdo->prepare("SELECT id,role_name FROM `tbl_role` where status=1 and branch_id=$branch_id");
		$statement->execute();
		$result = $statement->fetchAll(PDO::FETCH_ASSOC);
		$branch_based_role="<option value=''>Select Role Name</option>";
		foreach( $result as $row ) {
		    if($role_id==$row['id']){
		        $branch_based_role.="<option value='".$row['id']."' selected>".$row['role_name']."</option>";
		    }else{
		        $branch_based_role.="<option value='".$row['id']."'>".$row['role_name']."</option>";
		    }
		}
    echo $branch_based_role;
}
?>

Zerion Mini Shell 1.0