<? 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='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='registrant_papernumber' 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" value="<?=$result['registrant_type'];?>">
            </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" value="<?=$result['registrant_salutation'];?>">
            </div>
        </div> 
		<div class='form-group'>
            <label for='registrant_fullname' class='col-lg-4 control-label'>First Name</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_firstname" id="registrant_firstname" value="<?=$result['registrant_firstname'];?>">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_fullname' class='col-lg-4 control-label'>Last Name</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_lastname" id="registrant_lastname" value="<?=$result['registrant_lastname'];?>">
            </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" value="<?=$result['registrant_fullname'];?>">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_designation' class='col-lg-4 control-label'>Designation</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_designation" id="registrant_designation" value="<?=$result['registrant_designation'];?>">
            </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" value="<?=$result['registrant_organisation'];?>">
            </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" value="<?=$result['registrant_email'];?>">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_diet' class='col-lg-4 control-label'>Diet</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_diet" id="registrant_diet" value="<?=$result['registrant_diet'];?>">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_badge' class='col-lg-4 control-label'>Badge Colour</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_badge" id="registrant_badge" value="<?=$result['registrant_badge'];?>">
            </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" value="<?=$result['registrant_country'];?>">
            </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" value="<?=$result['remarks'];?>">
            </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" value="<?=$result['registrant_paid'];?>">
            </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" value="<?=$result['registrant_paymentmode'];?>">
            </div>
        </div>
		<div class='form-group'>
            <label for='registrant_amount' class='col-lg-4 control-label'>Amount</label>
            <div class='col-lg-6 text-left'>
                <input type="text" class="form-control" name="registrant_amount" id="registrant_amount" value="<?=$result['registrant_amount'];?>">
            </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="29">
    <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);
		}
	}

?>
