<?php
//important================================
include "tab_pricing_config_form.php"; //important
//important================================



//============================================FORM SUBMITTED======================================================
if ($_SERVER[REQUEST_METHOD] == 'POST') {
$error_msg="";
$password_confirmation=false;
$password_temp="";

	for($i=1;$i<=count($form_field);$i++)
	{


		if($form_field_type[$i]=="DROPDOWN")
		{

			if($form_field_checking[$i]=="COMPULSORY")
			{
				if($_REQUEST[$form_field[$i]]=="0")
					{
						$error_msg=$error_msg."<li>".$form_field_label[$i]."</li>";
						$form_field_class[$i]=$form_field_class[$i]."_error";
					}
			}

		}
		elseif($form_field_type[$i]=="QUANTITY")
		{
			if(($form_field_checking[$i]=="COMPULSORY")and($_REQUEST[$form_field[$i]]==""))
			{
				$error_msg=$error_msg."<li>".$form_field_label[$i]."</li>";
				$form_field_class[$i]=$form_field_class[$i]."_error";

			}
			else
			{
				if(!is_numeric($_REQUEST[$form_field[$i]]))
				{
					$error_msg=$error_msg."<li>".$form_field_label[$i]." must be number value only.</li>";
					$form_field_class[$i]=$form_field_class[$i]."_error";
				}
				else
				{
					if(stripos($_REQUEST[$form_field[$i]],'.'))
					{
					 	$error_msg=$error_msg."<li>".$form_field_label[$i]." must be integer value only.</li>";
						$form_field_class[$i]=$form_field_class[$i]."_error";
					}
				}


			}


		}
		elseif($form_field_type[$i]=="PRICE")
		{
			if(($form_field_checking[$i]=="COMPULSORY")and($_REQUEST[$form_field[$i]]==""))
			{
				$error_msg=$error_msg."<li>".$form_field_label[$i]."</li>";
				$form_field_class[$i]=$form_field_class[$i]."_error";

			}
			else
			{
				if(!is_numeric($_REQUEST[$form_field[$i]]))
				{

					$error_msg=$error_msg."<li>".$form_field_label[$i]." must be numeric value only.</li>";
					$form_field_class[$i]=$form_field_class[$i]."_error";
				}


			}


		}
		else
		{
			if($form_field_checking[$i]=="COMPULSORY")
			{
				if($_REQUEST[$form_field[$i]]=="")
					{
						$error_msg=$error_msg."<li>".$form_field_label[$i]."</li>";
						$form_field_class[$i]=$form_field_class[$i]."_error";
					}
			}


		}


		if($form_field_checking[$i]=="PASSWORD1")
		{
			if($_REQUEST[$form_field[$i]]=="")
				{

				}
			else
				{
					$password_temp=$_REQUEST[$form_field[$i]];
				}
		}

		if($form_field_checking[$i]=="PASSWORD2")
		{
			if($_REQUEST[$form_field[$i]]=="")
				{
					if($password_temp!="")
					{
						$error_msg=$error_msg."<li>Password confirmation</li>";
						$form_field_class[$i]=$form_field_class[$i]."_error";
					}
				}
			else
				{
				 	if($password_temp=="")
				 	{
						$error_msg=$error_msg."<li>Password</li>";
						$form_field_class[$i-1]=$form_field_class[$i-1]."_error";
					}
					else
					{
						if($password_temp!=$_REQUEST[$form_field[$i]])
					 	{
							$error_msg=$error_msg."<li>Password Confirmation Not Match</li>";
							$form_field_class[$i]=$form_field_class[$i]."_error";
							$form_field_class[$i-1]=$form_field_class[$i-1]."_error";
						}
					}


				}
		}
	}


	//check if the session date is within the event main date:
	if(($_REQUEST["eos_date"]>=$line_tab_main["evt_start_date"])and($_REQUEST["ses_date"]<=$line_tab_main["evt_end_date"]))
	{
		
	
	}
	else {
		//$error_msg=$error_msg."<li>Your outsource date must be within the main event date range. (".$line_tab_main["evt_start_date"]." to ".$line_tab_main["evt_end_date"].")</li>";
	}
	


	if($error_msg=="")
		{

		if($_REQUEST[$form_key_id]=="")
			{
			  	$query="";
				$query=$query."INSERT INTO $form_table_name(";
				for($i=1;$i<=count($form_field);$i++)
				{

				 	if($form_field_type[$i]=="PASSWORD")
				 	{
				 	 	if(($form_field_checking[$i]=="PASSWORD1")&&($_REQUEST[$form_field[$i]]!=""))
				 	 	{
							$query=$query."".$form_field[$i].",";
						}
					}
					elseif($form_field_type[$i]!="FILE_PHOTO")
					{

					 	if($form_field_type[$i]=="DATE")
						{

						 	if($_REQUEST[$form_field[$i]]=="")
						 	{
							//	$query=$query."".$form_field[$i].",";
							}
						 	else
						 	{
								$query=$query."".$form_field[$i].",";
							}

					 	}
					 	else
					 	{
						  $query=$query."".$form_field[$i].",";

						}


					}

				}

				if($_REQUEST["relationkey"]!="")
				{
					$query=$query." ".$header_save_field.",";
				}

				$query=$query."".$tab_module_link_field[$tab_selected].",";
				$query=$query."created_by,";
				$query=$query."modified_by,";
				$query=$query."created_date,";
				$query=$query."modified_date";
				$query=$query.")VALUES(";
				for($i=1;$i<=count($form_field);$i++)
				{
				 	if($form_field_type[$i]=="PASSWORD")
				 	{
				 	 	if(($form_field_checking[$i]=="PASSWORD1")&&($_REQUEST[$form_field[$i]]!=""))
				 	 	{

							$query=$query."'".md5($_REQUEST[$form_field[$i]])."',";
						}
					}
					elseif($form_field_type[$i]!="FILE_PHOTO")
					{
					 	if($form_field_type[$i]=="DATE")
						{

						 	if($_REQUEST[$form_field[$i]]=="")
						 	{
							//	$query=$query."'".($_REQUEST[$form_field[$i]])."',";
							}
						 	else
						 	{
								$query=$query."'".toMySQLString($_REQUEST[$form_field[$i]])."',";
							}

					 	}
						elseif($form_field_type[$i]=="TIME")
						{
							$query=$query."'".toMySQLTime($_REQUEST[$form_field[$i]])."',";
						}
					 	else
					 	{
						  $query=$query."'".toMySQLString($_REQUEST[$form_field[$i]])."',";

						}

					}

				}

				if($_REQUEST["relationkey"]!="")
				{
					$query=$query." '".$_REQUEST["relationkey"]."',";
				}

				$query=$query."'".$_REQUEST[$tab_key_id]."',";
				$query=$query."'".$CurrentUserID."',";
				$query=$query."'".$CurrentUserID."',";
				$query=$query."'".date("Y-m-d H:i:s")."',";
				$query=$query."'".date("Y-m-d H:i:s")."'";
				$query=$query.");";
				//echo $query;

				$result = mysqli_query($dbconn,$query) or die("Creation failed- Err msg  ". mysqli_error($dbconn));
				$_REQUEST[$form_key_id]=mysqli_insert_id($dbconn);
				$_REQUEST["action"]="EDIT";
	    		$message_type="CREATED";//to be shown at bottom
	    		mon_log_audit($CurrentUserFullName,$CurrentUserID,$form_key_id,$_REQUEST[$form_key_id],$message_type);


			}
		else
			{
			  	$query="";
			  	$query=$query."UPDATE $form_table_name SET ";

				for($i=1;$i<=count($form_field);$i++)
				{

				 	if($form_field_type[$i]=="PASSWORD")
				 	{
				 	 	if(($form_field_checking[$i]=="PASSWORD1")&&($_REQUEST[$form_field[$i]]!=""))
				 	 	{
							$query=$query."".$form_field[$i]."='".md5($_REQUEST[$form_field[$i]])."',";
						}
					}
					elseif($form_field_type[$i]!="FILE_PHOTO")
					{

						if($form_field_type[$i]=="DATE")
						{

						 	if($_REQUEST[$form_field[$i]]=="")
						 	{
							//	$query=$query."'".($_REQUEST[$form_field[$i]])."',";
							}
						 	else
						 	{
								$query=$query."".$form_field[$i]."='".toMySQLString($_REQUEST[$form_field[$i]])."',";
							}

					 	}
						elseif($form_field_type[$i]=="TIME")
						{
							$query=$query."".$form_field[$i]."='".toMySQLTime($_REQUEST[$form_field[$i]])."',";
						}
					 	else
					 	{
						  $query=$query."".$form_field[$i]."='".toMySQLString($_REQUEST[$form_field[$i]])."',";

						}
					}

				}
				if($_REQUEST["relationkey"]!="")
				{
					$query=$query." ".$header_save_field."='".$_REQUEST["relationkey"]."',";
				}
				$query=$query."modified_by='".$CurrentUserID."',";
				$query=$query."MODIFIED_DATE='".date("Y-m-d H:i:s")."' ";
				$query=$query."WHERE $form_key_id=".$_REQUEST[$form_key_id];
				$query=$query." AND ".$tab_module_link_field[$tab_selected]." = '".$_REQUEST[$tab_key_id]."' ";
				$query=$query.";";


				$result = mysqli_query($dbconn,$query) or die("Saving failed- Err msg  ". mysqli_error($dbconn).$query);

				$message_type="UPDATED";//to be shown at bottom
	    		mon_log_audit($CurrentUserName,$CurrentUserID,$form_key_id,$_REQUEST[$form_key_id],$message_type);


			}



			

	    }
    else
	    {
	      	$message_type="FAIL";//to be shown at bottom
		}

			for($i=1;$i<=count($form_field);$i++)
			{
			 	if($form_field_type[$i]=="PASSWORD")
				{
				 $form_field_value[$i]="";
				}
				else
				{
				 $form_field_value[$i]=$_REQUEST[$form_field[$i]];
				}

			}

}
?>




<?php
//=====================SYSTEM Script(DO NOT CHANGE): DELETION=======================================================
	if(($_REQUEST[$form_key_id]!="")and($_REQUEST["action"]== 'DELETE'))
	  	{
	  	  		$query="";
			  	$query=$query."DELETE from $form_table_name ";
				$query=$query."WHERE $form_key_id =".$_REQUEST[$form_key_id].";";
				$result = mysqli_query($dbconn,$query) or die("Deletion failed- Err msg  ". mysqli_error($dbconn));
	  	 		$message_type="DELETED";//to be shown at bottom
	  	}
//=====================END of SYSTEM Script(DO NOT CHANGE): DELETION=======================================================
?>









<?php
//==================================GET THE LISTING=======================================================




	if($_REQUEST["view_mode"]=="A")
		{
		 	$_SESSION["view_mode"]="LIST";
		}
	if($_REQUEST["view_mode"]=="B")
		{
		 	$_SESSION["view_mode"]="THUMBNAIL";
		 	$_SESSION["view_mode_row_cells"]=5;
		}
	if($_REQUEST["view_mode"]=="C")
		{
		 	$_SESSION["view_mode"]="THUMBNAIL";
		 	$_SESSION["view_mode_row_cells"]=2;
		}
	if($_SESSION["view_mode"]=="")
		{
			$cell_mode="LIST";//default

		}
	else
		{
			$cell_mode=$_SESSION["view_mode"];
		}

	if($_SESSION["view_mode_row_cells"]=="")
		{
			$cell_per_row=5;//default
		}
	else
		{
		 	$cell_per_row=$_SESSION["view_mode_row_cells"];
		}




//important================================
include "tab_pricing_config_view.php";
//important================================
?>



<?php
	//=======================SYSTEM Script(DO NOT CHANGE)====================
		//-------------------Headear START-----------------------

if($header_table_name!="")
{

echo "<table align='center' cellspacing=0 cellpadding='5' border='0' class='header_info_table' >";


	$query_header="SELECT * FROM $header_table_name ";
	$query_header=$query_header." WHERE $header_table_key_id = '".$_REQUEST["relationkey"]."';";
	$result_header=mysqli_query($dbconn,$query_header)or die("Get Data failed- Err msg  ". mysqli_error($dbconn));
	if($line_header=mysqli_fetch_array($result_header,MYSQLI_ASSOC))
	  	{
			for($i=1;$i<=count($header_field);$i++)
			{
				echo "<tr class='header_info_tr' >";
				echo "<td class='header_info_cell' width=30%>";
				echo "<b>".$header_label[$i]."</b></td><td class='header_info_cell' >: ".$line_header[$header_field[$i]];
				echo "</td>";
				echo "</tr>";
			}
		}
$relation_url="&relationkey=".$_REQUEST["relationkey"]."";

echo "</table>";
echo "<br>";
}



		//-------------------Headear END-----------------------
	//=======================SYSTEM Script(DO NOT CHANGE)====================
?>



<?php
	//=======================SYSTEM Script(DO NOT CHANGE)====================
	if ($_REQUEST["offset"]=="")
		{ $offset = 0;}
	else
		{ $offset=$_REQUEST["offset"]; }



	if ($_REQUEST["order_by"]=="")
		{

		$sql_order_by=" order by created_date desc  ";
		//$order_by=1;
		}
	else
		{
		 $sql_order_by=" order by ".$listing_content[$_REQUEST["order_by"]]." ";
		 $order_by=$_REQUEST["order_by"];
		}

	if ($_REQUEST["sort_by"]=="")
		{ $sql_sort_by = " ";}
	else
		{
		 $sql_sort_by=" desc ";
		 $sort_by=$_REQUEST["sort_by"];
		 }





    /*

	if ($_REQUEST["search_word"]=="")
		{
		$search_word = "";
		if($header_table_name!="")
			{
				$sql_search=" AND ".$header_save_field."='".$_REQUEST["relationkey"]."' ";
			}
		}
	else
		{
		$sql_search=" AND ".$listing_content[$_REQUEST["search_field"]]." like '%".$_REQUEST["search_word"]."%' ";
		if($header_table_name!="")
			{
				$sql_search=$sql_search." AND ".$header_save_field."='".$_REQUEST["relationkey"]."' ";
			}

		$search_word = $_REQUEST["search_word"];
		}
	*/


    if ($_REQUEST["search_word"]=="")
		{
			$search_word = "";
			//$sql_search=" WHERE xxx=xxx ";

		}
	else
		{
			$search_word = $_REQUEST["search_word"];
			$sql_search="";
			if(isset($listing_search_field))
			{
				foreach($listing_search_field as $field_to_search)
				{

					if($sql_search=="")
					{
						$sql_search="  ".$field_to_search." like '%".$_REQUEST["search_word"]."%' ";
					}
					else
					{
						$sql_search=$sql_search." OR  ".$field_to_search." like '%".$_REQUEST["search_word"]."%' ";
					}



				}
			}


			if($field_to_search!="")
			{
				$sql_search	= " AND ( ".$sql_search." ) ";
			}




		}




	$query=$query.$sql_search;
	$query=$query.$sql_order_by." ".$sql_sort_by."  ";
    $display_limit = " LIMIT " . $offset . "," . $limit.";";

	$extraurl=$relation_url."&order_by=".$order_by."&sort_by=".$sort_by."&search_word=".$search_word."&search_field=".$_REQUEST["search_field"].$tab_extra_url;
    $extraurl=$relation_url."&order_by=".$order_by."&sort_by=".$sort_by.$tab_extra_url;


	$result = mysqli_query($dbconn,$query." ".$display_limit) or die("Listing failed- Err msg  ". mysqli_error($dbconn).$query);
	$num_rows = mysqli_num_rows($result);


	echo "<section class='view_toolbar'>";

		echo "<div class='view_toolbar_search_field'>";

			//----search panel and navigation-----------------

			//echo "<input type='text' class='textbox textbox-full' name=view_search id='search_word_".$form_key_id."_".$_REQUEST[$form_key_id]."' value='".$search_word."'> ";

            /*
			echo "<select id='search_field_".$form_key_id."_".$_REQUEST[$form_key_id]."' class='dropdown dropdown-auto'>";
			for($i=1;$i<=count($listing_search_label);$i++)
			{
			 	if($_REQUEST["search_field"]==$i)
			 	{echo "<option value='$i' selected>".$listing_search_label[$i]."</option>";}
			 	else
			 	{echo "<option value='$i' >".$listing_search_label[$i]."</option>";}

			}

			echo "</select> ";

            */

        echo "</div>";


		echo "<div class='view_toolbar_search_button'>";


			/*
            	echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_send_get('$this_url','?offset=0".$extraurl."&search_word='+document.getElementById('search_word_".$form_key_id."_".$_REQUEST[$form_key_id]."').value,'div_main')\">";
				echo '<i class="fa fa-square fa-stack-2x color_blue"  ></i><i class="fa fa-search fa-stack-1x color_white" ></i>';
			echo "</div>";

			echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_send_get('".$this_url."','?offset=0".$extraurl."','div_main')\">";
				echo '<i class="fa fa-square fa-stack-2x color_grey"  ></i><i class="fa fa-bars fa-stack-1x color_white" ></i>';
			echo "</div>";
				*/


		echo "</div>";
		echo "<div class='view_toolbar_action_button'>";

                if($action_cell)
                {
                    if(isset($action_button))
                    {
                        foreach($action_button as $actbtton_id=>$action_button_name)
                        {
                            echo "<input type=button  value='".$action_button_name."' class=button onclick=\"mon_send_get('$this_url','?offset=0".$extraurl."&search_word='+document.getElementById('search_word_".$form_key_id."_".$_REQUEST[$form_key_id]."').value+'&search_field='+document.getElementById('search_field_".$form_key_id."_".$_REQUEST[$form_key_id]."').value+'&action=ACTION".$actbtton_id."&ids='+document.getElementById('id_checbox_list_".$form_key_id."_".$_REQUEST[$form_key_id]."').value,'div_main')\"> ";

                        }
                    }



                echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_next_focus_field='id_".$form_field[1]."';mon_send_get('".$this_url."','?action=NEW&offset=".$offset.$relation_url.$tab_extra_url."','div_main')\">";
					echo '<i class="fa fa-square fa-stack-2x color_green"  ></i><i class="fa fa-plus fa-stack-1x color_white" ></i>';
				echo "</div>";


                }
		echo "</div>";


	echo "</section>";




	if($message_type=="DELETED"){
		displaymessage("Item has been deleted!",$message_type);
	}




?>


<?php

	//=================SYSTEM Script(DO NOT CHANGE):Open New Form Panel=====================
	if(($_REQUEST["action"]=="NEW")and($message_type!="CREATED"))
	{


		if($message_type=="CREATED"){
		  	displaymessage("Information has been created as at ".date("g:i:s a"),$message_type);
		}
		if($message_type=="UPDATED"){
		  	displaymessage("Information has been updated as at ".date("g:i:s a"),$message_type);
		}
		if($message_type=="FAIL"){
		  	displaymessage($error_msg,$message_type);
		}

		include "tab_pricing_form.php";

	}

	//===================End of SYSTEM Script(DO NOT CHANGE):Open Form Panel=================
?>




<?php

	//---------EDIT Panel (DO NOT CHANGE)---------------------------
	if(($_REQUEST[$form_key_id]!="")and($_REQUEST["action"]== 'EDIT'))
	  		{

	  		 	$query_get="SELECT * FROM $form_table_name ";
	  		 	$query_get=$query_get." WHERE $form_key_id = '".$_REQUEST[$form_key_id]."';";
	  		 	$result_get=mysqli_query($dbconn,$query_get)or die("Get Data failed- Err msg  ". mysqli_error($dbconn));

	  		 	if($line_get=mysqli_fetch_array($result_get,MYSQLI_ASSOC))
	  		 	{

					for($i=1;$i<=count($form_field);$i++)
						{

						 	if($form_field_type[$i]=="PASSWORD")
							{
							 	$form_field_value[$i]="";
							}
							elseif($form_field_type[$i]=="TIME")
							{
								$form_field_value[$i]=toDisplayTime($line_get[$form_field[$i]]);
							}
							else
							{
							 	$form_field_value[$i]=$line_get[$form_field[$i]];
							}


						}

				}





				if($message_type=="CREATED"){
				  	displaymessage("Information has been created as at ".date("g:i:s a"),$message_type);
				}
				if($message_type=="UPDATED"){
				  	displaymessage("Information has been updated as at ".date("g:i:s a"),$message_type);
				}
				if($message_type=="FAIL"){
				  	displaymessage($error_msg,$message_type);
				  		for($i=1;$i<=count($form_field);$i++)
						{
						 	if($form_field_type[$i]=="PASSWORD")
							{
							 $form_field_value[$i]="";
							}
							else
							{
							 $form_field_value[$i]=$_REQUEST[$form_field[$i]];
							}

						}
				}


			include "tab_pricing_form.php";

			}

?>






<?php
//====================SYSTEM Script(DO NOT CHANGE):View Start==============================

	echo "<section class='view_content'>";


            //==================================first row=============================================================
				echo "<div class='view_list_title_row'>";

					echo "<div class='view_list_title_content'>";
						echo "<div style='min-width:20px;' class='view_list_title_row_count'  >";
							echo "#";
						echo "</div>";


						for($i=1;$i<=count($listing_header);$i++)
						{
							if($listing_content[$i]=="modified_date")
							{

							}
							else
							{
								echo "<div style='width:".$listing_width[$i]."px;' class='view_list_title_content_object'  >";
									echo "".$listing_header[$i]."<br>";
								echo "</div>";
							}

						}

					echo "</div>";


					if($action_cell)
					{
						echo "<div class='view_list_title_content'>";
						echo "</div>";
					}

				echo "</div>";





		$count=$offset;
		while($line=mysqli_fetch_array($result,MYSQLI_ASSOC))
			{



				$count=$count+1;
				if($_REQUEST[$form_key_id]==$line[$form_key_id])
				{
					echo "<div class='view_row'>";
				}
				else
				{
					echo "<div class='view_row'>";
				}




				//======================================================================================


			echo "<div class='view_row_content'>";


					echo "<div style='min-width:20px;' class='view_row_count'  >";
					echo "".$count."";
					echo "</div>";


					for($i=1;$i<=count($listing_header);$i++)
					{

						/*
						if($form_field_type[$i]=="FILE_PHOTO")
								{

									$query_file="select fil_id, fil_storage_method from t_".$key_table_prefix."_file
												where fil_mod='".$form_key_id."'
												and fil_mod_id='".$line[$form_key_id]."'
												and fil_mod_field='".$form_field[$i]."'
												";

									$result_file=mysqli_query($dbconn,$query_file) or die("Retrieval failed- Err msg  ". mysqli_error($dbconn));
									if($line_file=mysqli_fetch_array($result_file,MYSQLI_ASSOC))
									{

										 if($line_file["fil_storage_method"]=="OS")
											{
										    echo "<img  class='thumbnail_img' src='".$file_storage_folder.$line_file["fil_id"].".jpg' onclick=\"mon_send_get('$display_url','?$form_key_id=".$line[$form_key_id]."','div_display')\" >";
											}
										 else
											{
											echo "<img  class='thumbnail_img' src='mod/uploader/file.php?id=".$line_file["fil_id"]."' onclick=\"mon_send_get('$display_url','?$form_key_id=".$line[$form_key_id]."','div_display')\" >";
											}
									$photo_showed=true;
									}

								}//end display photo


							*/






						if($listing_content[$i]=="modified_date")
						{

						}
						else
						{
							echo "<div style='width:".$listing_width[$i]."px;' class='view_row_content_object'  >";
							echo "<font class='view_row_content_label'>".$listing_header[$i]."</font>";





								echo "<font class='view_row_content_text'>";
									$this_text=$line[$listing_content[$i]];
									$this_text=str_replace(chr(10),"<br>",$this_text);
									$this_text = str_replace($search_word, "<span class='view_search_hightlight' >".$search_word."</span>", $this_text);

									if($listing_content[$i]=="ses_start_time")
									{
										echo "".toDisplayTime($this_text)."";
									}	
									else {
										echo "".$this_text."";
									}
										


									

								echo "</font><br>";

							echo "</div>";
						}



					}



				echo "</div>";

				//======================================================================================

				if($action_cell)
					{
						echo "<div class='view_row_button'>";


						if($action_cell_edit)
						{

							echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_send_get('$display_url','?$form_key_id=".$line[$form_key_id]."','div_display')\" >";
								echo '<i class="fa fa-square fa-stack-2x color_blue"  ></i><i class="fa fa-eye fa-stack-1x color_white" ></i>';
							echo "</div>";


							echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_next_focus_field='id_".$form_field[1]."';mon_send_get('$this_url','?$form_key_id=".$line[$form_key_id]."&action=EDIT&offset=".$offset.$extraurl."','div_main')\" >";
								echo '<i class="fa fa-square fa-stack-2x color_grey"  ></i><i class="fa fa-pencil fa-stack-1x color_white" ></i>';
							echo "</div>";


						}

						if($action_cell_delete)
						{

                            echo "<div class='fa-stack fa-lg'  style='cursor:pointer;' onclick=\"mon_delete_item('$this_url','?$form_key_id=".$line[$form_key_id]."&action=DELETE&offset=".$offset.$extraurl."','div_main');\" >";
								echo '<i class="fa fa-square fa-stack-2x color_red"  ></i><i class="fa fa-trash-o fa-stack-1x color_white" ></i>';
							echo "</div>";


						}


						for($i=1;$i<=count($sub_item_url);$i++)
						{

							echo "<button class='button_blue' value='".$sub_item_label[$i]."'  onclick=\"mon_add_tab('".$line[$sub_item_label_dymamic_field[$i]]."','".$sub_item_url[$i]."','?".$sub_item_key[$i]."=".$line[$sub_item_key[$i]]."');\" >";
							echo "<span class='fa fa-trash-o fa-1x'></span> ".$sub_item_label[$i]."</button>";


						}

						echo "<input type=checkbox name='' id='id_chckbox_".$count."' value='' onclick=\"if(this.checked){document.getElementById('id_checbox_list_".$form_key_id."_".$_REQUEST[$form_key_id]."').value=document.getElementById('id_checbox_list_".$form_key_id."_".$_REQUEST[$form_key_id]."').value+',".$line[$form_key_id]."'}else{document.getElementById('id_checbox_list_".$form_key_id."_".$_REQUEST[$form_key_id]."').value=document.getElementById('id_checbox_list_".$form_key_id."_".$_REQUEST[$form_key_id]."').value.replace(/,".$line[$form_key_id]."/,'')}\">";



						echo "<br>";

						echo "<font class='view_row_button_info'>";
							echo "<span class='fa fa-calendar'></span> ".$line["modified_date_f"]." ";
							//echo "<span class='fa fa-male'></span> <i>Cre: ".mon_get_userfullname($line["created_by"])."</i><br>";
							echo "<span class='fa fa-male'></span> ".mon_get_userfullname($line["modified_by"])."";
						echo "</font>";


						echo "</div>";
					}




				echo "</div>";


			}




	echo "</section>";

		if($count>0)
		{
			recordsetNav($query, $this_url, $offset, $limit, $tablewidth='100%', $verbiage=1, $displaytotal=1, $extraurl, $blocksize=10);
		}
		else
		{
		 	echo "<font color=#cccccc >No Record</font>";

		}

		//====================End of SYSTEM Script(DO NOT CHANGE):View Start==============================
?>
