Exemple #1
0
function GetPage($res = '', $number)
{
    $c_date = date('Y-m-d H:i:s');
    $num = 0;
    if ($res[phone] == "") {
        $num = $number;
    } else {
        $num = $res[phone];
    }
    $increm = mysql_query("\tSELECT  `name`,\n                    \t            `rand_name`,\n                    \t            `id`\n                    \t    FROM \t`file`\n                    \t    WHERE   `incomming_call_id` = {$res['id']}\n                    \t    ");
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			<div style="float: left; width: 800px;">	
				<fieldset >
				<fieldset style="width:300px; float:left;">
			    	<legend>ძირითადი ინფორმაცია</legend>
		
			    	<table width="500px" class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="">მომართვა №</label></td>
							<td style="width: 180px;"><label for="">თარიღი</label></td>
						</tr>							
						
						<tr>
							<td style="width: 180px;">
								<input type="text" id="id" class="idle" onblur="this.className=\'idle\'"  value="' . ($res['id'] != '' ? $res['id'] : increment('incomming_call')) . '" disabled="disabled" />
								<input style="display:none;" type="text" id="h_id" class="idle" onblur="this.className=\'idle\'"  value="' . $res['id'] . '" disabled="disabled" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="c_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . ($res['call_date'] != '' ? $res['call_date'] : $c_date) . '" disabled="disabled" />
							</td>				
						</tr>
						<tr>
							<td style="width: 180px;"><label for="phone">ტელეფონი</label></td>							
							<td><label for="person_name">აბონენტის სახელი</label></td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="phone" class="idle" onblur="this.className=\'idle\'"  value="' . $num . '"  />
							</td>
							<td style="width: 69px;">
								<input type="text" id="person_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['first_name'] . '" />
							</td>	
						</tr>
						<tr>
							
							<td>
							</td>
						</tr>
						<tr>
							
							<td style="width: 69px;">
								<button id="button_calls" class="calls">ნომრები</button>
							</td>
						</tr>				
					</table>
				</fieldset>
				<fieldset style="width:220px; float:left; margin-left:10px; ">
			    	<legend>მომართვის ავტორი</legend>
					<table id="" class="dialog-form-table" width="220px">						
						<tr>
							<td style="width: 220px;"><input style="float:left;" type="radio" name="x" value="1" ' . ($res['type_id'] == '1' ? "checked" : "") . ' checked><span style="margin-top:5px; display:block;">ფიზიკური</span></td>
					  		<td style="width: 220px;"><input style="float:left;" type="radio" name="x" value="2" ' . ($res['type_id'] == '2' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">იურიდიული</span></td>
						</tr>
					</table>
				</fieldset>
				<fieldset style="width:220px; float:left; margin-left:10px; ">
			    	<legend>ზარის ტიპი</legend>
					<table id="" class="dialog-form-table" width="220px">						
						<tr>
							<td style="width: 220px;"><input style="float:left;" type="radio" name="xx" value="1" ' . ($res['call_type_id'] == '1' ? "checked" : "") . ' checked><span style="margin-top:5px; display:block;">ინფორმაცია</span></td>
					  		<td style="width: 220px;"><input style="float:left;" type="radio" name="xx" value="2" ' . ($res['call_type_id'] == '2' ? "checked" : "") . ' ><span style="margin-top:5px; display:block;"">პრეტენზია</span></td>
					  	</tr>
					  	<tr>
					  		<td style="width: 220px;"><input style="float:left;" type="radio" name="xx" value="3" ' . ($res['call_type_id'] == '3' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">სხვა</span></td>
						</tr>
					</table>
				</fieldset>
				<fieldset style="width:756px; float:left;">
			    	<legend>ინფორმაცია</legend>
					<table id="" class="dialog-form-table" width="500px">
					  	<tr>
					  		<td style="width: 600px;">
					  		    <label style="float:left; margin-top:7px; margin-right:5px;">სრულწლოვანი (18)</label>
					  		    <input style="float:left;" type="radio" name="status_1" value="1" ' . ($res['status_1'] == '1' ? "checked" : "") . '><span style="margin-top:8px; display:block; float: left;"">კი</span>
					  		    <input style="float:left;" type="radio" name="status_1" value="2" ' . ($res['status_1'] == '2' ? "checked" : "") . '><span style="margin-top:8px; display:block; float: left;"">არა</span>
					  		</td>
					  		<td style="width: 400px;">
					  		    <label style="float:left; margin-top:7px; margin-right:5px;">მწეველი</label>
					  		    <input style="float:left;" type="radio" name="status_2" value="1" ' . ($res['status_2'] == '1' ? "checked" : "") . '><span style="margin-top:8px; display:block; float: left;"">კი</span>
					  		    <input style="float:left;" type="radio" name="status_2" value="2" ' . ($res['status_2'] == '2' ? "checked" : "") . '><span style="margin-top:8px; display:block; float: left;"">არა</span>
					  		</td>
					  	</tr>
					</table>
				</fieldset>
				
				
				<fieldset style="width: 400px; float:left;">
					<legend>ზარის დაზუსტება</legend>
					<table id="" class="dialog-form-table" width="150px">
						<tr>
							<td><textarea  style="width: 400px; height: 50px;" id="call_comment" class="idle" name="call_comment" cols="300" >' . $res['call_comment'] . '</textarea></td>
						</tr>
					</table>
					</fieldset>
					<fieldset style="width: 317px; margin-left:10px; height:55px;  float:left;">
					<legend>მომართვის შინაარსი</legend>
					<table id="" class="dialog-form-table" width="150px">
						<tr>
							<td><select style="width: 310px; margin-left:5px;" id="call_status_id" class="idls object">' . Getcall_status($res['call_status_id']) . '</select></td>
						</tr>
					</table>				    
					</fieldset>';
    $data .= '
		   
				<fieldset style="margin-top: 5px;">
			    	<legend>დავალების ფორმირება</legend>
		
			    	<table class="dialog-form-table" style="width: 750px;">
						<tr>
							<td style="width: 180px;"><label for="task_type_id">დავალების ტიპი</label></td>
							<td style="width: 180px;"><label for="task_department_id">განყოფილება</label></td>
							<td style="width: 180px;"><label for="persons_id">პასუხისმგებელი პირი</label></td>
							<td style="width: 180px;"><label for="priority_id">პრიორიტეტი</label></td>
						</tr>
			    		<tr>
							<td><select style="width: 180px;" id="task_type_id" class="idls object">' . Gettask_type($res['task_type_id']) . '</select></td>
							<td><select style="width: 180px;" id="task_department_id" class="idls object">' . Getdepartment($res['task_department_id']) . '</select></td>
							<td><select style="width: 180px;" id="persons_id" class="idls object">' . Getpersons($res['persons_id']) . '</select></td>
							<td><select style="width: 180px;" id="priority_id" class="idls object">' . Getpriority($res['priority_id']) . '</select></td>
						</tr>
						</table>
						<table class="dialog-form-table" style="width: 750px;">
						<tr>
							<td style="width: 150px;"><label>შესრულების პერიოდი</label></td>
							<td style="width: 150px;"><label></label></td>
							<td style="width: 150px;"><label>კომენტარი</label></td>
							
						</tr>
						<tr>
							<td><input id="done_start_time" style="width: 150px; float:left;" class="idle" type="text" value="' . $res['done_start_time'] . '"><span style="margin-left:5px; ">დან</span></td>
					  		<td><input id="done_end_time" style="width: 150px; float:left;" class="idle" type="text" value="' . $res['done_end_time'] . '"><span style="margin-left:5px; ">მდე</span></td>
							<td>
								<textarea  style="width: 300px; resize: none;" id="comment" class="idle" name="content" cols="300" >' . $res['comment'] . '</textarea>
							</td>
						</tr>
					</table>
		        </fieldset>
			</div>
			<div>
				  </fieldset>
			</div>
			<div style="float: right;  width: 355px;">
				 
				<fieldset style="width: 334px; float:left;">
					   <legend>ტაგები</legend>
							    <div  id="tree">
				    ' . GetTree() . '
				        </div>
				</fieldset>					
				<fieldset style="margin-top: 10px; width: 150px; margin-left:10px; float: right;">
            		<legend>ფაილი</legend>
					<table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
     <tr>
      <td>
       <div class="file-uploader">
        <input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
        <button id="choose_button" class="center">აირჩიეთ ფაილი</button>
        <input id="hidden_inc" type="text" value="' . increment('action') . '" style="display: none;">
       </div>
      </td>
     </tr>
    </table>
        <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
             <tr style="border-bottom: 1px solid #85b1de;">
              <td colspan="3">მიმაგრებული ფაილი</td>
             </tr>
    </table>
    <table id="file_div" style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">';
    while ($increm_row = mysql_fetch_assoc($increm)) {
        $data .= ' 
                <tr style="border-bottom: 1px solid #85b1de;">
                  <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>              
                  <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
                  <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
                </tr>';
    }
    $data .= '
    </table>
				</fieldset>	
  					
						';
    if (!empty($res[phone])) {
        $data .= GetRecordingsSection($res);
    }
    $data .= '
	  		<button type="button" class="save-dialog" id="save-dialog" style="margin-top:10px;">შენახვა</button>
	  		</div>
			</div>
    </div>';
    return $data;
}
Exemple #2
0
<?php

require_once '../../includes/classes/core.php';
$action = $_REQUEST['act'];
$error = '';
$data = '';
switch ($action) {
    case 'get_add_page':
        $page = GetPage();
        $data = array('page' => $page);
        break;
    case 'get_edit_page':
        $callstatus_id = $_REQUEST['id'];
        $page = GetPage(Getcall_status($callstatus_id));
        $data = array('page' => $page);
        break;
    case 'get_list':
        $count = $_REQUEST['count'];
        $hidden = $_REQUEST['hidden'];
        $rResult = mysql_query("SELECT \tid,\r\n\t\t\t\t\t\t\t\t\t\t`name`\r\n\t\t\t\t\t\t\t    FROM \tsource\r\n\t\t\t\t\t\t\t    WHERE \tactived=1");
        $data = array("aaData" => array());
        while ($aRow = mysql_fetch_array($rResult)) {
            $row = array();
            for ($i = 0; $i < $count; $i++) {
                /* General output */
                $row[] = $aRow[$i];
                if ($i == $count - 1) {
                    $row[] = '<input type="checkbox" name="check_' . $aRow[$hidden] . '" class="check" value="' . $aRow[$hidden] . '" />';
                }
            }
            $data['aaData'][] = $row;
function GetPage($res = '', $number)
{
    $c_date = date('Y-m-d H:i:s');
    $num = 0;
    if ($res[phone] == "") {
        $num = $number;
    } else {
        $num = $res[phone];
    }
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			<div style="float: left; width: 800px;">	
				<fieldset >
				<fieldset style="width:300px; float:left;">
			    	<legend>ძირითადი ინფორმაცია</legend>
		
			    	<table width="500px" class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="">მომართვა №</label></td>
							<td style="width: 180px;"><label for="">თარიღი</label></td>
						</tr>							
						
						<tr>
							<td style="width: 180px;">
								<input type="text" id="id" class="idle" onblur="this.className=\'idle\'"  value="' . ($res['id'] != '' ? $res['id'] : increment('incomming_call')) . '" disabled="disabled" />
								<input style="display:none;" type="text" id="h_id" class="idle" onblur="this.className=\'idle\'"  value="' . $res['id'] . '" disabled="disabled" />
								<input style="display:none;" type="text" id="miss_date" class="idle" onblur="this.className=\'idle\'"  value="' . $_REQUEST['id'] . '" disabled="disabled" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="c_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . ($res['call_date'] != '' ? $res['call_date'] : $c_date) . '" disabled="disabled" />
							</td>				
						</tr>
						<tr>
							<td style="width: 180px;"><label for="phone">ტელეფონი</label></td>							
							<td><label for="person_name">აბონენტის სახელი</label></td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="phone" class="idle" onblur="this.className=\'idle\'"  value="' . $_REQUEST['num'] . '" disabled="disabled" />
							</td>
							<td style="width: 69px;">
								<input type="text" id="person_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['first_name'] . '" />
							</td>	
						</tr>
						<tr>
							<td>
								<label for="source_id">არხი</label>
							</td>
							<td>
							</td>
						</tr>
						<tr>
							<td>
								<select style="width: 165px;" id="source_id" class="idls object">' . Getsource($res['source_id']) . '</select>
							</td>
							<td style="width: 69px;">
								<button id="button_calls" class="calls">ნომრები</button>
							</td>
						</tr>				
					</table>
				</fieldset>
				<fieldset style="width:220px; float:left; margin-left:10px; ">
			    	<legend>მომართვის ავტორი</legend>
					<table id="" class="dialog-form-table" width="220px">						
						<tr>
							<td style="width: 220px;"><input style="float:left;" type="radio" name="x" value="1" ' . ($res['type_id'] == '1' ? "checked" : "") . '><span style="margin-top:5px; display:block;">ფიზიკური</span></td>
					  		<td style="width: 220px;"><input style="float:left;" type="radio" name="x" value="2" ' . ($res['type_id'] == '2' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">იურიდიული</span></td>
						</tr>
					</table>
				</fieldset>
				<fieldset style="width:220px; float:left; margin-left:10px; ">
			    	<legend>ზარის ტიპი</legend>
					<table id="" class="dialog-form-table" width="220px">						
						<tr>
							<td style="width: 220px;"><input style="float:left;" type="radio" name="xx" value="1" ' . ($res['call_type_id'] == '1' ? "checked" : "") . '><span style="margin-top:5px; display:block;">ინფორმაცია</span></td>
					  		<td style="width: 220px;"><input style="float:left;" type="radio" name="xx" value="2" ' . ($res['call_type_id'] == '2' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">პრეტენზია</span></td>
					  	</tr>
					  	<tr>
					  		<td style="width: 220px;"><input style="float:left;" type="radio" name="xx" value="3" ' . ($res['call_type_id'] == '3' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">სხვა</span></td>
						</tr>
					</table>
				</fieldset>
				<fieldset style="width:220px; float:left; margin-left:10px; ">
			    	<legend>განყოფილება</legend>
					<table id="" class="dialog-form-table" width="220px">						
						<tr>
							<td><select style="width: 220px;" id="department_id" class="idls object">' . Getdepartment($res['department_id']) . '</select></td>
						</tr>
					</table>
				</fieldset>
				<fieldset style="width:756px; float:left;">
			    	<legend>ინფორმაცია</legend>
					<table id="" class="dialog-form-table" width="500px">
					  	<tr>
					  		<td><label for="information_category_id">კატეგორია</label></td>
					  	</tr>						
						<tr>
							<td><select style="width: 756px;" id="information_category_id" class="idls object">' . Getinformation_category($res['information_category_id']) . '</select></td>
						</tr>
						<tr>
					  		<td><label for="information_category_id">ქვე-კატეგორია</label></td>
					  	</tr>
						<tr>
							<td><select style="width: 756px;" id="information_sub_category_id" class="idls object">' . Getinformation_sub_category($res['information_sub_category_id'], $res['information_category_id']) . '</select></td>
						</tr>
					</table>
				</fieldset>
				
				
				<fieldset style="width:557px; float:left;">
			    	<legend>პროდუქცია</legend>
					<table id="" class="dialog-form-table" width="755px">						
						<tr>
							<td style="width: 50px;"><input style="float:left;" type="radio" name="xxx" value="1" ' . ($res['product_type_id'] == '1' ? "checked" : "") . '><span style="margin-top:5px; display:block;">ახალის შეძენა</span></td>
					  		<td style="width: 50px;"><input style="float:left;" type="radio" name="xxx" value="2" ' . ($res['product_type_id'] == '2' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">შეძენილი</span></td>
					  		<td style="width: 50px;"><input style="float:left;" type="radio" name="xxx" value="3" ' . ($res['product_type_id'] == '3' ? "checked" : "") . '><span style="margin-top:5px; display:block;"">საინტერესო</span></td>
						</tr>
					</table>
				<div id="show_all" class="dialog_hidden">
					<table id="" class="dialog-form-table" width="750px">
					  	<tr>
					  		<td><label for="information_category_id">პროდუქტი კატეგორია</label></td>
					  		<td><label for="information_category_id">ჟანრი</label></td>
					  		<td><label for="information_category_id">დასახელება</label></td>
					  	</tr>						
						<tr>
							<td><select style="width: ;" id="production_category_id" class="idls object">' . Getproduction_category($res['production_category_id'], $res['information_category_id']) . '</select></td>
							<td><select style="width: ;" id="genre_id" class="idls object">' . Getgenre($res['genre_id']) . '</select></td>
							<td><select style="width: ;" id="production_id" class="idls object">' . Getproduction($res['production_id']) . '</select></td>
						</tr>	
											
					</table>
					<table id="" class="dialog-form-table" width="700px">
					  	<tr>
					  		<td><label for="information_category_id">ან შეიყვანეთ კოდი</label></td>
					  		<td></td>
					  		<td><label for="information_category_id">წიგნების ID</label></td>
					  	</tr>						
						<tr>
							<td><select style="width: ;" id="" class="idls object"></select></td>
							<td><button id="add_product">დამატება</button></td>
					  		<td><textarea  style="width: 370px; resize: none;" id="content" class="idle" name="content" cols="300" >' . $res['content'] . '</textarea></td>
						</tr>
					</table>													
					</table>
					  	<table class="dialog-form-table" width="400px">				
					  	<tr>
							<td>ჯამური ღირებულება</td>
							<td><input type="text" style="width: 60px;" id="sum_pirce" class="idle" onblur="this.className=\'idle\'"  value="' . $res['sum_pirce'] . '"  /></td>
							<td>ლარი</td>
							<td><input style="float:left;" type="checkbox" name="xxxx" value="1" ' . ($res['card_id'] == '1' ? "checked" : "") . '><span style="margin-top:8px; display:block;""> + ბარათი</span></td>
						</tr>					
					</table>
					<table class="dialog-form-table" width="750px">
						<tr>
					  		<td><label for="">მიწოდება</label></td>
					  		<td><label style="margin-left:5px;" for="">მოდული</label></td>
					  	</tr>					
					  	<tr>
							<td><select style="width: 330px;" id="shipping_id" class="idls object">' . Getshipping($res['shipping_id']) . '</select></td>
							<td><select style="width: 420px; margin-left:5px;" id="module_id" class="idls object">' . Getmodule($res['module_id']) . '</select></td>
						</tr>					
					</table>
				</div>					
				</fieldset>
				<fieldset style="width: 400px; float:left;">
					<legend>ზარის დაზუსტება</legend>
					<table id="" class="dialog-form-table" width="150px">
						<tr>
							<td><textarea  style="width: 400px; resize: none;" id="call_comment" class="idle" name="call_comment" cols="300" >' . $res['call_comment'] . '</textarea></td>
						</tr>
					</table>
					</fieldset>
					<fieldset style="width: 317px; margin-left:10px; height:55px;  float:left;">
					<legend>ზარის სტატუსი</legend>
					<table id="" class="dialog-form-table" width="150px">
						<tr>
							<td><select style="width: 310px; margin-left:5px;" id="call_status_id" class="idls object">' . Getcall_status($res['call_status_id']) . '</select></td>
						</tr>
					</table>
					</fieldset>
				';
    $data .= '
		   
				<fieldset style="margin-top: 5px;">
			    	<legend>დავალების ფორმირება</legend>
		
			    	<table class="dialog-form-table" style="width: 750px;">
						<tr>
							<td style="width: 180px;"><label for="task_type_id">დავალების ტიპი</label></td>
							<td style="width: 180px;"><label for="task_department_id">განყოფილება</label></td>
							<td style="width: 180px;"><label for="persons_id">პასუხისმგებელი პირი</label></td>
							<td style="width: 180px;"><label for="priority_id">პრიორიტეტი</label></td>
						</tr>
			    		<tr>
							<td><select style="width: 180px;" id="task_type_id" class="idls object">' . Gettask_type($res['task_type_id']) . '</select></td>
							<td><select style="width: 180px;" id="task_department_id" class="idls object">' . Getdepartment($res['task_department_id']) . '</select></td>
							<td><select style="width: 180px;" id="persons_id" class="idls object">' . Getpersons($res['persons_id']) . '</select></td>
							<td><select style="width: 180px;" id="priority_id" class="idls object">' . Getpriority($res['priority_id']) . '</select></td>
						</tr>
						</table>
						<table class="dialog-form-table" style="width: 750px;">
						<tr>
							<td style="width: 150px;"><label>შესრულების პერიოდი</label></td>
							<td style="width: 150px;"><label></label></td>
							<td style="width: 150px;"><label>კომენტარი</label></td>
							
						</tr>
						<tr>
							<td><input id="done_start_time" style="width: 150px; float:left;" class="idle" type="text" value="' . $res['done_start_time'] . '"><span style="margin-left:5px; ">დან</span></td>
					  		<td><input id="done_end_time" style="width: 150px; float:left;" class="idle" type="text" value="' . $res['done_end_time'] . '"><span style="margin-left:5px; ">მდე</span></td>
							<td>
								<textarea  style="width: 300px; resize: none;" id="comment" class="idle" name="content" cols="300" >' . $res['comment'] . '</textarea>
							</td>
						</tr>
					</table>
		        </fieldset>
			</div>
			<div>
				  </fieldset>
			</div>
			<div style="float: right;  width: 355px;">
				 
				<fieldset>
					<legend>მომართვის ავტორი</legend>
					<table style="height: 243px;">						
						<tr>
							<td style="width: 180px; color: #3C7FB1;">ტელეფონი</td>
							<td style="width: 180px; color: #3C7FB1;">პირადი ნომერი</td>
						</tr>
						<tr>
							<td>
								<input type="text" id="personal_phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_phone'] . '" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="personal_id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_id'] . '" />
							</td>					
						</tr>
						<tr>
							<td style="width: 180px; color: #3C7FB1;">სახელი</td>
							<td style="width: 180px; color: #3C7FB1;">ელ-ფოსტა</td>
						</tr>
						<tr >
							<td style="width: 180px;">
								<input type="text" id="personal_first_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_first_name'] . '" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="personal_mail" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_mail'] . '" />
							</td>			
						</tr>
						<tr>
							<td td style="width: 180px; color: #3C7FB1;">გვარი</td>
							<td td style="width: 180px; color: #3C7FB1;">დაბადების თარიღი</td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="personal_last_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_last_name'] . '" />		
							</td>
							<td td style="width: 180px;">
								<input type="text" id="personal_d_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_d_date'] . '" />		
							</td>
						</tr>
						<tr>
							<td td style="width: 180px; color: #3C7FB1;">ქალაქი</td>
							<td td style="width: 180px; color: #3C7FB1;">მისამართი</td>
						</tr>
						<tr>
							<td><select style="width: 165px;" id="personal_city" class="idls object">' . Getcity($res['personal_city']) . '</select></td>
							<td td style="width: 180px;">
								<input type="text" id="personal_addres" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_addres'] . '" />		
							</td>
						</tr>
						<tr>
							<td td style="width: 180px; color: #3C7FB1;">ოჯახური სტატუსი</td>
							<td td style="width: 180px; color: #3C7FB1;">პროფესია</td>
						</tr>
						<tr>
							<td><select style="width: 165px;" id="personal_status" class="idls object">' . Getfamily($res['personal_status']) . '</select></td>
							<td td style="width: 180px;">
								<input type="text" id="personal_profession" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_profession'] . '" />		
							</td>
						</tr>
					</table>
				</fieldset>	
				<!--fieldset>
					<legend>ყველა გაყიდვა (ბოლო 10)</legend>					
		                <table style="border:2px solid #85B1DE; width:100%;">
		                   		<tr style="background:#F2F2F2; ">	
									<th style="width:7%; padding:5px; border:1px solid #85B1DE;">#</th>
									<th style="border:1px solid #85B1DE; padding:5px;">თარიღი</th>
									<th style="border:1px solid #85B1DE; padding:5px;">მომხმარებელი</th>
									<th style="width:12%; padding:5px; border:1px solid #85B1DE;">ფასი</th>
									<th style="border:1px solid #85B1DE; padding:5px;">წიგნები</th>
								</tr>		
								<tr style="background: #FEFEFE">
										<td style="border:1px solid #85B1DE; padding:2px;">1</td>
										<td style="border:1px solid #85B1DE; padding:2px;">test</td>
										<td style="border:1px solid #85B1DE; padding:2px;">test</td>
										<td style="border:1px solid #85B1DE; padding:2px;">test</td>
										<td style="border:1px solid #85B1DE; padding:2px;">test</td>
								</tr>												
		                </table>
							<button id="read_more" style="float:right;">სრულად ნახვა</button>
				</fieldset-->					
				<fieldset style="margin-top: 10px; width: 150px; margin-left:10px; float: right;">
            		<legend>ფაილი</legend>
					<table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
     <tr>
      <td>
       <div class="file-uploader">
        <input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
        <button id="choose_button" class="center">აირჩიეთ ფაილი</button>
        <input id="hidden_inc" type="text" value="' . increment('action') . '" style="display: none;">
       </div>
      </td>
     </tr>
    </table>
        <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
             <tr style="border-bottom: 1px solid #85b1de;">
              <td colspan="3">მიმაგრებული ფაილი</td>
             </tr>
    </table>
    <table id="file_div" style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">';
    while ($increm_row = mysql_fetch_assoc($increm)) {
        $data .= ' 
                <tr style="border-bottom: 1px solid #85b1de;">
                  <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>              
                  <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
                  <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
                </tr>';
    }
    $data .= '
    </table>
				</fieldset>	
  					
						';
    if (!empty($res[phone])) {
        $data .= GetRecordingsSection($res);
    }
    $data .= '
	  		<button type="button" class="save-dialog" id="save-dialog" style="margin-top:10px;">შენახვა</button>
	  		</div>
			</div>
    </div>';
    return $data;
}
     $inc_id = $_REQUEST['inc_id'];
     $redactor_comment = $_REQUEST['redactor_comment'];
     $user_id = $_SESSION['USERID'];
     mysql_query(" UPDATE `incomming_call` \r\n                         SET `call_status_id`   = {$call_status_id},\r\n                             `fan_status`       = '4',\r\n                             `redactor_user_id` = '{$user_id}',\r\n                             `redactor_comment` = '{$redactor_comment}'\r\n                      WHERE  `id`               = '{$inc_id}'");
     $page = GetRecordingsSection($in_phone, $tab);
     $data = array('htm_records' => $page);
     break;
 case 'page_records1':
     $incom_id = $_REQUEST['incom_id'];
     $in_phone = $_REQUEST['in_phone'];
     $page = '  <fieldset style="width: 364px; border: solid 1px #85b1de;">
                 <legend>მიუთითეთ საჭირო სტატუსი</legend>
                     <table>
                         <tr>
             	            <td style="width: 110px;"><label style="display: block; margin-top: 18px; margin-left: 10px;" for="d_number">ზარის სტატუსი</label></td>
             				<td style="width: 180px;"><select style="width: 180px; display: block; margin-top: 12px; height: 25px;" id="call_status" class="idls object">' . Getcall_status() . '</select></td>
         		        </tr>
             		    <tr>
             	            <td style="width: 110px;">
             				    <label style="display: block; margin-top: 20px; margin-left: 10px;" for="d_number">კომენტარი</label>
             				</td>
             				<td style="width: 180px;">
             				    <textarea  style="width: 235px; resize: vertical; margin-top: 6px;" id="redactor_comment" class="idle" name="call_content" cols="300" rows="2"></textarea>
             				</td>
         		        </tr>
             	    </table>
             			<input id="inc_id" type="text" value="' . $incom_id . '" style="display: none;">
             			<input id="in_phone" type="text" value="' . $in_phone . '" style="display: none;">
             	</fieldset>';
     $data = array('htm_records' => $page);
     break;
Exemple #5
0
function GetPage($res = '', $number)
{
    $num = 0;
    if ($res[phone] == "") {
        $num = $number;
    } else {
        $num = $res[phone];
    }
    $increm = mysql_query("\tSELECT  `name`,\r\n\t\t\t`rand_name`\r\n\t\t\tFROM \t`file`\r\n\t\t\tWHERE   `task_id` = {$res['id']}\r\n\t\t\t");
    if ($res[call_id] == '') {
        $data .= '<div id="dialog-form">
							<div style="float: left; width: 500px;">
								<fieldset >
							    	<legend>ძირითადი ინფორმაცია</legend>
						
							    	<table width="100%" class="dialog-form-table">
										<tr>
											<td style="width: 180px;"><label for="req_num">დავალების №</label></td>
											<td style="width: 180px !important;"><label for="req_data">ფორმირების თარიღი</label></td>
											<td style="width: 180px;"><label for="req_phone">ტელეფონი</label></td>
										</tr>
										<tr>
											<td style="width: 180px;">
												<input type="text" id="id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
											</td>
											<td style="width: 180px;">
												<input type="text" id="c_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $res['call_date'] . '" disabled="disabled" />
											</td>
											<td style="width: 180px;">
												<input type="text" id="phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['phone'] . '" disabled="disabled" />
											</td>
											<td style="width: 69px;">
												<button class="calls">ნომრები</button>
											</td>
										</tr>
														
										<tr>
											<td style="width: 180px;"><label for="req_num">შესრულების გეგმ. დრო</label></td>
											<td style="width: 180px !important;"><label for="req_data">შესრულების ფაქტ. დრო</label></td>
											<td style="width: 180px;"><label for="req_phone">შესრულების დრო</label></td>
										</tr>
										<tr>
											<td style="width: 180px;">
												<input type="text" id="planned_end_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['planned_end_date'] . '" disabled="disabled" />
											</td>
											<td style="width: 180px;">
												<input type="text" id="fact_end_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['fact_end_date'] . '" disabled="disabled" />
											</td>
											<td style="width: 180px;">
												<input type="text" id="call_duration" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['call_duration'] . '" disabled="disabled" />
											</td>
											<td style="width: 69px;">
											</td>
										</tr>';
        $data .= '<table class="dialog-form-table">
										<tr>
											<td style="width: 180px;"><label for="d_number">დავალების ტიპი</label></td>
											<td style="width: 180px;"><label for="d_number">განყოფილება</label></td>
											<td style="width: 180px;"><label for="d_number">პასუხისმგებელი პირი</label></td>
											
										</tr>
							    		<tr>
											<td style="width: 180px;"><select id="task_type_id" class="idls object"disabled="disabled" disabled="disabled">' . Gettask_type($res['task_type_id']) . '</select></td>
											<td style="width: 180px;"><select id="task_department_id" class="idls object"disabled="disabled">' . Getdepartment($res['task_department_id']) . '</select></td>
											<td style="width: 180px;"><select id="persons_id" class="idls object" disabled="disabled">' . Getpersonss($res['persons_id']) . '</select></td>
											
										</tr>
										<tr>
											<td style="width: 180px;"><label for="d_number">პრიორიტეტები</label></td>
											<td style="width: 180px;"><label for="d_number">თემა</label></td>
											<td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;"><select id="priority_id" class="idls object" disabled="disabled">' . Getpriority($res['priority_id']) . '</select></td>
											<td style="width: 180px;"><select id="template_id" class="idls object" disabled="disabled">' . Gettemplate($res['template_id']) . '</select></td>
											<td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 150px;"><label for="content">კომენტარი</label></td>
											<td style="width: 150px;"><label for="content"></label></td>
											<td style="width: 150px;"><label for="content"></label></td>
										</tr>
													
										
										<tr>
						
											<td colspan="6">
												<textarea  style="width: 641px; resize: none;" id="comment" class="idle" name="call_content" cols="300" rows="2" disabled="disabled">' . $res['comment'] . '</textarea>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;"><label for="content">საუბრის შინაარსი</label></td>
										</tr>
										<tr>
								
											<td colspan="6">
												<textarea style="width: 641px; resize: none;" id="problem_comment" class="idle" name="call_content" cols="300" rows="2" >' . $res['problem_comment'] . '</textarea>
											</td>
										</tr>
									</table>
						        </fieldset>
							</div>
							<div>
								  </fieldset>
							</div>
							<div style="float: right;  width: 355px;">
								 <fieldset>
									<legend>მომართვის ავტორი</legend>
									<table style="height: 243px;">
										<tr>
											<td style="width: 180px;">PIN კოდი</td>
											<td style="width: 180px;">ეგობრის PIN ცოდი</td>
										</tr>
										<tr>
											<td style="width: 180px;"><input type="text" id="personal_pin" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_pin'] . '" /></td>
											<td style="width: 180px;"><input type="text" id="personal_pin" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['friend_pin'] . '" /></td>
											
										</tr>
										<tr>
											<td style="width: 180px;">პირადი ნომერი</td>
											<td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;">
												<input type="text" id="personal_id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_id'] . '" />
											</td>
											<td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;">სახელი და გვარი</td>
											</td>
										</tr>
										<tr >
											<td style="width: 180px;">' . $res['name1'] . '</td>
											</td>
										</tr>
										<tr >
											<td style="width: 180px;">ტელეფონი</td>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;">' . $res['personal_phone'] . '</td>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;">ელ-ფოსტა</td>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;">' . $res['mail'] . '</td>
											<td ></td>
										</tr>
							
						
										<tr>
											<td td style="width: 180px;">user-ი</td>
											<td td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;">' . $res['user'] . '</td>
											<td td style="width: 180px;"></td>
										</tr>
									</table>
								</fieldset>
								<fieldset>
									<legend>მომართვის ავტორი</legend>
									<table>
										<tr>
											<td>სულ</td>
											<td></td>
											<td></td>
											<td style="width: 150px;"></td>
											<td>1</td>
										</tr>
										<tr>
											<td></td>
											<td>მოგვარებულები</td>
											<td></td>
											<td style="width: 150px;"></td>
										    <td>2</td>
										</tr>
										<tr>
											<td></td>
											<td></td>
											<td>პრეტენზია</td>
											<td style="width: 150px;"></td>
											<td>2</td>
										</tr>
										<tr>
											<td></td>
											<td></td>
											<td>ინფორმაცია</td>
											<td style="width: 150px;"></td>
											<td>2</td>
										</tr>
										<tr>
											<td></td>
											<td>მიმდინარე</td>
											<td></td>
											<td style="width: 150px;"></td>
											<td>2</td>
										</tr>
										<tr>
											<td></td>
											<td></td>
											<td></td>
											<td style="width: 150px;"></td>
											<td>2</td>
										</tr>
										<tr>
											<td></td>
											<td></td>
											<td>პრეტენზია</td>
											<td style="width: 150px;"></td>
											<td>2</td>
										</tr>
										<tr>
											<td></td>
											<td></td>
											<td>ინფორმაცია</td>
											<td style="width: 150px;"></td>
											<td>2</td>
										</tr>
										<tr>
											<td></td>
											<td></td>
											<td></td>
											<td style="width: 150px;"></td>
								    		<td style="width: 300px;">
											<input type="button" value="ვრცლად"/>
						      				</td>
										</tr>
						
									</tr>
									</table>
								</fieldset>
								<fieldset>
									<legend>დამატებითი ინფორმაცია</legend> 
									<table style="float: left; border: 1px solid #85b1de; width: 180px; text-align: center;">
										<tr style="border-bottom: 1px solid #85b1de;">
											<td colspan="2">საუბრის ჩანაწერი</td>
										</tr>
										<tr style="border-bottom: 1px solid #85b1de; ">
											<td>დრო</td>
											<td style="border-left:1px solid #85b1de; width: 50px;">ჩანაწერი</td>
										</tr>
										<tr >
											<td></td>
											<td><input type="button" value="მოსმენა"/></td>
										</tr>
									<table/>
									<table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
										<tr>
											<td>
												<div class="file-uploader">
													<input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
													<button id="choose_button" class="center">აირჩიეთ ფაილი</button>
													<input id="hidden_inc" type="text" value="' . increment('task') . '" style="display: none;">
												</div>
											</td>
										</tr>
									</table>
								     <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
								          <tr style="border-bottom: 1px solid #85b1de;">
								           <td colspan="3">მიმაგრებული ფაილი</td>
								          </tr>
									</table>
									<table id="file_div" style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">';
        while ($increm_row = mysql_fetch_assoc($increm)) {
            $data .= ' 
									        <tr style="border-bottom: 1px solid #85b1de;">
									          <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>													 
									          <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
									          <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
									        </tr>';
        }
        $data .= '
				 					</table>
								</fieldset>
							</div>
				    </div>';
    } else {
        $data .= '<div id="dialog-form">
					<div style="float: left; width: 500px;">	
						<fieldset >
					    	<legend>ძირითადი ინფორმაცია</legend>
				
					    	<table width="100%" class="dialog-form-table">
								<tr>
									<td style="width: 180px;"><label for="req_num">მომართვა №</label></td>
									<td style="width: 180px !important;"><label for="req_data">თარიღი</label></td>
									<td style="width: 180px;"><label for="req_phone">ტელეფონი</label></td>
								</tr>
								<tr>
									<td style="width: 180px;">
										<input type="text" id="id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
									</td>
									<td style="width: 180px;">
										<input type="text" id="c_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $res['call_date'] . '" disabled="disabled" />
									</td>
									<td style="width: 180px;">
										<input type="text" id="phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $num . '" />
									</td>
									<td style="width: 69px;">
										<button class="calls">ნომრები</button>
									</td>
								</tr>
								<tr>
									<td style="width: 180px;"><label for="d_number">ზარის ტიპი</label></td>
									<td style="width: 180px;"><label for="d_number">კატეგორია</label></td>
									<td style="width: 180px;"><label for="d_number">ქვე-კატეგოტია</label></td>
									<td ></td>
								</tr>
								<tr>
									<td style="width: 180px;"><select id="call_type_id" class="idls object" disabled="disabled">' . Getcall_type($res['call_type_id']) . '</select></td>
									<td style="width: 180px;"><select id="category_parent_id" class="idls object" disabled="disabled">' . Getcategory($res['category_parent_id']) . '</select></td>
									<td style="width: 180px;"><select id="category_id" class="idls object" disabled="disabled">' . Getcategory1_edit($res['category_id']) . '</select></td>
									<td ></td>
								</tr>
							</table>';
        if (Getcategory($res['category_parent_id']) == 407) {
            $data .= '<table id="additional" class="hidden dialog-form-table" width="100%">
								<tr >
									<td style="width: 180px;"><label for="d_number">შეტანის ფორმა</label></td>
									<td style="width: 180px;"><label for="d_number">მომსახურე ბანკი</label></td>
									<td style="width: 180px;"><label for="d_number">ფილიალი</label></td>
									<td style="width: 106px;"></td>
								</tr>
								<tr >
									<td style="width: 180px;"><select id="pay_type_id" class="idls object" disabled="disabled">' . Getpay_type($res['pay_type_id']) . '</select></td>
									<td style="width: 180px;"><select id="bank_id" class="idls object" disabled="disabled">' . Get_bank($res['bank_id']) . '</select></td>
									<td style="width: 180px;"><select id="bank_object_id" class="idls object" disabled="disabled">' . Getbank_object_edit($res['bank_object_id']) . '</select></td>
									<td style="width: 106px;"></td>
								</tr>
								<tr >
									<td style="width: 180px;"><label for="d_number">ბარათის ტიპი</label></td>
									<td style="width: 180px;"><label for="d_number">ანგარიშსწორება</label></td>
									<td style="width: 180px;"><label for="d_number">აპარატის ტიპი</label></td>
									<td style="width: 106px;"></td>
								</tr>
								<tr >
									<td style="width: 180px;"><select id="card_type_id" class="idls object" disabled="disabled">' . Getcard_type($res['card_type_id']) . '</select></td>
									<td style="width: 180px;"><select id="card_type1_id" class="idls object" disabled="disabled">' . Getcard_type1($res['card_type1_id']) . '</select></td>
									<td style="width: 180px;"><select id="pay_aparat_id" class="idls object" disabled="disabled">' . Getpay_aparat($res['pay_aparat_id']) . '</select></td>
									<td style="width: 106px;"></td>
								</tr>
							</table>';
        }
        $data .= '<table width="100%" class="dialog-form-table">
								<tr>
									<td style="width: 180px;"><label for="req_num">პრობლემის თარიღი</label></td>
									<td style="width: 180px;"><label for="d_number">ობიექტი</label></td>
									<td style="width: 180px;"><label for="d_number">ზარის სტატუსი</label></td>			
									<td ></td>
								</tr>
								<tr>	
									<td style="width: 180px;"> <input type="text" id="problem_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res[problem_date] . '"disabled="disabled" /></td>
									<td style="width: 180px;"><select id="object_id" class="idls object" disabled="disabled">' . Getobject($res['object_id']) . '</select></td>
									<td style="width: 180px;"><select id="call_status_id" class="idls object"disabled="disabled">' . Getcall_status($res['status']) . '</select></td>	
									<td ></td>
								</tr>
								<tr>
									<td style="width: 180px;"><label for="content">საუბრის შინაარსი</label></td>
								</tr>
								<tr>
									
									<td colspan="6">	
										<textarea disabled="disabled" style="width: 641px; resize: none;" id="call_content" class="idle" name="call_content" cols="300" rows="2" >' . $res['call_content'] . '</textarea>
									</td>
								</tr>	
								<tr>
									<td style="width: 180px;"><label for="content">პრობლემის გადაწყვეტა</label></td>
								</tr>
								<tr>
						
									<td colspan="6">
										<textarea  style="width: 641px; resize: none;" id="problem_comment" class="idle" name="call_content" cols="300" rows="2">' . $res['problem_comment'] . '</textarea>
									</td>
								</tr>		
							</table>
						</fieldset >
				   
						<fieldset style="margin-top: 5px;">
					    	<legend>დავალების ფორმირება</legend>
				
					    	<table class="dialog-form-table">
								<tr>
									<td style="width: 180px;"><label for="d_number">დავალების ტიპი</label></td>
									<td style="width: 180px;"><label for="d_number">განყოფილება</label></td>
									<td style="width: 180px;"><label for="d_number">პასუხისმგებელი პირი</label></td>
								</tr>
					    		<tr>
									<td style="width: 180px;"><select id="task_type_id" class="idls object"disabled="disabled">' . Gettask_type($res['task_type_id']) . '</select></td>
									<td style="width: 180px;"><select id="task_department_id" class="idls object"disabled="disabled">' . Getdepartment($res['task_department_id']) . '</select></td>
									<td style="width: 180px;"><select id="persons_id" class="idls object"disabled="disabled">' . Getpersonss($res['persons_id']) . '</select></td>
								</tr>
								<tr>
									<td style="width: 180px;"><label for="d_number">პრიორიტეტები</label></td>
									<td style="width: 180px;"></td>
									<td style="width: 180px;"></td>
								</tr>
								<tr>
									<td style="width: 180px;"><select id="priority_id" class="idls object">' . Getpriority($res['priority_id']) . '</select></td>
									<td style="width: 180px;"></td>
									<td style="width: 180px;"></td>
								</tr>
								<tr>
									<td style="width: 150px;"><label for="content">კომენტარი</label></td>
									<td style="width: 150px;"><label for="content"></label></td>
									<td style="width: 150px;"><label for="content"></label></td>
								</tr>
								<tr>
									<td colspan="6">
										<textarea  style="width: 641px; resize: none;" id="comment" class="idle" name="content" cols="300" rows="2">' . $res['comment'] . '</textarea>
									</td>
								</tr>
							
								</tr>
							</table>
				        </fieldset>
					</div>
					<div>
						  </fieldset>
					</div>
					<div style="float: right;  width: 355px;">
						 <fieldset>
									<legend>მომართვის ავტორი</legend>
									<table style="height: 243px;">
										<tr>
											<td style="width: 180px;">PIN კოდი</td>
											<td style="width: 180px;">ეგობრის PIN ცოდი</td>
										</tr>
										<tr>
											<td style="width: 180px;"><input type="text" id="personal_pin" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_pin'] . '" /></td>
											<td style="width: 180px;"><input type="text" id="personal_pin" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['friend_pin'] . '" /></td>
											
										</tr>
										<tr>
											<td style="width: 180px;">პირადი ნომერი</td>
											<td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;">
												<input type="text" id="personal_id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_id'] . '" />
											</td>
											<td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;">სახელი და გვარი</td>
											</td>
										</tr>
										<tr >
											<td style="width: 180px;">' . $res['name1'] . '</td>
											</td>
										</tr>
										<tr >
											<td style="width: 180px;">ტელეფონი</td>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;">' . $res['personal_phone'] . '</td>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;">ელ-ფოსტა</td>
											</td>
										</tr>
										<tr>
											<td style="width: 180px;">' . $res['mail'] . '</td>
											<td ></td>
										</tr>
							
						
										<tr>
											<td td style="width: 180px;">user-ი</td>
											<td td style="width: 180px;"></td>
										</tr>
										<tr>
											<td style="width: 180px;">' . $res['user'] . '</td>
											<td td style="width: 180px;"></td>
										</tr>
									</table>
								</fieldset>
						<fieldset>
							<legend>მომართვის ავტორი</legend>
							<table>
								<tr>
									<td>სულ</td>
									<td></td>
									<td></td>
									<td style="width: 150px;"></td>
									<td>1</td>
								</tr>
								<tr>
									<td></td>
									<td>მოგვარებულები</td>
									<td></td>
									<td style="width: 150px;"></td>
								    <td>2</td>
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td>პრეტენზია</td>
									<td style="width: 150px;"></td>
									<td>2</td>
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td>ინფორმაცია</td>
									<td style="width: 150px;"></td>
									<td>2</td>
								</tr>
								<tr>
									<td></td>
									<td>მიმდინარე</td>
									<td></td>
									<td style="width: 150px;"></td>
									<td>2</td>
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td></td>
									<td style="width: 150px;"></td>
									<td>2</td>
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td>პრეტენზია</td>
									<td style="width: 150px;"></td>
									<td>2</td>
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td>ინფორმაცია</td>
									<td style="width: 150px;"></td>
									<td>2</td>
								</tr>
								<tr>
									<td></td>
									<td></td>
									<td></td>
									<td style="width: 150px;"></td>
						    		<td style="width: 300px;">
									<input type="button" value="ვრცლად"/>
				      				</td>
								</tr>
												
							</tr>
							</table>
						</fieldset>
						<fieldset>
									<legend>დამატებითი ინფორმაცია</legend> 
									<table style="float: left; border: 1px solid #85b1de; width: 180px; text-align: center;">
										<tr style="border-bottom: 1px solid #85b1de;">
											<td colspan="2">საუბრის ჩანაწერი</td>
										</tr>
										<tr style="border-bottom: 1px solid #85b1de; ">
											<td>დრო</td>
											<td style="border-left:1px solid #85b1de; width: 50px;">ჩანაწერი</td>
										</tr>
										<tr >
											<td></td>
											<td><input type="button" value="მოსმენა"/></td>
										</tr>
									<table/>
									<table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
										<tr>
											<td>
												<div class="file-uploader">
													<input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
													<button id="choose_button" class="center">აირჩიეთ ფაილი</button>
													<input id="hidden_inc" type="text" value="' . increment('task') . '" style="display: none;">
												</div>
											</td>
										</tr>
									</table>
								     <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
								          <tr style="border-bottom: 1px solid #85b1de;">
								           <td colspan="3">მიმაგრებული ფაილი</td>
								          </tr>
									</table>
									<table id="file_div" style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">';
        while ($increm_row = mysql_fetch_assoc($increm)) {
            $data .= ' 
										        <tr style="border-bottom: 1px solid #85b1de;">
										          <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>													 
										          <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
										          <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
										        </tr>';
        }
        $data .= '
				 					</table>
								</fieldset>
					</div>
		    </div>';
    }
    $data .= '<input type="hidden" id="outgoing_call_id" value="' . $res['id'] . '" />';
    return $data;
}
function GetPage($res = '', $number)
{
    $num = 0;
    if ($res[phone] == "") {
        $num = $number;
    } else {
        $num = $res[phone];
    }
    if ($res[id] != '') {
        $dis = 'disabled="disabled"';
    } else {
        $dis = '';
    }
    $increm = mysql_query("\tSELECT  `name`,\r\n\t\t\t\t\t\t\t\t\t`rand_name`\r\n\t\t\t\t\t\t\tFROM \t`file`\r\n\t\t\t\t\t\t\tWHERE   `incomming_call_id` = {$res['id']}\r\n\t\t\t");
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			<div style="float: left; width: 673px;">	
				<fieldset >
			    	<legend>ძირითადი ინფორმაცია</legend>
						<tr>
							<label for="req_num">დამფორმირებელი</label>
							<label for="req_num">:</label>
							<label for="req_num">' . $res['operator'] . '</label>
						</tr>
			    	<table width="100%" class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="req_num">მომართვა №</label></td>
							<td style="width: 180px !important;"><label for="req_data">თარიღი</label></td>
							<td style="width: 180px;"><label for="req_phone">ტელეფონი</label></td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="c_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $res['call_date'] . '" disabled="disabled" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $num . '" disabled="disabled"/>
							</td>
							<td style="width: 69px;">
								
							</td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="d_number">ზარის ტიპი</label></td>
							<td style="width: 180px;"><label for="d_number">კატეგორია</label></td>
							<td style="width: 180px;"><label for="d_number">ქვე-კატეგოტია</label></td>
							<td ></td>
						</tr>
						<tr>
							<td style="width: 180px;"><select id="call_type_id" class="idls object"disabled="disabled">' . Getcall_type($res['call_type_id']) . '</select></td>
							<td style="width: 180px;"><select id="category_parent_id" class="idls object"disabled="disabled">' . Getcategory($res['category_parent_id']) . '</select></td>
							<td style="width: 180px;"><select id="category_id" class="idls object"disabled="disabled">' . Getcategory1_edit($res['category_id']) . '</select></td>
							<td ></td>
						</tr>
					</table>';
    $data .= '<table id="additional" class="hidden dialog-form-table" width="100%">

						<tr id="aaaa">
							<td style="width: 180px;"><label pey_label1 for="d_number">ტრანზაქციის ფორმა</label></td>
							<td style="width: 180px;"><label id="bank_label" for="d_number">მომსახურე ბანკი</label></td>
							<td style="width: 180px;"><label id="pey_label" for="d_number">აპარატის ტიპი</label></td>
							<td style="width: 106px;"></td>
						</tr>
						<tr id="c">
							<td style="width: 180px;"><select id="pay_type_id" class="idls object"disabled="disabled">' . Getpay_type($res['pay_type_id']) . '</select></td>
							<td style="width: 180px;"><select id="bank_id" class="idls object"disabled="disabled">' . Get_bank($res['bank_id']) . '</select></td>
							<td style="width: 180px;"><select id="pay_aparat_id" class="idls object"disabled="disabled">' . Getpay_aparat($res['pay_aparat_id']) . '</select></td>
							<td style="width: 106px;"></td>
						</tr>
						<tr id="bbbb">
							<td style="width: 180px;"><label id="card_label" for="d_number">ბარათის ტიპი</label></td>
							<td style="width: 180px;"></td>
							<td style="width: 180px;"></td>
							<td style="width: 106px;"></td>
						</tr>
						<tr id="d" >
							<td style="width: 180px;"><select id="card_type_id" class="idls object"disabled="disabled">' . Getcard_type($res['card_type_id']) . '</select></td>
							<td style="width: 180px;"></td>
							<td style="width: 180px;"></td>
							<td style="width: 106px;"></td>
						</tr>
					</table>';
    $data .= '<table width="100%" class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="req_num">პრობლემის თარიღი</label></td>
							<td style="width: 180px;"><label for="d_number">სტატუსი</label></td>
							<td style="width: 180px;"><label for="d_number">ობიექტი</label></td>			
							<td ></td>
						</tr>
						<tr>	
							<td style="width: 180px;"> <input type="text" id="problem_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['problem_date'] . '"disabled="disabled" /></td>
							<td style="width: 180px;"><select id="call_status_id" class="idls object"disabled="disabled"disabled="disabled">' . Getcall_status($res['status']) . '</select></td>
							<td style="width: 180px;"><select id="object_id" class="idls object"disabled="disabled">' . Getobject($res['object_id']) . '</select></td>	
							<td ></td>
						</tr>
						
						<tr>
							<td style="width: 180px;"><label for="req_num">ინფორმაციის წყარო</label></td>
							<td style="width: 180px;"></td>
							<td style="width: 180px;"></td>			
							<td ></td>
						</tr>
						<tr>	
							<td style="width: 180px;"><select id="source_id" class="idls object"disabled="disabled">' . Getsource($res['source_id']) . '</select></td>
							<td style="width: 180px;"></td>
							<td style="width: 180px;"></td>	
							<td ></td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="content">საუბრის შინაარსი</label></td>
						</tr>
						<tr>
							
							<td colspan="6">	
								<textarea  style="width: 641px; resize: none;" id="call_content" class="idle" name="call_content" cols="300" rows="4"disabled="disabled">' . $res['call_content'] . '</textarea>
							</td>
						</tr>			
					</table>
				</fieldset >
		   
				<fieldset style="margin-top: 5px;">
			    	<legend>დავალების ფორმირება</legend>
		
			    	<table class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="d_number">დავალების ტიპი</label></td>
							<td style="width: 180px;"><label for="d_number">განყოფილება</label></td>
							<td style="width: 180px;"><label for="d_number">პასუხისმგებელი პირი</label></td>
						</tr>
			    		<tr>
							<td style="width: 180px;" id="task_type_change"><select id="task_type_id" class="idls object"disabled="disabled">' . Gettask_type($res['task_type_id']) . '</select></td>
							<td style="width: 180px;"><select id="task_department_id" class="idls object"disabled="disabled">' . Getdepartment($res['task_department_id']) . '</select></td>
							<td style="width: 180px;"><select id="persons_id" class="idls object"disabled="disabled">' . Getpersons($res['persons_id']) . '</select></td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="d_number">პრიორიტეტები</label></td>
							<td style="width: 180px;"><label for="d_number">მაკონტროლებელი</label></td>
							<td style="width: 180px;"><label for="d_number">სხვა ნომერი</label></td>
						</tr>
						<tr>
							<td style="width: 180px;"><select id="priority_id" class="idls object">' . Getpriority($res['priority_id']) . '</select></td>
							<td style="width: 180px;"><select id="controler_id" class="idls object">' . Get_control($res['control_user_id']) . '</select></td>
							<td style="width: 180px;">
								<input type="text" id="task_phone" class="idle" onblur="this.className=\'idle\'" value="' . $res['task_phone'] . '" />	
							</td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="content">პრობლემის გადაწყვეტა</label></td>
						</tr>
						<tr>
							
							<td colspan="6">	
								<textarea  style="width: 641px; resize: none;" id="problem_coment" class="idle" name="call_content" cols="300" rows="4"disabled="disabled">' . $res['problem_comment'] . '</textarea>
							</td>
						</tr>	
					</table>
		        </fieldset>
			</div>
			<div>
				  </fieldset>
			</div>
			<div style="float: right;  width: 355px;">
				 <fieldset>
					<legend>მომართვის ავტორი</legend>
					<table style="height: 119px;">
						<tr>
							<td style="width: 180px;">PIN კოდი</td>
							<td style="width: 180px;"></td>
						</tr>
						<tr>
							<td style="width: 180px;"><input type="text" id="personal_pin" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_pin'] . '"' . $dis . ' disabled="disabled"/></td>
							<td style="width: 180px;" class="hidden friend">
							</td>
						</tr>
						<tr>
							<td style="width: 180px;">პირადი ნომერი</td>
							<td style="width: 180px;"></td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="personal_id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['personal_id'] . '" ' . $dis . 'disabled="disabled"/>
							</td>
							<td style="width: 180px;"></td>
						</tr>
					</table>
				</fieldset>
				<div id="additional_info">';
    $data .= '</div>';
    $data .= GetRecordingsSection1($res);
    $data .= GetRecordingsSection($res);
    $data .= '		<fieldset>
					<legend>დამატებითი ინფორმაცია</legend> 
					<table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
					<tr>
						<td>
							<div class="file-uploader">
								<input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
								<button id="choose_button" class="center">აირჩიეთ ფაილი</button>
								<input id="hidden_inc" type="text" value="' . increment('incomming_call') . '" style="display: none;">
							</div>
						</td>
					</tr>
				</table>
			     <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
			          <tr style="border-bottom: 1px solid #85b1de;">
			           <td colspan="3">მიმაგრებული ფაილი</td>
			          </tr>
				</table>
				<table id="file_div" style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">';
    while ($increm_row = mysql_fetch_assoc($increm)) {
        $data .= ' 
								        <tr style="border-bottom: 1px solid #85b1de;">
								          <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>													 
								          <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
								          <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
								        </tr>';
    }
    $data .= '
	 		</table>
				</fieldset>
			</div>
	 		<input id="hidden_user" type="text" value="' . $res['user_id'] . '" style="display: none;">
    </div>';
    return $data;
}
Exemple #7
0
function GetPage($res = '', $number, $incom_id)
{
    $num = 0;
    if ($res[phone] == "") {
        $num = $number;
    } else {
        $num = $res[phone];
    }
    $tanxa = 'class="hidden dialog-form-table"';
    $disabled = '';
    $hidden_class = '';
    if ($_REQUEST['id'] == '') {
        $hidden_class = 'class="hidden"';
    } else {
        //echo $_REQUEST['id'];
        if ($res[category_id] == 407) {
            //echo $res[category_id];
            $tanxa = 'class="dialog-form-table"';
        } else {
            $tanxa = 'class="hidden dialog-form-table"';
        }
        $disabled = 'disabled="disabled"';
    }
    $increm = mysql_query("\tSELECT  `name`,\n\t \t\t\t\t\t\t\t\t`rand_name`,\n\t\t\t\t\t\t\t\t\t`id`\n\t\t\t\t\t\t\tFROM \t`file`\n\t\t\t\t\t\t\tWHERE   `task_id` = {$res['id']}\n\t\t\t\t\t\t\t  ");
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			<div style="float: left; width: 500px;">	
				<fieldset >
			    	<legend>ძირითადი ინფორმაცია</legend>
		
			    	<table width="100%" class="dialog-form-table">
						<tr>
							<td style="width: 215px;"><label for="req_num">დავალების №</label></td>
							<td style="width: 215px !important;"><label for="req_data">თარიღი</label></td>
							<td style="width: 215px;"><label for="req_data">ტელეფონი</label></td>
						</tr>						
						<tr>
							<td style="width: 215px;">
								<input  style="width: 180px; type="text" id="id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
							</td>
							<td style="width: 215px;">
								<input style="width: 180px; type="text" id="c_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $res['call_date'] . '" disabled="disabled" />
							</td>
							<td style="width: 215px;">
								<input style="width: 180px; type="text" id="phone" class="idle" onblur="this.className=\'idle\'" value="' . $res['phone'] . '" />
							</td>
							
						</tr>
					</table>';
    $data .= '<table id="additiona" class="dialog-form-table" width="100%">				
									
						<tr>
							<td style="width: 215px;"><label for="d_number">ზარის ტიპი</label></td>
							<td style="width: 215px;"><label for="d_number">კატეგორია</label></td>
							<td style="width: 215px;"><label for="d_number">ქვე-კატეგოტია</label></td>
							
						</tr>
						<tr>
							<td style="width: 215px;"><select style="width: 186px;" id="call_type_id" class="idls object"" >' . Getcall_type($res['call_type_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="category_parent_id" class="idls object"" >' . Getcategory1($res['call_type_id'], $res['category_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="category_id" class="idls object"" >' . Getcategory2($res['category_id'], $res['category_parent_id']) . '</select></td>
							
						</tr>
						</table>
						<table id="additiona3" ' . $tanxa . ' width="100%">
						<tr id="aaaa">
							<td style="width: 215px;"><label id="pey_label1" for="d_number">ტრანზაქციის ფორმა</label></td>
							<td style="width: 215px;"><label for="d_number" id="bank_label">მომსახურე ბანკი</label></td>
							<td style="width: 215px;"><label id="pey_label"  for="d_number" >აპარატის ტიპი</label></td>
							
						</tr>
						<tr id="c">
							<td style="width: 215px;"><select style="width: 186px;" id="pay_type_id" class="idls object">' . Getpay_type($res['pay_type_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="bank_id" class="idls object">' . Get_bank($res['bank_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="pay_aparat_id" class="idls object">' . Getpay_aparat($res['pay_aparat_id']) . '</select></td>

						</tr>
						<tr id="bbbb">
							<td style="width: 215px;"><label for="d_number" id="card_label">ბარათის ტიპი</label></td>
							<td style="width: 215px;"></td>
							<td style="width: 215px;"></td>
							
						</tr>
						<tr id="d">
							<td style="width: 215px;"><select style="width: 186px;" id="card_type_id" class="idls object">' . Getcard_type($res['card_type_id']) . '</select></td>
							<td style="width: 215px;"></td>
							<td style="width: 215px;"></td>
						
						</tr>
					</table>
					<table id="additiona2" class="dialog-form-table" width="100%">	
						<tr>
							<td style="width: 215px;"><label for="req_num">პრობლემის თარიღი</label></td>
							<td style="width: 215px;"><label for="d_number">სტატუსი</label></td>
							<td style="width: 215px;"><label for="d_number">ობიექტი</label></td>			
						</tr>
						<tr>	
							<td style="width: 215px;">
								<input style="width: 180px;" type="text" id="problem_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res[problem_date] . '""  />
							</td>
							<td style="width: 215px;"><select style="width: 186px;" id="call_status_id" class="idls object">' . Getcall_status($res['call_status_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="object_id" class="idls object">' . Getobject($res['object_id']) . '</select></td>	
								
						</tr>
						<tr>
							<td style="width: 215px;"><label for="task_type_id">დავალების ტიპი</label></td>
							<td style="width: 215px;"><label for="task_department_id">განყოფილება</label></td>
							<td style="width: 215px;"><label for="persons_id">პასუხისმგებელი პირი</label></td>
						</tr>
						<tr>
							<td style="width: 215px;"><select style="width: 186px;" id="task_type_id" class="idls object">' . Gettask_type($res['task_type_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="task_department_id" class="idls object">' . Getdepartment($res['task_department_id']) . '</select></td>
							<td style="width: 215px;"><select style="width: 186px;" id="persons_id" class="idls object">' . Getpersons($res['persons_id']) . '</select></td>
						</tr>
						<tr>
							<td style="width: 215px;"><label for="task_type_id">ინფორმაციის წყარო</label></td>
							<td style="width: 215px;"><label id="pr" class="hidden" for="d_number">პრიორიტეტები</label></td>
							<td style="width: 215px;"></td>
						</tr>
						<tr>
							<td style="width: 215px;"><select style="width: 186px;" id="source" class="idls object">' . Getsource($res['source']) . '</select></td>
							<td style="width: 215px;"><label class="hidden" id="priority"><select id="priority_id" class="idls" >' . Getpriority($res['priority_id']) . '</label></select></td>
							<td style="width: 215px;"></td>
						</tr>
						</table>

									
						<table id="additiona1" class="hidden dialog-form-table" width="100%">
						<tr>
							<td style="width: 215px;"><label for="req_num">შესრ.პერ.დასაწყისი</label></td>
							<td style="width: 215px !important;"><label for="req_data">შესრ.პერ.დასასრული</label></td>
							<td style="width: 215px;"><label for="req_phone">შესრულების დრო</label></td>
						</tr>
						<tr>
							<td style="width: 215px;">
								<input type="text" id="planned_date" style="width: 180px;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['planned_end_date'] . '" />
							</td>
							<td style="width: 215px;">
								<input type="text" id="fact_end_date" style="width: 180px;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['call_date'] . '"/>
							</td>
							<td style="width: 215px;">
								<input type="text" id="call_duration" style="width: 180px;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $num . '" />
							</td>
						</tr>
					</table>	
								<br>	
									
						<table>			
						<tr>
							<td style="width: 150px;"><label for="content">საუბრის შინაარსი</label></td>
							<td style="width: 150px;"><label for="content"></label></td>
							<td style="width: 150px;"><label for="content"></label></td>
						</tr>
						<tr>
							<td colspan="6">
								<textarea  ' . $disabled . ' style="width: 641px; resize: vertical;" id="comment" class="idle" name="content" cols="300" rows="4">' . $res['comment'] . '</textarea>
							</td>
						</tr>
						<tr>
							<td ' . $hidden_class . ' style="width: 215px;"><label for="content">პრობლემის გადაწყვეტა</label></td>
						</tr>
						<tr>
							
							<td colspan="5">	
								<textarea ' . $hidden_class . ' style="width: 641px; resize: vertical;" id="problem_comment" class="idle" name="call_content" cols="300" rows="4">' . $res['problem_comment'] . '</textarea>
							</td>
						</tr>	
					</table>';
    $data .= '
				</fieldset >
		   
				
			</div>
			<div>
				  </fieldset>
			</div>
			<div style="float: right;  width: 355px;">
				 					    
<!---------------------------------------------------------------კლიენტი---------------------------------------------------------------------------->							    
				 <fieldset onload="legal()">
					<legend>მომართვის ავტორი</legend>
					<table style="height: 172px;">
						<tr style="height:20px;">
							<td style="padding: 0px 0px 10px 45px;"><input type="radio" style="float:left;" class="legal" onclick="legal()" value="fhisical" name="legal" ' . ($res['abonent_status'] == "fhisical" ? "checked" : "checked") . '><span style="display: inline-block; margin: 8px;" >ფიზიკური </span></td>
							<td style="width: 180px; height:20px;"><input type="radio" style="float:left;" class="legal" onclick="legal()" value="Jural" name="legal" ' . ($res['abonent_status'] == "Jural" ? "checked" : "") . '><span style="display: inline-block; margin: 8px;">იურიდიული </td>
						</tr>
						<tr style="height:20px;">
							<td style="width: 180px; height:20px;">ტელეფონი</td>
							<td style="width: 180px; height:20px;"><div class="fhisical">პირადი ნომერი</div><div class="Jural">საიდენთიპიკაციო კოდი</div></td>
						</tr>	    
						<tr style="height:40px;">
							<td style="width: 180px; height:20px;"><input type="text" id="abonent_phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['abonent_phone'] . '" /></td>
                            <td style="width: 180px; height:20px;"><input type="text" id="abonent_pin" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['abonent_pin'] . '" /></td>
						</tr>
						<tr style="height:20px;">
							<td colspan="2" style="height:20px;"><div class="fhisical">აბონენტის სახელი გვარი</div><div class="Jural">ორგანიზაცია</div></td>
						</tr>
						<tr style="height:40px;">
							<td colspan="2" style="height:20px;">
								<input type="text" id="abonent_name" style="width: 328px;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['abonent_name'] . '" />
							</td>		
						</tr>
						<tr style="height:20px;" class="Jural">
							<td colspan="2" style="height:20px;">პასუხისმგებელი პირი</td>
						</tr>		    
						<tr style="height:40px;" class="Jural">
							<td colspan="2" style="height:20px;">
								<input type="text" id="abonent_responsibl_person" style="width: 328px;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['abonent_responsibl_person'] . '" />
							</td>		
						</tr>		    
						<tr style="height:20px;">
							<td colspan="2" style="height:20px;">მისამართი</td>
						</tr>
						<tr style="height:20px;">
							<td colspan="2" style="height:40px;">
								<textarea type="text" id="abonent_address" style="width: 328px; resize: vertical;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'"  >' . $res['abonent_address'] . '</textarea>
							</td>		
						</tr>
						<tr style="height:20px;">
							<td style="width: 180px;"></td>
							<td style="width: 180px;">აბონენტის ნომერი</td>
						</tr>	    
						<tr style="height:40px;">
							<td style="width: 180px;">შენიშვნა</td>
                            <td style="width: 180px;"><input type="text" id="abonent_number" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['abonent_number'] . '" /></td>
						</tr>
                        <tr style="height:40px;">
							<td colspan="2">
								<textarea type="text" id="abonent_coment" style="width: 328px; resize: vertical;" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" >' . $res['abonent_coment'] . '</textarea>
							</td>		
						</tr>        		    		    
						
					</table>
				</fieldset>
				
				<div id="additional_info">';
    if (!empty($res['personal_pin'])) {
        $data .= get_addition_all_info($res['personal_pin']);
    }
    $data .= '</div>';
    $data .= GetRecordingsSection($res);
    $data .= '		<fieldset>
		         	<legend>დამატებითი ინფორმაცია</legend> 
		         	<table id="additiona1" class="hidden dialog-form-table" style="float: left; border: 1px solid #85b1de; width: 180px; text-align: center;">
			        <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
						<tr>
							<td>
								<div class="file-uploader">
									<input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
									<button id="choose_button" class="download">აირჩიეთ ფაილი</button>
									<input id="hidden_inc" type="text" value="' . increment('task') . '" style="display: none;">
								</div>
							</td>
						</tr>
					</table>
				     <table style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">
				          <tr style="border-bottom: 1px solid #85b1de;">
				           <td colspan="3">მიმაგრებული ფაილი</td>
				          </tr>
					</table>
					<table id="file_div" style="float: right; border: 1px solid #85b1de; width: 150px; text-align: center;">';
    while ($increm_row = mysql_fetch_assoc($increm)) {
        $data .= ' 
									        <tr style="border-bottom: 1px solid #85b1de;">
									          <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>													 
									          <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
									          <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
									        </tr>';
    }
    $data .= '
		 		</table>
		        </fieldset>
							
			</div>
		<!-- ID -->
		<input type="hidden" id="req_id" value="' . $res['id'] . '" />
    </div>';
    return $data;
}
function GetPage($res = '', $number)
{
    $c_date = date('Y-m-d H:i:s');
    $num = 0;
    if ($res[source] == "") {
        $num = $number;
    } else {
        $num = $res[source];
    }
    if ($res[date] == "") {
        $date = $c_date;
    } else {
        $date = $res[date];
    }
    if ($res[id] != '') {
        $disable = '';
        $dis_val = 1;
    } else {
        $disable = '';
        $dis_val = 0;
    }
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<input id="disable_all" type="hidden" value="0">
    	<input id="update_status" type="hidden" value="0">
	</div>
	<div id="dialog-form">
	<table width="100%" class="dialog-form-table">
        <tr>
            <td style="vertical-align: top;">
                <fieldset style="width: 190px; margin-top: 55px;">
                	<legend>ძირითადი ინფორმაცია</legend>
                    <table class="dialog-form-table">
                		<tr>
                            <td>
                			     <label for="req_num">ავტორი</label>
                            </td>
                            <td>
                			     <label for="req_num">:</label>
                            </td>
                            <td>
                			     <label for="req_num">' . $res['operator'] . '</label>
                			</td>
                		</tr>
            		</table>
                	<table width="100%" class="dialog-form-table">
            			<tr>
            				<td style="width: 180px;"><label for="req_num">მომართვა №</label></td>
                		</tr>
                	    <tr>
            				<td style="width: 100px;">
            					<input style="width: 180px;" type="text" id="id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
            				</td>
            		    </tr>
            			<tr>
            				<td style="width: 180px !important;"><label  for="req_data">თარიღი</label></td>
                		</tr>
            		    <tr>
            				<td style="width: 180px;">
            					<input style="width: 180px;" type="text" id="call_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $date . '" disabled="disabled" />
            				</td>
            			</tr>
            			<tr>
            				<td style="width: 180px;"><label  for="req_phone">ტელეფონი</label></td>
                	    </tr>
            			<tr>
            				<td style="width: 150px;">
            					<input style="width: 180px;" type="text" id="phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['phone'] . '" ' . $disable . ' />
            				</td>
            			</tr>
            			<tr>
            			    <td style="width: 180px;"><label  for="req_phone">სახელი</label></td>
            			</tr>
            			<tr>
            			    <td style="width: 180px;">
            					<input style="width: 180px;" type="text" id="client_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['name'] . '" ' . $disable . ' />
            				</td>
            			</tr>
            		    <tr>
            				<td style="width: 180px;"><label for="d_number">ზარის სტატუსი</label></td>
            			</tr>
            			<tr>
            				<td style="width: 180px;"><select style="width: 180px;" id="call_status" class="idls object" ' . $disable . '>' . Getcall_status($res['call_status_id']) . '</select></td>
            			</tr>
            		    <tr style="margin-top: 20px; margin-top=25px">
            				<td style="width: 180px;"><label for="content">დამატებითი ინფორმაცია</label></td>
            			</tr>
            			<tr>
            				<td colspan="5">
            					<div id="content">		
            					<textarea  style="width: 180px; resize: vertical; margin-top: 5px;" id="call_content" class="idle" name="call_content" cols="300" rows="2" ' . $disable . '>' . $res['call_content'] . '</textarea>
            					</div>
            				</td>
            			</tr>			
            		</table>
            	</fieldset>
                <fieldset style="margin-top: 5px; width: 190px;">
                	<legend>დავალების ფორმირება</legend>
                    <table class="dialog-form-table">
            			<tr style="display: none">
            				<td style="width: 180px; display: none"><label for="d_number">პასუხისმგებელი პირი</label></td>
            			</tr>
            			<tr style="display: none">
            				<td style="width: 180px; display: none"><select style="width: 180px;" id="persons_id" class="idls object" ' . $disable . '>' . Getpersons($res['responsible_user_id']) . '</select></td>
            		    </tr>
            			<tr>
            				<td style="width: 180px;"><label for="d_number">დეპარტამენტი</label></td>
            			</tr>
            			<tr>
            				<td style="width: 180px;"><select style="width: 180px;" id="department_id" class="idls object" ' . $disable . '>' . Getdepartment($res['department_id']) . '</select></td>
            			</tr>
                		<tr>
            				<td style="width: 180px;"><label for="d_number">დავალების ტიპი</label></td>
            			</tr>
            			<tr>
            				<td style="width: 180px;"><select style="width: 180px;" id="task_type_id" class="idls object" ' . $disable . '>' . Gettask_type($res['task_type_id']) . '</select></td>
            			</tr>
            			<tr>
            				<td style="width: 180px;"><label for="d_number">პრიორიტეტი</label></td>
            			</tr>
            		    <tr>
            				<td style="width: 180px;"><select style="width: 180px;" id="priority_id" class="idls object" ' . $disable . '>' . Getpriority($res['priority_id']) . '</select></td>
            			</tr>
                		<tr style="display: none">
            				<td style="width: 180px;"><label for="d_number">სხვა ნომერი</label></td>
            			</tr>
            			<tr>
            				<td style="width: 180px;"><label for="content">შინაარსი</label></td>
            			</tr>
            			<tr>
            				
            				<td>	
            					<textarea  style="width: 180px; resize: vertical;" id="problem_coment" class="idle" name="call_content" cols="300" rows="2" ' . $disable . '>' . $res['problem_comment'] . '</textarea>
            				</td>
            			</tr>	
            		</table>
                </fieldset>
        	</td>
            <td>
            	<fieldset id="search" style="float: right; margin-top: 7px; margin-top: 62px;">
            	</fieldset>
            </td>
        	<td style="vertical-align: top;">';
    $data .= '</div><div id="chanawerebi" style="float: right; width: 195px;">';
    $data .= GetRecordingsSection($res);
    $data .= '</div>
            </td>
        </tr>
    </table>
                    
        <input id="hidden_user" type="text" value="' . $res['user_id'] . '" style="display: none;">
    	<input id="asterisk_incomming_id" type="text" value="' . $res['asterisk_incomming_id'] . '" style="display: none;">
    	<input id="inc_id" type="text" value="' . $res['id'] . '" style="display: none;">
    	    
    </div>';
    return $data;
}
function GetPage($res = '', $number)
{
    $c_date = date('Y-m-d H:i:s');
    $num = 0;
    if ($res[phone] == "") {
        $num = $number;
    } else {
        $num = $res[phone];
    }
    if ($res[date] == "") {
        $date = $c_date;
    } else {
        $date = $res[date];
    }
    if ($res[incomming_call_id] != "") {
        $dis = 'disabled="disabled"';
    } else {
        $dis = '';
    }
    $increm = mysql_query("\tSELECT  `name`,\r\n\t\t\t\t\t\t\t\t\t`rand_name`\r\n\t\t\t\t\t\t\tFROM \t`file`\r\n\t\t\t\t\t\t\tWHERE   `incomming_call_id` = {$res['id']}");
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			<div style="float: left; width: 551px;">	
				<fieldset >
			    	<legend>ძირითადი ინფორმაცია</legend>
					<tr>
						<label for="req_num">დამფორმირებელი</label>
						<label for="req_num">:</label>
						<label for="req_num">' . $res['operator'] . '</label>
					</tr>
			    	<table width="100%" class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="req_num">მომართვა №</label></td>
							<td style="width: 180px !important;"><label for="req_data">თარიღი</label></td>
							<td style="width: 180px;"><label for="req_phone">ტელეფონი</label></td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="call_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $date . '" disabled="disabled" />
							</td>
							<td style="width: 180px;">
								<input type="text" id="phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $num . '" ' . $dis . '/>
							</td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="d_number">კატეგორია       <span style="color: #FA0000;">*</span></label></td>
							<td style="width: 180px;"><label for="d_number">ქვე-კატეგორია</label></td>
							<td style="width: 180px;"><label for="d_number"></label></td>
							<td ></td>
						</tr>
						<tr>
							<td style="width: 180px;"><select id="category_id" class="idls object">' . Getcategory($res['call_category_id']) . '</select></td>
							<td style="width: 180px;"><select id="category_parent_id" class="idls object">' . Getcategory1_edit($res['call_subcategory_id'], $res['call_category_id']) . '</select></td>
							<td style="width: 180px;"></td>
							<td ></td>
						</tr>
					</table>
						<tr style="margin-top: 20px;">
							<td style="width: 180px; "><label for="content">დამატებითი ინფორმაცია</label></td>
						</tr>
						<tr>
							
							<td colspan="6">
								<div id="content">		
								<textarea  style="width: 525px; resize: vertical; margin-top: 5px;" id="call_content" class="idle" name="call_content" cols="300" rows="2" ' . $dis . '>' . $res['call_content'] . '</textarea>
								</div>
							</td>
						</tr>			
					</table>
					<table class="dialog-form-table">
						<tr>
							<td style="width: 180px;"><label for="d_number">დავალების ტიპი</label></td>
							<td style="width: 180px;"><label for="d_number">სტატუსი</label></td>
							<td style="width: 180px;"><label for="d_number">პასუხისმგებელი პირი</label></td>
						</tr>
			    		<tr>
							<td style="width: 180px;"><select id="task_type_id" class="idls object" ' . $dis . '>' . Gettask_type($res['task_type_id']) . '</select></td>
							<td style="width: 180px;"><select id="task_status_id" class="idls object">' . Getcall_status($res['status']) . '</select></td>
							<td style="width: 180px;"><select id="persons_id" class="idls object" ' . $dis . '>' . Getpersons($res['responsible_user_id']) . '</select></td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="d_number">სხვა ნომერი</label></td>
							<td style="width: 180px;"></td>
							<td style="width: 180px;"></td>
						</tr>
			    		<tr>
							<td style="width: 180px;">
								<input type="text" id="out_phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['task_phone'] . '" ' . $dis . '/>
							</td>
							<td style="width: 180px;"></td>
							<td style="width: 180px;"></td>
							
						</tr>
						<tr>
							<td style="width: 180px;"><label for="content">შინაარსი</label></td>
						</tr>
						<tr>
							
							<td colspan="6">	
								<textarea  style="width: 525px; resize: vertical;" id="problem_coment" class="idle" name="call_content" cols="300" rows="2" ' . $dis . '>' . $res['problem_comment'] . '</textarea>
							</td>
						</tr>
						<tr>
							<td style="width: 180px;"><label for="content">პრობლემის გადაწყვეტა</label></td>
						</tr>
						<tr>
							<td colspan="6">	
								<textarea  style="width: 525px; resize: vertical;" id="comment" class="idle" name="call_content" cols="300" rows="2">' . $res['comment'] . '</textarea>
							</td>
						</tr>	
					</table>
		        </fieldset>
			</div>
			<div style="float: left; margin-left: 10px; width: 190px;">
				 <fieldset>
					<legend>მომართვის ავტორი</legend>
					<table style="height: 172px;">
						<tr>
							<td style="width: 180px;">რეგიონი</td>
						</tr>
						<tr>
							<td style="width: 180px;"><select id="region_id" class="idls object" ' . $dis . '>' . Get_region($res['region_id']) . '</select></td>
						</tr>
						<tr>
							<td style="width: 180px;">ქალაქი</td>
						</tr>
						<tr>
							<td style="width: 180px;"><select id="sity_id" class="idls object" ' . $dis . '>' . Get_city_edit($res['city_id'], $res['region_id']) . '</select></td>
						</tr>
						<tr>
							<td style="width: 180px;">DY კოდი</td>
						</tr>
						<tr>
							<td style="width: 180px;">
								<input type="text" id="DY_code" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['DY_code'] . '" ' . $dis . '/>
							</td>
						</tr>
					</table>
				</fieldset>
				<div id="additional_info">';
    $data .= '</div>';
    $data .= GetRecordingsSection($res);
    $data .= '	<fieldset style="display: inline-flex; width: 168px;">
					<legend>დამატებითი ინფორმაცია</legend> 
					<table style="float: left; border: 1px solid #85b1de; width: 168px; text-align: center;">
					<tr>
						<td>
							<div class="file-uploader">
								<input id="choose_file" type="file" name="choose_file" class="input" style="display: none;">
								<button id="choose_button" class="center">აირჩიეთ ფაილი</button>
								<input id="hidden_inc" type="text" value="' . increment('incomming_call') . '" style="display: none;">
							</div>
						</td>
					</tr>
				</table>
			     <table style="float: left; border: 1px solid #85b1de; width: 168px; text-align: center;">
			          <tr style="border-bottom: 1px solid #85b1de;">
			           <td colspan="3">მიმაგრებული ფაილი</td>
			          </tr>
				</table>
				<table id="file_div" style="float: left; border: 1px solid #85b1de; width: 168px; text-align: center;">';
    while ($increm_row = mysql_fetch_assoc($increm)) {
        $data .= ' 
								        <tr style="border-bottom: 1px solid #85b1de;">
								          <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>													 
								          <td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
								          <td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
								        </tr>';
    }
    $data .= '
	 		</table>
				</fieldset>
	 		</div>
	 		<input id="hidden_user" type="text" value="' . $res['user_id'] . '" style="display: none;">
	 		<input id="note" type="text" value="' . $res['note'] . '" style="display: none;">
    </div>';
    return $data;
}
function GetPage($res = '', $number)
{
    $num = 0;
    $disabled = '';
    $c_date = date('Y-m-d H:i:s');
    $user = $_SESSION['USERID'];
    if ($res[id] != '') {
        $res_row = mysql_fetch_assoc(mysql_query("SELECT persons.department_id,\r\n                                        \t             users.group_id\r\n                                        \t      FROM   users\r\n                                        \t      JOIN   persons ON persons.id=users.person_id\r\n                                        \t      WHERE  users.id={$user}"));
        if ($res_row[department_id] != 1 && $res_row[department_id] != 5) {
            $disabled = 'disabled="disabled"';
        }
    }
    if ($res[date] == "") {
        $date = $c_date;
    } else {
        $date = $res[date];
    }
    if ($res[date] == 0) {
        $diss = '';
        $diss1 = 'disabled="disabled"';
    } else {
        $diss = 'disabled="disabled"';
        $diss1 = '';
    }
    $data .= '
	<!-- jQuery Dialog -->
    <div id="add-edit-goods-form" title="საქონელი">
    	<!-- aJax -->
	</div>
	<div id="dialog-form">
			<div style="float: left; width: 800px;">	
				<fieldset >
			    	<legend>ძირითადი ინფორმაცია</legend>
					<tr>
						<label for="req_num">დამფორმირებელი</label>
						<label for="req_num">:</label>
						<label for="req_num">' . $res['operator'] . '</label>
					</tr>
			    	<table width="100%" class="dialog-form-table">
						<tr>
							<td style="width: 100px;"><label for="req_num">მომართვა №</label></td>
							<td style="width: 150px !important;"><label style="margin-left: -70px;" for="req_data">თარიღი</label></td>
							<td style="width: 150px;"><label style="margin-left: -55px;" for="req_phone">ტელეფონი</label></td>
						    <td style="width: 180px;"><label style="margin-left: -50px;" for="req_phone">სახელი</label></td>
						</tr>
						<tr>
							<td style="width: 100px;">
								<input style="width: 75px;" type="text" id="task_id" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['id'] . '" disabled="disabled" />
							</td>
							<td style="width: 150px;">
								<input style="width: 130px; margin-left: -70px;" type="text" id="call_date" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField date\'" value="' . $date . '" disabled="disabled" />
							</td>
							<td style="width: 150px;">
								<input style="width: 120px; margin-left: -55px;" type="text" id="phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['phone'] . '" ' . $diss . ' />
							</td>
						    <td style="width: 200px;">
								<input style="width: 200px; margin-left: -50px;" type="text" id="client_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['name'] . '" ' . $diss . '/>
							</td>
						</tr>
					    <tr>
						    <td style="width: 180px;"><label for="d_number">ზარის სტატუსი</label></td>
							<td colspan="3" style="width: 240px;"><label for="d_number">დავალების სტატუსი</label></td>
						</tr>
			    		<tr>
						    <td style="width: 180px;"><select style="width: 180px;" id="call_status" class="idls object" disabled="disabled">' . Getcall_status($res['call_status_id']) . '</select></td>
							<td colspan="3" style="width: 240px;"><select style="width: 230px;" id="task_status" class="idls object" ' . $diss1 . '>' . status($res['status']) . '</select></td>
						</tr>
					    <tr style="margin-top: 20px; margin-top=25px">
							<td style="width: 180px;"><label for="content">დამატებითი ინფორმაცია</label></td>
						</tr>
						<tr>
							<td colspan="6">
								<div id="content">		
								<textarea  style="width: 760px; resize: vertical; margin-top: 5px;" id="call_content" class="idle" name="call_content" cols="300" rows="2"' . $diss . '>' . $res['call_content'] . '</textarea>
								</div>
							</td>
						</tr>			
					</table>
				</fieldset >
		        </div>
				<div style="float: left; width: 800px;">
				   <fieldset style="margin-top: 5px;">
			    	<legend>დავალების ფორმირება</legend>
		
			    	<table class="dialog-form-table">
						<tr>
							<td style="width: 240px;"><label for="d_number">დეპარტამენტი</label></td>
							<td style="width: 240px;"><label for="d_number">დავალების ტიპი</label></td>
							<td style="width: 180px;"><label for="d_number">პრიორიტეტი</label></td>
						</tr>
			    		<tr>
							<td style="width: 240px;"><select style="width: 230px;" id="department_id" class="idls object" ' . $disabled . '>' . Getdepartment($res['department_id']) . '</select></td>
							<td style="width: 240px;"><select style="width: 230px;" id="task_type_id" class="idls object" ' . $disabled . '>' . Gettask_type($res['task_type_id']) . '</select></td>
							<td style="width: 180px;"><select style="width: 230px;" id="priority_id" class="idls object" ' . $disabled . '>' . Getpriority($res['priority_id']) . '</select></td>
						</tr>
						<tr>
							<td style="width: 240px;"><label for="content">შინაარსი</label></td>
						</tr>
						<tr>
							<td colspan="6">	
								<textarea  style="width: 760px; resize: vertical;" id="problem_coment" class="idle" name="call_content" cols="300" rows="2"' . $diss . '>' . $res['problem_comment'] . '</textarea>
							</td>
						</tr>
					    <tr>
							<td style="width: 240px;"><label for="content">პრობლემის გადაწყვეტა</label></td>
						</tr>
						<tr>
							<td colspan="6">	
								<textarea  style="width: 760px; resize: vertical;" id="comment" class="idle" name="call_content" cols="300" rows="2">' . $res['comment'] . '</textarea>
							</td>
						</tr>
						<tr>
							<td style="width: 240px;"><label for="content">პრობლემის გადაწყვეტა</label></td>
						</tr>
						<tr>
							<td colspan="6">	
								<textarea  style="width: 760px; resize: vertical;" id="comment1" class="idle" name="call_content" cols="300" rows="2">' . $res['comment1'] . '</textarea>
							</td>
						</tr>
					</table>
		        </fieldset>
			';
    $data .= '</div><div id=chanawerebi style="float: right; width: 195px; margin-top: -194px;">';
    $data .= GetRecordingsSection($res);
    $data .= GetRecordingsSection1($res);
    $data .= '	</table></fieldset></div>
	     
 		<input id="hidden_user" type="text" value="' . $res['user_id'] . '" style="display: none;">
 		<input id="asterisk_incomming_id" type="text" value="' . $res['asterisk_incomming_id'] . '" style="display: none;">
 		<input id="task_hide_id" type="text" value="' . $res['id'] . '" style="display: none;">
 		<input id="task_hide_department_id" type="text" value="' . $res['department_id'] . '" style="display: none;">
 	</div>';
    return $data;
}