Exceedinglife's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
64 (0.07 per day)
Joined:
01-July 12
Profile Views:
871
Last Active:
User is offline Nov 19 2014 07:50 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Subaru
Dream Kudos:
0
Icon   Exceedinglife has not set their status

Posts I've Made

  1. In Topic: Validation / Time limit before certaintimeorder / online ordering site

    Posted 18 Nov 2014

    View PostArtificialSoldier, on 18 November 2014 - 10:18 AM, said:

    Do you have specific questions about things you're stuck on? About the dates, don't use Javascript to compare dates, use the server. Send the date selected to the server and send a response back whether or not the date is valid. If you use Javascript to compare dates then you comparing with the date/time and timezone settings on the user's computer. You should be checking against the server time instead.



    This project is going all client side so there will be no PHP involved. I suggested the same to my client saying about 10 A.M. ordering online is absurd but she agreed and continued with her choice..

    Here is some things i have tried for that so far. right now i have the current time Am or Pm and i have to set a default time of 10 am and compare them possibly with an if statement? right now when i try to set the time to 10 am it is in milliseconds with some HUGE number..

    function determineCutoffTime() {
    	    console.log("cut off time function");
    	    var msg = "To recieve an order the current day it must be played before 10 a.m. of that day.";
    	    //var timeNow = new Date($.now());
    	    //var dd = new Date.now();
    	   // console.log(dd);
    	    //get current time and date if before time accept otherwise show message and allow cancel
    
    	    //  jquery take 2
    	   // var jqueryTime = $.datepicker.formatDate('mm/dd/yy HH:mm:dd');
    	    // console.log(jqueryTime);
    	   // var jtime = new Date().getTime();
    	    //console.log(jtime);
    
    	    //alert($.datepicker.formatDate('yy/mm/dd', new Date()));
    	   // console.log("date now");
    	    //console.log($.now());
    	    //var myTime = $.now();
    	   // console.log(myTime);
    	    //console.log("dateNow()");
    	    //console.log(dateNow());
    	    //another try this time i will set date/time to 10 am
    	   // var buyingTime = new date();
    	   // buyingTime.setHours(10, 0, 0);
    	   // console.log(buyingTime);
    	   // console.log(new Date.today().toString());
    
    	    console.log('javascript');
    	    //javascript way
    	    var jsDate = new Date();
    	    var seconds = jsDate.getSeconds();
    	    var minutes = jsDate.getMinutes();
    	    var hours = jsDate.getHours();
    	    var day = jsDate.getDate();
    	    var month = jsDate.getMonth() + 1;
    	    var year = jsDate.getYear();
    	    //var jsTime = jsDate.getHours() + ":" + jsDate.getMinutes() + ":" + jsDate.getSeconds();//getMonth() getDate()   getFullYear()
    	    //var jsTime = hours:minutes:seconds month/day/year;
    	   // console.log(hours+":"+minutes+":"+seconds+" "+ month+"/"+day+"/"+year);
    
    	    //Get current Date and Time
    	    var today = new Date();
    	    var dd = today.getDate(); var mm = today.getMonth() + 1; var yyyy = today.getFullYear();
    	    var hh = today.getHours(); var min = today.getMinutes(); var sec = today.getSeconds();
    	    if (dd < 10) {
    	        dd = '0' + dd;
    	    }
    	    if (mm < 10) {
    	        mm = '0' + mm;
    	    }
    	    if (min < 10) {
    	        min = '0' + min;
    	    }
    	    today = hh + ":" + min + ":" + sec + " " + mm + "/" + dd + "/" + yyyy;
    	    console.log(today);
    
    	    /////////////////////////////////////////////
    	    var now = new Date();
            var nowhrs = now.getHours(); var nowmins = now.getMinutes(); var nowsecs = now.getSeconds();
            var determine = (nowhrs >= 12) ? " P.M." : " A.M.";
    
    	    if (nowhrs == 0) nowhrs = 12;	    
    	    var timeValue = "" + ((nowhrs > 12) ? nowhrs - 12 : nowhrs);
    	    timeValue += ((nowmins < 10) ? ":0"+nowmins : ":" + nowmins);
    	    timeValue += ((nowsecs < 10) ? ":0"+nowsecs : ":" + nowsecs);
    	    //timeValue += (nowhrs >= 12) ? " P.M." : " A.M.";
    	    timeValue += determine;
    	    console.log(timeValue);
    	    /////////////////////////////////
    	    //cutoff time
    	    var cutoffTime = new Date();
    	    var cutoffDay = cutoffTime.getDate();
    	    var cutoffMonth = cutoffTime.getMonth() + 1;
    	    var cutoffYear = cutoffTime.getFullYear();
    	    var cutoffHours = cutoffTime.setHours(10); var cutoffMins = cutoffTime.setMinutes(00); var cutoffSecs = cutoffTime.setSeconds(00); var cutoffDetermine = " A.M.";
    	    var cutoffTimeValue = cutoffHours + ":" + cutoffMins + ":" + cutoffSecs + cutoffDetermine;
    	    console.log(cutoffTimeValue);
    	}
    
    


    Also for validation to possibly stop the button from being clicked if there is no filling on the sub sandwich so you cant order a sub with just bread?
    I made a validation method and i wanted to return something like onClientClick but i believe that may not be javascript and only asp.net along with the onclick method of making the sub sandwich i want the validation to delay the onclick but still researching how to do that...
  2. In Topic: sharepoint radio button value

    Posted 29 Oct 2014

    heres the answer to my question

    string radioButtonSideSelection = myNavigator.SelectSingleNode("//my:FruitOrVeggieGroup", NamespaceManager).ToString();
    
  3. In Topic: sharepoint radio button value

    Posted 29 Oct 2014

    View PostSkydiver, on 29 October 2014 - 05:29 AM, said:

    Why are you trying to get the selected items by parsing the XML instead of just using either the SharePoint Object Model or the Client Side Object Model?


    I am not sure how to do ether..
    i am completely new with share point and need to build a online ordering system for example like subway / dominos / pizza hut / etc so you can order food online.

    if you have a little bit of time maybe you could explain to me anything that you think would help me?

    my next step is probably to build a object with all the selected values i have and then send it to a new page so i can make a receipt
    eventually i will be doing security working about credit card processing and etc so the site will be hosted live online
  4. In Topic: Display data from 2 tables from phpmyadmin in 1 table in html

    Posted 21 Oct 2014

    table2 is my query to pull the numbers out of the table so i would say result of query?
    my $result variable is calling my 1st query which is all the info in my first table that works fine with no issues
    the problem is getting the data from the second table in the correct spots of my html table.
    i believe $result->close() is ending my html table because there is no further data to read
    im not sure maybe i dont need it because i close my connection later on

      			<?php
    			  	$sql = "SELECT userID, firstName, lastName, email, address FROM users";	//, phone
    			  	$table2 = "SELECT homePhone, cellPhone FROM usersphone";
    				$phoneResults = mysqli_query($mysqli, $table2);		//=$mysqli->query($table2);
    				
    			    if ($result = $mysqli->query($sql)) 
    			    {
    			      if ($result->num_rows > 0) 
    			      {
    			        echo "<table>\n";
    			        echo "  <tr class=\"heading\">\n";
    			        echo "    <td>ID</td>\n";
    			        echo "    <td>firstname</td>\n";
    			        echo "    <td>lastname</td>\n";
    					echo "    <td>email</td>\n";
    					echo "    <td>address</td>\n";
    					echo "    <td>Home phone</td>\n";
    					echo "    <td>Cell phone</td>\n";
    			        echo "  </tr>\n";
    			        // loop through each of the results to build the table rows
    			        // the fetch_object() method returns the columns as a property on the object
    			        // which can be accessed using "->" (method annotation)
    			        while($row = $result->fetch_object()) 
    			        {
    			          echo "  <tr>\n";
    			          echo "    <td><a href='javascript:nameall()'>" . $row->userID . "</a></td>\n";
    			          echo "    <td>" . $row->firstName . "</td>\n";
    			          echo "    <td>" . $row->lastName . "</td>\n";
    					  echo "    <td>" . $row->email . "</td>\n";
    					  echo "    <td>" . $row->address . "</td>\n";
    					  //table 2 display phone numbers
    					  echo "    <td>";  
    					  	while ($row = mysqli_fetch_array($table2)) {
    					  //		$phone1 = $row['homePhone'];
    						//  echo "$phone1 ";	//		$row->homePhone
    					  	}
    						echo "</td>";
    					  //$row->phone . "</td>\n";
    					  
    			          echo "  </tr>\n";
    			        }
    			        echo "</table>";
    			        // close the result set
    			        $result->close();
    			      } 
    			      else 
    			      {
    			        echo "No employees in database.";
    			      }
    			    } 
    			    else 
    			    {
    			      echo "ERROR: Could not execute query: $sql. " . $mysqli->error;
    			    }			      
    			    // close connection
    			    $mysqli->close();
    			?>
    


    After i figure out how to read the data then i am working on my login which looks like this maybe you can help me with that as well after i figure this out

    $username = $mysqli->escape_string($username);
    				    
    					 $sql = "SELECT COUNT(*) FROM users WHERE email = '$username'";//username
    				      if ($result = $mysqli->query($sql)) 
    				      {
    				        $row = $result->fetch_array();
    				        // if yes, fetch the encrypted password
    				        if ($row[0] == 1) 
    				        {
    				          $sql = "SELECT password FROM users WHERE email = '$username'"; //username
    						         
    				          if ($result = $mysqli->query($sql)) 
    				          {
    				            $row = $result->fetch_object();    
    				
    				            $hash = $row->password;
    							
    							
    							if (crypt($password, $hash) == $hash) 
    				            {              
    				              echo 'Your login credentials were successfully verified.'; 
    							  
    							  session_start();
    							  $_SESSION['username'] = $username;
    							  
    							  $queryLogin = "SELECT * FROM users WHERE email = '{$_SESSION["username"]}' ";
    							  $myResult = $mysqli->query($queryLogin);
    							  $myRow = $myResult->fetch_array();
    							  
    							  $fname = $row["firstName"];
    							  
    							  
    							  echo "<input type=\"text\" name=\"xyz\" value='<?php echo $fname; ?>' >";
    							   
    				            /*
    							//<input type="text" name="xyz" value=<?php echo $val; 
    							//echo "<input type=\"text\" name=\"xyz\" value='$val'>";
    							 *<input type="text" name="text1" value="<?php echo $row["usr_password"]; ?>">
    							 * 
    							 * 
    							 * 
    							 * 		$id = $_GET['id'];
     								 	$sql="select * from Doctor where DocID='$id'";
    									$result=mysql_query($sql);
    									$row=mysql_fetch_array($result);
    							 * 
    							 *   <input type = "text" name = "DocName" value = "<? echo $row['DocName']; ?>" >
    							 * */
    							 // UPDATE tablename SET columnName $variable etc... WHERE id = $id;
    							
    							
    							/*
    							 * $Name=$_POST['unames'];
    								$data=mysql_query("SELECT * FROM tbl_sample where Name='$Name'");
    
    								$info=mysql_fetch_array($data);
    								while($info=mysql_fetch_array($data)){}
    							 */
    							} 
    				            else 
    				            {
    				              echo 'You entered an incorrect password.';            
    				            }
    				          } 
    $mysqli->close();
    
    
  5. In Topic: Display data phpmyadmin in txtbox and have a profile picture

    Posted 15 Oct 2014

    <header>
    		<h1>Please enter user information.</h1>
    	</header>
    		<!-- PHP Code / Entering into Database, and more -->
    		<?php
    			$server = getenv('OPENSHIFT_MYSQL_DB_HOST');
    			$user = getenv('OPENSHIFT_MYSQL_DB_USERNAME');		
    			$password = getenv('OPENSHIFT_MYSQL_DB_PASSWORD');
    			$database = 'lab03LoginUsers';
    			
    			$mysqli = new mysqli($server, $user, $password, $database);
    			
    			if ($mysqli === false) 
    		    {
    		      die("ERROR: Could not connect to database. " . mysqli_connect_error());
    		    }
    			//When submit button is clicked ->
    			if(isset($_POST['submit']))
    			{
    				$inputError = false;
    				//put firstname field in a variable.
    				if (empty($_POST['firstName'])) 
    	      		{
    		        	echo 'ERROR: Please enter a valid firstname';
    	    	    	$inputError = true;        
    	    		} 
    	    		else 
    	      		{	//properly escape the field
    	      			$fName = $mysqli->escape_string($_POST['firstName']);
    	    		}
    if($inputError != true)
    				{
    					//insert query
    					$sqlInsertQuery = "INSERT INTO Users (address, email, firstName, lastName, password)
    					VALUES ($address', '$email', '$fName', '$lName', '$salt', )";
    					
    					if ($mysqli->query($sqlInsertQuery) === TRUE)
    					{
    						echo 'New employee record added with ID: '  . $mysqli->insert_id;  
    					}
    <div>
    			<form method="post" id="registerForm">
    				<fieldset>
    					<legend>Information</legend>
    					<div class="registerDiv">
    						<label for="firstName">First name:</label>
    						<input type="text" name="firstName" id="firstName" placeholder="Enter your name" />
    						<br><br>
    					</div>
    				</fieldset>
    			</form>
    		</div>
    
    <?php
      				if(!isset($_POST['btnSubmit']))
    				{
    			?>	
    					<form method="post" action="index.php">
    						<label for="username">Username:</label>
    						<input type="text" name="username" />
    						<br>
    						<label for="password">Password:</label>
    						<input type="text" name="password" />
    						<br>
    						<input type="submit" name="btnSubmit" value="Log In!" />
    					</form>
    			<?php
    			//the form is submitted check everything to login successfully
    				}
    				else 
    				{
    					 $username = $_POST['username'];
          $password = $_POST['password'];
    				}
     $sql = "SELECT COUNT(*) FROM users WHERE username = '$username'";
          if ($result = $mysqli->query($sql)) 
          {
            $row = $result->fetch_array();
            // if yes, fetch the encrypted password
            if ($row[0] == 1) 
            {
              $sql = "SELECT password FROM users WHERE username = '$username'";        
              if ($result = $mysqli->query($sql)) 
              {
                $row = $result->fetch_object();    
    
                $hash = $row->password;
                // take a look at what the hashed password value looks like:
                // echo $hash;
    
                // verify that the hash matches the plain password
                if (crypt($password, $hash) == $hash) 
                {              
                  echo 'Your login credentials were successfully verified.';  
                } 
    			?>
    
    

My Information

Member Title:
D.I.C Head
Age:
23 years old
Birthday:
January 24, 1991
Gender:
Location:
Wisconsin
Full Name:
Andrew
Years Programming:
1
Programming Languages:
Java
HTML
CSS
JavaScript
Little bit of PHP
C# currently learning

Contact Information

E-mail:
Click here to e-mail me

Friends

Exceedinglife hasn't added any friends yet.

Comments

Exceedinglife has no profile comments yet. Why not say hello?