golden hour
/home4/theinves/public_html/seshaasschool.com/dashboard/apis
⬆️ Go Up
Upload
File/Folder
Size
Actions
api
-
Del
OK
banner.php
1.8 KB
Del
OK
category.php
4.37 KB
Del
OK
flash_news.php
1.92 KB
Del
OK
latest_events.php
1.81 KB
Del
OK
settings.php
3.49 KB
Del
OK
sub-category.php
0 B
Del
OK
Edit: flash_news.php
<?php ob_start(); session_start(); include "../config/config.php"; include "../config/session.php"; if(isset($_POST['type']) && $_POST['type']=='flash_news_add'){ try{ $title = $_POST['title']; $description = $_POST['description']; $u_link = $_POST['u_link']; $statement = $pdo->prepare("INSERT INTO `tbl_flash_news`(`title`, `description`, `u_link`) VALUES (?,?,?)"); $result = $statement->execute(array($title, $description, $u_link)); if($result){ $return_arr['message']='Flash News Added Successfully...'; $return_arr['status']=200; } else{ $return_arr['message']='Something Went Wrong..'; $return_arr['status']=400; } }catch(PDOException $e){ $return_arr['message']="$e"; $return_arr['status']=500; } echo json_encode($return_arr); } if(isset($_POST['type']) && $_POST['type']=='flash_news_update'){ try{ $ids = $_POST['ids']; $title = $_POST['title']; $description = $_POST['description']; $status = $_POST['status']; $u_link = $_POST['u_link']; $statement = $pdo->prepare("UPDATE `tbl_flash_news` SET `title`=?,`description`=?, `status`=? ,`u_link`=? WHERE id=?"); $result = $statement->execute(array($title, $description, $status, $u_link, $ids)); if($result){ $return_arr['message']='Flash News Updated Successfully...'; $return_arr['status']=200; } else{ $return_arr['message']='Something Went Wrong..'; $return_arr['status']=400; } }catch(PDOException $e){ $return_arr['message']="$e"; $return_arr['status']=500; } echo json_encode($return_arr); } ?>
Save