<?php

include 'config/database.php';
$res = get_notify(); 
$i = 0;
$drop = [];
foreach ($res as $key => $value) {
  $i = $i+1;
  $drop[$i] = $value['n_cliend_id'];
}
$rand = rand(1,$i);
$BOT = $drop[$rand];

$param = encode(json_encode(['key'=>$BOT,'groupId'=>$_GET['gid']]),APP);
header("Location: https://notify-bot.line.me/oauth/authorize?response_type=code&redirect_uri=http://at-mybot.me:8000/callback.php&scope=notify&state=$param&client_id=$BOT");
//http://at-mybot.me:8000/create.php
?>