<script>

function submitform(start,limit)

{

	document.searchfrm.act.value=document.location.href;

	document.getElementById("start").value=start;

	document.getElementById("limit").value=limit;

		

	//document.searchfrm.action = u;

	

	document.searchfrm.submit();

}

function gotolink(u,exp_id)

{

	document.searchfrm.act.value=document.location.href;

	document.getElementById("exp_id").value=exp_id;

	document.searchfrm.action = u;

	

	document.searchfrm.submit();

}

function PrintFun(ID)

{

	window.open('','formpopup',"height=350,width=600,scrollbars=yes,left=50");

	document.searchfrm.act.value='printevent';

	document.getElementById("exp_id").value=ID;

	document.searchfrm.action = 'printexp';

	document.searchfrm.target = 'formpopup';

	document.searchfrm.submit();

	

}

function EmailToFrined(ID)

{

	window.open('','formpopup',"height=350,width=600,scrollbars=yes,left=50");

	document.searchfrm.act.value='emailevent';

	document.getElementById("exp_id").value=ID;

	document.searchfrm.action = 'emailexp';

	document.searchfrm.target = 'formpopup';

	document.searchfrm.submit();

}

</script>

<form name="searchfrm" id="searchfrm" action="<?php echo $page_name?>" method="post" target="_parent">

<input type="hidden" name="start" id="start" value="<?=$_REQUEST["start"]?>" />

<input type="hidden" name="limit" id="limit" value="<?=$_REQUEST["limit"]?>" />

<input type="hidden" name="act" id="act" value="" />

<input type="hidden" name="birthday_id" id="birthday_id" value="<?php echo $birthdaydetail->id?>" />

 <div style="padding-top:40px;">

<table width="99%" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td colspan="2" align="left" class="breadcrumb"><a href="index.php" class="bnav">Home</a> &raquo; Birthday Wish</td>

                </tr>

              <tr>

                <td colspan="2">&nbsp;</td>

                </tr>

              <tr>

                <td width="76%"><h3>Birthday Wish</h3></td>

                <td width="24%" align="right"><table width="100%" border="0" cellspacing="3" cellpadding="0" >

                  <tr>

                    <td width="45%" align="center">&nbsp;</td>

                    <td width="55%" align="center"><a href="birthdaylist" class="btn btn-blue">Birthday List</a></td>

                  </tr>

                </table></td>

                </tr>

              <tr>

                <td><br /><h3 style="color:red"><?php echo $error_msg;?></h3></td>

                </tr>

                <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-bordered table-striped">

                  <tr>

                    <td width="86%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                      <tr>

                        <td>Happy Birthday,</td>

                      </tr>

                      <tr>

                        <td><br />To:  <?php echo $birthdaydetail->fam_fullname?></td>

                      </tr>

                    </table></td>

                    <td width="14%" align="center"><?php if($birthdaydetail->fam_simage!='' and file_exists('./static/uploadfiles/members/'.$birthdaydetail->fam_simage)){?>

						<img src="./static/uploadfiles/members/<?php echo $birthdaydetail->fam_simage?>" width="80px" height="80px" />

					<?php }else{?>

						<img src="images/noimg.jpg" width="80px" height="80px" /></td>

					<?php }?></td>

                  </tr>

                </table></td>

              </tr>

			  <tr>

    <td colspan="2"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="table table-bordered table-striped">

      <tr>

        <td width="8%" height="28" align="center"><strong>Sr. No.</strong></td>

        <td width="13%"><strong>Date</strong></td>

        <td width="67%"><strong>Wish</strong></td>

        <td width="12%" align="center"><strong>Photo</strong></td>

      </tr>

	  <?php

	  $i=1;

	 foreach($wishlist as $wish){

	 ?>

      <tr>

        <td align="center" valign="top"><?php echo $i+$_REQUEST["start"];?>.</td>

        <td valign="top"><?php echo date('d.m.Y h:i',strtotime($wish->tdate))?></td>

        <td valign="top"><?php echo $wish->wish?>. - by <?php echo $wish->member?></td>

        <td align="center" valign="middle" bgcolor="#F5F5F5" class="td">

		<?php if($wish->photo!='' and file_exists('./static/uploadfiles/members/'.$wish->photo)){?>

						<img src="./static/uploadfiles/members/<?php echo $wish->photo?>" width="80px" height="80px" />

					<?php }else{?>

						<img src="images/noimg.jpg" width="80px" height="80px" /></td>

					<?php }?>

		</td>

      </tr>

     <?php

	 $i++;

	  }

	  ?>

     

	  <tr><td colspan="5">

	  <table width="100%">

			 <tr>

			  		<td align="center" valign="top">

                    	<a href="#" onclick="submitform('0','<?php echo $_REQUEST['limit']?>')" >First</a>

                    </td>

                    <td  align="center" valign="top">

						<?php //print_r($_POST);

                        if($_REQUEST["back"] >=0){

                        ?>

                        <a href="#" onclick="submitform('<?php echo $_REQUEST["back"]?>','<?php echo $_REQUEST['limit'] ?>')">Prev</a>

                        <?php

                        }

                        ?>

                    </td>

                    <td align="center" valign="top"><strong>Pages </strong>

                    <?php								  

						$l=1;

						$lastPage = ceil($_REQUEST["nume"]/($_REQUEST["limit"]));

						for($i=0;$i < $_REQUEST["nume"];$i=$i+$_REQUEST["limit"]){

						if($i <> $_REQUEST["eu"]){

							if($l == $lastPage){

								$lastPageLink = "'".$i."','".$_REQUEST['limit']."'";

							}

						?>

						<a class="onav" href="#" onclick="submitform('<?php echo $i?>','<?php echo $_REQUEST['limit']?>')"><?php echo $l; ?></a>

					<?php

						}

						else { 

								if($l == $lastPage){

									$lastPageLink = "#";

								}

						?>

							<span class="paging_pages_cur"><a href="#" class="selected" alt="<?php echo SEO_ENCHOR_ALT; ?>" title="<?php echo SEO_ENCHOR_TITLE; ?>"><?php echo $l; ?></a></span>

							<?php

								}       

							$l=$l+1;

							} 

					  ?>                  </td>

                    <td align="center" valign="top">

						<?php  

						if($_REQUEST["th"] < $_REQUEST["nume"]) { 	

                        ?>

                      		<a href="#" onclick="submitform('<?php echo $_REQUEST["next"]?>','<?php echo $_REQUEST['limit']?>')">Next</a>

                        <?php

						}

						?>

                    </td>

                    <td align="center" valign="top"><a href="#" onclick="submitform(<?php echo $lastPageLink; ?>,'')">Last</a></td>

                </tr>

			 </table>

			 </td></tr>

    </table></td>

  </tr>

              <tr>

                <td colspan="2" valign="top">

				<?php if($_SESSION["member_id"]!=''){?>

					<table>

						<tr><td>Make a Wish : </td><td>

						<div class="form-group">

							<textarea name="wish" id="wish" cols="50" rows="5"></textarea>

						<div id="wish_vmsg"></div>

						</td></tr>

						<tr><td></td><td><input type="submit" class="btn btn-blue" name="Submit" id="Submit" value="Submit" /></td></tr>

					</table>

					<?php }else{

					?><font color="#FF0000">You have to <a href="#" onclick="gotolink_birthdaylist('birthdaydetail','<?php echo $birthdaydetail->id;?>')" class="bnav">login</a> to make a Wish</font><?php

					}?>

				</td>

              </tr>

              <tr>

                <td colspan="2" class="font"><?php echo $explist->description?></td>

              </tr>

              <tr>

                <td colspan="2">&nbsp;</td>

              </tr>

              

              

              <tr>

                <td colspan="2">&nbsp;</td>

              </tr>

              <tr>

                <td colspan="2">&nbsp;</td>

              </tr>

              </table>

           </div>

</form>



<form name="frm_birthday" id="frm_birthday" method="post">

	<input type="hidden" name="birthday_id" id="birthday_id" />

    <input type="hidden" name="checkLogin" id="checkLogin" value="1" />

</form>

<script type="text/javascript">

$(document).ready(function() {

    $('#searchfrm').bootstrapValidator({

        message: 'This value is not valid',

        fields: {

            wish: {

				container:'#wish_vmsg',

                message: 'The Value is not valid',

                validators: {

                    notEmpty: {

                        message: 'Please enter some text'

                    }

                }

            }

        }

    });

});

</script>

<script>

function gotolink_birthdaylist(u,birthday_id)

{

	document.frm_birthday.birthday_id.value=birthday_id;

	document.frm_birthday.action = u;

	

	document.frm_birthday.submit();

}

</script>