
<?php 
/*if($_SESSION["login"]!="True")
{
	header('Location:./index.php');
}*/




/*if($_SESSION["login"]!="True")
{
	header('Location:./index.php');
}*/

	

						 
	require_once("config.inc.php");
	require_once("DBConnector1.php");
						
	$sql = "delete FROM TMP_EDU_FILTER";
	$db = new DBConnector();
	$result =$db->RunQuery($sql);
						
	$sql = "delete FROM	TMP_QUALI_FILTER";
	$db = new DBConnector();
	$result =$db->RunQuery($sql);
?>	

						 
	



<link rel="stylesheet" href="css/table_min.css" type="text/css"/>	
<link rel="stylesheet" type="text/css" media="all" href="css/jsDatePick_ltr.min.css" />
<script type="text/javascript" src="js/jsDatePick.min.1.3.js"></script>

<script language="javascript" type="text/javascript">
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>

<script type="text/javascript">
function openWin()
{
myWindow=window.open('serach_inv.php','','width=200,height=100');
myWindow.focus();

}
</script>

<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"dte_dor",
			dateFormat:"%Y-%m-%d"
			/*selectedDate:{				This is an example of what the full configuration offers.
				day:5,						For full documentation about these settings please see the full version of the code.
				month:9,
				year:2006
			},
			yearsRange:[1978,2020],
			limitToToday:false,
			cellColorScheme:"beige",
			dateFormat:"%m-%d-%Y",
			imgPath:"img/",
			weekStartDay:1*/
		});
	};
</script>

</label>
          
<fieldset>
                                                	<legend>
  <div class="text_forheader"></div>
                                               	 </legend>             

<form name="form1" id="form1">            
  <table width="100%" border="1" cellpadding="0" cellspacing="0"  class=\"form-matrix-table\">
  <tr>
    <td width="20%"><span class="style1">
      <input type="text"  class="label_purchase" value="1" disabled="disabled" align="middle"/>
    </span></td>
    <td width="20%"><span class="style1">
      <input type="text"  class="label_purchase" value="2" disabled="disabled" align="middle"/>
    </span></td>
    <td width="23%"><span class="style1">
      <input type="text"  class="label_purchase" value="3" disabled="disabled" align="middle"/>
    </span></td>
    <td width="20%"><span class="style1">
      <input type="text"  class="label_purchase" value="4" disabled="disabled" align="middle"/>
    </span></td>
    <td width="20%"><span class="style1">
      <input type="text"  class="label_purchase" value="5" disabled="disabled" align="middle" />
    </span></td>
  </tr>
  <?php
  include('connectioni.php');
  
  $i=1;
  while ($i<50){
  	echo "<tr>";
  	$j=1;
	while ($j<6){ 	
		
		$cell_content="";
		
		$sql="select * from acc_text where mrow=".$i." and mcol=".$j."";
		$result=mysqli_query($GLOBALS['dbacc'],$sql);
		if($row = mysqli_fetch_array($result)){
			$cell_content = $row["description"];
		}	
		
		$sql="select * from acc_account where mrow=".$i." and mcol=".$j."";
		$result=mysqli_query($GLOBALS['dbacc'],$sql);
		while($row = mysqli_fetch_array($result)){
			$cell_content .= $row["acc_code"]." / ";
		}	
		
		$sql="select * from acc_cel_cal where mrow=".$i." and mcol=".$j."";
		$result=mysqli_query($GLOBALS['dbacc'],$sql);
		if($row = mysqli_fetch_array($result)){
			if (trim($row["opr"])=="+"){
			
				$cell_content="SUM(".$row["mrow1"].", ".$row["mcol1"]." : ".$row["mrow2"].", ".$row["mcol2"].")";
			} else {
				$cell_content="(".$row["mrow1"].", ".$row["mcol1"].") - (".$row["mrow2"].", ".$row["mcol2"].")";
			}
			
		}	
		
		if ($cell_content==""){
			$cell_content="&nbsp;";
		}
		
    		echo "<td width=\"20%\" ><div id=\"td_".$i."_".$j."\"  onclick=\"view_frame($i, $j);\">".$cell_content."</div>";
      		//<input type=\"text\"  class=\"text_purchase3\" name=\"c".$i."_".$j."\"/>
    	echo "</td>";
		$j=$j+1;	
	}		
	echo "</tr>";
    $i=$i+1;	
  }	
  
  
 /* 	while ($i<50){
  	
 		
		echo " <tr>";
		
		$j=1;
		while ($j<6){	
    		echo "<td><a onClick=\"NewWindow('search_ledger_acc_final.php','mywin','800','700','yes','center');return false\" onFocus=\"this.blur()\"><input type=\"button\" name=\"searchacc_".$i."_".$j."\" id=\"searchacc_".$i."_".$j."\" value=\"Acc\" class=\"btn_purchase\" /></a><input type=\"text\" name=\"cell_".$i."_".$j."\" id=\"cell_".$i."_".$j."\" value=\"\" class=\"text_purchase2\" /><input type=\"button\" name=\"searchcal_".$i."_".$j."\" id=\"searchcal_".$i."_".$j."\" value=\"Cal\" class=\"btn_purchase\" /></td>";
			$j=$j+1;
		}
		
		echo "</tr>";
		$i=$i+1;
	}	*/	
	 
  
  ?>  
  </table>

  
  <br/>   
  <div id="set_acc_frame" style="left:35px; top:170px; position:absolute; background-color:#999; padding:10px; width: 546px; height: 532px;"> 
    <p><a onClick="NewWindow('search_ledger_acc_final.php','mywin','800','700','yes','center');return false" onFocus="this.blur()"></a>
      <input type="radio" name="radio" id="descr" value="radio" checked="checked" onclick="dis_val();" />
      Text <br />
      <input type="radio" name="radio" id="coll_acc" value="radio" onclick="dis_val();"/>
      Collection Of Accounts Values<br />
      <input type="radio" name="radio" id="calc_cell_r" value="radio" onclick="dis_val();"/>
      Calculation Of Cell
      </p>
    <p><a onclick="NewWindow('search_ledger_acc_final.php','mywin','800','700','yes','center');return false" onfocus="this.blur()"></a>
      <input type="text" name="sheet_desc" id="sheet_desc" size="50" />
      </p>
    <p><a onclick="NewWindow('search_ledger_acc_final.php?stname=final_acc','mywin','800','700','yes','center');return false" onfocus="this.blur()">
      <input type="button" name="searchacc" id="searchacc" value="Sel Acc" class="btn_purchase" />
      </a>
      <input type="button" name="viewacc" id="viewacc" value="View Acc" class="btn_purchase" onclick="save_mettrix();"/>
    <div id="calc_cell">Row1 <input type="text" name="row1" id="row1" size="5" /> 
      Col1 
        <input type="text" name="col1" id="col1" size="5" />
        <a onclick="NewWindow('search_ledger_acc_final.php','mywin','800','700','yes','center');return false" onfocus="this.blur()"></a><a onclick="NewWindow('search_ledger_acc_final.php','mywin','800','700','yes','center');return false" onfocus="this.blur()"></a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Row2 
    <input type="text" name="row2" id="row2" size="5" /> 
      Col2 
        <input type="text" name="col2" id="col2" size="5" /> 
        &nbsp;&nbsp;
        -&gt; &nbsp;+/-&nbsp;
        <input type="text" name="opr" id="opr" size="5" />
    </div>
      </p>
    <div id="acc_table">
    <table width="415" border="1">
      <tr>
        <th width="92">Acc Code</th>
        <th width="307">Acc Name</th>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </div>
    <p>
      <input type="button" name="cmdsave" id="cmdsave" value="Save" class="btn_purchase" onclick="save_mettrix();" />
      <input type="button" name="cmdhide" id="cmdhide" value="Hide" class="btn_purchase" onclick="hide_frame();" />
    </p>
  </div>
  
  
  <fieldset>               
            
  
</form>        

</fieldset>    
            
            <table width="765" border="0" cellpadding="0">
<tr>
                	<th height="189" colspan="5" align="left" nowrap="nowrap">
              			<div align="left">