ok
Direktori : /proc/thread-self/root/home2/selectio/www/y1jobportal.in/apps-api/ |
Current File : //proc/thread-self/root/home2/selectio/www/y1jobportal.in/apps-api/get-plan.php |
<?php include_once('config/config.php'); include_once('config/custom-functions.php'); include 'config/send-sms.php'; $fn = new custom_functions(); date_default_timezone_set('Asia/Kolkata'); $today=date('d-m-Y h:m:s A'); try{ $sql="SELECT id, name,amount,duration,count FROM subscription where id!=0 "; $statement = $pdo->prepare($sql); $statement->execute(); $res = $statement->fetchAll(PDO::FETCH_ASSOC); if (!empty($res)) { $r=0; foreach($res as $re){ $res[$r]['name']=$re['name'].' (₹ '.$re['amount'].') - '.$re['count'].' Employee'; $r++; } $response['error'] = false; $response['message'] = "Data fetched successfully."; $response['data'] = $res; } else { $response['error'] = true; $response['message'] = "Something went wrong, please try again leter."; } $pdo = null; print_r(json_encode($response)); }catch(Exception $e){ $response["error"] = true; $response["status_code"] = '403'; $response["status"] = 'Forbidden'.$e; $pdo = null; print_r(json_encode($response)); return 0; } ?>