<div class="container">

    <!-- Marketing Icons Section -->
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">
                Welcome to NIQS 2-Day National Workshop in Makurdi - Online Registration
            </h1>
        </div>
        <div class="col-md-8">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4><i class="fa fa-fw fa-check"></i> Registration</h4>
                </div>
                <div class="panel-body">
                    <?php echo form_open('welcome/confirm'); ?>
                    <div class="row" style="margin-bottom:10px !important;">
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon">Select Category</span>
                                <select class="form-control" required="required" name="category" id='category'>
                                    <option value="">Select Category</option>
                                    <?php foreach ($categories as $c) { ?>
                                        <option value="<?php echo $c['cat_id']; ?>"><?php echo $c['cat_name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <span class="input-group-addon">NIQS Membership Number</span>
                                <input type="text" class="form-control" name="niqsNo" id="niqsNo" />
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-bottom:10px !important;">

                    </div>
                    <div class="row" style="margin-bottom:10px !important;">
                        <div class="col-sm-12">
                            <div class="input-group">
                                <span class="input-group-addon">Full Name</span>
                                <input type="text" class="form-control" required="required" name="names" id='names' />
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-bottom:10px !important;">
                        <div class="col-sm-4">
                            <div class="input-group">
                                <span class="input-group-addon">Phone</span>
                                <input type="number" name="phone" required="required" class="form-control" id='phone'  />
                            </div>
                        </div>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <span class="input-group-addon">Email Address</span>
                                <input type="email" class="form-control" name="email" required="required" id='email' />
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-bottom:10px !important;">

                    </div>
                    <div class="row" style="margin-bottom:10px !important;">
                        <div class="col-sm-12">
                            <div class="input-group">
                                <span class="input-group-addon">Company</span>
                                <input type="text" class="form-control" name="company" required="required"  />
                            </div>
                        </div>
                    </div>
                   
                    <div class="row" style="margin-bottom:10px !important;">
					<div class="col-sm-6">
                            <div class="input-group">
                                <?php
                                $a=rand(0,10);
                                $b=rand(0,10);
                                $c=$a+$b;
                                
                                ?>
                                
                                <span class="input-group-addon">Proof you are Human </span>
                                <span><h5><strong> <?php echo $a." + ".$b." ="; ?></strong></h5></span>
                                <input type="number" id="proof" required="required" class="form-control" />
                                <input type="hidden" id="proof2" value="<?php echo $c; ?>" />
                                
                                       
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <input type="submit" id="submit" class="btn btn-primary" value="Begin Registration" />
                        </div>
                    </div>
<?php echo form_close(); ?>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4><i class="fa fa-fw fa-compass"></i>Print Badge</h4>
                </div>
                <div class="panel-body">
                    <ul class="list-group">
                        <li class="list-group-item"><strong>Instructions</strong></li>
                        <li class="list-group-item">Enter your transaction id or application number below</li>
                        <li class="list-group-item">Recommended Browser for printing is Google Chrome and Firefox</li>
                        <li class="list-group-item">Enable background image in your browser before printing. If using Firefox Browser, enable background image in the option settings of the browser</li>
                        
                        
                    </ul>
<?php 
$form=array('target'=>'_new');
echo form_open('welcome/printBadge',$form); ?>
                    <div class="input-group" style="margin-bottom:10px !important;">
                        <span class="input-group-addon">Transaction ID</span>
                        <input type="number" required="required" name="transactionID" class="form-control" />

                    </div>
                    <div class="input-group">

                        <input type="submit" name="submit" class="btn btn-success" />

                    </div>
<?php echo form_close(); ?>
                </div>
            </div>
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4><i class="fa fa-fw fa-compass"></i>Print Receipt</h4>
                </div>
                <div class="panel-body">
                    
<?php 
$form=array('target'=>'_new');
echo form_open('welcome/printReceipt2',$form); ?>
                    <div class="input-group" style="margin-bottom:10px !important;">
                        <span class="input-group-addon">Transaction ID</span>
                        <input type="number" required="required" name="transactionID" class="form-control" />

                    </div>
                    <div class="input-group">

                        <input type="submit" name="submit" class="btn btn-success" />

                    </div>
<?php echo form_close(); ?>
                </div>
            </div>
        </div>
        <script>
            $(document).ready(function() {
                $("#niqsNo").change(function() {
                    var niqsNo = $("#niqsNo").val();
                    dis_url = <?php echo "'" . site_url('welcome/getMemberDetails') . "'"; ?> + '/' + niqsNo;
                    $.getJSON(dis_url, function(data) {
                                $.each(data, function(index) {
                                    //alert(data[index].memberName);
                                    $("#category").val(data[index].memberGrade);
                                    $("#grade").val(data[index].memberGrade);
                                    $("#phone").val(data[index].memberPhone);
                                    $("#email").val(data[index].memberEmail);
$("#names").val(data[index].memberSurname + ' '+ data[index].memberOthernames);

                                });
                            })
           
                })
				$("#submit").click(function(){
            proof=$("#proof").val();
            proof2=$("#proof2").val();
            if(proof !=proof2){
                alert('Proof you are human,solve the question');
                return false
            }
            
        })
            })
        </script>