Click here to Skip to main content
15,392,078 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: I am really stumped on how to check if user exists and redirects. Pin
Richard Deeming15-Sep-16 7:27
mveRichard Deeming15-Sep-16 7:27 
GeneralRe: I am really stumped on how to check if user exists and redirects. Pin
samflex15-Sep-16 7:41
Membersamflex15-Sep-16 7:41 
GeneralRe: I am really stumped on how to check if user exists and redirects. Pin
Richard Deeming15-Sep-16 7:52
mveRichard Deeming15-Sep-16 7:52 
GeneralRe: I am really stumped on how to check if user exists and redirects. Pin
samflex15-Sep-16 9:10
Membersamflex15-Sep-16 9:10 
GeneralRe: I am really stumped on how to check if user exists and redirects. Pin
samflex15-Sep-16 10:30
Membersamflex15-Sep-16 10:30 
GeneralRe: I am really stumped on how to check if user exists and redirects. Pin
Richard Deeming15-Sep-16 10:50
mveRichard Deeming15-Sep-16 10:50 
GeneralRe: I am really stumped on how to check if user exists and redirects. Pin
samflex15-Sep-16 11:14
Membersamflex15-Sep-16 11:14 
QuestionButton working on second click and not first. Pin
Member 1189879629-Aug-16 4:51
MemberMember 1189879629-Aug-16 4:51 
I'm not sure what I'm doing wrong, but for some reason my page works fine only after hitting the submit button twice.

Below is the code. Any help or a point in the right direction would be greatly appreciated.

The removejob.php is a small page that just makes a connection and updates a single field based on the jobid.


HTML
<html>
	<head>
		<title>Phoenix Metals Job Interface</title>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
		<script type="text/javascript">

		function like(Job) 
	    {
	
	        $.ajax({
	            url: "RemoveJob.php",
	            type: "POST",
	            data: { 'JobID': Job },                   
	            success: function()
	                        {
									    window.location.reload();                          
	                        }
	        });
	    }
	    </script>
		<style>
			body 
			{
			    font-size: 200%;
			} 
			table 
			{
				width: 900px;			    
			   font-size:40px;  
			   font-weight: bold; 
			}
			td 
			{
    			text-align: center;
    			vertical-align: center;
    			border: 1px solid black;
    			padding: 10px;
			}
			.button 
			{
				 background-color: #ff3386;
			    color: white;
			    width: 175px;
			    height: 65px;
			    text-align: center;
			    vertical-align: middle;
			    font-size: 20px;
			    font-weight: bold; 
			}
		</style>
	</head>
	<body>

		<?php
		$con=mysqli_connect('localhost', 'xxxxxxx', 'xxxxxxx','xxxxxxx');

			if (mysqli_connect_errno())
			  {
			  echo "Failed to connect to MySQL: " . mysqli_connect_error();
			  }

		$JobResults = mysqli_query($con,"SELECT * FROM JobInterface WHERE Completed is null ORDER BY JobNumber"); 
			  	
		echo"<table>";
			echo"<tr>";
				echo"<tr><td colspan='3'>Phoenix Metals Job Interface</td></tr>";
				echo"<td>";
				echo"Job Number";
				echo"</td>";
				echo"<td>";
				echo"Project Name";
				echo"</td>";
				echo"<td>";
				echo"Account";
				echo"</td>";
				echo"<td>";
				echo"Edit";
				echo"</td>";
				echo"<td>";
				echo"Remove";
				echo"</td>";		
			echo"</tr>";	
			$JobRow = array();
			while($JobRow = mysqli_fetch_array($JobResults))		
				{
					$back = 'white';
					$message = 'Not Finished';
					if(($JobRow['Sheets'] != 1) && ($JobRow['Burned'] != 1) && ($JobRow['FormUp'] != 1) && ($JobRow['CoilLine'] != 1) && ($JobRow['Liner'] != 1) && ($JobRow['Vanes'] != 1) && ($JobRow['Assembled'] != 1) && ($JobRow['Wrapped'] != 1) && ($JobRow['HandFab'] != 1) && ($JobRow['Welded'] != 1) && ($JobRow['Supplies'] != 1) && ($JobRow['WardFrames'] != 1) && ($JobRow['Special'] != 1))
					{
						$back = 'aqua';
						$message = 'Possibly Done';
					}
					echo"<tr>";
						echo"<td>";
						echo $JobRow['JobNumber'];
						echo"</td>";
						echo"<td>";
						echo $JobRow['ProjectName'];
						echo"</td>";
						echo"<td>";
						echo $JobRow['AccountName'];
						echo"</td>";												
						if ($JobRow['RTS'] == 0)
							{
								echo"<td style='background-color:".$back.";'>";
								echo"<form style='margin-bottom:0; align:center;' name='EditJob' action='JobEdit.php' method='POST'><input type='hidden' name='JobID' value='".$JobRow['IDJob']."'/><input class='button' type='submit' name='submit-btn' value='Details'/></form>";
								echo"</td>";
								echo"<td>".$message."</td>";
							}
						if ($JobRow['RTS'] == 1)
							{
								echo"<td style='background-color:aqua;'>";
								echo"RTS";
								echo"</td>";
								echo"<td bgcolor='#FF0000'>";
								echo"<form style='margin-bottom:0; align:center;' name='ReloadJob' action='JobInterfaceMain.php' method='POST'>";	
								echo"<input class='button' type='submit' name='submit-btn' onclick='like(".$JobRow['IDJob'].")' value='Gone'/>";
								echo"</form>";
								echo"</td>";
							}	

					echo"</tr>";				
				}
		echo"</table>";
		?>
	</body>
</html>

AnswerRe: Button working on second click and not first. Pin
Planet Thomas4-Jul-17 1:22
MemberPlanet Thomas4-Jul-17 1:22 
QuestionPassing Values to the next Page in PHP Pin
Androoidhotspot Hotspot19-Aug-16 2:28
MemberAndrooidhotspot Hotspot19-Aug-16 2:28 
AnswerRe: Passing Values to the next Page in PHP Pin
ZurdoDev19-Aug-16 3:26
professionalZurdoDev19-Aug-16 3:26 
QuestionBasic Join Not Working Pin
Django_Untaken19-Aug-16 0:43
MemberDjango_Untaken19-Aug-16 0:43 
SuggestionRe: Basic Join Not Working Pin
Richard MacCutchan19-Aug-16 2:00
mveRichard MacCutchan19-Aug-16 2:00 
GeneralRe: Basic Join Not Working Pin
Django_Untaken19-Aug-16 2:17
MemberDjango_Untaken19-Aug-16 2:17 
GeneralRe: Basic Join Not Working Pin
Richard MacCutchan19-Aug-16 3:14
mveRichard MacCutchan19-Aug-16 3:14 
GeneralRe: Basic Join Not Working Pin
johnjonny10-Oct-16 8:18
Memberjohnjonny10-Oct-16 8:18 
Questionassignment Pin
Eto'o3-Aug-16 12:15
MemberEto'o3-Aug-16 12:15 
AnswerRe: assignment Pin
Richard MacCutchan3-Aug-16 22:02
mveRichard MacCutchan3-Aug-16 22:02 
QuestionGoogle Translate facility Pin
Member 1264382519-Jul-16 18:51
MemberMember 1264382519-Jul-16 18:51 
AnswerRe: Google Translate facility Pin
Richard MacCutchan19-Jul-16 22:39
mveRichard MacCutchan19-Jul-16 22:39 
QuestionFor Linux Admin Fresher Pin
Abijith Ajayan12-Jul-16 18:05
MemberAbijith Ajayan12-Jul-16 18:05 
AnswerRe: For Linux Admin Fresher Pin
Richard MacCutchan12-Jul-16 21:28
mveRichard MacCutchan12-Jul-16 21:28 
Questionpaypal account Pin
Kannan Kalai28-Apr-16 21:21
MemberKannan Kalai28-Apr-16 21:21 
AnswerRe: paypal account Pin
Eddy Vluggen26-May-16 23:47
professionalEddy Vluggen26-May-16 23:47 
QuestionCan anyone recommend me a good php 7 hosting provider? Pin
masterarts11-Mar-16 2:11
Membermasterarts11-Mar-16 2:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.