data not get in select section more times - php

when i click update button without any change in editing form..the fields of product category and product brand become empty... and in database the record at that place also become empty.please help me what i should do for this problem.
<?php
include("include/db.php");
if(isset($_GET['edit_pro'])){
$get_id=$_GET['edit_pro'];
$get_pro="select * from products where product_id='$get_id'";
$run_pro=mysqli_query($db, $get_pro);
$row_pro=mysqli_fetch_array($run_pro);
$pro_id=$row_pro['product_id'];
$pro_title=$row_pro['product_title'];
$pro_image1=$row_pro['product_img1'];
$pro_image2=$row_pro['product_img2'];
$pro_image3=$row_pro['product_img3'];
$pro_price=$row_pro['product_price'];
$pro_desc=$row_pro['product_desc'];
$pro_keywords=$row_pro['product_keywords'];
$pro_cat=$row_pro['cat_id'];
$pro_brand=$row_pro['brand_id'];
$get_cat="select * from categories where cat_id='$pro_cat'";
$run_cat=mysqli_query($db,$get_cat);
$row_cat=mysqli_fetch_array($run_cat);
$cat_title=$row_cat['cat_title'];
$get_brand="select * from brands where brand_id='$pro_brand'";
$run_brand=mysqli_query($db,$get_brand);
$row_brand=mysqli_fetch_array($run_brand);
$brand_title=$row_brand['brand_title'];
}
?>
<!DOCTYPE>
<html>
<head><title>update product</title>
<!--text editor taken from tinymce.com-->
<!--<script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<script>tinymce.init({ selector:'textarea' });</script>-->
<link rel="stylesheet" href="styles/stylesheet.css" media="all">
</head>
<body>
<form method="post" action="" enctype="multipart/form-data" align="center">
<center><table width="700" align="center">
<tr align="center" style="background-color:transparent;">
<td colspan="2"><h2>edit product</h2></td>
</tr>
<tr class="button_row">
<td align="right"><b>product title</b></td>
<td><input type="text" name="product_title" value="<?php echo $pro_title; ?>" size="40" placeholder="enter title" style="background-color:transparent; color:gray; border:1px solid black;"></td>
</tr>
<tr>
<td align="right"><b>product category</b></td>
<td>
<select name="product_cat" style="background-color:transparent; color:gray; border:1px solid black; opacity:0.6;">
<option value=""><?php echo $cat_title; ?></option>
<?php
$get_cats="select * from categories";
$run_cats=mysqli_query($db,$get_cats);
while($row_cats=mysqli_fetch_array($run_cats)){
$cat_id=$row_cats['cat_id'];
$cat_title=$row_cats['cat_title'];
echo "<option value='$cat_id'>$cat_title</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td align="right"><b>product brand</b></td>
<td>
<select name="product_brand" style="background-color:transparent; color:gray; border:1px solid black; opacity:0.6;">
<option value=""><?php echo $brand_title; ?></option>
<?php
$get_brands="select * from brands";
$run_brands=mysqli_query($db,$get_brands);
while($row_brands=mysqli_fetch_array($run_brands)){
$brand_id=$row_brands['brand_id'];
$brand_title=$row_brands['brand_title'];
echo "<option value='$brand_id'>$brand_title</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td align="right"><b>product image 1</b></td>
<td><input type="file" name="product_img1" style="background-color:transparent; color:gray; opacity:0.7;"><img src="product_images/<?php echo $pro_image1; ?>" width="60" height="40"></td>
</tr>
<tr>
<td align="right"><b>product image 2</b></td>
<td><input type="file" name="product_img2" style="background-color:transparent; color:gray; opacity:0.7;"><img src="product_images/<?php echo $pro_image2; ?>" width="60" height="40"></td>
</tr>
<tr>
<td align="right"><b>product image 3</b></td>
<td><input type="file" name="product_img3" style="background-color:transparent; color:gray; opacity:0.7;"><img src="product_images/<?php echo $pro_image3; ?>" width="60" height="40"></td>
</tr>
<tr>
<td align="right"><b>product price</b></td>
<td><input type="text" name="product_price" value="<?php echo $pro_price; ?>" placeholder="enter price" style="background-color:transparent; color:gray; border:1px solid black;"></td>
</tr>
<tr>
<td align="right"><b>product description</b></td>
<td><textarea name="product_desc" cols="30" rows="1" placeholder="enter description" style="background-color:transparent; color:gray; border:1px solid black; outline: none;"><?php echo $pro_desc; ?></textarea></td>
</tr>
<tr>
<td align="right"><b>product keywords</b></td>
<td><input type="text" name="product_keywords" size="40" value="<?php echo $pro_keywords; ?>" placeholder="enter keywords" style="background-color:transparent; color:gray; border:1px solid black;"></td>
</tr>
<tr align="center" class="button_row">
<td colspan="2"><input type="submit" name="update" value="update product" style="background-color:transparent; width:120px; height:25px; font-size:15px; color:black; padding-bottom:10px; border:2px solid gray; text-align:center;"></td>
</tr>
</table></center>
</form>
</body>
</html>
<?php
if(isset($_POST['update'])){
$update_id=$pro_id;
$product_title=$_POST['product_title'];
$product_cat=$_POST['product_cat'];
$product_brand=$_POST['product_brand'];
$product_price=$_POST['product_price'];
$product_desc=$_POST['product_desc'];
$status='on';
$product_keywords=$_POST['product_keywords'];
//image names
$product_img1 = $_FILES['product_img1']['name'];
$product_img2 = $_FILES['product_img2']['name'];
$product_img3 = $_FILES['product_img3']['name'];
//image temo names
$temp_name1 = $_FILES['product_img1']['tmp_name'];
$temp_name2 = $_FILES['product_img2']['tmp_name'];
$temp_name3 = $_FILES['product_img3']['tmp_name'];
move_uploaded_file($temp_name1,"product_images/$product_img1");
move_uploaded_file($temp_name2,"product_images/$product_img2");
move_uploaded_file($temp_name3,"product_images/$product_img3");
if(!empty($_FILES['product_img1']['name']) AND
!empty($_FILES['product_img2']['name']) AND
!empty($_FILES['product_img3']['name']))
{
$update_product="update products set cat_id='$product_cat',
brand_id='$product_brand',
product_title='$product_title',
product_price='$product_price',
product_img1='$product_img1',
product_img2='$product_img2',
product_img3='$product_img3',
product_desc='$product_desc',
product_keywords='$product_keywords'
where product_id='$update_id'";
} else {
$update_product="update products set cat_id='$product_cat',
brand_id='$product_brand',
product_title='$product_title',
product_price='$product_price',
product_desc='$product_desc',
product_keywords='$product_keywords'
where product_id='$update_id'";
}
$run_update=mysqli_query($db, $update_product);
if($run_update){
echo "<script>alert('product has been updated')</script>";
echo "<script>window.open('index.php?view_products','_self') </script>";
}
}
?>

Related

Is it possible to use media queries with a php file?

I am trying to make my site responsive and my media query was working but now it isn't. I made some changes and didn't use version control because I'm an idiot. Now I've taken out all the changes and the old media query isn't working, can anyone see why? I've included my css and the html I'm applying it to.
.contact_form {
margin: auto auto auto 27%;
}
.slides p {
margin: 2%;
text-align: center;
}
.slides h2 {
text-align: center;
font-size: 1.5em;
}
.required {
color: red;
}
.privacy p {
width: 60%;
text-align: center;
margin: auto;
}
#media screen and (max-width: 500px) {
.slides h2 {
text-align: center;
font-size: 1em;
margin: 10% auto auto auto;
}
.slides h1 {
text-align: center;
font-size: 2em;
margin: auto;
}
.contact_form {
margin: 2%;
}
.privacy p {
width: 90%;
text-align: center;
margin: auto;
}
.tablet_content {
display: none;
}
}
Html
<body>
<div class="banner">
<header>
<div id="ytWidget"></div>
<script src="https://translate.yandex.net/website-widget/v1/widget.js?widgetId=ytWidget&pageLang=en&widgetTheme=dark&autoMode=true" type="text/javascript"></script>
<br clear = "all">
<a href="index.html">
<h1>Laura Pohl Web Solutions</h1>
<h2>User Based Web Design</h2>
</a>
</header>
</div>
<div class="topnav" id="myTopnav">
Home
<div class="dropdown">
<button class="dropbtn">About</button>
<div class="dropdown-content">
My Story
Mascots
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Portfolio</button>
<div class="dropdown-content">
Custom Web Design
Wordpress
<!--Wix
Squarespace-->
</div>
</div>
FAQ
Contact
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
<i class="fa fa-bars"></i>
</a>
</div>
<main class="site-content">
<div class="gradient">
<br>
<div class="slide">
<div class="main">
<div class="slides">
<h1>Contact Questionnaire</h1>
<h2>If you’d like to work with me, I can’t wait to get started! Your first step is to fill out the custom form below.</h2>
<br>
<br>
</div>
</div>
<div class = "contact_form">
<form name="form4" action="Contact Us.php" method="post">
<input type = "hidden" name ="recipient" value ="1">
<input type = "hidden" name ="subject" value ="Contact Survey">
<input type = "hidden" name ="print_blank_fields" value ="1">
<input type="hidden" name="_pid" value="154040">
<input type="hidden" name="_fid" value="A7QPIZEA">
<table class ="contact_table">
<tbody>
<!--Row 1-->
<tr>
<td class = "questions">Name:<span class="required">*</span></td>
<td colspan = "6"><input name="sender" id="name" type="text" maxlength="30" class ="input_text_box required" title="Please type your name." required></td>
</tr>
<!--Row 2-->
<tr>
<td class = "questions">Email:</td>
<td colspan = "6"><input name="senderEmail" type="text" maxlength="30" class ="input_text_box"></td>
</tr>
<!--Row 3-->
<tr>
<td class = "questions">Phone:</td>
<td colspan = "6"><input name="senderPhone" type="text" id="textfield2" maxlength="30"class ="input_text_box"></td>
</tr>
<!--Row 4-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 5-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 6-->
<tr>
<td class = "questions" rowspan="2">Preferred Method of Contact?</td>
<td><input type="radio" name="preferredContact" value="phone" id="PreferredContact_0"></td>
<td colspan = "2" width = "30%">Phone</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<!--Row 7-->
<tr>
<td><input type="radio" name="preferredContact" value="email" id="PreferredContact_2"></td>
<td colspan = "2">Email</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<!--Row 8-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 9-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 10-->
<tr>
<td class = "questions" rowspan="2">Would you like a response?<span class="required">*</span></td>
<td><input type="radio" name="Response" value="Yes" id="PreferredContact_2"></td>
<td colspan = "2">Yes</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<!--Row 11-->
<tr>
<td><input type="radio" name="Response" value="No" id="PreferredContact_3"></td>
<td>No</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<!--Row 12-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 13-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 14-->
<tr>
<td class = "questions" rowspan="7">What would you like to talk about?<span class="required">*</span></td>
<td><input type="radio" name="topic" value="web_design"></td>
<td colspan = "5">Website Design</td>
</tr>
<!--Row 15-->
<tr>
<td><input type="radio" name="topic" value="re_design"></td>
<td colspan="5">Website Re-Design</td>
</tr>
<!--Row 16-->
<tr>
<td><input type="radio" name="topic" value="consultation"></td>
<td colspan="6">Schedule a Consultation</td>
</tr>
<!--Row 17-->
<tr>
<td><input type="radio" name="topic" value="quote"></td>
<td colspan="6">Request a Quote</td>
</tr>
<!--Row 18-->
<tr>
<td><input type="radio" name="topic" value="suggestions"></td>
<td colspan="6">Suggestions</td>
</tr>
<!--Row 19-->
<tr>
<td><input type="radio" name="topic" value="problems"></td>
<td colspan="6">Site Problems</td>
</tr>
<!--Row 20-->
<tr>
<td><input type="radio" name="topic" value="something_else"></td>
<td colspan="6">Something Else</td>
</tr>
<!--Row 21-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 22-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 23-->
<tr>
<td class = "questions" style="vertical-align:middle;">Message Text: </td>
<td colspan = "6" style="text-align: left">
<textarea rows = "5" name="message" maxlength="800" id="Comments" class ="input_text_box" required></textarea>
</td>
</tr>
<!--Row 24-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 25-->
<tr>
<td colspan = "7"> </td>
</tr>
<!--Row 26-->
<tr>
<td><input name="submit" type="submit" id="submit" title="Submit" value="Submit" style = "float:left"></td>
<td colspan = "5"> </td>
<td><input type="reset" name="reset" id="reset" value="Reset" style = "float:right"></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
<br clear = "all">
<br>
<div class="privacy">
<hr style="width: 20%;">
<p>I take your privacy seriously. I will never share any of your
information with anyone outside legal requirements. You will never be spammed or marketed
to by any of my partners.</p>
<hr style="width: 20%;">
</div>
</main>
<div class="big_screen_content">
<footer>
<!--start footer-->
© November 30, 2020 · Laura Pohl · Billerica, MA <!--Copyright signature-->
</footer>
<!--end footer-->
</div>

1 form - two different lists

Ok so i have this is form
it works fine when i click submit but now I would it like do something else.
when the form is submitted i would like for the email and name fields to be added to my
getresponse list in addition to where it is going right now.
So essentially when the form is submitted i want the user to opt-in into two different lists. I know i may have to user the get response api key to add contacts. I do not own the cgi code so i cannot do it that away. Also i am not a programmer so I am not sure what the best way to go around doing this.
So thank you guys in advance for helping me find a solution for this
<form action="/cgi-bin/join.cgi" method="POST" name="info" id='info' onsubmit="return checkForm2();">
<input type=hidden name=page value=1>
<table cellpadding="3" cellspacing="0" width="570" align="center" border="0">
<tr>
<td width="500" align="center" valign="middle">
<table border=1 width="80%" cellpadding=0 cellspacing=0 style="bordercolor:#000000" align="center">
<tr bgcolor="#eaeaea">
<td>
<table border=0 cellpadding=0 cellspacing=0 align="center">
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td><b>First name</b></td><td width=10> </td><td><input type=text name=firstname value="" size=15 maxlength=20 id='firstname'>
</td>
</tr>
<tr>
<td><b>Last name</b></td><td width=10> </td><td><input type=text name=lastname value="" size=25 maxlength=30 id='lastname'></td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td><b>Email address</b></td><td width=10> </td><td><input type=text name=email value="" size=25 maxlength=100 id='email'></td>
</tr>
<tr>
<td><b>Re-type Email</b></td><td width=10> </td><td><input type=text name=email2 value="" size=25 maxlength=100 id='email2'></td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td><b>Select a password</b></td><td width=10> </td><td><input type=password name=password size=20 maxlength=20 id='password'></td>
</tr>
<tr>
<td><b>Re-type password</b></td><td width=10> </td><td><input type=password name=password2 size=20 maxlength=20 id='password2'></td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td colspan=3 align=center>
<input type="submit" name="send" value="Create Account and Continue ..." onClick="leaving=false" tabindex="6" style="background-color:#26701b; color:#ffffff; font-family:Verdana,Arial; font-weight: bold; font-size: 14px; border-left: 1 solid #a0a0a0; border-top: 1 solid #a0a0a0; border-right: 1 solid #000000; border-bottom: 1 solid #000000; padding: 2 2 2 2; outline: #a0a0a0 solid 2px; width:335px">
</td>
</tr>
<tr>
<td colspan=3 align=center>
<img src="/images/transdot.gif" height=8 width=1 alt=""><br>
<img src="/images/secure.gif" height=12 width=12 alt="">
<font class=fine>Email Security Guarantee & Privacy Policy</font><br><br>
</td>
</tr>
<tr>
<td colspan=3> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

How to print the array format data of a table using for loop in php?

***Here Is My Code****
<form name="f1" method="post" action="middle1.php">
*Here It Is Getting The Row Data From DB into array format and i placed dat data into variable data1***
<?
$user=$_SESSION['user'];
$data1= array();
$data1= $obj->pcode($user);
$dat= count($data1);
// echo $dat;
?>
***Here Using The data1 variable am trying to print the all rows present in the DB*
<?if($data1!=''){
for($i=0;$i<=$dat;$i++){
?>
<tr> <td width="52" height="28" align="center"bgcolor="#E1E1E1" class="cal_txt_black">
*Here is the problem how can i mention that it hav to print the first row then so...on in the php echo statement**
<input name="pcode" type="" value="<? echo $data1['projectcode']; ?>" size="1" border="0" style="background-color:D8D8D8"></td>
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black" style="border-right:1px solid #D8D8D8;"><input name="mon" type="text" value="<? echo $data1['mon']; ?>" size="1" border="0" style="background-color:White"></td>
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black"><input name="tue" type="text" value="<? echo $data1['tue']; ?>" size="1" border="0" style="background-color:White"></td>
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black"><input name="wed" type="text" value="<? echo $data1['wed']; ?>" size="1" border="0" style="background-color:White"></td>
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black" ><input name="thu" type="text" value="<? echo $data1['thu']; ?>" size="1" border="0" style="background-color:White"></td>
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black"><input name="fri" type="text" value="<? echo $data1['fri']; ?>" size="1" border="0" style="background-color:White"></td>
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black"><input name="sat" type="text" value="<? echo $data1['sat']; ?>" size="1" border="0" style="background-color:White">
<td width="52" height="28" align="center" bgcolor="#ffffff" class="cal_txt_black" style="border-right:1px solid #D8D8D8;"><input name="sun" type="text" value="<? echo $data1['sun']; ?>" size="1" border="0" style="background-color:White"></td>
<td width="52" height="28" align="center" bgcolor="#D8D8D8" class="cal_txt_black" style="border-right:1px solid #ffffff;" ></td>
<td width="52" height="28" align="center" bgcolor="#D8D8D8" class="cal_txt_black" style="border-right:1px solid #ffffff;"></td>
<td width="52" height="28" align="center" bgcolor="#D8D8D8" class="cal_txt_black" style="border-right:1px solid #ffffff;"></td>
<td><input name="save1" class="btn_login" type="submit" value="Save" align="center" formaction="middle2.php"></td>
</tr>
</form>
<? }
}?>
Simple use the $i variable in th loop
for($i=0;$i<=$dat;$i++){
?>
<input name="pcode" type="" value="<?php echo $data1[$i]['projectcode']; ?>" size="1" border="0" style="background-color:D8D8D8"></td>
<?php } ?>

Sum of numbers from dynamic inner text using jquery

I would like to get the total sum of values having class addition1:::
HTML CODE is
<tr >
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Inr</td>
<td align="right" class="heading"><?php if($inr!='')echo co($inr);else echo "0.00";?> </td>
<td> </td>
<td class="heading">ROE</td>
<td class="heading" ><span class="addition1"><?php if($inr!='')echo co($inr);else echo "0.00";?> </span> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Usd</td>
<td align="right" class="heading"><?php if($usd!='')echo co($usd);else echo "0.00";?> </td>
<td> </td>
<td><input name="roe1" id="roe11" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading1" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<span class="addition1">
<?php if($usd!='')echo co($usd);else echo "0.00";?> </span>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Gbp</td>
<td align="right" class="heading"><?php if($gbp!='')echo co($gbp);else echo "0.00";?></td>
<td> </td>
<td><input name="roe1" id="roe12" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading2" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<span class="addition1"><?php if($gbp!='')echo co($gbp);else echo "0.00";?></span>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Eur</td>
<td align="right" class="heading"><?php if($eur!='')echo co($eur); else echo "0.00";?></td>
<td> </td>
<td><input name="roe1" id="roe13" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading3" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<span class="addition1"> <?php if($eur!='')echo co($eur); else echo "0.00";?></span>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Other</td>
<td align="right" class="heading"><?php if($other!='')echo co($other);else echo "0.00";?></td>
<td> </td>
<td><input name="roe1" id="roe14" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading4" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<span class="addition1"><?php if($other!='')echo (co($other));else echo "0.00";?> </span>
</td>
<td> </td>
</tr>
Jquery Code is
$(document).ready(function() {
$('#tables tbody>tr>td>input.heading#roe13').change(function() {
var k = $('#roe13').val();
$('#tables tbody>tr>td.heading3').text(function(i,v) {
v= v.replace(/,/g, ''),
asANumber = +v;
x=Math.round(parseFloat(v*k)*100) / 100;
return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
});
});
$('#tables tbody>tr>td>input.heading#roe11').change(function() {
var k = $('#roe11').val();
$('#tables tbody>tr>td.heading1').text(function(i,v) {
v= v.replace(/,/g, ''),
asANumber = +v;
x1=Math.round(parseFloat(v*k)*100) / 100;
return x1.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
});
});
$('#tables tbody>tr>td>input.heading#roe12').change(function() {
var k = $('#roe12').val();
$('#tables tbody>tr>td.heading2').text(function(i,v) {
v= v.replace(/,/g, ''),
asANumber = +v;
x2=Math.round(parseFloat(v*k)*100) / 100;
return x2.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
});
});
$('#tables tbody>tr>td>input.heading#roe14').change(function() {
var k = $('#roe14').val();
$('#tables tbody>tr>td.heading4').text(function(i,v) {
v= v.replace(/,/g, ''),
asANumber = +v;
x3=Math.round(parseFloat(v*k)*100) / 100;
return x3.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
});
});
$('#tables tbody>tr').change(function() {
var sum = 0;
var regex = /\((\d+)\)/g;
$('span.addition1').each(function() {
matches = $(this).text().replace(/,/g, ''); alert(matches);
if( !isNaN( matches ) ){
sum += parseFloat(matches);
}
});
});
});
Class name in td can't be changed . I am trying to get the sum of values having class addition1. On running this code, 1 value is getting skipped, e.g. If I change a value say x1 then result generated due to x1 will be skipped in addition.
Please help me out.
Arrays in jquery are 0-based if you want the first value of matches use matches[0].
Don't put div's directly inside tr's. I'd recommend a span class="addition1" inside each of the td's and only round the floats you wish add.
This way you can parsefloat() first and then perform a NaN check after, stripping out all the regex stuff:
td code:
<td>..(<span class="addition1">1,230.0</span>)..</td>
jquery loop code:
$('span.addition1').each(function() {
var floatVal = parseFloat($(this).text().replace(/,/g,""));
if(!isNaN(floatVal)) {
sum += floatVal;
}
});
Use $(this).text() not .val().
$(this).val() refers to the value of the div.addition1, which does not have a value.
You are trying to nest td's inside a div which is not allowed for. If you cannot edit the TD's to give them a class you will have to use some other way of selecting them, like every eight TD or something similar.
HTML:
<tr >
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Inr</td>
<td align="right" class="heading"><?php echo $inr!=''?co($inr):"0.00";?> </td>
<td> </td>
<td class="heading">ROE</td><div class="addition1">
<td class="heading" ><?php echo $inr!=''?co($inr):"0.00";?> </td></div>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Usd</td>
<td align="right" class="heading"><?php echo $usd!=''?co($usd):"0.00";?> </td>
<td> </td>
<td><input name="roe1" id="roe11" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading1" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<?php echo $usd!=''?co($usd):"0.00";?>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Gbp</td>
<td align="right" class="heading"><?php echo $gbp!=''?co($gbp):"0.00";?></td>
<td> </td>
<td><input name="roe1" id="roe12" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading2" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<?php echo $gbp!=''?co($gbp):"0.00";?>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Eur</td>
<td align="right" class="heading"><?php echo $eur!=''?co($eur):"0.00";?></td>
<td> </td>
<td><input name="roe1" id="roe13" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading3" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<?php echo $eur!=''?co($eur):"0.00";?>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td class="heading">Total Other</td>
<td align="right" class="heading"><?php echo $other!=''?co($other):"0.00";?></td>
<td> </td>
<td><input name="roe1" id="roe14" type="text" class="heading" value="1" style="width:50px" /></td>
<td class="heading4" style="font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-variant: small-caps; font-weight: bold;">
<?php echo $other!=''?co($other):"0.00";?>
</td>
<td> </td>
</tr>
Script:
$('table tr').change(function() {
var sum = 0;
$.each($('tr td input'), function() {
var nextCol = $(this).parent().next("td").text();
if( nextCol && ! isNaN( nextCol ) ){
sum += parseFloat(nextCol, 10);
}
});
alert(sum);
});
Just Addition:
$('table tr').change(function() {
var sum = 0;
$.each($('addition1'), function() {
var nextCol = $(this).text();
if( nextCol && ! isNaN( nextCol ) ){
sum += parseFloat(nextCol, 10);
}
});
alert(sum);
});

Issue loading content into DIV with Jquery [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I'm out of ideas and have been searching for awhile now, so hopefully someone can point me in the right direction.
I have a select box that allows a user to select a specific value. Then try to load a page using the URL/value and keep receiving a blank page.
Assuming no value is passed, it works. I've used this page in the same way quite a number of times in the past so I'm not certain whats wrong. Also, it only seems to fail if specific URL parameters are passed. I remove a substantial amount of code outside of the problem area to make it a bit easier to read.
So
$('#sheetDiv').load('loaddates.php');
will work
and
$('#sheetDiv').load('loaddates.php?project_name=' + value);
will not
Code for main page is below:
<?php
session_start();
include('db.php');
if($_POST[submit]=="Submit")
{
mysql_query("INSERT INTO tblusers SET username='".$_POST[username]."',password='".$_POST[password]."',type='".$_POST[type]."'") or print mysql_error();
}
function make_star($x)
{
$s="";
for($i=1;$i<=strlen($x);$i++)
{
$s.="*";
}
return $s;
}
?>
<head>
<script language="javascript" src="jscript/jquery.js"></script>
<script type="text/javascript" src="jscript/facefiles/jquery-1.2.2.pack.js"></script>
<script type="text/javascript" src="jscript/ddaccordion.js"></script>
<script type="text/javascript" language="javascript" src="jscript/jmenu.js"></script>
<script language="javascript" src="jscript/user.js"></script>
<script language="javascript" src="jscript/common.js"></script>
<script type="text/javascript" src="calendarDateInput.js"></script>
<script language="javascript">
function selectProject() {
$('#selectProject').show();
$('#addProject').hide();
}
function selectDate() {
$('#addProject').hide();
$('#selectDate').show();
}
function pdelete(id)
{
if(confirm('Are sure to delete the data ?')==true)
{
$.ajax({
type: "GET",
url: "ajax.php",
data: "act=delete&tbl=timesheet"+"&id="+id,
success: function(result){
$(".error").html(result);
setTimeout('window.location.reload()',2000);
}
});
}
}
checked=false;
function checkedAll (myfrm) {
var aa= document.getElementById('frm');
if (checked == false)
{
checked = true
}
else
{
checked = false
}
for (var i =0; i < aa.elements.length; i++)
{
aa.elements[i].checked = checked;
}
}
function del()
{
var flag=false;
var pass ;
for(var i=0; i<document.frm.length; i++) //check for all checkboxes
{
if( document.frm.elements[i].type=="checkbox" && document.frm.elements[i].checked==true )
{
flag=true;
}
}
if(flag == true)
{
if(confirm("Do you sure to delete this?"))
{
return true;
}else
{ return false;
}
}
if( flag==false ) // if no checkbox selected
{
alert("Please select at least one checkbox to proceed.");
return false;
}
}
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
return false;
}
function loadUsers(id) {
if(id !=2) {
var value = $('#selectValue').val();
alert('loadates2.php?project_name=' + value);
$('#sheetDiv').load('loaddates.php?project_name=' + value);
}
else if(id == 2) {
var value = $('#f_new_age_date').val();
$('#sheetDiv').load('loaddates.php?project_date=' + value);
}
}
function addProject() {
$('#selectProject').hide();
$('#selectDate').hide();
$('#addProject').show();
}
</script>
<style>
.selectday{
border-right:#CBCBCB 1px solid;
border-left:#CBCBCB 1px solid;
border-bottom:#CBCBCB 1px solid;
border-top:#CBCBCB 1px solid;
color:#666;
font-weight:bold;
padding-left:5px;
padding-right:5px;
}
.selectedday{
border-right:#CBCBCB 1px solid;
border-left:#CBCBCB 1px solid;
border-bottom:#CBCBCB 1px solid;
border-top:#CBCBCB 1px solid;
color:#666;
padding-left:15px;
padding-right:15px;
padding-top:7px;
}
.sday
{
color:#f69929;
font-family:Arial;
font-size:24px;
font-weight:bold;
}
</style>
<link href="css/menu.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" media="all" href="images/calendar.css" title="win2k-cold-1">
<!-- main calendar program -->
<script type="text/javascript" src="images/calendar.js"></script>
<!-- language for the calendar -->
<script type="text/javascript" src="images/calendar-en.js"></script>
<!-- the following script defines the Calendar.setup helper function, which makes
adding a calendar a matter of 1 or 2 lines of code. -->
<script type="text/javascript" src="images/calendar-setup.js"></script>
</head>
<div id="newContainer">
<?php if($_SESSION[usertype] == "A" || $_SESSION[usertype] == "S" ) { ?>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<table width="100%" style="position:relative; left:15px;" border="0" cellspacing="0" cellpadding="0">
<?php include('header_project.php');?>
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td align="center"><div id="result" align="center" style="color:#FF0000; display:block;"> </div></td>
</tr>
<tr>
<td width="15%" height="395" align="left" valign="top" colspan="2"><? include('menu.php')?></td>
<td width="100%" valign="top">
< <div id="form_news" style="width:850px; position:relative;left:52px;">
<div id="options" style="margin-left: 350px;margin-top:130px;position:absolute;z-index:2">
Add New | Select Project
</div>
<div id="addProject" style="padding-top:15px; padding: 5px; display:none; height:500px; width:950px;position:relative; top:15px;">
<table width="100%" style="position:relative; left:25px" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><td colspan="8">
<form name="ff1" method="post" action="time.php">
<table width="100%" border="0" align="left" cellpadding="5" cellspacing="3">
<tr align="left">
<tr>
<td width="86" align="left" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Project</span></td>
<td width="86" align="left" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Work Code</span></td>
<td width="90" bgcolor="#e1e1e1" ><span class="text_pt space">Employee Name</span></td>
<td width="44" bgcolor="#e1e1e1" ><span class="text_pt space"> Billable Hours</span></td>
<td width="147" bgcolor="#e1e1e1" ><span class="text_pt space">Notes</span></td>
<td bgcolor="#e1e1e1" ><span class="text_pt space">Date</span></td>
<td > </td>
</tr>
<tr align="left">
<td width="132" valign="top" class="f12b"><select name="project_number" id="project_name">
<option value="">Select</option>
<?php
$aa=mysql_query("select * from projects");
while($sql=mysql_fetch_array($aa))
{
?>
<option value="<?php echo $sql['project_number']?>" ><?php echo $sql['project_name']?></option>
<?php } ?>
</select></td>
<td width="127" valign="top" class="f12b"><select name="task" id="task">
<option value="">Select</option>
<?php
$aa=mysql_query("select * from work_codes");
while($sql=mysql_fetch_array($aa))
{
?>
<option value="<?php echo $sql['work_codes']?>"><?php echo $sql['work_codes']?></option>
<?php } ?>
</select> </td>
<td width="111" valign="top" class="login_fnt"><select name="staff_name" id="staff_name">
<option value="">Select</option>
<?php
$aa=mysql_query("select * from staff_members");
while($sql_clients=mysql_fetch_array($aa))
{
?>
<option value="<?php echo $sql_clients['staff_id']?>" ><?php echo $sql_clients['staff_name']?></option>
<?php } ?>
</select></td>
<td width="47" valign="top" class="f12b"><input type="text" name="bill_hours" id="bill_hours" value="" size="5" /></td>
<td width="136" valign="top" class="f12b"><textarea name="description" id="description" cols="20" rows="1"></textarea>
<input type="hidden" name="expense_date" value="<?php echo $currdate;?>" /> </td>
<td width="185" valign="top" class="f12b">
<?php
$currdate=date('Y-m-d');
?>
<input name="new_age_date" id="f_new_age_date" onChange="document.form_news.new_rem_age_date.value=document.form_news.new_age_date.value" size="10" readonly="yes" type="text" value="<?php echo $currdate;?>">
<img src="images/img.gif" id="trigger_new_age_date" style="cursor: pointer; border: medium none;" title="Select Date">
<script type="text/javascript">
Calendar.setup({
inputField : "f_new_age_date",
ifFormat : "%Y-%m-%d",
button : "trigger_new_age_date",
singleClick : true
});
</script> </td>
<td width="41" valign="top" class="f12b"> </td>
</tr>
<tr align="left">
<td valign="top"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="login_fnt"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="f12b"> </td>
</tr>
<tr align="left">
<td valign="top"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="login_fnt"> </td>
<td valign="top" class="f12b"> </td>
<td valign="top" class="f12b"></td>
<td valign="top" class="f12b"><input type="submit" name="submit" id="submit" value="Add Time" /></td>
</tr>
</table>
</form>
</td></tr>
</table>
</div>
<div id="selectProject" style="position:relative; z-index:1; padding-top:15px; padding: 5px; display:none; height:500px; width:950px; top:125px;">
<div style="position:relative;bottom:45px">
<p style="padding:5px padding-bottom:0px;margin-left:50px; "> Select a Project:<p>
<select id ="selectValue" style="margin-left:50px;position:relative;bottom:15px;width:150px;">
<?php
$aa1 = mysql_query("select * from projects");
while(#$sql=mysql_fetch_array($aa1)) {?>
<option value="<?php echo $sql[project_name]; ?>"><?php echo $sql[project_name]; ?> </option>
<?php } ?>
</select>
<input type="button" id="selectProjectSubmit" value="Submit" onclick="loadUsers()" style="position:relative;bottom:15px;"/>
</div>
<div id="sheetDiv" style="height:500px;width:950px; border: solid 1px red; position:relative; bottom:70px;"> random </div>
</div>
</td></tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table></td>
</tr>
<?php }?>
</div>
*****Code for loaded div below:*******
<?php
session_start();
include('db.php');
?>
<head>
<script type="text/javascript">
function updateField(id, field, project_name, date) {
if(id) {
$field = $('#'+id);
$value = $field.val();
$.ajax({
type: "GET",
url: "ajax2.php",
data: "rqt=time&idfield=" + id + "&valuefield="+$value });
}
else {
$.ajax({
type: "GET",
url: "ajax2.php",
data: "rqt=updatetime&valuefield="+ field + "&date=" + date + "&project_name=" + project_name});
}
}
function doit(id,fieldtype, newvalue) {
if(fieldtype=="staff_name" || fieldtype=="task"){
var newvalue = newvalue.options[newvalue.selectedIndex].value;
}
$.ajax({
type: "GET",
url: "ajax2.php",
data: "fieldtype=" + fieldtype + "&id=" + id + "&newvalue=" + newvalue,
});
}
</script>
</head>
<?php if($_REQUEST[project_date]){
$currDate = date('Y-m-d', strtotime($_REQUEST[project_date]));
$dayOfWeek = date('N', strtotime($_REQUEST[project_date]));
if($dayOfWeek == 7) { $dayOfWeek = 0;}
$subtractTime = "-".(string)$dayOfWeek."days";
$newdate = strtotime($subtractTime , strtotime ($currDate) ) ;
$newdate = date ( 'Y-m-d' , $newdate );
$enddate = $newdate;
}
?>
<?php
if($_SESSION[usertype] == "E") { ?>
<table width="875px" style="position:relative; left:15px;" border="0" align="left" cellpadding="0" cellspacing="0">
<td colspan="8">
<table width="100%" border="0" align="left" cellpadding="5" cellspacing="3">
<tr>
<td width="100" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Project Name</span></td>
<td width="100" bgcolor="#e1e1e1" ><span class="text_pt space">Sunday</span></td>
<td width="100" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Monday</span></td>
<td width="100" align="left" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Tuesday</span></td>
<td width="100" align="left" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Wednesday</span></td>
<td width="100" bgcolor="#e1e1e1" ><span class="text_pt space">Thursday</span></td>
<td width="100" bgcolor="#e1e1e1" ><span class="text_pt space">Friday</span></td>
<td width="100" bgcolor="#e1e1e1" ><span class="text_pt space">Saturday</span></td>
</tr>
<?php
$totalhrs=0;
$Query_dbl=mysql_query("select * from projects");
while($dbl_=mysql_fetch_array($Query_dbl))
{
$counter = 0;
?> <?php
$secondCounter = 0;
$starting = true;
while($secondCounter != 7 ) {
$newdate = $enddate;
$newdate = strtotime("".$secondCounter."day" , strtotime($newdate));
$newdate = date("Y-m-d", $newdate);
$Query_fql=mysql_query("select * from timesheet where staff_name='".$_SESSION['staff_id']."' AND project_name='".$dbl_['project_name']."'");
if($secondCounter == 0 && mysql_num_rows($Query_fql) > 0 ) {
$PN_=mysql_fetch_array($Query_fql);
?>
<tr> <td> <?php echo $PN_['project_name']; ?>
</td>
<?php $starting = false;}
$Query_sql=mysql_query("select * from timesheet where staff_name='".$_SESSION['staff_id']."' AND project_name='".$dbl_['project_name']."' AND expense_date='".$newdate."'");
$Query_xql=mysql_query("select * from timesheet where staff_name='".$_SESSION['staff_id']."' AND project_name='".$dbl_['project_name']."' AND expense_date='".$newdate."'");
$secondCounter++;
if(mysql_num_rows($Query_xql) > 0) {
$currentDate = null;
while($sql_=mysql_fetch_array($Query_sql))
{
if($currentDate != $sql_['expense_date']){
$currentDate = $sql_['expense_date'];
$cyell = mysql_query("SELECT SUM(bill_hours) AS newhours FROM timesheet WHERE expense_date='".$sql_['expense_date']."' and project_name='".$sql_['project_name']."' and staff_name='".$_SESSION['staff_id']."'");
$cardyell=mysql_fetch_assoc($cyell);
}
else {
continue;
}
?>
<td align="left">
<select style="width:100px" name="billHours" id="<?php echo $sql_['id'] ?>" onchange="updateField(this.id)">
<?php $a = 0; while($a != 15) {?>
<option value="<?php echo $a; ?>" <?php if($sql_['bill_hours'] == $a) { echo "selected"; } ?>> <?php echo $a; ?> </option>
<?php $a = $a + .5;} ?>
</select>
</td>
<?php $totalhrs += $sql_['bill_hours']; } } else{ if($starting == false) { ?> <td>
<select style="width:100px" name="billHours" id="" onchange="updateField(null, this.value, <?php echo "'".$dbl_['project_name']."'";?>, <?php echo "'".$newdate."'";?>)">
<?php $a = 0; while($a != 15) {?>
<option value="<?php echo $a; ?>" <?php if($sql_['bill_hours'] == $a) { echo "selected"; } ?>> <?php echo $a; ?> </option>
<?php $a = $a + .5;} ?>
</select>
</td> <?php } } ?>
<?php } ?> </tr> <?php }
?>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"> </td>
<td align="left" valign="top" class="f12b"> </td>
<td colspan="2" align="right" valign="top" class="f12b"><br/><strong>Total Hours</strong></td>
<td align="center" valign="top" class="f12b">
<strong>
<?php
echo "<br/>";
echo $totalhrs;
?>
</strong></td>
<td align="left" valign="top" class="f12b"> </td>
</tr>
<tr>
<td colspan="7" align="left" valign="top"> </td>
</tr>
</table>
</td></tr>
</table>
</div>
<?php }
if($_SESSION[usertype] == "S" || $_SESSION[usertype] == "A"){ ?>
<table width="875px" style="position:relative;left:15px; bottom:0px !important" border="0" align="left" cellpadding="0" cellspacing="0">
<td colspan="8">
<table width="100%" border="0" align="left" cellpadding="5" cellspacing="3">
<tr>
<td width="20" class="login_fnt"><span class="text_pt space"> </span></td>
<td width="160" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Employee Name</span></td>
<td width="86" align="left" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Date Worked</span></td>
<td width="86" align="left" bgcolor="#e1e1e1" class="login_fnt"><span class="text_pt space">Billable Hours</span></td>
<td width="90" bgcolor="#e1e1e1" ><span class="text_pt space">Work Code</span></td>
<td width="44" bgcolor="#e1e1e1" ><span class="text_pt space">Notes</span></td>
</tr>
<?php
$Query_sql=mysql_query("select * from timesheet where project_name='".$_REQUEST['project_name']."'");
$totalhrs=0;
while($sql_=mysql_fetch_array($Query_sql))
{
?>
<tr>
<td width="20" align="left" valign="top">
<img src="redx.png" border="0" /></td>
<td width="90" align="left" valign="top" class="login_fnt"><select onchange="doit(<?php echo $sql_['id']?>, 'staff_name', this)" name="staff_name" id="staff_name">
<option value="">Select</option>
<?php
$aa=mysql_query("select * from staff_members");
while($sql_clients=mysql_fetch_array($aa))
{
?>
<option value="<?php echo $sql_clients['staff_id']?>" <?php if($sql_clients['staff_id']==$sql_['staff_name']) echo "selected";?>><?php echo $sql_clients['staff_name']?></option>
<?php } ?>
</select></td>
<td width="90" align="left" valign="top" class="login_fnt"> <input id="text" onblur="doit(<?php echo $sql_['id']?>, 'expense_date', this.value)" value="<?php echo $sql_['expense_date'];?>"/></td>
<td width="44" align="left" valign="top" class="f12b"><input type="text" onblur="doit(<?php echo $sql_['id']?>, 'bill_hours', this.value)" name="bill_hours" id="bill_hours" value="<?php echo $sql_['bill_hours']?>" size="5" />
<?php
$totalhrs=$totalhrs+$sql_['bill_hours'];
?>
</td>
<td width="86" align="left" valign="top" class="f12b"><select name="task" id="task" onchange="doit(<?php echo $sql_['id']?>, 'task', this)">
<option value="">Select</option>
<?php
$aa=mysql_query("select * from program_list");
while($sql=mysql_fetch_array($aa))
{
?>
<option value="<?php echo $sql['id']?>" <?php if($sql['id']==$sql_['task']) echo "selected";?>><?php echo $sql['sports']?></option>
<?php } ?>
</select> </td>
<td width="147" align="left" valign="top" class="f12b"><textarea name="description" onblur="doit(<?php echo $sql_['id']?>, 'description', this.value)" style="height:20px" id="description" cols="20" rows="1"><?php echo $sql_['description']?></textarea></td>
</tr><?php $i++; }
?>
<tr>
<td align="left" valign="top"> </td>
<td align="left" valign="top"> </td>
<td align="left" valign="top" class="f12b"> </td>
<td colspan="2" align="right" valign="top" class="f12b"><br/><strong>Total Hours</strong></td>
<td align="center" valign="top" class="f12b">
<strong>
<?php
echo "<br/>";
echo $totalhrs;
?>
</strong></td>
<td align="left" valign="top" class="f12b"> </td>
</tr>
<tr>
<td colspan="7" align="left" valign="top"> </td>
</tr>
</table>
</td></tr>
</table>
<?php } ?>
You may want to use a different approach to send parameters:
$("#sheetDiv").load("loaddates.php", { "project_name": value } );
That should do the job!

Categories