View file manage_funding_acquisition/templates/funding_acquisition/index.html

File size: 4.27Kb
<div class="page-margin">
	<form class="form pg_page padd pp_sett_form" id="create_fund" enctype="multipart/form-data">
		<h2 class="pg_in_page_title">{{LANG manage_funding}}</h2>
		<div class="prof-active">
			<div class="user-profile-page-content settings_page_requests">
				<div class="row followers--ls">
					<?php foreach($context['funding_requests'] as $key => $request){?>
					<div class="followers--ls__item col-xs-6 col-sm-6 col-md-4" id="ls_item_10">
						<div class="avatar text-center">
							<img src="<?php echo media($request->image);?>" alt="Picture" class="img-circle img-res">
						</div>
						<div class="user__info">
							<h5><a href="{{CONFIG site_url}}/funding/<?php echo $request->hashed_id;?>" data-ajax="ajax_loading.php?app=funding&amp;apph=funding&amp;id=<?php echo $request->hashed_id;?>"><?php echo $request->title;?></a></h5>
							<b><?php echo $context['currency_symbol'].$request->amount; ?></b>
							<div class="request-opts">
								<a href="{{CONFIG site_url}}/edit_funding/<?php echo $request->id;?>"  data-ajax="ajax_loading.php?app=edit_funding&amp;apph=edit_funding&amp;id=<?php echo $request->id;?>" class="btn accept_follow_btn accept_req" title="{{LANG edit_funding}}">
									<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check" style="margin-top: 13px;"><polyline points="20 6 9 17 4 12"></polyline></svg>
								</a>
								<button type="button" onclick="delete_follow(this,10)" class="btn accept_follow_btn decline_req" title="Delete">
									<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
								</button>
							</div>
						</div>
					</div>   
					<?php }?>
				</div>
			</div>
		</div>
	</form>
</div>

<script type="text/javascript">
jQuery(document).ready(function($) {
    $("form#create_fund").ajaxForm({
        url: link('profile/create_fund'),
        type: 'POST',
        dataType: 'json',
        beforeSubmit: function(arr,form){
            
            $(form).find('.pp_load_loader').addClass('loadingg');
            $(form).find('button[type="submit"]').attr('disabled','true');
        },
        success: function(data,stat,xhr,form){
            scroll2top();
            $.toast(data.message,{
                duration: 5000, 
                type: 'success',
                align: 'bottom',
                singleton: true
            });
            if (data.status == 200) {
                setTimeout(function () {
                    window.location.href = "{{CONFIG site_url}}/funding";
                },2000);
            }
            $(form).find('.pp_load_loader').removeClass('loadingg');
            $(form).find('button[type="submit"]').removeAttr('disabled');
        }
    });

    
});

$('.selectpicker').selectpicker({});

$(document).ready(function() {
	$("#image").on('change', function() {
	//Get count of selected files
	var product_countFiles = $(this)[0].files.length;
	var product_imgPath = $(this)[0].value;
	var extn = product_imgPath.substring(product_imgPath.lastIndexOf('.') + 1).toLowerCase();
	var product_image_holder = $("#fake_img_holder");
	product_image_holder.empty();
	if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
		if (typeof(FileReader) != "undefined") {
		//loop for each file selected for uploaded.
		for (var i = 0; i < product_countFiles; i++) 
		{
			var product_reader = new FileReader();
			product_reader.onload = function(e) {
				$("<img />", {
                    "src": e.target.result,
                    "class": "thumb-image"
                  }).appendTo(product_image_holder);
                }
                product_image_holder.show();
                product_reader.readAsDataURL($(this)[0].files[i]);
              }
            } else {
              product_image_holder.html("<p>This browser does not support FileReader.</p>");
            }
         }
	});
});
</script>