<div class="col-md-8">
	<?php echo $p->pdesc;?>
     <?php   $techs=explode(",",$p->ptechs);
                    foreach($techs as $t){
						$tt=$this->db->get_where("techs",array("tid"=>$t))->row();
						echo '<label class="badge badge-success">'.$tt->tech_name.'</label>&nbsp;&nbsp;';
					}?>
</div>
<div class="col-md-4">
	<form action="" method="post" id="applyform">
    	<input type="hidden" name="uid" value="<?php echo $this->session->userdata("user");?>" />
        <input type="hidden" name="pro_id" value="<?php echo $p->pro_id;?>" />
        <div class="form-group">
        	<label>Request Payment</label>
            <input type="number" name="req_payment" required class="form-control" />
        </div>
        <div class="form-group">
        	<label>Preferred Time to Contact</label>
            <input type="text" name="pref_time" required class="form-control" />
        </div>
        <label>Contact me using</label>
        <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" value="Whatsapp" name="pref_mode[]" id="Whatsapp">
            <label class="custom-control-label" for="Whatsapp"><i class="fa fa-whatsapp"></i> Whatsapp</label>
        </div>
        <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" value="Call" name="pref_mode[]" id="Call" checked="checked">
            <label class="custom-control-label" for="Call"><i class="fa fa-phone"></i> Call</label>
        </div>
        <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" value="Email" name="pref_mode[]" id="Email" checked="checked">
            <label class="custom-control-label" for="Email"><i class="fa fa-envelope"></i> Email</label>
        </div>
        <div class="form-group">
        	<label>Remark</label>
            <textarea type="text" name="reply" class="form-control" rows="3"></textarea>
        </div>
        <button type="submit" class="btn btn-warning">Send Proposal</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </form>
</div>	
<script>
$("#applyform").submit(function(e){e.preventDefault();
	var formdata=$(this).serialize();
	$.ajax({
			 type: "POST",
			 url: '<?php echo base_url();?>home/applyform',
			 data: {formdata:formdata},
			 success: function(res){
				 //alert(res);
			$("button#"+<?php echo $p->pro_id;?>).html('<label class="badge badge-warning float-right applied"><i class="fa fa-check"></i> Applied</label>');
			$("#applyform").html(res);
			 }
		});
});
</script>