From c213601492058242dadc7bb15ab172018d380211 Mon Sep 17 00:00:00 2001 From: Sanjeev Date: Fri, 2 Jul 2021 14:47:17 +0530 Subject: [PATCH] Delete Video API : ps --- api/application/config/routes.php | 1 + api/application/controllers/PD_Controller.php | 14 ++++++++++++++ api/application/helpers/video_grabber_helper.php | 10 ++++++++++ 3 files changed, 25 insertions(+) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index f9cb4c86..4d859da5 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -234,6 +234,7 @@ $route['putSalCheck'] = 'PD_Controller/putSalCheck'; $route['sendCusLinkViaSMS'] = 'PD_Controller/sendCusLinkViaSMS'; $route['saveCusVideo'] = 'PD_Controller/saveCusVideo'; $route['getVideoURL'] = 'PD_Controller/getVideoURL'; +$route['deleteVideo'] = 'PD_Controller/deleteVideo'; $route['getListOfvendors'] = 'PD_Controller/getListOfvendors'; $route['(getListVendorPDOfficers/:num)'] = 'PD_Controller/getListVendorPDOfficers'; $route['duplicatePD'] = 'PD_Controller/duplicatePD'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 8d85ea62..e73f2d28 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -9779,6 +9779,20 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $this->response($data,REST_Controller::HTTP_OK); + } + + // To Inactive Video Recorded. + public function deleteVideo_post(){ + $multipleWhere = $this->post(); + $multipleWhere['fk_pd_id'] = $multipleWhere['pd_id']; + unset($multipleWhere['pd_id']); + $this->load->helper('video_grabber_helper'); + $result_data = (new video_grabber_helper)->deleteVideo($multipleWhere); + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['msg'] = $result_data ; + $this->response($data,REST_Controller::HTTP_OK); + } function updateTwlioVideoStatus_post() diff --git a/api/application/helpers/video_grabber_helper.php b/api/application/helpers/video_grabber_helper.php index 91062fe6..36bdff79 100644 --- a/api/application/helpers/video_grabber_helper.php +++ b/api/application/helpers/video_grabber_helper.php @@ -49,6 +49,16 @@ class video_grabber_helper return $result_data; } + public function deleteVideo($multipleWhere) + { + $CI =&get_instance(); + $updateRows = array('isactive' => 0); + // $multipleWhere = array('fk_pd_id' => $pdid, 'room_id' => $roomid); + $CI->db->where($multipleWhere); + $CI->db->update(VIDEO_ROOM_INFO, $updateRows); + $affectedRows = $CI->db->affected_rows(); + return (($affectedRows > 0 ) ? "Deleted successfully" : "Fail to Delete"); + } }