ok
Direktori : /proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/old/api/backups/ |
Current File : //proc/self/root/home2/selectio/www/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; } ?>