<?php include_once($_SERVER['DOCUMENT_ROOT'] . '/_ps2020/_global/dir_root.php'); ?>
<?php include_once($_SERVER['DOCUMENT_ROOT'] . '/_ps2020/config/cfg_loggedUser.php'); ?>
<?php include($_SERVER['DOCUMENT_ROOT'] . "/_ps2020/config/connect.php"); ?>

<!DOCTYPE HTML>
<!--
	Hielo by TEMPLATED
	templated.co @templatedco
	Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)
-->
<html>

<head>
	<title>Inbox | GEESE</title>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />

	<?php include_once(dir_rootPHP . '_global/icon.php'); ?>


	<!-- libs -->
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
		<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/fontAwesome/css/font-awesome.min.css" /> -->
		<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/animate.css" /> -->

		<!-- animation -->
			<link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate.css" />
			<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_bounce.css" /> -->
			<link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_fade.css" />
			<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_flip.css" /> -->
			<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_other.css" /> -->
			<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_rotate.css" /> -->
			<link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_slide.css" />
			<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>libs/Animate/animate_zoom.css" /> -->

		<!-- table-fucntions -->
			<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/jszip-2.5.0/dt-1.10.21/af-2.3.5/b-1.6.3/b-colvis-1.6.3/b-flash-1.6.3/b-html5-1.6.3/b-print-1.6.3/cr-1.5.2/fc-3.3.1/fh-3.1.7/kt-2.5.2/r-2.2.5/rg-1.1.2/rr-1.2.7/sc-2.0.2/sb-1.0.0/sp-1.1.1/sl-1.3.1/datatables.min.css"/>

			<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
			<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
			<script type="text/javascript" src="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/jszip-2.5.0/dt-1.10.21/af-2.3.5/b-1.6.3/b-colvis-1.6.3/b-flash-1.6.3/b-html5-1.6.3/b-print-1.6.3/cr-1.5.2/fc-3.3.1/fh-3.1.7/kt-2.5.2/r-2.2.5/rg-1.1.2/rr-1.2.7/sc-2.0.2/sb-1.0.0/sp-1.1.1/sl-1.3.1/datatables.min.js"></script>

	<!-- css -->
		<link rel="stylesheet" href="<?php echo dir_root; ?>css/template-hielo/main.css" />
		<link rel="stylesheet" href="<?php echo dir_root; ?>css/template-hielo/dataTable.css" />

	<!-- css (custom) -->
		<link rel="stylesheet" href="<?php echo dir_root; ?>css/henry_style.css" />
		<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>css/tanuj_style.css" /> -->
		<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>css/karl_style.css" /> -->
		<!-- <link rel="stylesheet" href="<?php echo dir_root; ?>css/harsh_style.css" /> -->

		<style type="text/css">

			input[type="text"]{height: 2rem;}

			table{
				min-width: 600px;
			}

			.table thead th{
				border-bottom: 0px;
			}

			table td{
				padding-right: 3rem;
			}

			table tbody tr:hover{
				background-color: #58ff582e !important; /*#47cd475c*/
			}

			#btnDel, #btnShow{
				text-align: center;
				border-left: 1px solid #cbcbcb;

				cursor: pointer;
				transition: all .4s ease;
			}
				#btnDel:hover{
					background-color: #f55757;
				}
				#btnDel:hover >i{
					color: white !important;
				}

				#btnDel >i{
					color: #e80000;
					padding-left: 2px;
				}

				#btnShow:hover{
					background-color: green;
				}
				#btnShow:hover >i{
					color: white !important;
				}

				#btnShow >i{
					color: #e80000;
					padding-left: 2px;
				}
		</style>

</head>
<!-- <body class="subpage"> -->

<body>

	<!-- Header | Nav -->
	<?php include_once(dir_rootPHP . '_global/navbar/navbar.php'); ?>
	<?php include_once(dir_rootPHP . '_global/navbar/navbar-mobile.php'); ?>


	<!-- Page-Title -->
	<section id="One" class="wrapper style3" style="padding-top: 9rem;">
		<div class="inner">
			<header class="align-center">
				<p>Greenscape Environmental Experience & Learning Survey Experiments</p>
				<h2>Inbox</h2>
			</header>
		</div>
	</section>

	<!-- Content -->
	<section id="two" class="wrapper style2">

		<div class="inner">
			<div class="box ctm-box">
				<div class="content">

					<!-- Table -->
					<div class="table-wrapper">

						<!-- <h2>Manage Feedback</h2> -->

						<div style="padding: 5px; overflow-x: auto;">

							<?php
							$result = $conn->query("SELECT feedback_id AS 'ID', name AS 'Name', email AS 'Email', type AS 'Message-Type', subject AS 'Subject', message AS 'Message' FROM feedback ORDER BY feedback_id DESC;");

							$tablesAndTheirData = array();
							array_push($tablesAndTheirData, array(
								'fields' => $result->fetch_fields(),
								'data' => $result
							));

							foreach ($tablesAndTheirData as $table) {
								if ($table['data']->num_rows) {
							?>
									<table id="data_table" class="table table-striped" style="width:100%;">

										<thead class="animated fadeInUp">
											<tr>
												<?php
												foreach ($table['fields'] as $field) {
												?>
													<th><?php echo $field->name; ?></th>
												<?php
												}
												?>
												<th id="thDel" class="1u 1u$(xsmall)"></th>
											</tr>
										</thead>

										<tbody>
											<?php
											$order_num = 0;
											while ($row = $table['data']->fetch_assoc()) {
												$order_num++;
											?>
												<tr class="animated fadeIn">
												<?php
													$index = 0;
													$name = $email = $msgType = $msgSubject = $msgContent = '';


													foreach ($row as $key => $value) {
														if ($key == 'ID') {
															$index = $value;
														}
												?>
														<td>
															<!--I need to continue editing from here-->
															<?php
															if ($key == 'Name') {
																$name = $value;
															?>
																<!-- label -->
																<div id="username_Row_<?php echo $index; ?>">
																	<label id="username_<?php echo $index; ?>" style="display: inline-block; margin: 0 !important;"><?php echo $value;?></label>
																</div>

															<?php
															} else if ($key == 'Email') {
																$email = $value;
															?>
																<!-- label -->
																<div id="email_Row_<?php echo $index; ?>">
																	<label id="email_<?php echo $index; ?>" style="display: inline-block; margin: 0 !important;"><?php echo $value; ?></label>
																</div>

															<?php
															} else if ($key == 'Message-Type') {
																$msgType = $value;
															?>
																<!-- label -->
																<div id="type_Row_<?php echo $index; ?>">
																	<label id="type_<?php echo $index; ?>" style="display: inline-block; margin: 0 !important;"><?php echo $value; ?></label>
																</div>

															<?php
															} else if ($key == 'Subject') {
																$msgSubject = $value;
															?>
																<!-- label -->
																<div id="subjectRow_<?php echo $index; ?>">
																	<label id="subject_<?php echo $index; ?>" style="display: inline-block; margin: 0 !important;"><?php echo $value; ?></label>
																</div>

															<?php
															} else if ($key == 'Message') {
																$msgContent = $value;
																$msg = substr($value, 0, 10).'...';
															?>
																<!-- label -->
																<div id="messageRow_<?php echo $index; ?>">
																	<label id="messageFull_<?php echo $index; ?>" style="display: none;"><?php echo $value; ?></label>
																	<label id="message_<?php echo $index; ?>" style="display: inline-block; margin: 0 !important;"><?php echo $msg; ?></label>
																</div>

															<?php
															} else {
																echo $value;
															}
															?>
														</td>
												<?php
													}
												?>

													<!-- Delete -->
													<td id="btnDel" class="1u 1u$(xsmall)" onclick="feedbackDelete('<?php echo $index; ?>')">
														<i id="icDel_<?php echo $index; ?>" class="fa fa-trash" style="color:red;"></i>
													</td>
													<!--This will show the message on a pop up-->
													<td id="btnShow" class="1u 1u$(xsmall)" onclick="feedbackView('<?php echo $index; ?>')">
														<i id="icView_<?php echo $index; ?>" class="fa fa-envelope" style="color:green;"></i>
													</td>
												</tr>
											<?php
											}
											?>
										</tbody>
									</table>
							<?php
								}
							}
							?>

						</div>

						<div style="height: 10px;"></div>

						<!-- ==== (Add) button ==== -->
						<div id="btnAdd" class="animated fadeIn ctm-toCenter" style="background-color: red; color:white; padding:10px;" onclick="feedbackAdd()">
							<iconPlus><i class="fa fa-minus-circle"></i>Remove Multiple Records!!</iconPlus>
						</div>

						<!-- ==== New-Survey ==== -->
						<div id="surveyAdd_row" class="animated fadeInDown ctm-hide">
							<div class="3u 12u$(medium)">
								<h2>Delete Messages</h2>
							</div>

							<div class="12u$">

							<div id="deleting-guidelines" style="width:75%;text-align:center;background-color:yellow;color:gray;margin:auto;padding:5px;border:'15px solid';">
							        	
											<h3>Guidelines For Deletion</h3>
											<p>
							        		Based on your requirements you can either delete old or new records. Select valid "Delete Option" for that.<br/>
											After selecting the option you need to input a valid number to delete the records. Than click submit Button.<br/>
											After delete records the screen will update in a few seconds. So that success of the deletion can be seen.
											</p>
							        		<p>Note: If records more than existing are selected for deletion the website will display an error accordingly.</p>
							        	
							        </div>

							</div>

							<div class="9u 9u$(medium) surveyAdd_rowInner">
								<!-- Survey-Name -->
								<!--Should probably add a dropdown list over here for type selection-->
								<div class="4u 12u$(medium)" style="padding: 10px;">
									<div class=""><label for="newName">Delete-Options</label></div>
									<!-- <input id="newName" name="newName" type="text" style="border-color: #9f9f9f; border-radius: 5px;" value="" /> -->
									<select id="newName" name="newName" class="browser-default custom-select mb-4">
										<option value="" selected disabled>Select Delete Option</option>
										<option value="top">Delete Old Messages</option>
										<option value="bottom">Delete New Messages</option>
									</select>
								</div>

								<!-- URL -->
								<!--This section will be used to fix the message type-->
								<div class="8u 12u$(medium)" style="padding: 10px;">

									<div class=""><label for="newUrl">Number of Records</label></div>
									<input id="newUrl" name="newUrl" type="text" class="" style="border-color: #9f9f9f; border-radius: 5px;" value="" placeholder="Number of Rows" />
								</div>

								<!-- ==== (Complete) button ==== -->
								<div class="2u 12u$(medium)" style="padding: 10px;">
									<div style="height: 2rem;"></div>
									<div id="btnComplete" class="animated fadeIn ctm-toCenter" >
										<div class="button special fit" style="text-transform: unset; border-radius: 5px; margin: 0;" onclick="feedbackAdd_toDb()">Delete!!</div>
									</div>
								</div>

								<!-- ==== (Close) button ==== -->
								<div id="btnClose"><i class="fa fa-times-circle-o" style="font-size: 32px; color: #ff00009e;" onclick="feedbackAdd_close()"></i></div>
							</div>
						</div>

					</div>

				</div>
			</div>
		</div>
	</section>


	<!-- Footer -->
	<?php include_once(dir_rootPHP . '_global/footer/footer.php'); ?>

	<!-- Scripts -->
	<script src="<?php echo dir_root; ?>js/template-hielo/jquery.min.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/jquery.scrollex.min.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/skel.min.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/util.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/main.js"></script>

	<!-- Scripts (custom) -->
	<script type="text/javascript">
		$(document).ready(function() {
			$('#data_table').DataTable({
				dom: 'frtip'
			});

		});
	</script>

	<!-- Scripts -->
	<!-- <script src="<?php echo dir_root; ?>js/template-hielo/jquery.min.js"></script> -->
	<script src="<?php echo dir_root; ?>js/template-hielo/jquery.scrollex.min.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/skel.min.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/util.js"></script>
	<script src="<?php echo dir_root; ?>js/template-hielo/main.js"></script>


	<!-- ==========  <- Pop-Notification ->  ========== -->
		<?php include_once(dir_rootPHP.'_global/tools/popNotif.php'); ?>

	<!-- ==========  <- Pop-up ->  ========== -->
		<?php include_once(dir_rootPHP.'_global/tools/popAlert.php'); ?>

	<!-- ==========  <- Pop-Window ->  ========== -->
		<?php include_once(dir_rootPHP.'_global/tools/popWindow.php'); ?>


	<!-- Scripts (custom) -->
	<script type="text/javascript">
		/* -----  Delete Inbox Message ----- */

		function feedbackView($sid){

			var name = $('#username_'+$sid).html();
			var email = $('#email_'+$sid).html();
			var type = $('#type_'+$sid).html();
			var subject = $('#subject_'+$sid).html();
			var message = $('#messageFull_'+$sid).html();

			// show pop-pWin
				$pWUrl = '';
				$pWTitle = 'Messaage Box';
				$pWHeader = 'Message';

				var msgP = [
					'<b>From: </b>'+name+'<br>',
					'<b>Email: </b>'+email+'<br><br>',
					'<b>Message-Type: </b>'+type+'<br>',
					'<b>Subject: </b>'+subject+'<br><br>',
					'<div><b>Body: </b><br>'+message+'</div>'
				].join('\n');
				
				$pWMsg = msgP;
					// $pWMsg += 'Name: <?php echo $name; ?><br>';
					// $pWMsg += 'Email: <?php echo $email; ?><br>';
					// $pWMsg += 'Message-Type: <?php echo $msgType; ?><br>';
					// $pWMsg += 'Subject: <?php echo $msgSubject; ?><br>';
					// $pWMsg += 'Message: <?php echo $msgContent; ?><br>';
				$pWConfirm = 'Done';
				$pWCancel = 'Cancel';
				$pWIcon = 0;
			
			popWindow_btnSingle()
			popWindow_show($pWUrl,$pWTitle,$pWHeader,$pWMsg,$pWConfirm,$pWCancel,$pWIcon);

			// var iFrame_func = $('#popWin_iFrame')[0].contentWindow;
			// $('#popWin_iFrame')[0].contentWindow.$('#name').html(name);

			$('#popWinBtn_confirm').click(function(e){
				popWindow_hide();
			});
		}

		function feedbackDelete($sid) {

			// style 'Confirm'
			$('#popBtn_confirm').css({
				'color': 'red'
			});

			$('#popBtn_confirm').hover(function() {
				$(this).css({
					'background-color': 'red',
					'color': 'white'
				});
			}, function() {
				$(this).css({
					'background-color': '',
					'color': 'red'
				});
			});

			// style 'Cancel'
			$('#popBtn_cancel').hover(function() {
				$(this).css({
					'background-color': 'white',
					'color': 'unset',
					'font-weight': 'bold'
				});
			}, function() {
				$(this).css({
					'background-color': '',
					'color': '',
					'font-weight': ''
				});
			});

			// show pop-alert
			$title = 'Are you sure?';
			$msg = 'Clicking "Remove" will permanently delete this message';
			$confirm = 'Remove';
			$cancel = 'Cancel';
			$icon = 0;

			popAlert_show($title, $msg, $confirm, $cancel, $icon);

			$('#popBtn_confirm').click(function() {
				$.ajax({
					type: 'GET',
					url: '<?php echo dir_root; ?>php/ajax/post_inboxDelete.php?sid=' + $sid,
					date: '',
					success: function(m) {
						location.reload();
					}
				});
			});
		}

		/* -----  Add-section  ----- */
		function feedbackAdd() {
			$('#surveyAdd_row').removeClass('ctm-hide');
			$('#btnAdd').addClass('ctm-hide');
		}
	
		function numOfRows(){
			var result = 0;
			var xmlhttp = new XMLHttpRequest();
			xmlhttp.onreadystatechange = function(){
				if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
					if(this.responseText != undefined || this.responseText != ""){
						result = this.responseText;
					}
				}
			};
			xmlhttp.open("GET","<?php echo dir_root; ?>php/ajax/post_totalRow.php", false);
			xmlhttp.send();
			return result;
		}

		$("#newUrl").blur(function(){
			var num = $("#newUrl").val();
			$("#newUrl").val(num.trim());
			
			num = num.trim();
			
			if(isNaN(num)){
				$icon = 2;
				$msg = 'Please enter a valid Number';
				popNotif_show($icon, $msg);
			}

			var option = $("#newName").val();
			//alert("The value of option: " + option);
			if(option == undefined || option == ""){
				$icon = 2;
				$msg = 'Choose Delete Option!';
				popNotif_show($icon, $msg);
			}

			var totalNumber = numOfRows();
			if(parseInt(num) > parseInt(totalNumber)){
				$icon = 2;
				$msg = 'You have exceeded the Limit';
				popNotif_show($icon, $msg);
				// return;
			}
		});

		function feedbackAdd_toDb(){
			var option = $("#newName").val();
			var num = $("#newUrl").val();
			$("#newUrl").val(num.trim());
			num = num.trim();
			var totalRows = numOfRows();
			//First we check if option has been selected or not
			//Than we check if the num is a number of not
			//Than we check if num value exceeds the number of records
			//Otherwise we just execute the request
			
			if(option == null || option == undefined || option == "" ){

				$('#popBtn_confirm').css({
					'background-color': 'white',
					'color': 'black',
					'font-weight': 'normal'
				});

				$('#popBtn_confirm').hover(function() {
					$(this).css({
						'font-weight': 'bold'
					});
				}, function() {
					$(this).css({
						'font-weight': 'normal'
					});
				});

				// show pop-alert
				$title = 'Select Delete Operation!';
				$msg = 'Please select a delete option!';
				$confirm = 'Okay';
				$cancel = 'Cancel';
				$icon = 3;

				popAlert_btnSingle();
				popAlert_show($title, $msg, $confirm, $cancel, $icon);


			}else if(isNaN(num)){

				$('#popBtn_confirm').css({
					'background-color': 'white',
					'color': 'black',
					'font-weight': 'normal'
				});

				$('#popBtn_confirm').hover(function() {
					$(this).css({
						'font-weight': 'bold'
					});
				}, function() {
					$(this).css({
						'font-weight': 'normal'
					});
				});

				// show pop-alert
				$title = 'Input Valid Number!';
				$msg = 'Please input a valid number!';
				$confirm = 'Okay';
				$cancel = 'Cancel';
				$icon = 3;

				popAlert_btnSingle();
				popAlert_show($title, $msg, $confirm, $cancel, $icon);

			}else if(parseInt(num) > parseInt(totalRows)){

				$('#popBtn_confirm').css({
					'background-color': 'white',
					'color': 'black',
					'font-weight': 'normal'
				});

				$('#popBtn_confirm').hover(function() {
					$(this).css({
						'font-weight': 'bold'
					});
				}, function() {
					$(this).css({
						'font-weight': 'normal'
					});
				});

				// show pop-alert
				$title = 'Error: Limit Exceeded!';
				$msg = 'You can delete upto ' + totalRows + ' Records!';
				$confirm = 'Okay';
				$cancel = 'Cancel';
				$icon = 3;

				popAlert_btnSingle();
				popAlert_show($title, $msg, $confirm, $cancel, $icon);

			}else{
				//So after checking everything the only thing left to be done 
				//Is to delete the designated num of rows
				var $result = -2;
				var xmlhttp = new XMLHttpRequest();
				xmlhttp.onreadystatechange = function(){
					if(xmlhttp.status == 200 && xmlhttp.readyState == 4){
						
						var theResponse = this.responseText;
						
						if(theResponse == "1" || theResponse == 1){
							$icon = 1;
							$msg = 'The records are being deleted!!';
							popNotif_show($icon, $msg);
							// setTimeout(() => {
							// 	window.location.reload();
							// }, 4000);
							window.location.reload();
							// setInterval(function(){window.location.reload(); }, 3000);
						}else{
							$icon = 2;
							$msg = 'Delete Operation Failed!!';
							popNotif_show($icon, $msg);
							// setTimeout(() => {
							// 	window.location.reload();
							// }, 4000);
							setInterval(function(){ window.location.reload() }, 3000);
						}
					}
				};
				xmlhttp.open("POST","<?php echo dir_root; ?>php/ajax/post_inboxDeleteRows.php?num=" + num + "&option=" + option, false);
				xmlhttp.send();
			}
		}


		function old_feedbackAdd_toDb() {

			$newName = $('#newName').val();
			$newUrl = $('#newUrl').val();
			$("#newUrl").val($newUrl.trim());
			$newUrl = $("#newUrl").val();
			var numRow = numOfRows();
			var numOfRows = parseInt(numRow);

			if ($newUrl == '' || isNaN($newUrl) || ($newUrl > numRows)) {

				// style 'Confirm'
				if($newUrl > numRows && !isNaN($newUrl)){
					$('#popBtn_confirm').css({
					'background-color': 'white',
					'color': 'black',
					'font-weight': 'normal'
				});

				$('#popBtn_confirm').hover(function() {
					$(this).css({
						'font-weight': 'bold'
					});
				}, function() {
					$(this).css({
						'font-weight': 'normal'
					});
				});

				// show pop-alert
				$title = 'Number Limit Exceeded';
				$msg = 'Please insert below or to ' + numRows + ' num!';
				$confirm = 'Okay';
				$cancel = 'Cancel';
				$icon = 3;

				popAlert_btnSingle();
				popAlert_show($title, $msg, $confirm, $cancel, $icon);
				}else{
					$('#popBtn_confirm').css({
					'background-color': 'white',
					'color': 'black',
					'font-weight': 'normal'
				});

				$('#popBtn_confirm').hover(function() {
					$(this).css({
						'font-weight': 'bold'
					});
				}, function() {
					$(this).css({
						'font-weight': 'normal'
					});
				});

				// show pop-alert
				$title = 'Insert a valid number';
				$msg = 'Please insert a number of records to delete!';
				$confirm = 'Okay';
				$cancel = 'Cancel';
				$icon = 3;

				popAlert_btnSingle();
				popAlert_show($title, $msg, $confirm, $cancel, $icon);
				}

			} else {
				//Here we check if the records entered is valid of not
				
				
				if ($newName == '' || $newName == undefined) {

					// style 'Confirm'
					$('#popBtn_confirm').css({
						'background-color': 'white',
						'color': 'black',
						'font-weight': 'normal'
					});

					$('#popBtn_confirm').hover(function() {
						$(this).css({
							'font-weight': 'bold'
						});
					}, function() {
						$(this).css({
							'font-weight': 'normal'
						});
					});

					// show pop-alert
					$title = 'Select Delete Option!';
					$msg = 'Please select "Delete Option" to delete';
					$confirm = 'Okay';
					$cancel = 'Cancel';
					$icon = 3;

					popAlert_btnSingle();
					popAlert_show($title, $msg, $confirm, $cancel, $icon);
				} else {
					$.ajax({
						type: 'GET',
						url: '<?php echo dir_root; ?>php/ajax/post_inboxDeleteRows.php?option=' + $newName + '&num=' + $newUrl,
						date: '',
						success: function(m) {
							
							
							setTimeout(() => {
								window.location.reload();
							}, 6000);
						}
					});
				}
			}

		}
		/* -----  Add-section (close)  ----- */
		function feedbackAdd_close() {
			$('#surveyAdd_row').addClass('ctm-hide');
			$('#btnAdd').removeClass('ctm-hide');
		}
	</script>
</body>

</html>