<?php $this->load->view('header')?>

<style>
.col-xs-11.col-sm-4.alert.alert-warning.alert-with-icon.animated.fadeInDown {
    width: 555px;
}

</style>

       <div class="content">
            <div class="container-fluid">
			
				<div class="row">
					<div class="col-md-12">
                        <div class="card ">
                            <div class="header" style="margin-bottom:15px;">
								<div class="pull-left">
									<h4 class="title"><i class="pe-7s-note2"></i> My Keywords</h4>
								</div>
								<div class="pull-right" style="margin-bottom:15px;">
									<a href="newData"><button class="btn btn-warning btn-fill"><i class="fa fa-plus"></i> Create Campaign</button></a>
								</div>
                            </div>
                            <div class="content">
                                 <div class="table-full-width">
                                    <table class="table">
                                        <tbody>
                                         <?php if($campaign) {
                    	foreach ($campaign as $key => $value) { ?>
                        <tr>
                        	<td><b><?php echo $value->name; ?></b></td>
                        	<td class="td-actions text-right">
<button type="button" onclick="showlink('amzndealoffer.com/link','<?php echo $value->hash_keyword; ?>')" rel="tooltip" title="" class="btn btn-success btn-simple btn-xs" data-original-title="Get Link"><i class="fa fa-link"></i></button>
  <button type="button" rel="tooltip" title="Edit" onclick="showedit('<?php echo $value->id; ?>')" class="btn btn-info btn-simple btn-xs">
                        			<i class="fa fa-pencil"></i>
   </button>
<button type="button" rel="tooltip" onclick="showdelete('<?php echo $value->id; ?>')" title="Delete" class="btn btn-danger btn-simple btn-xs">
                        			<i class="fa fa-times"></i>
</button>
                        	</td>
                        </tr>                                        		
                    	<?php } } ?>           
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                           
                        </div>
                    </div>
				</div>
				
				
			

               


            </div>
        </div>
<script src="<?php echo base_url(); ?>assets/js/jquery.min.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery-ui.min.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.validate.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/moment.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap-datetimepicker.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap-selectpicker.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap-checkbox-radio-switch-tags.js"></script>
<script src="<?php echo base_url(); ?>assets/js/chartist.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/sweetalert2.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery-jvectormap.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.bootstrap.wizard.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap-table.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.datatables.js"></script>
<script src="<?php echo base_url(); ?>assets/js/fullcalendar.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap-notify.js"></script>
<script src="<?php echo base_url(); ?>assets/js/light-bootstrap-dashboard.js"></script>
<script type="text/javascript">

function showlink(domain,slug){
$.notify(
	{
	icon: "pe-7s-link",
	message: "The campaign link is: <br/><a href=\"http://"+domain+"?uid="+slug+"\">"+domain+"?uid="+slug+"</a>"
	},
	{
	type: 'warning',
	timer: 20000,
	placement: 
		{
		from: 'top',
		align: 'center'
		}
	});
}
	
function showdelete(id){
	if (confirm("Are you sure you want to delete campaign ") == true) {
		document.location="/keyword/removecampaign/"+id;
	}
}
	
function showedit(slug){
	document.location="/keyword/edit/"+slug;
}
	
function showstats(slug){
	document.location = "stats.php?campaign="+slug;	
}


$(document).ready(function(){		
	Chartist.Pie('#lateststats',{labels:["Banana","Orange","Apple"],series:[1,1,2]});
});
</script>