<?php
////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('form_button_simple')) {
function form_button_simple($id,$links_array){
  ?>
<div class="col-md-12">
  <div>  
<div class="input-group">
                                                        <div class="input-group-btn">
                                                            <button type="button" class="btn-lg btn-primary dropdown-toggle" data-toggle="dropdown" style="overflow: hidden; position: relative;" aria-expanded="false">Action <span class="caret"></span></button>
                                                            <ul class="dropdown-menu">
<?php         
	foreach (array_combine($links_array['labels'], $links_array['urls']) as $label => $url) {
?>
		 <li><a href="<?php echo $url; ?>" target="_blank"><?php echo $label; ?></a></li>
	<?php } ?> 
		 </ul>
                                                        </div>
                                                    </div>
													</div>
													<p>&nbsp;</p>
													<p>&nbsp;</p>
														</div>
 <!-- PAGE FUNCTION ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////

////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////
////// updated 28-3-2021
if (!function_exists('view_details_v2')) {
function view_details_v2($parameters){

 if (array_key_exists('id', $parameters)) {
   $id=$parameters['id'];
   }   
 
 if (array_key_exists('btn_id', $parameters)) {
   $btn_id=$parameters['btn_id'];
   }   
 
 
 if (array_key_exists('settings', $parameters)) {
   $settings=$parameters['settings'];
   }   

 if (array_key_exists('fields', $parameters)) {
   $fields=$parameters['fields'];
   }   

 if (array_key_exists('pw_fields', $parameters)) {
   $pw_fields=$parameters['pw_fields'];
   }   
 
 if (array_key_exists('url_fields', $parameters)) {
   $url_fields=$parameters['url_fields'];
   }   
 
 if (array_key_exists('remote_cols', $parameters)) {
   $remote_fields=$parameters['remote_cols'];
   }   
 
 if (array_key_exists('links', $parameters)) {
   $links=$parameters['links'];
   }   


if (array_key_exists('table', $settings)) {
   $table=$settings['table'];
   }
   if (array_key_exists('ref', $settings)) {
   $ref=$settings['ref'];
   }		
   if (array_key_exists('id_col', $settings)) {
   $id_col=$settings['id_col'];
   }	

$tdsettings=array(
	'table'=>$table,
	'id_col'=>$id_col,
	'ref_value'=>$ref,
	'where_col'=>$id_col,
	'where_value'=>$id,
	'fields_array'=>$fields['fields'],
	'status_value'=>'Active',
	'order'=>'ASC',
	'order_col'=>id_col,
	'errors'=>"0",
	'echo'=>"0",
	'limit'=>1,
	'type'=>'wherecol_ref_status');

	$loaded=db_fetch($tdsettings);
	
   
?>
   <!-- PAGE FUNCTION STARTS (c) i2d Technologies Website Engine -->
   <div id="page-right-content">
<!-- note this div closes in footer -->
                    <div class="container">
                        <div class="row">
                            <div class="col-sm-12">
   
<?php

	

echo "<h3>".$parameters['heading']."</h3> <hr />";


?>
   
   <p>&nbsp;</p>
   <div class="col-md-12">
   
   
   <div class="col-md-6">
      <p>
	  <?php if($loaded){ 
	foreach($loaded as $item){
	foreach (array_combine($fields['labels'], $fields['fields']) as $key => $field) {
	
    ?>
	  <strong><?php echo $key; ?> : </strong><?php 
	  if(isset($item[$field]) && $item[$field]!="empty value!"){
	  echo check_decode($item[$field]);
	  }
	  ?>
	  
	  
	  <br />
	  <br />
	  <?php } }  }
	  else{
		echo "not working";  
	  }
	?>
 
	 </p>
	  
	  
                        </div>
	
	
	
	<?php
	if (array_key_exists('remote_cols', $parameters)) {
 ?>
	<div class="col-md-6">
	<?php
	
	$tdsettings2=array(
	'table'=>$table,
	'id_col'=>$id_col,
	'ref_value'=>$ref,
	'where_col'=>$id_col,
	'where_value'=>$id,
	'fields_array'=>$remote_fields['fields'],
	'status_value'=>'Active',
	'order'=>'ASC',
	'order_col'=>id_col,
	'errors'=>"0",
	'echo'=>"0",
	'limit'=>1,
	'type'=>'wherecol_ref_status');

	
	 $loaded2=db_fetch($tdsettings2);
  ?>
	
	<p>
	  <?php if($loaded2){ 
	foreach($loaded2 as $item2){
	foreach (array_combine($remote_fields['labels'], $remote_fields['fields']) as $key2 => $remote_field) {
	
    ?>
	  <strong><?php echo $key2; ?> : </strong><?php 
	  
	  $zoor=db_ref($settings['child_table'],$settings['child_table_id_col'],$item2[$remote_field],$settings['child_table_title'],0,0);
	   
	  echo check_decode($zoor);
	  
	  
	  ?>
	  
	  
	  <br />
	  <br />
	  <?php } }  }
	?>
 
	 </p>
	  
</div>
	<?php } ?>

<?php 
   
   if (array_key_exists('links', $parameters)) {
   
   form_button_simple($btn_id,$links); 
   
   }
   ?>
   
                        </div>
						
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="text-center">
	  <button type="button" class="btn btn-success m-t-10" onclick="history.go(-1);">Close View</button>
      
	  
   </div>
													<p>&nbsp;</p>
													<p>&nbsp;</p>
													<p>&nbsp;</p>
   
                        </div> <!-- end row -->
                    </div>

 <!-- PAGE FUNCTION ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////
////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('del_child_modal')) {
	function del_child_modal($bg="0"){
   ?>
   <!-- PAGE FUNCTION DEL MODAL STARTS (c) i2d Technologies Website Engine -->
<?php if($bg!=0){ ?>
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;" id="delmodal" data-backdrop="false">
<?php } else { ?>                       
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;" id="delmodal">
<?php } ?>					   <div class="modal-dialog modal-sm">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                                    <h4 class="modal-title" id="mySmallModalLabel">Are You Really Sure?</h4>
                                                </div>
                                               
												    <div class="modal-footer">
                                                    <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">Cancel</button>
                                                    <button type="button" id="yes_del" class="btn btn-danger waves-effect waves-light" data-dismiss="modal">Yes</button>
                                                </div>
                                            </div><!-- /.modal-content -->
                                        </div><!-- /.modal-dialog -->
                                    </div><!-- /.modal -->


 <!-- PAGE FUNCTION DEL MODAL ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////

////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('view_list_child')) {
	function view_list_child($settings,$cols,$remotes,$array_cols,$excluded,$status100,$button_items,$sys_button_items,$special_button_items=0){
	$auther="10";	
   
del_child_modal();  
   
   ?>
<script type="text/javascript">
  $(document).ready(function() {
	   $( '#searchable-container' ).searchable({
        searchField: '#search',
        selector: '.<?php echo $settings['col_divide']; ?>',
        childSelector: '.card-box',
        show: function( elem ) {
            elem.slideDown(100);
        },
        hide: function( elem ) {
            elem.slideUp( 100 );
        }
    })


	  });
  </script>
  
   
   <!-- PAGE FUNCTION LIST STARTS (c) i2d Technologies Website Engine -->
   <!-- START PAGE CONTENT -->
     <script type="text/javascript">
$(document).ready(function() {
var nb = $('div.member-card').length.toString();
$('#counter').html(nb);
$('#search').bind("keyup change blur", function(e) {
var bn = $('div.card-box:visible').length.toString();
$('#counter').html(bn);
});
$(".btn_delete a").click(function() {
var deL_iD = $(this).attr('id');	
var rowElement = $(this).parent().parent().parent().parent();
$("#delmodal").modal('show');	
$("#yes_del").click(function() {
$.ajax({
        
        Type : 'POST',
		
		contentType : "application/json; charset=utf-8",
		 
		dataType: 'text',

		cache	: false,

		url		: "perl.txt",
		
		
	    data	: 'section_flag=del_rec&ref_id=' + deL_iD + '&tbl=<?php echo $settings['table']; ?>&id_col=<?php echo $settings['id_table']; ?>',

		success : function(response){
rowElement.fadeOut(500).remove();
var bn2 = $('div.member-card:visible').length.toString();
$('#counter').html(bn2);	
console.log(response);

				},
        error:function(exception){
		   
		console.log(exception);
		   
		   ;}

	
				
				
});// end ajax()

});

});
});
</script>

                <div id="page-right-content">

                    <div class="container">
                        
						<div class="row">
                            <div class="col-sm-12">
                                <h4 class="header-title m-t-0 m-b-20"><?php echo $settings['heading']." List"; ?> <span id="counter" style="color:red; font-weight:bold;"></span> Item(s)</h4>
                            </div>
							<div class="col-md-6 pull-left">
							<br />
                                        <div class="input-group">
										
                                                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                                    <input type="text" id="search" name="example-input1-group1" class="form-control" placeholder="Search"><br />
													
                                                </div>
                                                </div>
												<div class="col-md-6 pull-right">
												<?php 
												if($auther!=0){
												if(isset($settings['add_new_view']) && $settings['add_new_view']!=0){
												?>
												<br />
												<span class="pull-right"><a button type="button" class="btn btn-lg btn-success" href="<?php echo $settings['add_new_link']; ?>"><?php echo $settings['add_new_label']; ?></button></a></span>
												<?php }
												}
												?>
												<span id="counter2" style="color:red; font-weight:bold;"></span>
							</div>
                        </div> <!-- end row -->
<p>&nbsp;</p>

<?php
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

$table=$settings['table'];
$ref_val=$settings['ref_value'];
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

	if(isset($settings['legend']) && $settings['legend']!=0){
	$tdsettings=array(
	'table'=>$table,
	'id_col'=>$id_table,
	'ref_value'=>$ref_val,
	'where_col'=>$where_col,
	'fields_array'=>$array_cols,
	'where_value'=>$legend,
	'uplink'=>uplink(),
	'status_vaue'=>'Active',
	'order'=>'ASC',
	'type'=>'status_where_ref');

	$tdload=db_fetch($tdsettings);
	
	}
	else{
	    
$db_settings=array(
'table'=>$table,
'ref_value'=>$ref_val,
'fields_array'=>$array_cols,
'type'=>'status_ref',
'uplink'=>uplink(),
'order'=>'DESC');

$tdload=db_fetch($db_settings);
    
	    
	}
	
	$table_id=id_col;
	?>


                        <div class="row p-20">
									
				<div class="row" id="searchable-container">
									
									
									<?php
									$b=0;

if(!empty($tdload)){
	foreach($tdload as $item){ 
	$b++;								
///////////////////////////////////////////////////////////////////////
					  ?>
                <div class="<?php echo $settings['col_divide']; ?>">
				
                        		<div class="text-left card-box">
                                    
									<div class="dropdown pull-right">
                                        <a href="#" class="dropdown-toggle card-drop" data-toggle="dropdown" aria-expanded="false">
                                            <h3 class="m-0 text-muted"><i class="mdi mdi-dots-horizontal"></i></h3>
                                        </a>
							
                                        <ul class="dropdown-menu" role="menu">
                                            <?php if(isset($button_items) && !empty($button_items)){ 
				foreach($button_items as $bitem=>$bval){ 
				if($button_items[$bitem]['active']=="1"){
				?>
											
											<?php 
											
				}
				}
											}
											?>
											<?php if(isset($button_items) && !empty($button_items)){ 
				foreach($button_items as $bitem=>$bval){ 
				if($button_items[$bitem]['active']=="1" || $button_items[$bitem]['active']=="10"){
				?>
				<?php 
				if(isset($button_items[$bitem]['target']) && $button_items[$bitem]['target']=="blank"){ ?>
											<li><a href="<?php echo $button_items[$bitem]['link'].$item[$table_id]; ?>" target="_blank"><i class="<?php echo $button_items[$bitem]['icon']; ?>"></i> <?php echo $button_items[$bitem]['label']; ?></a></li>
				<?php }
				else { ?>
											<li><a href="<?php echo $button_items[$bitem]['link'].$item[$table_id]; ?>"><i class="<?php echo $button_items[$bitem]['icon']; ?>"></i> <?php echo $button_items[$bitem]['label']; ?></a></li>
				<?php } ?>
											<?php }
 
else{ 
?>

<br />
                                            <li style="border-bottom:1px solid rgba(153,153,153,.3); margin:-10px 0 4px 0";></li>
																						
											<?php					
					  
				  } 
}
				}
				  ?>
                               <?php
if(isset($special_button_items) && !empty($special_button_items)){ 
foreach($special_button_items as $special_bitem=>$special_bval){
if($special_button_items[$special_bitem]['active']=="10"){				
				 ?>
				 
<li><a href="<?php echo $special_button_items[$special_bitem]['link'].$item[$table_id]."/"; ?>" target="_blank"><i class="<?php echo $special_button_items[$special_bitem]['icon']; ?>"></i> <?php echo $special_button_items[$special_bitem]['label']; ?></a></li>
  <?php } 
				  else{
					?>
	
					<?php					
					  
				  } 
}
				}
				  ?>
<?php
if(isset($sys_button_items) && !empty($sys_button_items)){ 
foreach($sys_button_items as $sys_bitem=>$sys_bval){
if($sys_button_items[$sys_bitem]['active']=="10"){				
				 ?>
				 
<li class="btn_delete"><a href="<?php echo $sys_button_items[$sys_bitem]['link'].$table."/".$item[$table_id]."/"; ?>" onclick="return false;" id="<?php echo $item[$table_id]; ?>"><i class="<?php echo $sys_button_items[$sys_bitem]['icon']; ?>"></i> <?php echo $sys_button_items[$sys_bitem]['label']; ?></a></li>
  <?php } 
				  else{
					?>
	
					<?php					
					  
				  } 
}
				}
				  ?>
				</ul>
               
				</div>
				
									
                                    <div class="clearfix"></div>
                                    <div class="member-card">
									
                                        <span class="user-badge bg-warning" style="background-color:<?php echo $settings['badge_color']; ?>!IMPORTANT;"><?php echo $settings['suffix'].$b; ?></span>
                                        

                                        

<div class="col-md-12">                                            

<?php if(isset($settings['photo_on']) && $settings['photo_on']!=0) { ?>
			  <img class="img-<?php echo $settings['photo_type']; ?> img-thumbnail" style="max-width: <?php echo $settings['photo_percentage']; ?>;" src="<?php echo $settings['photo_path'].$item[$settings['photo_col']]; ?>">
			  <?php } else {	?>
			 <!-- <img class="img-circle img-thumbnail" style="max-width: 25%;" src="<?php //echo photo_folder; ?>default.png"> -->
			  <?php } ?>
<?php
if(isset($cols) && !empty($cols)){
foreach ($cols as $cols_key=>$col_value){
?>
<<?php echo $cols[$cols_key]['html_heading_size'];?> class="m-b-5">
<?php echo $cols[$cols_key]['html_heading_label'];?>
<?php
if(isset($cols[$cols_key]['col']) && !empty($cols[$cols_key]['col'])){ 
if($cols[$cols_key]['col_encoding']==1){echo ucwords(base64_decode($item[$cols[$cols_key]['col']]));}
else{
echo ucwords($item[$cols[$cols_key]['col']]);
}
}	
?>
</<?php echo $cols[$cols_key]['html_heading_size'];?>>
<?php	
}
}
?>	
<?php
if(isset($remotes) && !empty($remotes)){
foreach ($remotes as $remotes_key=>$remotes_value){
?>
<<?php echo $remotes[$remotes_key]['html_heading_size'];?> class="m-b-5">
<?php echo $remotes[$remotes_key]['html_heading_label'];?>
<?php
$this_id=$item[$remotes[$remotes_key]['this_col']];
$fetched_remote=db_ref($remotes[$remotes_key]['remote_table'],$remotes[$remotes_key]['remote_table_id_col'],$this_id,$remotes[$remotes_key]['remote_table_find_col']);
if($remotes[$remotes_key]['remote_col_encoding']==1){echo ucwords(base64_decode($fetched_remote));}
else{
echo ucwords($fetched_remote);
}
	
?>
</<?php echo $remotes[$remotes_key]['html_heading_size'];?>>
<?php	
}
}
?>	
	
 
                  <small>
                	  <span>
					
					Last Edit : <?php echo date('M j Y g:i A', strtotime($item[server_time]))."<br/ >"; ?>
				    
                   
                     </span>
                  </small>
                  
			  
			  </a> </span></p>
                                        </div>
    </div>

                                        <p class="text-muted font-13">
&nbsp;
                                        </p>

                                        
                                        
                                    

                                </div>
	


                            </div>
							<?php } 
	}
?>
</div>							
							
							
                            </div>
                            
							
							</div>
                            
							
							
 <!-- PAGE FUNCTION LIST ENDS (c) i2d Technologies Website Engine -->   
<?php   

//helloworld($id);


}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////

////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////
////// updated 28-3-2021
if (!function_exists('view_details_v3')) {
function view_details_v3($parameters){

 if (array_key_exists('id', $parameters)) {
   $id=$parameters['id'];
   }   
 
 if (array_key_exists('btn_id', $parameters)) {
   $btn_id=$parameters['btn_id'];
   }   
 
 
 if (array_key_exists('settings', $parameters)) {
   $settings=$parameters['settings'];
   }   

 if (array_key_exists('fields', $parameters)) {
   $fields=$parameters['fields'];
   }   

 if (array_key_exists('pw_fields', $parameters)) {
   $pw_fields=$parameters['pw_fields'];
   }   
 
 if (array_key_exists('url_fields', $parameters)) {
   $url_fields=$parameters['url_fields'];
   }   
 
 if (array_key_exists('remote_cols', $parameters)) {
   $remote_fields=$parameters['remote_cols'];
   }   
 
 if (array_key_exists('links', $parameters)) {
   $links=$parameters['links'];
   }   


if (array_key_exists('table', $settings)) {
   $table=$settings['table'];
   }
   if (array_key_exists('ref', $settings)) {
   $ref=$settings['ref'];
   }		
   if (array_key_exists('id_col', $settings)) {
   $id_col=$settings['id_col'];
   }	

$tdsettings=array(
	'table'=>$table,
	'id_col'=>$id_col,
	'ref_value'=>$ref,
	'where_col'=>$id_col,
	'where_value'=>$id,
	'fields_array'=>$fields['fields'],
	'status_value'=>'Active',
	'order'=>'ASC',
	'order_col'=>id_col,
	'errors'=>"0",
	'echo'=>"0",
	'limit'=>1,
	'type'=>'wherecol_ref_status');

	$loaded=db_fetch($tdsettings);
	
   
?>
   <!-- PAGE FUNCTION STARTS (c) i2d Technologies Website Engine -->
   <div id="page-right-content">
<!-- note this div closes in footer -->
                    <div class="container">
                        <div class="row">
                            <div class="col-sm-12">
   
<?php

	

echo "<h3>".$parameters['heading']."</h3> <hr />";


?>
   
   <p>&nbsp;</p>
 
   
   
   <div class="col-md-12">
      
	  <?php if($loaded){ 
	foreach($loaded as $item){
	foreach (array_combine($fields['labels'], $fields['fields']) as $key => $field) {
	
    ?>
	  <strong><?php echo $key; ?> : </strong><?php 
	  if(isset($item[$field]) && $item[$field]!="empty value!"){
	  echo check_decode($item[$field]);
	  }
	  ?>
	  
	  
	  <br />
	  <br />
	  <?php } }  }
	  else{
		echo "not working";  
	  }
	?>
 
	  
	  
                        </div>
	
	
	

<?php 
   
   if (array_key_exists('links', $parameters)) {
   
   form_button_simple($btn_id,$links); 
   
   }
   ?>
   
                        
						
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="text-center">
	  <button type="button" class="btn btn-success m-t-10" onclick="history.go(-1);">Close View</button>
      
	  
   </div>
													<p>&nbsp;</p>
													<p>&nbsp;</p>
													<p>&nbsp;</p>
   
                        </div> <!-- end row -->
                    </div>

 <!-- PAGE FUNCTION ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////
////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('del_child_modal')) {
	function del_child_modal($bg="0"){
   ?>
   <!-- PAGE FUNCTION DEL MODAL STARTS (c) i2d Technologies Website Engine -->
<?php if($bg!=0){ ?>
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;" id="delmodal" data-backdrop="false">
<?php } else { ?>                       
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;" id="delmodal">
<?php } ?>					   <div class="modal-dialog modal-sm">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                                    <h4 class="modal-title" id="mySmallModalLabel">Are You Really Sure?</h4>
                                                </div>
                                               
												    <div class="modal-footer">
                                                    <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">Cancel</button>
                                                    <button type="button" id="yes_del" class="btn btn-danger waves-effect waves-light" data-dismiss="modal">Yes</button>
                                                </div>
                                            </div><!-- /.modal-content -->
                                        </div><!-- /.modal-dialog -->
                                    </div><!-- /.modal -->


 <!-- PAGE FUNCTION DEL MODAL ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////

////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('view_list_child')) {
	function view_list_child($settings,$cols,$remotes,$array_cols,$excluded,$status100,$button_items,$sys_button_items,$special_button_items=0){
	$auther="10";	
   
del_child_modal();  
   
   ?>
<script type="text/javascript">
  $(document).ready(function() {
	   $( '#searchable-container' ).searchable({
        searchField: '#search',
        selector: '.<?php echo $settings['col_divide']; ?>',
        childSelector: '.card-box',
        show: function( elem ) {
            elem.slideDown(100);
        },
        hide: function( elem ) {
            elem.slideUp( 100 );
        }
    })


	  });
  </script>
  
   
   <!-- PAGE FUNCTION LIST STARTS (c) i2d Technologies Website Engine -->
   <!-- START PAGE CONTENT -->
     <script type="text/javascript">
$(document).ready(function() {
var nb = $('div.member-card').length.toString();
$('#counter').html(nb);
$('#search').bind("keyup change blur", function(e) {
var bn = $('div.card-box:visible').length.toString();
$('#counter').html(bn);
});
$(".btn_delete a").click(function() {
var deL_iD = $(this).attr('id');	
var rowElement = $(this).parent().parent().parent().parent();
$("#delmodal").modal('show');	
$("#yes_del").click(function() {
$.ajax({
        
        Type : 'POST',
		
		contentType : "application/json; charset=utf-8",
		 
		dataType: 'text',

		cache	: false,

		url		: "perl.txt",
		
		
	    data	: 'section_flag=del_rec&ref_id=' + deL_iD + '&tbl=<?php echo $settings['table']; ?>&id_col=<?php echo $settings['id_table']; ?>',

		success : function(response){
rowElement.fadeOut(500).remove();
var bn2 = $('div.member-card:visible').length.toString();
$('#counter').html(bn2);	
console.log(response);

				},
        error:function(exception){
		   
		console.log(exception);
		   
		   ;}

	
				
				
});// end ajax()

});

});
});
</script>

                <div id="page-right-content">

                    <div class="container">
                        
						<div class="row">
                            <div class="col-sm-12">
                                <h4 class="header-title m-t-0 m-b-20"><?php echo $settings['heading']." List"; ?> <span id="counter" style="color:red; font-weight:bold;"></span> Item(s)</h4>
                            </div>
							<div class="col-md-6 pull-left">
							<br />
                                        <div class="input-group">
										
                                                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                                    <input type="text" id="search" name="example-input1-group1" class="form-control" placeholder="Search"><br />
													
                                                </div>
                                                </div>
												<div class="col-md-6 pull-right">
												<?php 
												if($auther!=0){
												if(isset($settings['add_new_view']) && $settings['add_new_view']!=0){
												?>
												<br />
												<span class="pull-right"><a button type="button" class="btn btn-lg btn-success" href="<?php echo $settings['add_new_link']; ?>"><?php echo $settings['add_new_label']; ?></button></a></span>
												<?php }
												}
												?>
												<span id="counter2" style="color:red; font-weight:bold;"></span>
							</div>
                        </div> <!-- end row -->
<p>&nbsp;</p>

<?php
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

$table=$settings['table'];
$ref_val=$settings['ref_value'];
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

	if(isset($settings['legend']) && $settings['legend']!=0){
	$tdsettings=array(
	'table'=>$table,
	'id_col'=>$id_table,
	'ref_value'=>$ref_val,
	'where_col'=>$where_col,
	'fields_array'=>$array_cols,
	'where_value'=>$legend,
	'uplink'=>uplink(),
	'status_vaue'=>'Active',
	'order'=>'ASC',
	'type'=>'status_where_ref');

	$tdload=db_fetch($tdsettings);
	
	}
	else{
	    
$db_settings=array(
'table'=>$table,
'ref_value'=>$ref_val,
'fields_array'=>$array_cols,
'type'=>'status_ref',
'uplink'=>uplink(),
'order'=>'DESC');

$tdload=db_fetch($db_settings);
    
	    
	}
	
	$table_id=id_col;
	?>


                        <div class="row p-20">
									
				<div class="row" id="searchable-container">
									
									
									<?php
									$b=0;

if(!empty($tdload)){
	foreach($tdload as $item){ 
	$b++;								
///////////////////////////////////////////////////////////////////////
					  ?>
                <div class="<?php echo $settings['col_divide']; ?>">
				
                        		<div class="text-left card-box">
                                    
									<div class="dropdown pull-right">
                                        <a href="#" class="dropdown-toggle card-drop" data-toggle="dropdown" aria-expanded="false">
                                            <h3 class="m-0 text-muted"><i class="mdi mdi-dots-horizontal"></i></h3>
                                        </a>
							
                                        <ul class="dropdown-menu" role="menu">
                                            <?php if(isset($button_items) && !empty($button_items)){ 
				foreach($button_items as $bitem=>$bval){ 
				if($button_items[$bitem]['active']=="1"){
				?>
											
											<?php 
											
				}
				}
											}
											?>
											<?php if(isset($button_items) && !empty($button_items)){ 
				foreach($button_items as $bitem=>$bval){ 
				if($button_items[$bitem]['active']=="1" || $button_items[$bitem]['active']=="10"){
				?>
				<?php 
				if(isset($button_items[$bitem]['target']) && $button_items[$bitem]['target']=="blank"){ ?>
											<li><a href="<?php echo $button_items[$bitem]['link'].$item[$table_id]; ?>" target="_blank"><i class="<?php echo $button_items[$bitem]['icon']; ?>"></i> <?php echo $button_items[$bitem]['label']; ?></a></li>
				<?php }
				else { ?>
											<li><a href="<?php echo $button_items[$bitem]['link'].$item[$table_id]; ?>"><i class="<?php echo $button_items[$bitem]['icon']; ?>"></i> <?php echo $button_items[$bitem]['label']; ?></a></li>
				<?php } ?>
											<?php }
 
else{ 
?>

<br />
                                            <li style="border-bottom:1px solid rgba(153,153,153,.3); margin:-10px 0 4px 0";></li>
																						
											<?php					
					  
				  } 
}
				}
				  ?>
                               <?php
if(isset($special_button_items) && !empty($special_button_items)){ 
foreach($special_button_items as $special_bitem=>$special_bval){
if($special_button_items[$special_bitem]['active']=="10"){				
				 ?>
				 
<li><a href="<?php echo $special_button_items[$special_bitem]['link'].$item[$table_id]."/"; ?>" target="_blank"><i class="<?php echo $special_button_items[$special_bitem]['icon']; ?>"></i> <?php echo $special_button_items[$special_bitem]['label']; ?></a></li>
  <?php } 
				  else{
					?>
	
					<?php					
					  
				  } 
}
				}
				  ?>
<?php
if(isset($sys_button_items) && !empty($sys_button_items)){ 
foreach($sys_button_items as $sys_bitem=>$sys_bval){
if($sys_button_items[$sys_bitem]['active']=="10"){				
				 ?>
				 
<li class="btn_delete"><a href="<?php echo $sys_button_items[$sys_bitem]['link'].$table."/".$item[$table_id]."/"; ?>" onclick="return false;" id="<?php echo $item[$table_id]; ?>"><i class="<?php echo $sys_button_items[$sys_bitem]['icon']; ?>"></i> <?php echo $sys_button_items[$sys_bitem]['label']; ?></a></li>
  <?php } 
				  else{
					?>
	
					<?php					
					  
				  } 
}
				}
				  ?>
				</ul>
               
				</div>
				
									
                                    <div class="clearfix"></div>
                                    <div class="member-card">
									
                                        <span class="user-badge bg-warning" style="background-color:<?php echo $settings['badge_color']; ?>!IMPORTANT;"><?php echo $settings['suffix'].$b; ?></span>
                                        

                                        

<div class="col-md-12">                                            

<?php if(isset($settings['photo_on']) && $settings['photo_on']!=0) { ?>
			  <img class="img-<?php echo $settings['photo_type']; ?> img-thumbnail" style="max-width: <?php echo $settings['photo_percentage']; ?>;" src="<?php echo $settings['photo_path'].$item[$settings['photo_col']]; ?>">
			  <?php } else {	?>
			 <!-- <img class="img-circle img-thumbnail" style="max-width: 25%;" src="<?php //echo photo_folder; ?>default.png"> -->
			  <?php } ?>
<?php
if(isset($cols) && !empty($cols)){
foreach ($cols as $cols_key=>$col_value){
?>
<<?php echo $cols[$cols_key]['html_heading_size'];?> class="m-b-5">
<?php echo $cols[$cols_key]['html_heading_label'];?>
<?php
if(isset($cols[$cols_key]['col']) && !empty($cols[$cols_key]['col'])){ 
if($cols[$cols_key]['col_encoding']==1){echo ucwords(base64_decode($item[$cols[$cols_key]['col']]));}
else{
echo ucwords($item[$cols[$cols_key]['col']]);
}
}	
?>
</<?php echo $cols[$cols_key]['html_heading_size'];?>>
<?php	
}
}
?>	
<?php
if(isset($remotes) && !empty($remotes)){
foreach ($remotes as $remotes_key=>$remotes_value){
?>
<<?php echo $remotes[$remotes_key]['html_heading_size'];?> class="m-b-5">
<?php echo $remotes[$remotes_key]['html_heading_label'];?>
<?php
$this_id=$item[$remotes[$remotes_key]['this_col']];
$fetched_remote=db_ref($remotes[$remotes_key]['remote_table'],$remotes[$remotes_key]['remote_table_id_col'],$this_id,$remotes[$remotes_key]['remote_table_find_col']);
if($remotes[$remotes_key]['remote_col_encoding']==1){echo ucwords(base64_decode($fetched_remote));}
else{
echo ucwords($fetched_remote);
}
	
?>
</<?php echo $remotes[$remotes_key]['html_heading_size'];?>>
<?php	
}
}
?>	
	
 
                  <small>
                	  <span>
					
					Last Edit : <?php echo date('M j Y g:i A', strtotime($item[server_time]))."<br/ >"; ?>
				    
                   
                     </span>
                  </small>
                  
			  
			  </a> </span></p>
                                        </div>
    </div>

                                        <p class="text-muted font-13">
&nbsp;
                                        </p>

                                        
                                        
                                    

                                </div>
	


                            </div>
							<?php } 
	}
?>
</div>							
							
							
                            </div>
                            
							
							</div>
                            
							
							
 <!-- PAGE FUNCTION LIST ENDS (c) i2d Technologies Website Engine -->   
<?php   

//helloworld($id);


}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////
////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('timeline')) {
	function timeline($settings){
   ?>
   <!-- PAGE FUNCTION STARTS (c) i2d Technologies Website Engine -->
   <div class="timeline">
   
                                    <article class="timeline-item alt">
                                        <div class="text-right">
                                            <div class="time-show first">
                                                <a href="#" onclick="return false;" class="btn  <?php echo $settings['class']; ?>"><?php echo $settings['heading']; ?></a>
                                            </div>
                                        </div>
                                    </article>
									<?php if ($settings['left']=="1") { ?> 
                                    <article class="timeline-item">
									<?php } else { ?>
									<article class="timeline-item alt">
									<?php } ?>
                                        <div class="timeline-desk" style="color:black;">
                                            <div class="panel">
                                                <div class="timeline-box">
                                                    <span class="arrow-alt"></span>
                                                    <span class="timeline-icon"><i class="mdi mdi-checkbox-blank-circle-outline"></i></span>
                                                    <h4 style="font-weight:bold;"><?php echo $settings['date']; ?> </h4>
                                                    <p class="timeline-date text-muted"></p>
                                                    <p style="color:black;"><?php echo $settings['description']; ?></p>
                                                </div>
                                            </div>
                                        </div>
                                    </article>
                                    

                                    
                                </div>
 <!-- PAGE FUNCTION ENDS (c) i2d Technologies Website Engine -->   
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////
////////////////////// FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////

if (!function_exists('view_timeline')) {
	function view_timeline($id){
		
$domain=db_ref(main_table,id_col,$id,domain);		
$business=strtoupper(db_ref(main_table,id_col,$id,title));		

$dated1=date("l F j, Y");
$dte1 = strtotime("+7 day");
$dated2= date("l F j, Y", $dte1);
$dte2 = strtotime("+14 day");
$dated3= date("l F j, Y", $dte2);
$dte3 = strtotime("+16 day");
$dated4= date("l F j, Y", $dte3);
$dte4 = strtotime("+20 day");
$dated5= date("l F j, Y", $dte4);
$dte5 = strtotime("+22 day");
$dated6= date("l F j, Y", $dte5);
$dte6 = strtotime("+60 day");
$dated7= date("l F j, Y", $dte6);
$dte7 = strtotime("+63 day");
$dated8= date("l F j, Y", $dte7);
$dte8 = strtotime("+73 day");
$dated9= date("l F j, Y", $dte8);
$dte9 = strtotime("+80 day");
$dated10= date("l F j, Y", $dte9);
$dte10 = strtotime("+110 day");
$dated11= date("l F j, Y", $dte10);

//$domain="try.com";
//$business="Try Enterprises";
?>
		
	
		
		
   ?>
   <!-- PAGE FUNCTION STARTS (c) i2d Technologies Website Engine -->


									
  	
  <div id="page-right-content">

                    <div class="container">
                        <div class="row">
                            <div class="col-sm-12">
							<p>&nbsp;</p>
<p>&nbsp;</p>

																				                                <h4 class="header-title">Timeline for <?php echo $domain ?></h4>
																											<h5><?php echo $business ?></h5>
      


	  </div>
                        </div> <!-- end row -->
<div class="row">
                            <div class="col-sm-12">
							
                             <?php 
							 
							 $start=array(
							 'heading'=>'Take First Step & Register .com',
							 'date'=>$dated1,
							 'left'=>0,
							 'class'=>'btn-success',
							 'description'=>$business.' : purchase the i2d Prohost 1 GB plan for <strong>'.$domain.'</strong> with Invocie via Cash / online.',
							 );
							 echo timeline($start) ;
							 
							 $live=array(
							 'heading'=>'Server Setup Completes in 1-2 Hours',
							 'date'=>$dated1,
							 'left'=>1,
							 'class'=>'btn-primary',
							 'description'=>'<strong>'.$domain.'</strong> is <strong>Live</strong> and Accessible <strong>with a COMING SOON PAGE</strong>',
							 );
							 echo timeline($live) ; 
							 
							 
							 $storage=array(
							 'heading'=>'Web Space Integrates with all ISPs / Cell Companies',
							 'date'=>$dated2,
							 'left'=>0,
							 'class'=>'btn-warning',
							 'description'=>'<strong>'.$domain.'</strong> is ready for File Storage and Uploads',
							 );
							 echo timeline($storage) ; 
							 
							 $data=array(
							 'heading'=>'i2d Blue Proposal & Data Gathering',
							 'date'=>$dated4,
							 'left'=>1,
							 'class'=>'btn-primary',
							 'description'=>'Check i2d Blue Data / Requirements with '.$business,
							 );
							 echo timeline($data) ; 
							 
							 $inv1=array(
							 'heading'=>'i2d Blue 70% Downpayment Invoice Payment',
							 'date'=>$dated5,
							 'left'=>0,
							 'class'=>'btn-danger',
							 'description'=>$business.' : Pays the Downpayment / Advance Invoice for the i2d Blue Project',
							 );
							 echo timeline($inv1) ; 
							 
							 $support=array(
							 'heading'=>'i2d Blue Project Starts',
							 'date'=>$dated6,
							 'left'=>1,
							 'class'=>'btn-success',
							 'description'=>'<strong>'.$domain.'</strong> i2d Blue Website data is emailed to <strong>support@i2dtechnologies.com</strong> for project start.',
							 );
							 echo timeline($support) ; 
							 
							 $project_check_staff=array(
							 'heading'=>'i2d Blue Project is Uploaded for Error Checking by i2d staff',
							 'date'=>$dated7,
							 'left'=>0,
							 'class'=>'btn-danger',
							 'description'=>'<strong>'.$domain.'</strong> i2d Blue Website is <strong>LIVE</strong> for error / corrections checking by i2d Staff.',
							 );
							 echo timeline($project_check_staff) ; 
							 
							 $project_check_client=array(
							 'heading'=>'i2d Blue Project is Uploaded for Error Checking by : '.$business,
							 'date'=>$dated8,
							 'left'=>0,
							 'class'=>'btn-primary',
							 'description'=>'<strong>'.$domain.'</strong> i2d Blue Website is <strong>LIVE</strong> for checking by : '.$business,
							 );
							 echo timeline($project_check_client) ; 
							 
							 $project_check_feedback=array(
							 'heading'=>'i2d Blue Project is minor Edited / Altered as per : '.$business.' requirements',
							 'date'=>$dated9,
							 'left'=>1,
							 'class'=>'btn-danger',
							 'description'=>'<strong>'.$domain.'</strong> i2d Blue Website is <strong>minor Modified / Edited</strong> as per requirements of : '.$business,
							 );
							 echo timeline($project_check_feedback) ; 
							 
							 $project_check_client2=array(
							 'heading'=>'i2d Blue Project is Uploaded for <strong>Again</strong> Checking by : '.$business,
							 'date'=>$dated10,
							 'left'=>0,
							 'class'=>'btn-warning',
							 'description'=>'<strong>'.$domain.'</strong> i2d Blue Website is <strong>LIVE</strong> for <strong>AGAIN</strong> checking by : '.$business,
							 );
							 echo timeline($project_check_client2) ; 
							 
							 $inv2=array(
							 'heading'=>'i2d Blue 30% Balance Invoice Payment',
							 'date'=>$dated11,
							 'left'=>1,
							 'class'=>'btn-success',
							 'description'=>$business.' : Pays the Balance / Pending Invoice for the i2d Blue Project',
							 );
							 echo timeline($inv2) ; 
							 
							 $done=array(
							 'heading'=>'i2d Blue Project Completed / Closed',
							 'date'=>$dated11,
							 'left'=>0,
							 'class'=>'btn-danger',
							 'description'=>$domain.' : i2d Blue Project Completes & is Closed',
							 );
							 echo timeline($done) ; 
							 
							 
							 ?>   
                            </div>
                        </div>
                        <!-- end row -->       
   <div class="text-center">
	  <button type="button" class="btn btn-success m-t-10" onclick="history.go(-1);">Close View</button>
      
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
	  <p>&nbsp;</p>
   </div>
 
</div>


 <!-- PAGE FUNCTION ENDS (c) i2d Technologies Website Engine --> 
 
<?php   
}
}
//////////////////////////// HTML FUNCTION ENDS (c) i2d Technologies ///////////////////////////////////////

?>