function GetPage($res = '')
{
    $data = '
	<!-- jQuery Dialog -->
    <div id="add-edit-prod-form" class="form-dialog" title="პროდუქტი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>
			<table border="0" width="100%">
				<tr>
					<th><label for="persom">აღმწერი პირი</label></th>
					<th><label for="object">აღმწერის ობიექტი</label></th>
				</tr>
				<tr>
					<th align="center">
						<select id="person" class="idls address">' . GetPersons($res['person_id']) . '</select>
						
					</th>
					<th>
						<select id="object" class="idls address">' . GetObject($res['object_id']) . '</select>
					</th>
				</tr>				
			</table>
        </fieldset>

		<fieldset>
	    	<legend>პროდუქტი</legend>	
			<div id="button_area">
        		<button id="add_button1">დამატება</button><button id="del_button1">წაშლა</button>
        	</div>			
			<td>		
			    <div id="dt_example" class="ex_highlight_row">
			        <div id="container" style="width:550px;">
			            <div id="dynamic" style="overflow-x: none !important;">
			                <table class="display" id="prod_list" style="width: 550px;">
			                    <thead>
			                        <tr id="datatable_header">
			                            <th>ID</th>
			                            <th style="width: 297px !important;">პროდუქტი</th>
			                            <th style="width: 100px !important;">რაოდ.ა</th>
			                            <th style="width: 100px !important;">რეალ. რაოდ.</th>
										<th class="check"></th>
			                        </tr>
			                    </thead>
			                </table>
		                </div>
		            </div>
			    </div>
			</td>
		</fieldset>

		<input type="hidden" id="describe_id" value="' . $res['id'] . '" />
		<input type="hidden" id="describe_status" value="' . $res['status'] . '" />				
    </div>    
    ';
    return $data;
}
function GetPage($res = '', $o_type = '')
{
    if (empty($o_type)) {
        $o_type = $res['type'];
    }
    $stream = $res['stream'];
    //-----------Temporary----Only--Distribution------------
    if (empty($o_type)) {
        $o_type = 4;
    }
    //-----------/Temporary---------/Only--/Distribution-------
    $data = '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" class="form-dialog" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>

	    	<table width="90%" class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="o_type">ზედნადების ტიპი</label></td>
					<td style="width: 170px;"><label for="o_number">ზედნადების №</label></td>
					<td style="width: 170px;"><label for="actation_data">გააქტიურების თარიღი</label></td>
					<td style="width: 170px;"><label for="object" class="object">საწყობი</label></td>
				</tr>
				<tr>
					<td>
						<select id="o_type" class="idls">' . GetOverheadType($o_type) . '</select>
					</td>
					<td>
						<input type="text" id="o_number" class="idle" disabled="disabled" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['waybill_number'] . '" />
					</td>
					<td>
						<input type="text" id="actation_data" class="idle" disabled="disabled" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['activate_date'] . '" />
					</td>
					<td>
						<select id="object" class="idls object">' . GetObject($res['id'], $o_type) . '</select>
					</td>
				</tr>
			</table>
        </fieldset>
    ';
    $data .= GetRelationsSection($res, $o_type, $stream);
    $data .= GetTransportSection($res, $o_type);
    $data .= GetAccountSection($res, $o_type);
    $data .= '
		<fieldset>
	    	<legend>საქონელი</legend>

		    <div class="inner-table">
			    <div id="dt_example" class="ex_highlight_row">
			        <div id="container" class="overhead_container">
			        	<div id="button_area">
			        		<button id="add_button_goods">დამატება</button><button id="delete_button_goods">წაშლა</button>
			        	</div>
			            <div id="dynamic">';
    $data .= GetTableSection($o_type, $stream);
    $data .= '
			            </div>
			            <div id="bottom_button_area">
			        		<button id="sub_overhead_button" class="left">ახალი ქვე-ზედნადები</button>
			        	</div>
			        </div>
			    </div>
			</div>
		</fieldset>
		<!-- ID -->
		<input type="hidden" id="overhead_id" value="' . $res['id'] . '" />
		<input type="hidden" id="local_overhead_id"/>
		<input type="hidden" id="overhead_status" value="' . $res['status'] . '" />
		<input type="hidden" id="overhead_confirmed" value="' . $res['is_confirmed'] . '" />
    </div>    
    ';
    return $data;
}
function GetPage($res = '')
{
    $data = '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" class="form-dialog" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>

	    	<table width="80%" class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="d_number">დოკუმენტის №</label></td>
					<td style="width: 170px;"><label for="operation_data">ოპერაციის თარიღი</label></td>
					<td style="width: 170px;"><label for="object" class="object">საწყობი</label></td>
				</tr>
				<tr>
					<td>
						<input type="text" id="d_number" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['waybill_number'] . '" />
					</td>
					<td>
						<input type="text" id="operation_data" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['activate_date'] . '" />
					</td>
					<td>
						<select id="object" class="idls object">' . GetObject($res['id']) . '</select>
					</td>
				</tr>
			</table>
        </fieldset>
    ';
    $data .= GetRelationsSection($res);
    $data .= GetAccountSection($res);
    $data .= '
		<fieldset>
	    	<legend>საქონელი</legend>

		    <div class="inner-table">
			    <div id="dt_example" class="ex_highlight_row">
			        <div id="container" class="overhead_container">
			        	<div id="button_area">
			        		<button id="add_button_goods">დამატება</button><button id="delete_button_goods">წაშლა</button>
			        	</div>
			            <div id="dynamic">';
    $data .= GetTableSection();
    $data .= '
			            </div>
			        </div>
			    </div>
			</div>
		</fieldset>
		<!-- ID -->
		<input type="hidden" id="buying_id" value="' . $res['id'] . '" />
		<input type="hidden" id="local_buying_id"/>
		<input type="hidden" id="status" value="' . $res['status'] . '" />
    </div>    
    ';
    return $data;
}
function GetPage($res = '')
{
    $data = '
	<!-- jQuery Dialog -->
    <div id="add-edit-prod-form" class="form-dialog" title="შემადგენლობა">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>
			<table border="0" width="100%">
				<tr>
					<th><label for="source_object">საწყისი მდებარეობა</label></th>
					<th><label for="target_object">საბოლოო მდებარეობა</label></th>
				</tr>
				<tr>
					<th>
						<select id="source_object" class="idls address">' . GetObject($res['source_id']) . '</select>
					</th>
					<th>
						<select id="target_object" class="idls address">' . GetObject($res['target_id']) . '</select>
					</th>
				</tr>
			</table>
        </fieldset>

		<fieldset>
	    	<legend>პროდუქტი</legend>

		    <div class="inner-table">
			    <div id="dt_example" class="ex_highlight_row">
			        <div id="container" class="overhead_container">
			        	<div id="button_area">
			        		<button id="add_button_prod">დამატება</button><button id="delete_button_prod">წაშლა</button>
			        	</div>
			            <div id="dynamic">
			                <table class="display" id="prod_list">
			                    <thead>
			                        <tr id="datatable_header">				                        
			                            <th>ID</th>
			                            <th style="width : 100%">პროდუქტი</th>
			                            <th class="min">რაოდენობა</th>
			                            <th class="check">#</th>
			                        </tr>
			                    </thead>
			                    <thead>
			                        <tr class="search_header">				                        
			                            <th class="colum_hidden">
			                            	<input type="text" name="search_id" value="ფილტრი" class="search_init" />
			                            </th>
			                            <th>
			                            	<input type="text" name="search_prod" value="ფილტრი" class="search_init" />
			                            </th>
			                            <th></th>
										<th>
											<input type="checkbox" name="check-all" id="check-all-prod" style="margin-left: 13px;">
										</th>
			                        </tr>
			                    </thead>
			                </table>
			            </div>
			        </div>
			    </div>
			</div>
		</fieldset>
		<!-- ID -->
		<input type="hidden" id="trans_id" value="' . $res['id'] . '" />
		<input type="hidden" id="local_trans_id" />
    </div>    
    ';
    return $data;
}
function GetActPage($res)
{
    $doctype = $res[stream];
    $type = $res[stream] == 1 ? "ზედნადები" : "შეძენის აქტი";
    $data = '<fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>

	    	<table width="100%" class="dialog-form-table">
				<tr>
   					<td style="width: 200px;"><label for="doc_type">დოკუმენტის ტიპი</label></td>
					<td style="width: 200px;"><label for="d_number">პარტნიორი</label></td>
					<td style="width: 200px;"><label for="operation_data">ოპერაციის თარიღი</label></td>
					<td style="width: 200px;"><label for="object" class="object">საწყობი</label></td>
				</tr>
				<tr>
   					<td>
						<input type="text" id="doc_type" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $type . '" disabled/>
					</td>
					<td>
						<input type="text" id="d_number" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res[seller_name] . '" disabled/>
					</td>
					<td>
						<input type="text" id="operation_data" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res[activate_date] . '" disabled/>
					</td>
					<td>
						<select id="object" class="idls object" disabled>' . GetObject($res[id]) . '</select>
					</td>
				</tr>
			</table>
        </fieldset>';
    return $data;
}