Sindbad~EG File Manager

Current Path : /home/numerotech/www/livemt2023.aios-scientificcommittee.org/app/views/arc/
Upload File :
Current File : //home/numerotech/www/livemt2023.aios-scientificcommittee.org/app/views/arc/step3.blade.php


{{ Form::open(array('url' => 'arc/store','role'=>'form','id'=>'form_s3')) }}

{{ Form::hidden('hdnId', isset($arc)? $arc->abs_id : 0,array('id'=>'hdnId')) }}
{{ Form::hidden('hdnStep', '3',array('id'=>'hdnStep')) }}
{{ Form::hidden('hdnIsNext', '1',array('id'=>'hdnIsNext')) }}

    <div class="row">            
    <div class="col-sm-12">               
       <div class="alert alert-success" style="display:none">            
       </div>

      <div class="alert alert-danger"  style="display:none">                  
      </div>
    </div>
</div>

<div class="col-lg-12 col-md-12 col-sm-12 nopadding margin10">
      <div class="step completedstep">STEP 1 </div>
      <div class="step completedstep">STEP 2 </div>
      <div class="step activestep">STEP 3 </div>
      <div class="step">STEP 4 </div> 
<!--       <div class="step">STEP 5 </div>   -->             
</div>

<?php $is_upload =null ?>
<div class="row">            
    <div class="col-lg-12 col-md-12 col-sm-12">               
    <label>Applicants must have passed MS/MD/DNB at the time of submission. Proof of
passing must be uploaded here   </label>
    @if(isset($abs_upload) && count($abs_upload) >0) 
    <?php $is_upload =1 ?>
    <table>
        <thead>
          <tr>
            <th>
              File Name
            </th>
            <th>
              
            </th>
          </tr>
        </thead>
        <tbody>
          @foreach($abs_upload as $item)
          <tr>
            <td>
            {{ $item->file_name   }}
            </td>
            <td>
                <a class="btn btn-xs btn-primary" onclick="onDelete({{ $item->upload_id }})" title="Remove video">
              <span class="glyphicon glyphicon-trash " aria-hidden="true"></span>
            </a> 
            </td>
            <!--<td>-->
            <!--</td>-->
          </tr>
         @endforeach 
        </tbody>
      </table>
     @else

<a href="#!" onclick="PopModal()">
    
             <!-- <a href="#" data-toggle="modal" data-target="#Modal_Conference"> --> 
             ( Click here to upload the proof )
            </a>  <span id="format" class="red"> (jpeg, jpg, png, gif)</span>  
            
    @endif        
    </div>                
</div>
{{ Form::hidden('hdnIsUpoad',$is_upload,array('id'=>'hdnIsUpoad')) }}


<!--step 3 details  -->
{{-- <div class="row">            
    <div class="col-lg-12 col-md-12 col-sm-12">                    
          <label>Co Authors (not more than {{ CustomClass::$FP_COA_Count }}) </label>    
    </div>                
</div> --}}

<!-- @if(isset($coas) &&  count($coas)>0) -->
{{-- <div class="row">            
    <div class="col-lg-12 col-md-12 col-sm-12">  
    <div class="table-responsive">
    <table id="tbl_COA" class="table table-bordered">
      <thead>
        <tr>            
            <th>
              Membership No 
            </th>
            <th>
              Author Name
            </th>
            <th>
              Email
            </th>
            <th>
              Mobile
            </th>
            <th>
            </th>
        </tr>
      </thead>
      <tbody>
      @foreach ($coas as $value)
        <tr>          
          <td data-label="Membership No">
              {{ $value->membership_no }}
          </td>
          <td data-label="Author Name">
              {{ $value->name }}
          </td>
          <td data-label="Eamil">
              {{ $value->email }}
          </td>
          <td  data-label="Mobile">
              {{ $value->mobile }}
          </td>          
          <td>
            <a class="btn btn-xs btn-primary" onclick="Remove({{ $value->author_id }})" title="Remove Topic">
              <span class="glyphicon glyphicon-trash " aria-hidden="true"></span>
            </a>                        
          </td>
        </tr>
      @endforeach
      </tbody>        
    </table>    
    </div>      
    </div>          
</div> --}}
<!-- @endif -->



{{-- <div class="row">            
    <div class="col-lg-12 col-md-12 col-sm-12 text-center">       
              <input type="button" value="Click here to search the Co Author details" id ="btnSearch" class="btn btn-md btn-primary"
        onclick="SearchPOP()"> --}}
        {{-- SearchPOP funcation in search.blade.php  --}}      
   {{-- </div>                
</div> --}}



<!--End step 3 details  -->
<br><br>
<div class="row margin30">  
    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 page-left">   
     <input type="button" value="Previous" id ="btnPrevious_s2" class="btn primary button-large"
      onclick="Move(3,0)">
    </div>
    <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 page-right">
     <input type="button" value="Next" id ="btnNext_s2" class="btn primary button-large pull-right"
     onclick="Move(3,1)">
    </div>
</div>

{{ Form::close() }}
<?php


$url =  url('/arc/response_arc'.'/'.$arc->abs_id);

// Enter your Access Key IDenen
$AWSAccessKeyId = 'AKIAIVJULUNYWYOTNLAQ';

// Enter your Secret Access Key
$AWSSecretKey = 'G9kEjx+3MfwYSPxupwRISUNDRecBAaqVhYKfFZp3';

// Enter the name of the bucket you want to use for the samples
$bucket = 'aiossc1';

$policy = base64_encode(json_encode(array(
    'expiration' => '2027-01-01T00:00:00Z',
    'conditions' => array(
        array("eq", '$acl' , 'public-read'),
        array('bucket' => $bucket),
        array('starts-with', '$key', ''),
        // array('starts-with', '$Content-Type', '')
        array('starts-with','$success_action_redirect' , $url)

    )
)));

$signature = hash_hmac('sha1', $policy, $AWSSecretKey, true);
$signature = base64_encode($signature);

?>



<div id="Modal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title"> ARC  </h4>
      </div>
      <div class="modal-body">
        <form id="from_AAC" action="https://aiossc1.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
      <input type="hidden" name="key" value="ARC2020/{{ $arc->abs_id }}/${filename}">
      <input type="hidden" name="AWSAccessKeyId" value="<?php echo $AWSAccessKeyId ?>">
      <input type="hidden" name="acl" value="public-read">
      <input type="hidden" name="success_action_redirect" value="{{ $url }}">
      <input type="hidden" name="policy" value="<?php echo $policy?>">
      <input type="hidden" name="signature" value="<?php echo $signature ?>">
      <!-- <input type="hidden" name="Content-Type" value="image/jpeg"> -->
      <!-- Include any additional input fields here -->

     <label>Please upload Image <span id="format" class="red"> (jpeg, jpg, png, gif)</span> :</label> 
      <input name="file" type="file">
      <label id="msgerror" class="msgerror" style="color: red" ></label>
      <br>
      <input id="btn_AAC" type="button"  value="Click here to Submit file" class="btn btn-primary">

   
    </form>
      </div>
      <div class="modal-footer">
        
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

  </div>
</div>
<br>

@include('arc.search')



   
<script type="text/javascript">

function Remove(coa_id) {
    var checkstr =  confirm('Are you sure you want to delete this Co-Author?');
    if(checkstr == true){
        $.ajax({
            type: 'POST', // <-- get method of form
            url: baseUrl + '/arc/deleteupload', // <-- get action of form
            data: {'coa_id':coa_id,'arc_id':$(hdnId).val()} , // <-- serialize all fields into a string that is ready to be posted to your PHP file
            dataType: 'json',
            beforeSend: function(){
                //$('#result').html('<img src="loading.gif" />');
            },
            success: function(data){
              if(data.code == 1)
              {              
                  $('#frm').html(data.data);
              }          
            }
        });   
      }
}

$(function () {

$('.msgerror').hide();

$("#btn_AAC").click(function() {

    var isvalid =true;
    var file    = $('#from_AAC input[type=file]').val();
    $('#from_AAC #msgerror').hide();
    $('#from_AAC').validate({
              rules: {
                  file: {
                      required: true,
                      // extension : "png|jpg|jpeg"
                  }
             },
             messages: {
                    file:
                    {
                      required:"Please choose the file",
                    }
             }
    });
    if($("#from_AAC").valid())
    {
      //set al type vide farmates
            if (!file.match(/\.(?:png|jpg|jpeg)$/)) {
              $('#from_AAC #msgerror').show();
                $('#from_AAC #msgerror').text('Sorry! Can not accept files of this type.Only image files are allowed');
                isvalid =false;
            }
    }
    if($("#from_AAC").valid() && isvalid)
    {

     $('#btn_AAC').prop('disabled', true);
      $('#btn_AAC').val("File Uploading Please wait..");
      $('#from_AAC').submit();

      //return true;
    }
    else
    {
      //return false;
    }


});
});  



function PopModal() {
$('#Modal').modal('show');

}

//Delete Upload Video
function onDelete(upload_id)
   {
    var checkstr =  confirm('Are you sure you want to delete this Image?');
    if(checkstr == true){
      $.ajax({
            type: 'POST', // <-- get method of form
            url: baseUrl + '/arc/deleteupload', // <-- get action of form
            data: {'abs_id':$(hdnId).val(),'upload_id':upload_id}, 
            async: false,
            dataType: 'json',
            // <-- serialize all fields into a string that is ready to be posted to your PHP file
            success: function(data){
                  if(data.code == 1)
                  {              
                      $('#frm').html(data.data);
                  }          
                }
        });   
    }
   }



</script>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists