parent
8a75c0735c
commit
89c231b5ea
@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
include "save.php";
|
|
||||||
|
|
||||||
$name = $_POST['name'];
|
|
||||||
$email = $_POST['email'];
|
|
||||||
$lang = $_POST['lang'];
|
|
||||||
|
|
||||||
$foundjquery = "Not found";
|
|
||||||
if(in_array('jQuery',$lang)){
|
|
||||||
$foundjquery = "found";
|
|
||||||
}
|
|
||||||
// Converting the array to comma separated string
|
|
||||||
$lang = implode(",",$lang);
|
|
||||||
|
|
||||||
// check entry
|
|
||||||
$sql = "SELECT COUNT(*) AS cntuser from userinfo WHERE email='".$email."'";
|
|
||||||
$result = mysqli_query($con,$sql);
|
|
||||||
$row = mysqli_fetch_array($result);
|
|
||||||
$count = $row['cntuser'];
|
|
||||||
|
|
||||||
if($count > 0){
|
|
||||||
// update
|
|
||||||
$updatequery = "UPDATE userinfo SET name='".$name."',lang='".$lang."' WHERE email='".$email."'";
|
|
||||||
mysqli_query($con,$updatequery);
|
|
||||||
}else{
|
|
||||||
// insert
|
|
||||||
$insertquery = "INSERT INTO userinfo(name,email,lang) VALUES('".$name."','".$email."','".$lang."')";
|
|
||||||
mysqli_query($con,$insertquery);
|
|
||||||
}
|
|
||||||
$return_arr = array('name'=>$name,'email'=>$email,'lang'=>$lang,"foundjquery"=>$foundjquery);
|
|
||||||
|
|
||||||
echo json_encode($return_arr);
|
|
File diff suppressed because one or more lines are too long
@ -1,41 +0,0 @@
|
|||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
// submit button click
|
|
||||||
$("#submit").click(function(){
|
|
||||||
|
|
||||||
var name = $("#txt_name").val();
|
|
||||||
var email = $("#txt_email").val();
|
|
||||||
var lang = [];
|
|
||||||
|
|
||||||
// Initializing array with Checkbox checked values
|
|
||||||
$("input[name='prolang']:checked").each(function(){
|
|
||||||
lang.push(this.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(email != ''){
|
|
||||||
$.ajax({
|
|
||||||
url: 'getData.php',
|
|
||||||
type: 'post',
|
|
||||||
data: {name:name,email:email,lang:lang},
|
|
||||||
dataType: 'JSON',
|
|
||||||
success: function(response){
|
|
||||||
|
|
||||||
$('.details').show();
|
|
||||||
|
|
||||||
// selecting values from response Object
|
|
||||||
var name = response.name;
|
|
||||||
var email = response.email;
|
|
||||||
var lang = response.lang;
|
|
||||||
var foundjquery = response.foundjquery;
|
|
||||||
|
|
||||||
// setting values
|
|
||||||
$('#name').text(name);
|
|
||||||
$('#email').text(email);
|
|
||||||
$('#lang').text(lang);
|
|
||||||
$('#foundjquery').text(foundjquery);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@ -1,47 +0,0 @@
|
|||||||
.container{
|
|
||||||
width: 400px;
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content{
|
|
||||||
padding: 5px;
|
|
||||||
border: 2px solid gray;
|
|
||||||
border-radius: 3px;
|
|
||||||
margin-bottom:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.element{
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1{
|
|
||||||
background: lightgreen;
|
|
||||||
color: white;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: normal;
|
|
||||||
padding: 5px 10px;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Textbox */
|
|
||||||
input[type='text'],input[type='email']{
|
|
||||||
padding: 5px 10px;
|
|
||||||
width: 94%;
|
|
||||||
font-size: 15px;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Button */
|
|
||||||
input[type='button']{
|
|
||||||
background: orange;
|
|
||||||
color: white;
|
|
||||||
padding: 5px 10px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.details{
|
|
||||||
display: none;
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
CREATE TABLE `userinfo` (
|
|
||||||
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
||||||
`name` varchar(100) NOT NULL,
|
|
||||||
`email` varchar(100) NOT NULL,
|
|
||||||
`lang` varchar(100) NOT NULL,
|
|
||||||
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
@ -1,5 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
require "ConnexionBDD.php";
|
||||||
session_start();
|
session_start();
|
||||||
|
$db=new MyDB();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$cartes=$_POST['cartestables'];
|
$cartes=$_POST['cartestables'];
|
||||||
$_SESSION['cartestables']=$cartes;
|
$_SESSION['cartestables']=$cartes;
|
||||||
|
$idpartie = $_SESSION['idpartie'];
|
||||||
|
|
||||||
|
|
||||||
|
for ($i = 1; $i <= 16; $i++) {
|
||||||
|
|
||||||
|
$valcol1= $cartes[$i][0];
|
||||||
|
print_r($valcol1);
|
||||||
|
$valcol2= $cartes[$i][1];
|
||||||
|
print_r($valcol2);
|
||||||
|
$valcol3= $cartes[$i][2];
|
||||||
|
print_r($valcol3);
|
||||||
|
$update = $db->query('UPDATE partieCartes SET "colUn" = "'.$valcol1.'","colDeux"="'.$valcol2.'","colTrois"="'.$valcol3.'" where Id="'.$idpartie.'" ');
|
||||||
|
}
|
||||||
|
|
||||||
print_r($cartes);
|
print_r($cartes);
|
Binary file not shown.
Loading…
Reference in new issue