Hey there anyone will plz help me. Submit button not work on checks on both check boxes. My link is http://www.couponsplay.com/storecoupon.php?cid=12 and the storecoupon.php is
So please fix error and revert back i m waiting.
PHP Code:
<?php
include("includes/header.php");
registerglobal('couponsubmitbutton','host','f_Ccode','f_descriptions','WebsiteID','storeurlc','expdate');
$today=date('Y-m-d');
if(isset($_GET['cid']))
{
$stid=$_GET['cid'];
$sqlstore="select * from storename where storeid=".$stid;
$sqlnumstore=sqlnumber($sqlstore);
if($sqlnumstore<=0)
{
header("location:index.php");
exit;
}
$runvalue=$db->getrow($sqlstore);
$storename=$runvalue['storename'];
$hturl=$runvalue['hturl'];
$storeid=$runvalue['storeid'];
$store_url=$runvalue['storeurl'];
$today = date("m/d/Y");
$sqlcouponstr="select id,storename,couponcode,discription,strid,storeurlc,novoting,yvoting,coupon_type,expdate,DATE_FORMAT(`createdon`,'%d %M %Y') as createdon from couponstore where status=1 and strid='".$storeid."' order by id desc";
$numofcopon=sqlnumber($sqlcouponstr);
}
else
{
header("location:index.php");
exit;
}
if(isset($couponsubmitbutton))
{
if($f_Ccode=="")
{
$errormsg[0]="Please enter both a coupon code and the discount details.";
}
if($f_Ccode!="")
{
$sqnnn="select * from couponstore where couponcode='".$f_Ccode."' ";
$nnnn=mysql_query($sqnnn);
$ffff=mysql_num_rows($nnnn);
$nnnn['couponcode'];
if($ffff>0)
{
$errormsg['1']= "Coupon Code Already Exits.";
}
}
if($f_descriptions=="")
{
$errormsg[0]="Please enter both a coupon code and the discount details.";
}
if(count($errormsg)==0)
{
$sqlinsert="insert into couponstore(`storename`,`couponcode`,`discription`,`status`,`createdon`,`strid`,`storeurlc`,`expdate`) values('".trim($host)."','".trim($f_Ccode)."','".trim($f_descriptions)."',0,'".$today."','".trim($WebsiteID)."','".trim($storeurlc)."','".$expdate."')";
$runsql=mysql_query($sqlinsert);
$_SESSION['msg2']="Your Coupon Code Shared.";
header("location:storecoupon.php?cid=".$storeid);
exit;
}
}
?><link rel="stylesheet" href="css/jquery-ui.css" />
<script src="css/jquery-ui.js"></script>
<link type="text/css" href="css/jquery.datepick.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="css/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
$('#popupDatepicker').datepick();
$('#inlineDatepicker').datepick({onSelect: showDate});
});
function showDate(date) {
alert('The date chosen is ' + date);
}
</script>
<script type="text/javascript">
function checkboxClick(){
//$(":checkbox").change(function() {
var obj = document.getElementById("popupDatepicker");
if (obj.style.display == "none") {
obj.style.display = "block"
}
else {
obj.style.display = "none"
}
return false
//alert("disabled");
}//).change(); // trigger once if needed
</script>
<script type="text/javascript">
$(document).ready(function(){
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(".show_hide").hide();
$(".slidingDiv").slideToggle();
});
});
</script>
<style>
.show_hide {
display:none;
}
</style>
<div class="inner_page">
<div class="c_bg_img_in ">
<div class="c_featured_coupon">
<div class="contact">
<div class="coupon_share">
<h2><?php echo ucwords($storename);?> Coupon Codes</h2>
<div class="coupon_shared" style="font-family:cursive; color:#fff; text-align:center; background-image:url(images/bg.gif);"><strong><?php echo $numofcopon;?></strong><br> coupons shared</div>
<div class="coupon_code">
<div><P>
<span><?php echo $runvalue['discription'];?></span> <h2>Go Directly To Store → <span><a href="<?php echo $runvalue['storeurl'];?>" target="_blank" rel="nofollow"><?php echo $storename;?> »</a></span>
</P></h2></div>
</div>
<div class="clear"></div>
</div>
<div class="c_featured_coupon2">
<h2>Active Coupons</h2>
<div><img height="3" class="img" src="images/img.jpg"></div>
</div>
<?php
$rownumber=sqlnumber($sqlcouponstr);
if($rownumber>0){
$runsqlcoponstr=$db->getrows($sqlcouponstr);
foreach($runsqlcoponstr as $couponvalue){
if($couponvalue['couponcode']=='singlecode')
{
$sqlsing="select SQL_CACHE * from subcoupstore where cstoreid=".$couponvalue['id']." and substatus=1";
$sqlsingval=$db->getrow($sqlsing);
$couponcode=$sqlsingval['code'];
$cutype='onetimeuse';
}
else
{
$couponcode=$couponvalue['couponcode'];
$cutype='regular';
}
$start = strtotime(date("m/d/Y"));
$end = strtotime($couponvalue['expdate']);
$days_between = (($end - $start) / 86400);
// echo floor($datediff/(60*60*24));
if(strcmp($couponvalue['expdate'], '')==0){
$days_between=1;
}
if($days_between>0)
{
?>
<div class="coupon_share">
<div class="store_img">
<a href="<?php echo $runvalue['storeurl'];?>" target="_blank" rel="nofollow"><img src="allstoreimg/<?php echo $runvalue['storeimg'];?>" alt="<?php echo ucwords($runvalue['storename']);?>" height="84" width="152" class="imglist"/></a>
</div>
<div class="store_heading1">
Offer ➩  <a target="_blank" href="<?php if($couponvalue['storeurlc']!="") {echo $couponvalue['storeurlc'];}
else { echo 'http://'.$runvalue['storeurl'].""; }?>" rel="nofollow"><?php echo $couponvalue['discription'];?> </a>
<div class="">Coupon Code: <div class="coupon_code_s">
<div id="coupon_code_container_<?php echo $couponvalue['id'];?>" style="position:relative;" class="tooltip"><?php if($couponcode!="No"){ echo "<strong class='coupon_code_text' code='$couponcode'></strong>"; } else { echo "<strong class='coupon_code_text' code='Deal Activated'></strong>"; } ?> </div></a>
<a href="<?php if($couponvalue['storeurlc']!="No") {echo $couponvalue['storeurlc'];}
else { echo 'http://'.$runvalue['storeurl'].""; }?>" class="show_hide" target="_blank"><?php if($couponcode!="No"){ echo "Click To See Coupon Code"; } else {echo "Activate Deal";} ?></a>
<div class="slidingDiv">
<?php if($couponcode!="No"){ echo $couponcode; } else { echo "Deal Activated"; } ?>
</div>
</div></div>
</div>
<div class="store_like">
<div>Did this coupon work for you?</div>
<div > <a name="c<?php echo $couponvalue['id'];?>">
<div id="c<?php echo $couponvalue['id'];?>">
<div class="stats" >
<?php
if($couponvalue['novoting']==0 && $couponvalue['yvoting']==0){
$realvot='new';
echo "<span style=text align='center;'><em>$realvot</em></span>";
}
else
{
$countvot=$couponvalue['novoting']+$couponvalue['yvoting'];
$realvoting=(($couponvalue['yvoting'])/$countvot);
$realvot=round((($couponvalue['yvoting'])/$countvot)*100).'%';
echo "<span class='percent'><em>Success $realvot</em></span>";
}?></div></div></div><div class="like_icon">
<form class="voting" action="couponvoting.php" method="post" id="frm_voting_<?php echo $couponvalue['couponcode'];?>">
<button class="yesVote" name="vote_code" type="submit" value="1" style="background:#fff"><img src="images/1.jpg" height="20" width="20"></button>
<button class="noVote" name="vote_code" type="submit" value="0" style="background:#fff"><img src="images/2.jpg" height="20" width="20"></button>
<input name="couponid" value="<?php echo $couponvalue['couponcode'];?>" type="hidden" class="couponid">
<input name="coupon_id" value="<?php echo $couponvalue['id'];?>" type="hidden" class="coupon_id">
</form>
</div>
</div>
<div class="clear"></div>
<div class="s_bg_color">
<div class="s_left_section">
<div>
<?php
//0000-00-00
if(strcmp($couponvalue['expdate'], '')==0){
echo "Never Expire/Limited Period Offer";
}else {
$datesplit=split(" ",$couponvalue['createdon']);
echo $datesplit[0]." ".substr($datesplit[1],0,3)." ".$datesplit[2];
echo ' ';
$d=(strtotime($couponvalue['expdate'])-strtotime($today))/(60*60*24);
$exd= round($d);
if($exd>0){
echo $couponvalue['expdate'];
echo " Expire in $exd days ";
}
}
?>
</div>
</div>
<div class="s_right_section">
<?php $sqlcomentur="select name,time,coment,DATE_FORMAT( `date` , '%d %M %Y') as date from couponcoment where status=1 and storeid='".$storeid."' and couponid='".$couponvalue['id']."' order by id desc";
$runsqlcomentur=$db->getrows($sqlcomentur);
$comnumur=sqlnumber($sqlcomentur);?>
<ul class="commentActions" style=" color:#000">
<li class="toggleComments"> <a href="javascript:void(0);" id="li_toggle_comments_<?php echo $couponvalue['id'];?>" onclick="show_comments('<?php echo $couponvalue['id'];?>');"><?php echo $comnumur;?> comments</a> </li>
<li class="writeComment" id="li_write_comments_<?php echo $couponvalue['id'];?>"> <a href="javascript:void(0);" onclick="show_window_comment('<?php echo $couponvalue['id'];?>');">Add comment</a> </li>
<li class="closeComments" id="li_close_comments_<?php echo $couponvalue['id'];?>"> <a href="javascript:void(0);" onclick="close_comments('<?php echo $couponvalue['id'];?>');">Close comments</a> </li>
</ul>
</div>
<div class="clear"></div>
<div class="comments" id="div_comments_<?php echo $couponvalue['id'];?>">
<?php if($comnumur>0){
foreach($runsqlcomentur as $comentvalur){?>
<div>
<p><?php echo $comentvalur['coment'];?></p>
<p class="attribution"><?php echo $comentvalur['name']; echo ' posted on '.$comentvalur['date']." ".$comentvalur['time'];?></p>
</div>
<?php } }?>
</div>
</div>
</div>
<?php } }} else {?><div ><div id="ContentPlaceHolder1_pnlnocoupon">
<span class="block">
<img src="images/sadimg.jpg" alt=""><span class="blocsty"><span class="blocsty1">Sorry!!</span> Coupons & Deals Not Available<br><span>please Click Below<img src="images/greenarrimg.jpg" alt=""></span></span></span><br />
<span class="yelbg">
<a href="<?php echo $runvalue['storeurl'];?>" target="_blank" rel="nofollow" class="redbg">Click here to Visit Retailer Site</a>
</span>
</div></div> <?php } ?>
</div>
<div align=right><form method="post" action="" id="myform" >
<div class="contact_form">
<h2 class="share">Share Your Coupons</h2>
<p id="pstyle"> Found a coupon for <strong><?php echo ucwords($storename);?></strong>? <br>
Enter the details below to share with other users:</p>
<div id="storeField">
<input title="Store" id="host" name="host" readonly="readonly" maxlength="60" value="<?php echo $storename;?>" type="text" class="required">
<input id="WebsiteID" name="WebsiteID" value="<?php echo $storeid;?>" type="hidden">
</div>
<div id="storeField"><input id="f_Ccode" name="f_Ccode" maxlength="50" type="text" placeholder="Coupon Code" required="required">
<div id="storeField"> <input type="checkbox" id="f_Ccode" name="f_Ccode" value="No" placeholder="Code Url" unchecked onchange="checkboxClickX()"> NO COUPON CODE REQUIRED?
</div>
<script type="text/javascript">
function checkboxClickX(){
//$(":checkbox").change(function() {
var obj = document.getElementById("f_Ccode");
if (obj.style.display == "none") {
obj.style.display = "block"
obj.removeAttribute("required");
}
else {
obj.style.display = "none"
obj.setAttribute("required", "true");
}
return false
//alert("disabled");
}//).change(); // trigger once if needed
</script>
</div>
<div id="storeField">
<input title="Store Url" id="storeurlc" name="storeurlc" maxlength="60" type="text" class="required" placeholder="Code Url" required="required">
</div>
<div id="storeField">
<textarea id="f_descriptions" name="f_descriptions" rows="2" cols="30" class="required" minlength="15" placeholder="Discount" required="required"></textarea>
</div>
<div id="storeField"> <input type="checkbox" id="expire" name="expire" value="No" placeholder="Code Url" unchecked onchange="checkboxClick()"> Never Expire/Limited Period Offer?
</div>
<div id="storeField">
<input type="text" id="popupDatepicker" title="expdate" style="display:block" name="expdate" maxlength="60" placeholder="expired on" >
</div>
<div ><input type="submit" id="couponSubmitButton" name="couponsubmitbutton" class="submit" value="submit"></button>
</div>
</div>
</align>
</form>
<div class="clear"></div>
</div>
</div>
</div>
<div id="div_Background" style="display:none; background-color:#000000; position:fixed; z-index:100">
</div>
<div id="div_Window" style="display:none; top:10% !important; z-index:105; position:fixed; padding: 8px; width: auto;">
<style type="text/css">
#commentSubmit .error { margin-bottom: 0px;}
#commentSubmit label.error { float:none; display:block; padding: 5px; width:200px; color: red; vertical-align: top; background: none; border: none; text-align: left;}
.input_text_popup
{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#333;
margin:8px 0 5px 5px;
}
</style>
<div id="div_Login" class="popup" style="display:none; z-index:105; width: auto;">
<div id="facebox">
<div class="body">
<div style="display: block;" id="content">
<div id="popup">
<div id="heading">
Write and Post a comment
</div>
<div id="content">
<div style="margin: 0pt; padding: 0pt; display: inline;">
</div>
<div>
<div class="input_text_popup"><label for="f_name">Name:</label></div>
<input type="text" id="f_name" name="User_POST_Name" class="required">
<div class="input_text_popup"><label for="f_name">E-mail:</label></div>
<div><input type="text" id="f_email" name="User_POST_Email" class="required"></div>
<div class="input_text_popup"><label for="f_description">Comments:</label></div>
<div><textarea name="Comments_POST" id="f_description" style="width:300px; height:60px;" class="required"></textarea></div>
<div>
<p id="erromsg" style="font-family:Times New Roman, Times, serif; color:#990033; font-weight:bold;"></p><p id="loader_image" style="display:none; font-size:14px; color:#009933;font-weight:bold;">Please wait<img src="images/loading1.gif"></p>
</div>
<div ><button id="user_submit" name="commit" class="inputbtn" title="Click">Submit Comment!</button>
</div>
</div>
</div>
<div style="clear: both;">
</div>
</div>
</div>
<div style="display: block; background:#fff; height:35px; text-align:center;" class="footer" >
<a style="cursor:pointer;" class="close" onClick="close_window()">
<img src="images/closelabel.gif" title="close" class="close_image">
</a>
</div></div>
</div>
</div>
</div><?php
include("includes/footer.php");
?>
Comment