EVOLUTION-NINJA
Edit File: edit_cpd_v.php
<?php echo view('includes/flow-header'); ?> <section class="spec-main"> <div class="row"> <div class="col-sm-3"> <div class="spec-left"> <ul> <li><a href="">My CPD Portfolio</a></li> </ul> </div> </div> <div class="col-sm-9 view_cpd_bg"> <div class="cme-right-new" style="padding: 2% 5% 0 0;"> <div class="row"> <div class="col-sm-9"> <div class="row"> <div class="col-sm-3 mb-5 cpd_back" id="go-back-new"> <a href="<?php echo base_url('cpd-activity');?>"> <i class="fa fa-arrow-left" aria-hidden="true"></i>Back</a> </div> </div> <div class="row cpd_start_four"> <div class="col-sm-3"> <a href="<?php echo base_url('cpd-dashboard');?>"><span><button type="button" class="form-control" id="dash-button-1"><img class="avc-img" src="public/assets/cpdimage/Dashboard 1.png">Dashboard</button></a></span> </div> <div class="col-sm-3 mob_cpdacti"> <a href="<?php echo base_url('cpd-activity');?>"><button type="button" class="form-control dash-button"><img class="avc-img" src="public/assets/cpdimage/Activities 1.png">Activities</button></a> </div> <div class="col-sm-4 mob_cpdproto"> <a href="<?php echo base_url('my-cpd-portfolio');?>"><button type="button" class="form-control cps-summary-button "><img class="avc-img" src="public/assets/cpdimage/My CPD Portfolio 1.png">CPD Summary/Download</button></a> </div> </div> <div class="row"> <div class="col-sm-3 mob_cpdactivity"> <a href="<?php echo base_url('add-cpd');?>"> <img src="public/assets/cpdimage/Subtract.png" class="cpd_subtract"> <button type="button" class="form-control add_act_new">Add Activity</button></a> </div> </div> <!-- <div class="row cpd_start_four"> <div class="col-sm-3"> <a href="<?php echo base_url('cpd-dashboard');?>"> <img src="public/assets/cpdimage/Rectangle 4108 (2).png"> <h5 class="cpd_dash">Dashboard</h5> </a> </div> <div class="col-sm-3 mob_cpdacti"> <a href="<?php echo base_url('cpd-activity');?>"><img src="public/assets/cpdimage/Rectangle 4108 (2).png"> <h5 class="cpd_acti">Activities</h5> </a> </div> <div class="col-sm-5 mob_cpdproto"> <a href="<?php echo base_url('my-cpd-portfolio');?>"><img src="public/assets/cpdimage/Rectangle 4108 (2).png"> <h5 class="cpd_proto">My CPD Portfolio</h5> </a> </div> <div class="col-sm-3 mb-5 cpd_back" id="go-back-new"> <a href="<?php echo base_url('cpd-activity');?>"> <i class="fa fa-arrow-left" aria-hidden="true"></i>Back</a> </div> <div class="col-sm-5 mt-2 mob_cpdactivity"> <a href="<?php echo base_url('add-cpd');?>"><img src="public/assets/cpdimage/Rectangle 4108 (2).png"> <img src="public/assets/cpdimage/Subtract.png" class="cpd_subtract"> <h5 class="cpd_addaccti">Add Activity</h5> </a> </div> --> <!-- end new --> <!-- <div class="col-sm-3 mb-5 cpd_back" id="go-back-new"> <a href="#"> <i class="fa fa-arrow-left" aria-hidden="true"></i>Back</a> </div> --> </div> <form id ="update_cpd"> <div class="row"> <div class="col-sm-12 ml-3 mt-3 cpd_box1"> <div class="row"> <h4 class="box_cpdcont">Edit Activity</h4> </div> <div class="row cpd_border"></div> <div class="row"> <div class="col-sm-4 mt-2 ml-2 "> <label for="select_category"> Select Category<span class="mandat">*</span></label> <select id="mainHeading" class="mt-2 form-control cpd_input1 category" name = "category_name"> <!-- <?php if($portfolio_val['section'] == "Practice_Improvement_Activity"){ ?> <option value="Practice_Improvement_Activity" selected>Practice Improvement Activity</option> <?php } else{ ?> <option value="Practice_Improvement_Activity">Practice Improvement Activity</option> <?php } if($portfolio_val['section'] == "Emergency_Response_Activity"){ ?> <option value="Emergency_Response_Activity" selected>Emergency Response Activity</option> <?php } else{ ?> <option value="Emergency_Response_Activity">Emergency Response Activity</option> <?php } if($portfolio_val['section'] == "Personal_Educational"){ ?> <option value="Personal_Educational" selected>Personal Educational & Skills Activity</option> <?php } else{ ?> <option value="Personal_Educational">Personal Educational & Skills Activity</option> <?php } ?> --> <option value="Practice_Improvement_Activity" <?=($portfolio_val['category']==='Practice Improvement Activity' ) ? 'selected' : '' ?>>Practice Improvement Activity</option> <option value="Emergency_Response_Activity" <?=($portfolio_val['category']==='Emergency Response Activity' ) ? 'selected' : '' ?>>Emergency Response Activity</option> <option value="Personal_Educational" <?=($portfolio_val['category']==='Personal Educational & Skills Activity' ) ? 'selected' : '' ?>>Personal Educational</option> </select> </div> <!-- <?php echo "<h1>".$portfolio_val['category']."</h1>";?> --> <div class="col-sm-4 mt-2" id="mob_sel_cate"> <label for="select_selection" style="margin-left: 80px;">Select Section</label> <select id="subHeading" class="form-control cpd_input2 " name="section_name"> <?php if($portfolio_val['category']=="Practice Improvement Activity"){ $category = array("CNB/Labour/Obstetric Database", "Reflective Anaesthesia Logbook", "Clinical Audits", "Patient Related Experience Measures (PREMs)","Patient Centered Outcome Measures (PCOMs)", "PIA Others"); $i = 0; for($i = 0; $i < count($category); $i++ ){ if($portfolio_val['section'] == $category[$i]){ ?> <option value="<?php echo $category[$i];?>" selected><?php echo $category[$i];?></option> <?php } else{ ?> <option value="<?php echo $category[$i];?>"><?php echo $category[$i];?></option> <?php } } } ?> <?php if ($portfolio_val['category']=="Emergency Response Activity") { $category = array("Crisis Management Workshops", "Emergency Response Seminars", "ERA Others"); $i = 0; for($i = 0; $i < count($category); $i++ ){ if($portfolio_val['section'] == $category[$i]){ ?> <option value="<?php echo $category[$i];?>" selected><?php echo $category[$i];?></option> <?php } else{ ?> <option value="<?php echo $category[$i];?>"><?php echo $category[$i];?></option> <?php } } } ?> <?php if ($portfolio_val['category']=="Personal Educational & Skills Activity") { $category = array("Conferences & Seminars", "Workshops", "Learning Videos", "Exams", "Formal Courses", "Journal Reading", "Learning Sessions", "Publications", "Research", "Presentations", "Training and Development"); $i = 0; for($i = 0; $i < count($category); $i++ ){ if($portfolio_val['section'] == $category[$i]){ ?> <option value="<?php echo $category[$i];?>" selected><?php echo $category[$i];?></option> <?php } else{ ?> <option value="<?php echo $category[$i];?>"><?php echo $category[$i];?></option> <?php } } } ?> </select> <span class="sptextarea"> <textarea id="longTextDisplay" class="form-control " style="display: none; margin-top: 10px; border-radius: 15px; width: 300px; height: 70px; overflow: visible; margin-left: -95px;"></textarea></span> </div> </div> <div class="row"> <div class="col-sm-1 mt-4 ml-1"> <label for="Title"> <h6 class="mt-1">Title</h6> </label> </div> <div class="col-sm-6 mt-4"> <input type="text" class="form-control cpd_title" name="title" value = "<?php echo $portfolio_val['title'];?>"> <input type="hidden" class="form-control cpd_title" name="id" value = "<?php echo $portfolio_val['id'];?>"> </div> </div> <div class="row mt-4"> <div class="col-sm-2 mt-2"> <label for="Start Date">Start Date</label> </div> <div class="col-sm-4 "> <input type="date" for="date" class="form-control cpd_fromdate" name="start_date" value = "<?php echo $portfolio_val['start_date'];?>" > </div> <div class="col-sm-2 mt-2 cpd_enddate"> <label for="end Date">End Date</label> </div> <div class="col-sm-4 "> <input type="date" for="date" class="form-control cpd_fromdate1" name="end_date" value = "<?php echo $portfolio_val['end_date'];?>"> </div> </div> <div class="row mt-4"> <div class="col-sm-2 mt-2 mob-cpd-hours"> <label for="hours">Hours</label> </div> <div class="col-sm-4 "> <input type="text" class="form-control cpd-dat-mob" name="hours" style="width:100px;" value = "<?php echo $portfolio_val['hours'];?>" /> </div> <div class="col-sm-2 mt-2 cpd_points"> <label for="cpd points">CPD Points</label> </div> <div class="col-sm-4 "> <input type="text" for="text" class="form-control cpd_points1" name="cpd_points" value = "<?php echo $portfolio_val['cpd_points'];?>"> </div> </div> <div class="row"> <div class="col-sm-1 mt-4 ml-1"> <label for="notes"> <h6 class="mt-1 cpd_label-notes">Notes</h6> </label> </div> <div class="col-sm-6 mt-4"> <input type="text" class="form-control cpd_notes" name="notes" value = "<?php echo $portfolio_val['notes'];?>"> </div> </div> <div class="row mt-3 support-addingmob"> <div class="col-sm-10"> <div class="grid_div"></div> <div id="list2" > <table id="jqGrid" > </table> <div style="display:none;"> <table border="1" style="border-spacing: 0px !important;" id="user_excel" class="user_excel"></table> </div> </div> <div id="pager3"></div> </div> </div> <div id = "add_new"> <div class="row"> <div class="col-sm-1 mt-4 ml-1"> <label for="Title"> <h6 class="mt-1 cpd_supporting">Supporting Evidence</h6> </label> </div> <div class="col-sm-6 mt-4"> <input type="file" class="form-control ml-5 file-cpd-multi" name="upload_file_data[]" multiple> </div> <div class="col-sm-3 mt-4 "> <!-- <button type="button" class="form-control add_addition" > Additional Evidence</button> --> <button type="button" class="form-control add_addition " > <i class="fa fa-plus-square-o increase-font" aria-hidden="true"></i> </button> <!-- <p> Individual files can be up to 1MB and multiple files for a single<br> activity cannot exceed 5MB </p> --> </div> </div> </div> <div class="row"> <div class="col-sm-6"></div> <div class="col-sm-3 mob_savecpd"> <!-- <a href="#"><img src="public/assets/cpdimage/Rectangle 4110.png"> <h6 class="cpd_save">Save</h6> </a> --> <!-- <button type="submit" value="submit" class="btn">Save</button> --> <button type="submit" value="submit" class="btn cpd_save1"><h6>Update</h6></button> </div> <div class="col-sm-3 mob_cancelspd"> <a href="<?php echo base_url('cpd-activity');?>"> <img src="public/assets/cpdimage/Rectangle 4110 (1).png" class="cancel_cpdimg"> <h6 class="cpd_cancel"> Cancel</h6> </a> </div> </div> </div> </div> </form> </div> </div> </div> </div> </div> <!-- The Confirmation Modal --> <div id="deleteConfirmationModal" class="modal"> <div class="modal-content"> <h3 class="p-2" style="background-color: #0065A3;color: white; ">Logbook</h3> <div class="model_con"> <p><b>Do you want to delete this record?</b></p> <div class="row"> <div class="col-sm-6"> <button class="btn btn-light bt" onclick="closeDeleteConfirmation()"><b>No</b></button> </div> <div class="col-sm-6"> <button class="btn btn-danger bt"onclick="deleteRecord()"><b>Yes</b></button> </div> </div> </div> </div> </div> </section> <!----------------start---surgery location and surgery procedure --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc.--> <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/assets/css/jquery-ui.css'); ?>" /> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/jqgrid/css/ui.jqgrid.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('public/jqgrid/css/ui.jqgrid-bootstrap.css'); ?>" /> <script src="<?php echo base_url('public/assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> <script type="text/ecmascript" src="<?php echo base_url('public/jqgrid/js/jquery.table2excel.js'); ?>"></script> <script src="<?php echo base_url('public/assets/js/jquery.table2excel.js');?>"></script> <script> $(document).ready(function(){ jQuery("#jqGrid").jqGrid({ url: "<?php echo base_url('supporting-evidence')."?id=".$portfolio_val['id'];?>", datatype: "json", colNames:['Document Name','added on','Action'], colModel:[ // {name:'id',index:'id', width:140, editable:false }, {name:'evidence_name',index:'evidence_name', width:100, editable:false}, {name:'created_at',index:'created_at', width:50, editable:false}, { label: 'Action', name: 'edit', width: 75, formatter: function (cellValue, options, rowObject) { return `<div class="fd mt-1 pb-1"> <a href="#" onclick="showDeleteConfirmation(${options.rowId})"><i class="fa fa-trash fa-trash_del" aria-hidden="true"></i></a> </div>`; } } ], rowNum:20, rowList:[20,30,50,100,200,300], rownumbers: true, pager: '#pager3', sortname:'id', autowidth: true, height: '100%', // width: '100%', viewrecords: true, loadonce:true, gridview: true, sortorder:"desc", shrinkToFit: true, caption:"CPD Activities", subGrid: false, }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{stringResult: true,searchOperators : true}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:true,refresh:true}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); //fun_excel(); }); // $(document).ready(function () { // $("#jqGrid").jqGrid({ // url: "<?php echo base_url('supporting-evidence')."?id=".$portfolio_val['id'];?>", // datatype: 'json', // colNames:['Document Name','added on','Action'], // colModel:[ // // {name:'id',index:'id', width:140, editable:false }, // {name:'evidence_name',index:'evidence_name', width:100, editable:false}, // {name:'created_at',index:'created_at', width:50, editable:false}, // { // label: 'Action', // name: 'edit', // width: 75, // formatter: function (cellValue, options, rowObject) { // return `<div class="fd mt-1 pb-1"> // <a href="#" onclick="showDeleteConfirmation(${options.rowId})"><i class="fa fa-trash fa-trash_del" aria-hidden="true"></i></a> // </div>`; // } // } // ], // pager: '#pager3', // rowNum: 20, // rownumbers: true, // rowList:[20,30,50,100,200,300], // viewrecords: true, // gridview: true, // height: 'auto', // autowidth: true, // caption: 'Supporting Evidence Added' // }); // $("#list3").jqGrid("setLabel", "rn", "SL"); // $("#list3").jqGrid('filterToolbar',{stringResult: true,searchOperators : true}); // $("#list3").jqGrid('navGrid','#pager3', // {edit:false,add:false,del:false,search:true,refresh:true}, // { }, // { }, // { }, // { // sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], // closeOnEscape: true, // multipleSearch: true, // closeAfterSearch: true } // ); // }); $(".add_addition").click(function(){ addrow(); }); function addrow(){ var mode = ''; mode += ' <div class="row"><div class="col-sm-6 mt-4"><input type="file" class="form-control" name="upload_file_data[]" multiple></div></div>'; $("#add_new").append(mode).fadeIn('slow'); } function showDeleteConfirmation(id) { var modal = document.getElementById("deleteConfirmationModal"); modal.style.display = "block"; modal.setAttribute("data-record-id", id); } function closeDeleteConfirmation() { var modal = document.getElementById("deleteConfirmationModal"); modal.style.display = "none"; } function deleteRecord() { var modal = document.getElementById("deleteConfirmationModal"); var id = modal.getAttribute("data-record-id"); closeDeleteConfirmation(); $.ajax({ url: "<?php echo base_url('cpd-evidence-delete');?>", method: 'POST', data: { id: id, }, dataType: 'json', success: function (response) { if (response.success) { console.log('Delete successful:', response.message); $("#jqGrid").trigger("reloadGrid"); } else { console.error('Delete failed:', response.message); } }, error: function (error) { console.error('AJAX error:', error); } }); } $(document).ready(function(){ $('#update_cpd').submit(function(e){ e.preventDefault(); const cat = $('.category'); const catValue = cat.val(); if (!catValue) { toastr["error"]('Please select Category'); return; } var formData = new FormData(this); $.ajax({ type : "POST", url : '<?php echo base_url("update-cpd-case")?>', data : formData, contentType: false, processData: false, success:function(response){ response = jQuery.parseJSON(response); if(response.result == 1){ toastr["success"](response.message); // $(".add_conferences").modal("hide"); window.location = '<?php echo base_url("cpd-activity")?>'; } else{ toastr["error"](response.message); } } }); }); }); const mainHeadingSelect = document.getElementById('mainHeading'); const subHeadingSelect = document.getElementById('subHeading'); const longTextDisplay = document.getElementById('longTextDisplay'); const subHeadings = { Practice_Improvement_Activity: ["select", "CNB/Labour/Obstetric Database", "Reflective Anaesthesia Logbook", "Clinical Audits", "Patient Related Experience Measures (PREMs)", "Patient Centered Outcome Measures (PCOMs)", "PIA Others"], // ===================== Emergency_Response_Activity: ["select", "Crisis Management Workshops", "Emergency Response Seminars", "ERA Others"], Personal_Educational: ["select", "Conferences & Seminars", "Workshops", "Learning Videos", "Exams", "Formal Courses", "Journal Reading", "Learning Sessions", "Publications", "Research", "Presentations", "Training and Development"] }; subHeadingSelect.addEventListener('change', () => { const selectedSubHeadingText = subHeadingSelect.options[subHeadingSelect.selectedIndex].text; longTextDisplay.value = selectedSubHeadingText; if (selectedSubHeadingText.length > 10) { // You can adjust this threshold longTextDisplay.style.display = 'block'; } else { longTextDisplay.style.display = 'none'; } }); mainHeadingSelect.addEventListener('change', () => { const selectedMainHeading = mainHeadingSelect.value; subHeadingSelect.innerHTML = ''; // Clear previous options if (selectedMainHeading !== 'none') { const subHeadingOptions = subHeadings[selectedMainHeading]; subHeadingOptions.forEach(option => { const optionElement = document.createElement('option'); optionElement.value = option; optionElement.textContent = option; subHeadingSelect.appendChild(optionElement); }); } else { const defaultOption = document.createElement('option'); defaultOption.value = 'none'; defaultOption.textContent = 'Select more information'; subHeadingSelect.appendChild(defaultOption); } longTextDisplay.style.display = 'none'; }); </script> <style> .ui-jqgrid-sdiv{ display : none !important; } .ui-jqgrid-titlebar { background-color:#0065A3; } .ui-jqgrid-title{ color:#fff; font-weight: 600; font-size: 18px; } .user-tag{ color: #0065A3; font-weight: 600; font-size: 24px; } .soptclass{ display : none; } .fd{ display:flex; } .fa-trash_del{ font-size:21px !important; margin-left:10px; } .fa-trash_fol{ font-size:21px !important; margin-left:20px; } @media only screen and (max-width:600px){ #mobile-div{ padding: 20px; } .modal-content { width: 70% !important; } .bt{ width: 100%; margin-top: 2px; } .ui-jqgrid .ui-jqgrid-caption, .ui-jqgrid .ui-jqgrid-errorbar-ltr { margin: 5px !important; } #list2{ position: relative; top: -195px; } } /* CSS for the modal */ .modal { display: none; position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); } .modal-content { background-color: #fff; margin: 20% auto; /* padding: 20px; */ width: 30%; /* text-align: center; */ } .model_con{ padding: 20px; } .bt{ width: 100%; } </style> <!----------------end---surgery location and surgery procedure --> <style> .mob_cpdactivity{ margin-top: 20px !important; position: relative; left: 183px; } .dash-button{ background: linear-gradient(to left, #0160A2,#0198CD, #0160A2); color: white; border: none; border-radius: 6px; width: 100%; height: 45px; font-size: 17px; } #dash-button-1{ /* background: linear-gradient(to left, #0160A2,#0198CD, #0160A2); */ background-color: #0160A2; color: white; border: none; border-radius: 6px; width: 100%; height: 45px; font-size: 17px; } .cps-summary-button{ background: linear-gradient(to left, #0160A2,#0198CD, #0160A2); color: white; border: none; border-radius: 6px; width: 105%; height: 45px; font-size: unset; } .add_act_new{ background: linear-gradient(to left, #0160A2,#0198CD, #0160A2); color: white; border: none; border-radius: 6px; width: 85%; height: 30px; font-size: 14px; text-align: center; } .cpd_subtract{ margin-left: 3px; position: relative; top: 24px; width: 14px; left: 3px; } .cpd_back{ position: relative; top: 0px; } .mob_cpdacti{ /* margin-left: -50px; */ } .mob_cpdproto{ /* margin-left: -50px; */ } .cpd_start_four{ margin-top: -80px; } .avc-img{ width: 28px; height: 28px; position: relative; left: -7px; } @media only screen and (max-width: 600px){ .mob_cpdactivity{ width: 50%; margin-left: -148px; margin-top: 160px !important; } #dash-button-1{ margin-top: 50px; margin-left: 0px; } .cps-summary-button{ margin-left: 50px; margin-top: 10px; width: 80%; } .mob_cpdacti{ margin-top: 50px; margin-left: -189px !important; } .cpd_start_four{ margin-top: -45px; margin-left: 10px !important; } .can-mo{ position: relative; top: -30px; left: 4px; } .can-mo1{ position: relative; top: -12px; left: 4px; } .mob_cpdacti { position: relative; top: -35px; left: 187px; } .cps-summary-button { margin-left: 0px; margin-top: 10px; width: 100%; } .cpd_box1{ position: relative; top: -130px; width: 84% !important; left: 30px; min-width: none; min-height: 680px; } .cpd_enddate { position: relative; top: -70px !important; left: 165px; margin-top: 4px !important; } .cpd_fromdate1 { margin-top: -72px !important; margin-left: 160px; width: 150px !important; } } </style>