
 <a class="btn btn-primary editbtn" id="editbtn" data-owner='<?php echo  $c->owner;?>' data-dealowner='<?php echo  $c->dealowner;?>'  data-stage='<?php echo  $c->stage;?>'data-title='<?php echo  $c->title;?>' data-type='<?php echo  $c->type;?>'	data-nextstep='<?php echo  $c->nextstep;?>'  data-contactname='<?php echo  $c->contactname;?>' data-amount='<?php echo  $c->amount;?>'data-contact='<?php echo  $c->contact;?>' data-todate='<?php echo  $c->todate;?>' data-probability='<?php echo  $c->probability;?>' data-allsteps='<?php echo  $c->allsteps;?>'data-comments='<?php echo  $c->comments;?>' data-expectedrevenue='<?php echo  $c->expectedrevenue;?>'	data-fromdate='<?php echo  $c->fromdate;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editModel'>	 

         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		  $(document).on("click", "#editbtn", function()
        {
     	     var dealid = $(this).data('id');
		  $("#dealid").val(dealid);  	
          var owner = $(this).data('owner');
		  $("#owner").val(owner); 
		  
		    var dealowner = $(this).data('dealowner');
		   $("#dealowner").val(dealowner); 
		   
		     var title = $(this).data('title');
		   $("#title").val(title); 
		 
		     var type = $(this).data('type');
		   $("#type").val(type);


		     var nextstep = $(this).data('type');
		   $("#nextstep").val(nextstep); 

		     var contactname = $(this).data('contactname');
		   $("#contactname").val(contactname); 		
	
		   
 var 	todate = $(this).data('todate');
		   $("#todate").val(todate); 		
 var contact = $(this).data('contact');
		   $("#contact").val(contact); 		
 var probability = $(this).data('probability');
		   $("#probability").val(probability); 		
 var expectedrevenue = $(this).data('expectedrevenue');
		   $("#expectedrevenue").val(expectedrevenue); 	

 var amount = $(this).data('amount');
		   $("#amount").val(amount);
		   
		    var comments = $(this).data('comments');
		   $("#comments").val(comments);
		   
		       var stage = $(this).data('stage');
		   $("#stage").val(stage);
		   
		       var fromdate = $(this).data('fromdate');
		   $("#fromdate").val(fromdate);
		   
		      var allsteps = $(this).data('allsteps');
		   $("#allsteps").val(allsteps);
		  
        });
		
		
    </script>  
	<div class="form-group">
    <label for="inputowner" class="col-sm-2 control-label">	Business Name</label>
    <div class="col-sm-10">
	
		  		<input type="text" name="owner" id="owner" value="<?php echo set_value('owner'); ?>" class="form-control"  placeholder="Enter Business Name">
		 
				
		<span class="text-danger"> <?php echo form_error('owner'); ?>
		
		</span>
	</div>
  </div>
 
  
    <div class="form-group">
    <label for="inputdealowner" class="col-sm-2 control-label">Started by?</label>
    <div class="col-sm-10">
	<select class="form-control" name="dealowner" id="dealowner" style ="width: 100%"  required>
	
	<option value=""  >---Select task owner---</option>

	
	<?php 
					 
	


if(is_array($taskreceiver)) {

   foreach($taskreceiver as $receiverrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $receiverrow->id;   ?>"><?= $receiverrow->firstname ." ".$receiverrow->surname; ?></option>



	<?php

}} else {
    echo 'No  task owner.';
}
	
?>
</select>
		
						<span class="text-danger">Select the employee/person who started the deal/lead?<?php echo form_error('owner'); ?>

	</div>
  </div>
  
  
  
  
  
	<div class="form-group">
    <label for="inputtitle" class="col-sm-2 control-label">Deal title </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="title" id="title" value="<?php echo set_value('title'); ?>" class="form-control" required placeholder="Enter title">
		 
				
		<span class="text-danger"> <?php echo form_error('title'); ?>
		
		</span>
	</div>
  </div>
  
  <div class="form-group">
    <label for="inputtype" class="col-sm-2 control-label">Lead Source ?</label>
    <div class="col-sm-10">
	<select class="form-control" name="type"  id="type" required>
	
	<option value=""  >---select deal type--</option>
	<option value="cold call"  >cold call</option>
		<option value="Employement Referral"  >Employement Referral</option>
		<option value="External Referral"  >External Referral</option>
		<option value="Online source"  >Online source</option>
		<option value="Partner">Partner</option>
		<option value="Public Relations">Public Relations</option>
		<option value="Sales email allas">Sales email allas</option>
		<option value="Analog sales">Analog sales</option>
				<option value="other">Other</option>

</select>
		
						<span class="text-danger"><?php echo form_error('type'); ?>

	</div>
  </div>
   
   

	<div class="form-group">
    <label for="inputnextstep" class="col-sm-2 control-label">	Nextstep</label>
    <div class="col-sm-10">

				<textarea name="nextstep" id="nextstep" value="<?php echo set_value('nextstep'); ?>"  class="form-control"  placeholder="Enter next step/Customer feedback"></textarea>
			
		<span class="text-danger"> <?php echo form_error('nextstep'); ?>
		
		</span>
	</div>
  </div>
  
  	
  
  <div class="form-group">
    <label for="inputcontactname" class="col-sm-2 control-label">	Contact name </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="contactname"id="contactname" value="<?php echo set_value('contactname'); ?>" class="form-control"  placeholder="Enter contact name ">
		 
				
		<span class="text-danger"> <?php echo form_error('contactname'); ?>
		
		</span>
	</div>
  </div>
   <div class="form-group">
    <label for="inputcontact" class="col-sm-2 control-label">	Contact  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="contact" id="contact" value="<?php echo set_value('contact'); ?>" class="form-control"  placeholder="Enter contact  ">
		 
				
		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group">
    <label for="inputprobability" class="col-sm-2 control-label">Probability	?</label>
    <div class="col-sm-10">
	<select class="form-control" name="probability" id="probability" required>
	
	<option value="High"  >---High--</option>
	<option value="Low"  >---Low--</option>
		<option value="Medium"  >---Medium--</option>
</select>
		
						<span class="text-danger"><?php echo form_error('expectedrevenue'); ?>

	</div>
  </div>
  <div class="form-group">
    <label for="inputexpectedrevenue" class="col-sm-2 control-label">	Expected revenue Paid  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="expectedrevenue" id="expectedrevenue" value="<?php echo set_value('expectedrevenue'); ?>" class="form-control"  placeholder="Enter expected revenue  ">
		 
				
		<span class="text-danger"> <?php echo form_error('expectedrevenue'); ?>
		
		</span>
	</div>
  </div>
  
  
  <div class="form-group">
    <label for="inputamount" class="col-sm-2 control-label">	Amount Paid  </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="amount" id="amount" value="<?php echo set_value('amount'); ?>" class="form-control"  placeholder="Enter Amount paid ">
		 
				
		<span class="text-danger"> <?php echo form_error('amount'); ?>
		
		</span>
	</div>
  </div>
  
  
  
  
  <div class="form-group">
    <label for="inputnextstep" class="col-sm-2 control-label">Start Date </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="fromdate" id="fromdate" value="<?php echo set_value('fromdate',$mydate); ?>" class="form-control" required placeholder="Enter start date">
		 
				
		<span class="text-danger"> <?php echo form_error('fromdate'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputcontactname" class="col-sm-2 control-label">	Next step Date  </label>
    <div class="col-sm-10">
	
		  		<input type="date" name="contactname" id="contactname" value="<?php echo set_value('contactname', $mydate); ?>" class="form-control" required placeholder="Enter date of next action/closed date">
		 
				
		<span class="text-danger"> <?php echo form_error('contactname'); ?>
		
		</span>
	</div>
  </div>
  
    
     <div class="form-group">
    <label for="inputstage" class="col-sm-2 control-label">Stage?</label>
    <div class="col-sm-10">
	<select class="form-control" name="stage" id="stage" required>
	
	<option value="new"  >---new--</option>
	<option value="old"  >---old--</option>
		<option value="attended"  >---attended--</option>
		<option value="pending"  >---pending--</option>
		<option value="attended"  >---attended--</option>
		<option value="other">---other--</option>
</select>
		
						<span class="text-danger"><?php echo form_error('stage'); ?>

	</div>
  </div>
   
  

  
	<div class="form-group">
    <label for="inputtitle" class="col-sm-2 control-label">	title</label>
    <div class="col-sm-10">

				<textarea name="title" value="<?php echo set_value('title'); ?>" id="title" class="form-control"  placeholder="Enter Description/title"></textarea>
			
		<span class="text-danger"> <?php echo form_error('title'); ?>
		
		</span>
	</div>
  </div>
		
	<div class="form-group">
    <label for="inputallsteps" class="col-sm-2 control-label">All Feedback</label>
    <div class="col-sm-10">

				<textarea name="allsteps" value="<?php echo set_value('allsteps'); ?>" id="allsteps" class="form-control"  placeholder="Enter Indicate all the Feedback E.G 1. Call, 2.Send us proposal"></textarea>
			
		<span class="text-danger">Enter all the history for the customer <?php echo form_error('allsteps'); ?>
		
		</span>
	</div>
  </div