I have a dropdown where the user selects the Week Number. If the selected week is not presented in the database then "Not Done" has to be displayed and if the selected Week is present then it has to display "Done"
//JavaScript function
function onchangeval(){
}
//PHP
<?php
$date_string = date('Y-m-d');
if(!isset($_GET['week'])) {
$_GET['week'] = $currentweekno;
}
$sql = "SELECT distinct Import as Import FROM info_table where Import = '".$date_string."' and Week(Import) <= '".$currentweekno."' ";
//$currentweekno is the user modified CW from the drop down (dynamic - am not sure)
$adddetails = mysql_query($sql);
$adddetails = mysql_fetch_assoc($adddetails);
if ($adddetails['Import'] != ''){
$title1="Done";
}else if ($adddetails['Import'] == ''){
$title1="Not Done";
}
?>
<td>
CW:
<select name="week" id="week" style="width: 100px" onchange="return onchangeval(); >
<option value="">--Select--</option>
<?php for($i=1;$i<=53;$i++) {?>
<option value="<?php echo $i;?>" <?php echo @$_GET['week'] == $i ? "selected" : "";?> ><?php echo $i;?></option>
<?php }?>
<option value="1">1</option>
</select>
</td>
<td>
<span class='u' style='color: red'><b><?php echo $title1;?></b></span>
</td>
Am struck at this point, can anyone guide me here on how to do this