<? include ("../settings.php"); ?>
<? include ("session.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Delegate Details</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script>
        function frmsubmit(){
            $.ajax({
                type:"POST",
                url:"replace_edit_ajax.php",
                data:$("#delegate").serialize(),//only input
                success: function(response){
                    if (response != "1"){
                        alert(response);
                    }else{
                        alert("Changes saved.");
                        $('#myModal').modal('hide');
                    }
                }
            });
        }
        
    </script>
   </head>
<body>
<div class="well">
<div class="content" bgcolor="#FFFFD0">
<div class="col-12 feature">
<div class="panelCheck">
    <div class="panel-heading">
        <h3 class "panel-title"><strong>Delegate Details - Replacement</strong></h3>
    </div>

    <form name="delegate" id="delegate" method='POST' action="" enctype="multipart/form-data" class="form-horizontal" role="form">
    <center>
       
<?
    $bind = array(
        ":search1" => $_REQUEST['registrant_id']
    );
    $results = $db->select("tbl_registrant as a", "a.registrant_id = :search1", $bind);
    $result = $results[0];
    //<input type='text' class='form-control' id='datevisit' name='datevisit' value="=date("d-m-Y",strtotime ($row['datevisit']));">
?>        
        
<div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Delegate to be replaced</h3>
      </div>
      <div class="panel-body">
        <div class='form-group'>
            <label for='role_id' class='col-lg-4 control-label'>Delegate Number</label>
            <div class='col-lg-4  text-left'>
                 <?=$result['registrant_sn'];?>           
            </div>
        </div>
        <div class='form-group'>
            <label for='confirm_email' class='col-lg-4 control-label'>Name</label>
            <div class='col-lg-4  text-left'>
                 <?=$result['registrant_fullname'];?>           
            </div>
        </div>         
        <div class='form-group'>
            <label for='remind_email' class='col-lg-4 control-label'>Organisation</label>
            <div class='col-lg-4  text-left'>
                 <?=$result['registrant_organisation'];?>          
            </div>
        </div>         
        <div class='form-group'>
            <label for='role_id' class='col-lg-4 control-label'>Email</label>
            <div class='col-lg-4 text-left'>
                <?=$result['registrant_email'];?>
            </div>
        </div>
           
    </div>
</div>          
        
<div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">Delegate's' Particulars</h3>
      </div>
      <div class="panel-body">
        <div class='form-group'>
            <label for='registrant_papernumber' class='col-lg-4 control-label'>Registrant Paper Number</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_papernumber" id="registrant_papernumber">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_papertype' class='col-lg-4 control-label'>Paper Type</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_papertype" id="registrant_papertype">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_category' class='col-lg-4 control-label'>Registrant Category</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_category" id="registrant_category">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_type' class='col-lg-4 control-label'>Registrant Type</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_type" id="registrant_type">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_selection' class='col-lg-4 control-label'>Selection</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_selection" id="registrant_selection">
            </div>
        </div>
        <div class='form-group'>
            <label for='registrant_salutation' class='col-lg-4 control-label'>Salutation</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_salutation" id="registrant_salutation">
            </div>
        </div>      
		<div class='form-group'>
            <label for='registrant_familyname' class='col-lg-4 control-label'>Family Name</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_familyname" id="registrant_familyname">
        </div>
        </div>		
        <div class='form-group'>
            <label for='registrant_fullname' class='col-lg-4 control-label'>Full Name</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_fullname" id="registrant_fullname">
            </div>
        </div>
        <div class='form-group'>
            <label for='registrant_organisation' class='col-lg-4 control-label'>Organisation</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_organisation" id="registrant_organisation">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_mailing' class='col-lg-4 control-label'>Mailing</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_mailing" id="registrant_mailing">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_city' class='col-lg-4 control-label'>City</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_city" id="registrant_city">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_postal' class='col-lg-4 control-label'>Postal</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_postal" id="registrant_postal">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_country' class='col-lg-4 control-label'>Country</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_country" id="registrant_country">
            </div>
        </div>
        <div class='form-group'>
            <label for='registrant_email' class='col-lg-4 control-label'>Email</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_email" id="registrant_email">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_cc' class='col-lg-4 control-label'>Country Code</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_cc" id="registrant_cc">
            </div>
        </div>
        <div class='form-group'>
            <label for='registrant_telephone' class='col-lg-4 control-label'>Telephone</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_telephone" id="registrant_telephone">
            </div>
        </div>
        <div class='form-group'>
            <label for='registrant_diet' class='col-lg-4 control-label'>Meal</label>
            <div class='col-lg-6 text-left'>
                <select class="form-control" name="registrant_diet" id="registrant_diet">
					<?
						$options = array("None","Vegetarian");
						foreach ($options as $option){
							if ($option == $result['registrant_meal'])
								echo "<option value='$option' selected>$option</option>";
							else
								echo "<option value='$option'>$option</option>";
						}
					?>
				</select>
            </div>
        </div>
        <div class='form-group'>
            <label for='badgecolour' class='col-lg-4 control-label'>Badge</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="badgecolour" id="badgecolour">
            </div>
        </div>
		<div class='form-group'>
            <label for='remarks' class='col-lg-4 control-label'>Remarks</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="remarks" id="remarks">
            </div>
        </div>
		<div class='form-group'>
            <label for='presentdate' class='col-lg-4 control-label'>Present Date</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="presentdate" id="presentdate">
            </div>
        </div>
		<div class='form-group'>
            <label for='presenttime' class='col-lg-4 control-label'>Present Time</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="presenttime" id="presenttime">
            </div>
        </div>
		<div class='form-group'>
            <label for='presentvenue' class='col-lg-4 control-label'>Present Venue</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="presentvenue" id="presentvenue">
            </div>
        </div>
        <div class='form-group'>
            <label for='registrant_paymentmode' class='col-lg-4 control-label'>Payment Mode</label>
            <div class='col-lg-6 text-left'>
				<input type="text" class="form-control" name="registrant_paymentmode" id="registrant_paymentmode">
				</select>
            </div>
        </div>     
		<div class='form-group'>
            <label for='registrant_paid' class='col-lg-4 control-label'>Payment Status</label>
            <div class='col-lg-6 text-left'>
				<input type="text" class="form-control" name="registrant_paid" id="registrant_paid">
            </div>
        </div> 
		<div class='form-group'>
            <label for='registrant_cocktail_attend' class='col-lg-4 control-label'>Cocktail Attendance</label>
            <div class='col-lg-6 text-left'>
                <select class="form-control" name="registrant_cocktail_attend" id="registrant_cocktail_attend">
					<?
							echo "<option value='0' selected>No</option><option value='1'>Yes</option>";
					?>
				</select>
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_extra_cocktail' class='col-lg-4 control-label'>Extra Cocktail</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_extra_cocktail" id="registrant_extra_cocktail">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_dinner_attend' class='col-lg-4 control-label'>Dinner Attendance</label>
            <div class='col-lg-6 text-left'>
                <select class="form-control" name="registrant_dinner_attend" id="registrant_dinner_attend">
					<?
							echo "<option value='0' selected>No</option><option value='1'>Yes</option>";
					?>
				</select>
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_extra_dinner' class='col-lg-4 control-label'>Extra Dinner</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_extra_dinner" id="registrant_extra_dinner">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_total' class='col-lg-4 control-label'>Total Paid</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_total" id="registrant_total">
            </div>
        </div>
		
    </div>       
        
           
    <?
        $bind = array(":search1"=>$_REQUEST['registrant_id']);
        $exists = $db->select("tbl_registrant_attendance","registrant_id=:search1",$bind);
        if (count($exists)>0)
            $attendance = "disabled";
        else
            $attendance = "";
    ?>
    <input type="hidden" name="registrant_id" value="<?php echo $result['registrant_id']; ?>">
    <input type="hidden" name="role_id" value="8">
    <input type="button" name="confirm" value="Replace Delegate" class="btn btn-default" onclick="frmsubmit();" <?=$attendance?>>
    <input type="button" value="Close" class="btn btn-default" onclick="$('#myModal').modal('hide')">
    <br><br>        
        
    </center>
    <span>
    </span>
    </form>
</div>
</div>
</div>
</div>
</body>
</html>
    
    

<?

	function cleandata(&$inputarray){
		foreach ($inputarray as $key => $value) {
			if (!is_array($inputarray[$key]))
				$inputarray[$key]=htmlentities($value,ENT_QUOTES);
		}
	}

?>
