Example #1
0
function GetPage($res, $increment, $open_number, $queue)
{
    if ($open_number != '') {
        $phone_check = mysql_fetch_array(mysql_query("  SELECT  `name` AS `cl_ab`,\n                                                                `client_number` AS `cl_ab_num`,\n                                                                `client_phone` AS `cl_phone`\n                                                        FROM    `caller_history`\n                                                        WHERE   `phone` = '{$open_number}'"));
    }
    //    $phone_check = '';
    if ($increment == '' && $res == '') {
        $increment = increment(incomming_call);
    }
    if ($queue == '') {
        $ch_queue = $res['dst_queue'];
    } else {
        $ch_queue = $queue;
    }
    $dis = '';
    $checked = '';
    if ($res != '') {
        $dis = 'disabled';
    } else {
        $checked = 'checked';
    }
    if ($res != '' && $res[client_status] == 1) {
        $data .= "<script>client_status('pers')</script>";
    } elseif ($res != '' && $res[client_status] == 2) {
        $data .= "<script>client_status('iuri')</script>";
    }
    if ($_SESSION['USERGR'] == 5 || $_SESSION['USERID'] == 6) {
        $disa = "disabled";
    }
    //$rr = mysql_fetch_array(mysql_query("SELECT scenario_id FROM queue WHERE number = '2471707'"));
    $data .= '
	<div id="dialog-form">
	    <fieldset style="width: 150px;  float: left;">
	       <input id="scenario_id" type="hidden" value="0" />
	       <table class="dialog-form-table">
	           
    	       <tr>
	               <td style="width: 125px;"><label for="incomming_id">მომართვის №</label></td>
	           </tr>
	           <tr>
	               <td><input disabled style="width: 125px;" id="incomming_id" type="text" value="' . ($res['id'] == '' ? $increment : $res['id']) . '"></td>
               </tr>
	           <tr>
	               <td style="width: 125px;"><label for="incomming_date">თარიღი</label></td>
	           </tr>
	           <tr>
	               <td><input disabled style="width: 125px;" id="incomming_date" type="text" value="' . ($res['call_date'] == '' ? date("Y-m-d H:i:s") : $res['call_date']) . '"></td>
               </tr>
	           <tr>
	               <td><label for="incomming_phone">ტელეფონი</td>
    	       </tr>
               <tr>
	               <td><input disabled style="width: 125px;" id="incomming_phone" type="text" value="' . $res['phone'] . '"></td>
    	       </tr>
	       </table>
	       
	       <table class="dialog-form-table">
	           <tr>
	               <td><label for="inc_status_id">რეაგირება</label></td>
	           </tr>
	           <tr>
	               <td><select id="inc_status_id" style="width: 130px;">' . get_IncStatus($res['inc_status_id']) . '</select></td>
	           </tr>
	           <tr>
	               <td><label for="incomming_comment">დამატებითი ინფორმაცია</label></td>
	           </tr>
	           <tr>
	               <td><textarea id="incomming_comment" style="resize: vertical;width: 125px;height: 285px;">' . $res['comment'] . '</textarea></td>
	           </tr>
	       </table>
	       
	    </fieldset>
	    
	    
        <div id="side_menu" style="float: left;height: 585px;width: 80px;margin-left: 10px; background: #272727; color: #FFF;">
	       <spam class="info" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'info\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/info.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ინფო</div></spam>
	       <spam class="scenar" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick=""><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/scenar.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ბილინგი</div></spam>
	       <spam class="task" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'task\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/task.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">დავალება</div></spam>
	       <spam class="sms" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'sms\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/sms.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">SMS</div></spam>
	       <spam class="mail" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'mail\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/mail.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">E-mail</div></spam>
	       <spam class="record" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'record\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/record.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ჩანაწერი</div></spam>
	       <spam class="file" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'file\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/file.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ფაილი</div></spam>
	       <spam class="question" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'question\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/question.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">შეკითხვა</div></spam>
	       <spam class="box" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick=""><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/box.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">კანცელა<br>რია</div></spam>
       </div>
	    
	    <div style="width: 900px;float: left;margin-left: 10px;" id="right_side">
            <fieldset style="display:block;" id="info">
	            <span class="hide_said_menu">x</span>
	                   
	                    
                        <table class="margin_top_10">
    	                   <tr>
        	                   <td><label style="width: 280px;" for="source_info_id">მეთოდი</label></td>
        	                   <td><label style="width: 280px;" for="service_center_id">მომსახურების ცენტრი</label></td>
        	                   <td><label style="width: 280px;" for="in_district_id">უბანი</label></td>
            	           </tr>
            	           <tr>
            	               <td><select id="source_info_id" style="width: 245px;">' . getsource_info_id($res['source_info_id']) . '</select></td>
            	               <td><select id="service_center_id" style="width: 245px;">' . getservice_center_id($res['service_center_id']) . '</select></td>
            	               <td><select id="in_district_id" style="width: 245px;">' . getin_district_id($res['service_center_id'], $res['in_district_id']) . '</select></td>
            	           </tr> 
	                   </table>
	                   <br>
	                   <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 6px;">
	                   <hr style="width: 75%;position: absolute;margin-left: -11px;border: 5px solid #fff;">
	                   <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 17px;">
	                   <br>
	                   
	                   <table class="margin_top_10">
                           <tr>
                               <td style="width: 280px;"><label for="cl_id">კანცელარიის ნომერი</label></td>
                               <td style="width: 280px;"><label for="cl_name">განმცხადებელი</label></td>
	                           <td style="width: 240px;"><label for="in_type_id">ტიპი</label></td>
                           </tr>
                           <tr>
                               <td><input type="text" style="width: 240px; resize: vertical;" id="cl_id" value="' . $res['cl_id'] . '"></td>
                               <td><input type="text" style="width: 240px; resize: vertical;" id="cl_name" value="' . $res['cl_name'] . '"></td>
                               <td><select style="width: 245px;" id="in_type_id">' . getin_type_id($res['in_type_id']) . '</select></td>
                           </tr>
                           <tr>
                               <td style="width: 280px;"><label for="cl_ab_num">აბონენტის ნომერი</label></td>
                               <td style="width: 280px;"><label for="cl_ab">აბონენტი</label></td>
	                           <td style="width: 240px;"><label for="cl_debt">მიმდინარე დავალიანება</label></td>
                           </tr>
                           <tr>
                               <td><input type="text" style="width: 200px; resize: vertical;float: left;" id="cl_ab_num" maxlength="10" onkeypress=\'return event.charCode >= 48 && event.charCode <= 57\' value="' . ($res['cl_ab_num'] == '' ? $phone_check[1] : $res[cl_ab_num]) . '"> <button id="go" style="cursor: pointer;float: right;margin-right: 34px;border: 0;padding: 7px;background: green;">GO</button></td>
                               <td><input type="text" style="width: 240px; resize: vertical;" id="cl_ab" value="' . ($res['cl_ab'] == '' ? $phone_check[0] : $res[cl_ab]) . '"></td>
                               <td><input type="text" style="width: 240px; resize: vertical;" id="cl_debt" value="' . $res['cl_debt'] . '"></td>
                           </tr>
                           <tr>
                               <td style="width: 280px;"><label for="cl_phone">ტელეფონის ნომერი</label></td>
	                           <td style="width: 240px;"><label for="branch_id">ფილიალი</label></td>
                               <td style="width: 240px;"><label for="cl_addres">მისამართი</label></td>
                           </tr>
                           <tr>
                               <td><input type="text" style="width: 240px; resize: vertical;" id="cl_phone" value="' . ($res['cl_phone'] == '' ? $phone_check[2] : $res[cl_phone]) . '"></td>
                               <td><select style="width: 245px;" id="branch_id">' . getbranch_id($res['service_center_id']) . '</select></td>
                               <td><input type="text" style="width: 240px; resize: vertical;" id="cl_addres" value="' . $res['cl_addres'] . '"></td>
                           </tr>
                        </table>
                        <br>
	                    <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 6px;">
	                    <hr style="width: 75%;position: absolute;margin-left: -11px;border: 5px solid #fff;">
	                    <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 17px;">
	                    <br>
                        <table class="margin_top_10">
            	           <tr>
            	               <td><label style="width: 280px;" for="incomming_cat_1">ზარის კატეგორია</label></td>
            	               <td><label style="width: 280px;" for="incomming_cat_1_1">ზარის ქვე-კატეგორია 1</label></td>
	                           <td><label style="width: 280px;" for="incomming_cat_1_1_1">ზარის ქვე-კატეგორია 2</label></td>
            	           </tr>
            	           <tr>
	                           <td><select id="incomming_cat_1" style="width: 245px;">' . get_cat_1($res['cat_1']) . '</select></td>
            	               <td><select id="incomming_cat_1_1" style="width: 245px;">' . get_cat_1_1($res['cat_1'], $res['cat_1_1']) . '</select></td>
            	               <td><select id="incomming_cat_1_1_1" style="width: 245px;">' . get_cat_1_1_1($res['cat_1_1'], $res['cat_1_1_1']) . '</select></td>
                	       </tr>
            	        </table>
            	        <br>
	                    <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 6px;">
	                    <hr style="width: 75%;position: absolute;margin-left: -11px;border: 5px solid #fff;">
	                    <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 17px;">
	                    <br>
            	        <div id="check_history" style="padding-top: 15px;">
            	            <div style="float: left; width: 878px;">
        	                <span style="float: left;">
                            <label for="start_check" style="margin-left: 110px;">-დან</label>
                            <input class="callapp_filter_body_span_input date_input" type="text" id="start_check" style="width: 100px;" value="' . date('Y-m-d', strtotime('-10 days')) . '">
                            </span>
                            <span style="float: left;margin-left: 12px;">
                            <label for="end_check" style="margin-left: 110px;">-მდე</label>
                            <input class="callapp_filter_body_span_input date_input" type="text" id="end_check" style="width: 100px;" value="' . date('Y-m-d') . '">
                            </span>
            	            <span style="float: left;margin-left: 12px;">
                            <label for="check_ab" style="margin-left: 195px;">აბონენტი</label>
                            <input class="callapp_filter_body_span_input" type="text" id="check_ab" style="width: 185px;">
                            </span>
                            <span style="margin-left: 25px;float: left;">
                            <select id="task_status_ck" style="width: 240px;">' . getStatusTaskCK() . '</select>
                            </span>
            	            </div>
            	            <table class="display" id="table_history" style="width: 100%;">
                                <thead>
                                    <tr id="datatable_header">
                                        <th>ID</th>
                                        <th style="width: 120px;">თარიღი</th>
                                        <th style="width: 120px;">აბონენტიოს ნომერი</th>
                                        <th style="width: 25%;">ტელეფონის ნომერი</th>
                                        <th style="width: 25%;">კომენტარი</th>
                                        <th style="width: 25%;">შედეგი</th>
                                        <th style="width: 25%;">სტატუსი</th>
                                    </tr>
                                </thead>
                                <thead>
                                    <tr class="search_header">
                                        <th class="colum_hidden">
                                    	   <input type="text" name="search_id" value="ფილტრი" class="search_init" />
                                        </th>             
                                        <th>
                                            <input type="text" name="search_category" value="ფილტრი" class="search_init" />
                                        </th>            
                                        <th>
                                            <input type="text" name="search_category" value="ფილტრი" class="search_init" />
                                        </th>
                                        <th>
                                            <input type="text" name="search_category" value="ფილტრი" class="search_init" />
                                        </th>
                                        <th>
                                            <input type="text" name="search_phone" value="ფილტრი" class="search_init" />
                                        </th>
                                        <th>
                                            <input type="text" name="search_category" value="ფილტრი" class="search_init" />
                                        </th>
            	                        <th>
                                            <input type="text" name="search_category" value="ფილტრი" class="search_init" />
                                        </th>          
                                    </tr>
                                </thead>
                            </table>
            	        </div>
	    
            </fieldset>
    	    
            <fieldset style="display:none;" id="task">
                <legend>დავალების ფორმირება</legend>
	            <span class="hide_said_menu">x</span>
	            <table>
	               <tr>
                       <td style="width: 280px;"><label for="task_status_id">სტატუსი</label></td>
                       <td style="width: 280px;"><label for="task_send">ფორმირება</label></td>
	               </tr>	              
	               <tr>
	                   <td><select id="task_status_id" style="width: 240px;" disabled>' . getStatusTask($res[task_status_id]) . '</select></td>
	                   <td style="width: 280px;"><input ' . $disa . ' type="checkbox" id="task_send" value="0" ' . ($res[task_date] == '' ? '' : 'checked') . '/></td>
	               </tr>
	               <tr>
	                   <td><label for="task_start_date">ფორმირების თარიღი</label></td>
	                   <td><label for="task_start_date">პერიოდი</label></td>
	                   <td><label></label></td>
	               </tr>	              
	               <tr>
	                   <td><input style="float: left;width: 235px;" id="task_create_date" type="text" value="' . ($res[task_date] == '' ? date("Y-m-d h:i:s") : $res[task_date]) . '"></label></td>
	                   <td><input style="float: left;width: 235px;" id="task_start_date" type="text" value="' . $res[task_start_date] . '"><label for="task_start_date" style="float: left;margin-top: 7px;margin-left: 2px;">-დან</label></td>
	                   <td><input style="float: left;width: 235px;" id="task_end_date" type="text" value="' . $res[task_end_date] . '"><label for="task_end_date" style="float: left;margin-top: 7px;margin-left: 2px;">-მდე</label></td>
	               </tr>
	               <tr>
	                   <td><label for="task_description">კომენტერი</label></td>
	               </tr>
	               <tr>
	                   <td colspan=3><textarea style="resize: vertical;width: 800px;" id="task_description">' . $res[task_description] . '</textarea></td>
	               </tr>
	               <tr>
	                   <td><label for="task_note">შედეგი</label></td>
	               </tr>
	               <tr>
	                   <td colspan=3><textarea style="resize: vertical;width: 800px;" id="task_note" disabled>' . $res[task_note] . '</textarea></td>
	               </tr>
	            </table>
            </fieldset>
            
            <fieldset style="display:none;" id="sms">
                <legend>SMS</legend>
	            <span class="hide_said_menu">x</span>	 
	            <div class="margin_top_10">           
	            <div id="button_area">
                    <button id="add_sms">ახალი SMS</button>
                </div>
                <table class="display" id="table_sms" >
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 100%;">თარიღი</th>
                            <th style="width: 100%;">ადრესატი</th>
                            <th style="width: 100%;">ტექსტი</th>
                            <th style="width: 100%;">სტატუსი</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                        	   <input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            </div>
            </fieldset>
            
            <fieldset style="display:none;" id="mail">
                <legend>E-mail</legend>
	            <span class="hide_said_menu">x</span>
	            <div class="margin_top_10">           
	            <div id="button_area">
                    <button id="add_mail">ახალი E-mail</button>
                </div>
                <table class="display" id="table_mail" >
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 100%;">თარიღი</th>
                            <th style="width: 100%;">ადრესატი</th>
                            <th style="width: 100%;">გზავნილი</th>
                            <th style="width: 100%;">სტატუსი</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                        	    <input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            </div>
            </fieldset>
            
            <fieldset style="display:none;" id="record">
                <legend>ჩანაწერები</legend>
	            <span class="hide_said_menu">x</span>
	                ' . show_record($res) . '
            </fieldset>
            
            <fieldset style="display:none;" id="file">
                <legend>ფაილი</legend>
	            <span class="hide_said_menu">x</span>
	                ' . show_file($res) . '
            </fieldset>
	                    
	        <fieldset style="display:none;" id="question">
                <legend>შეკითხვა</legend>
	            <span class="hide_said_menu">x</span>
	                    <div style="margin-top:30px;">
	                <table class="display" id="table_question">
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 50%;">კითხვა</th>
                            <th style="width: 50%;">პასუხი</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                        	    <input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                        </tr>
                    </thead>
                </table>
	                    </div>
            </fieldset>
	        <fieldset style="display:none;" id="box">
                
            </fieldset>
                    <fieldset style="display:none;height: 600px;" id="scenar">
                        
	       </fieldset>
	    </div>
	</div><input type="hidden" value="' . $res[id] . '" id="hidden_id">';
    return $data;
}
Example #2
0
function GetPage($res, $increment, $open_number, $queue)
{
    echo $increment;
    if ($increment == '' && $res == '') {
        $increment = increment(incomming_call);
    }
    if ($queue == '') {
        $ch_queue = $res['dst_queue'];
    } else {
        $ch_queue = $queue;
    }
    $dis = '';
    $checked = '';
    if ($res != '') {
        $dis = 'disabled';
    } else {
        $checked = 'checked';
    }
    if ($res != '' && $res[client_status] == 1) {
        $data .= "<script>client_status('pers')</script>";
    } elseif ($res != '' && $res[client_status] == 2) {
        $data .= "<script>client_status('iuri')</script>";
    }
    $rr = mysql_fetch_array(mysql_query("SELECT scenario_id FROM queue WHERE number = '{$ch_queue}'"));
    $data .= '
	<div id="dialog-form">
	    <fieldset style="width: 150px;  float: left;">
	       <input id="scenario_id" type="hidden" value="' . $rr[0] . '" />
	       <table class="dialog-form-table">
	           
    	       <tr>
	               <td style="width: 125px;"><label for="incomming_id">მომართვის №</label></td>
	           </tr>
	           <tr>
	               <td><input disabled style="width: 125px;" id="incomming_id" type="text" value="' . ($res['id'] == '' ? $increment : $res['id']) . '"></td>
               </tr>
	           <tr>
	               <td style="width: 125px;"><label for="incomming_date">თარიღი</label></td>
	           </tr>
	           <tr>
	               <td><input disabled style="width: 125px;" id="incomming_date" type="text" value="' . ($res['call_date'] == '' ? date("Y-m-d H:i:s") : $res['call_date']) . '"></td>
               </tr>
	           <tr>
	               <td><label for="incomming_phone">ტელეფონი</td>
    	       </tr>
               <tr>
	               <td><input disabled style="width: 125px;" id="incomming_phone" type="text" value="' . $res['phone'] . '"></td>
    	       </tr>
	       </table>
	       <table class="dialog-form-table">
	           
	           <tr>
	               <td><label for="incomming_cat_1">ზარის კატეგორია</label></td>
	           </tr>
	           <tr>
	               <td><select id="incomming_cat_1" style="width: 130px;">' . get_cat_1($res['cat_1']) . '</select></td>
	           </tr>
	           <tr>
	               <td><label for="incomming_cat_1_1">ზარის ქვე-კატეგორია 1</label></td>
	           </tr>
	           <tr>
	               <td><select id="incomming_cat_1_1" style="width: 130px;">' . get_cat_1_1($res['cat_1'], $res['cat_1_1']) . '</select></td>
	           </tr>
	           <tr>
	               <td><label for="incomming_cat_1_1_1">ზარის ქვე-კატეგორია 2</label></td>
    	       </tr>
	           <tr>
	               <td><select id="incomming_cat_1_1_1" style="width: 130px;">' . get_cat_1_1_1($res['cat_1_1'], $res['cat_1_1_1']) . '</select></td>
    	       </tr>
	       </table>
	       <table class="dialog-form-table">
	           <tr>
	               <td><label for="inc_status_id">რეაგირება</label></td>
	           </tr>
	           <tr>
	               <td><select id="inc_status_id" style="width: 130px;">' . get_IncStatus($res['inc_status_id']) . '</select></td>
	           </tr>
	           <tr>
	               <td><label for="incomming_comment">დამატებითი ინფორმაცია</label></td>
	           </tr>
	           <tr>
	               <td><textarea id="incomming_comment" style="resize: vertical;width: 125px;height: 50px;">' . $res['comment'] . '</textarea></td>
	           </tr>
	       </table>
	       
	    </fieldset>
	    
	    
        <div id="side_menu" style="float: left;height: 520px;width: 80px;margin-left: 10px; background: #272727; color: #FFF;">
	       <spam class="info" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'info\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/info.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ინფო</div></spam>
	       <spam class="scenar" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'scenar\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/scenar.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ბილინგი</div></spam>
	       <spam class="task" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'task\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/task.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">დავალება</div></spam>
	       <spam class="sms" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'sms\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/sms.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">SMS</div></spam>
	       <spam class="mail" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'mail\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/mail.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">E-mail</div></spam>
	       <spam class="record" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'record\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/record.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ჩანაწერი</div></spam>
	       <spam class="file" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'file\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/file.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">ფაილი</div></spam>
	       <spam class="question" style="display: block;padding: 10px 5px;  cursor: pointer;" onclick="show_right_side(\'question\')"><img style="padding-left: 22px;padding-bottom: 5px;" src="media/images/icons/question.png" alt="24 ICON" height="24" width="24"><div style="text-align: center;">შეკითხვა</div></spam> 
       </div>
	    
	    <div style="width: 900px;float: left;margin-left: 10px;" id="right_side">
            <fieldset style="display:none;" id="info">
	            <span class="hide_said_menu">x</span>
	                   
                        <table class="margin_top_10">
    	                   <tr>
        	                   <td><label style="width: 280px;" for="in_sorce_info_id">ინფორმაციის წყარო</label></td>
        	                   <td><label style="width: 280px;" for="in_service_center_id">მომსახურების ცენტრი</label></td>
        	                   <td><label style="width: 280px;" for="in_district_id">უბანი</label></td>
            	           </tr>
            	           <tr>
            	               <td><select id="in_sorce_info_id" style="width: 245px;">' . getin_sorce_info_id($res['in_sorce_info_id']) . '</select></td>
            	               <td><select id="in_service_center_id" style="width: 245px;">' . getin_service_center_id($res['in_service_center_id']) . '</select></td>
            	               <td><select id="in_district_id" style="width: 245px;">' . getin_district_id($res['in_district_id']) . '</select></td>
            	           </tr>
	                   </table>
	                   <br>
	                   <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 6px;">
	                   <hr style="width: 75%;position: absolute;margin-left: -11px;border: 5px solid #fff;">
	                   <hr style="width: 75%;position: absolute;margin-left: -11px;margin-top: 17px;">
	                   <br>
	                   
	                   <table class="margin_top_10">
                           <tr>
                               <td style="width: 280px;"><label for="cl_id">კანცელარიის ნომერი</label></td>
                               <td style="width: 280px;"><label for="cl_name">განმცხადებელი</label></td>
	                           <td style="width: 240px;"><label for="in_type_id">ტიპი</label></td>
                           </tr>
                           <tr>
                               <td><textarea style="width: 240px; resize: vertical;" id="cl_id" >' . $res['cl_id'] . '</textarea></td>
                               <td><textarea style="width: 240px; resize: vertical;" id="cl_name" >' . $res['cl_name'] . '</textarea></td>
                               <td><select style="width: 245px;" id="in_type_id">' . getin_type_id($res['in_type_id']) . '</select></td>
                           </tr>
                           <tr>
                               <td style="width: 280px;"><label for="cl_ab">აბონენტი</label></td>
                               <td style="width: 280px;"><label for="cl_ab_num">აბონენტის ნომერი</label></td>
	                           <td style="width: 240px;"><label for="cl_addres">მისამართი</label></td>
                           </tr>
                           <tr>
                               <td><textarea style="width: 240px; resize: vertical;" id="cl_ab" >' . $res['cl_ab'] . '</textarea></td>
                               <td><textarea style="width: 240px; resize: vertical;" id="cl_ab_num" maxlength="10" onkeypress=\'return event.charCode >= 48 && event.charCode <= 57\'>' . $res['cl_ab_num'] . '</textarea></td>
                               <td><textarea style="width: 240px; resize: vertical;" id="cl_addres" >' . $res['cl_addres'] . '</textarea></td>
                           </tr>
                           <tr>
                               <td style="width: 280px;"><label for="cl_phone">ტელეფონის ნომერი</label></td>
	                           <td style="width: 240px;"><label for="in_branch_id">ფილიალი</label></td>
                           </tr>
                           <tr>
                               <td><textarea style="width: 240px; resize: vertical;" id="cl_phone" >' . $res['cl_phone'] . '</textarea></td>
                               <td><select style="width: 245px;" id="in_branch_id">' . getin_branch_id($res['in_branch_id']) . '</select></td>
                           </tr>
                        </table>
	    
            </fieldset>
    	    
            <fieldset style="display:none;" id="task">
                <legend>დავალების ფორმირება</legend>
	            <span class="hide_said_menu">x</span>
	            <table>
	               <tr>
                       <td style="width: 280px;"><label for="task_controler_id">პასუხისმგებელი სამსახური</label></td>
	                   <td style="width: 280px;"><label for="task_recipient_id">პასუხისმგებელი პირი</label></td>
                       <td style="width: 280px;"><label for="task_status_id">სტატუსი</label></td>
	               </tr>	              
	               <tr>
                       <td><select style="width: 240px;" id="task_departament_id">' . GetDepartament($res[task_departament_id]) . '</select></td>
	                   <td><select style="width: 240px;" id="task_recipient_id">' . getUsers($res[task_recipient_id]) . '</select></td>
	                   <td><select style="width: 240px;" id="task_status_id">' . getStatusTask($res[task_status_id]) . '</select></td>
	               </tr>
	               <tr>
	                   <td><label for="task_start_date">ფორმირების თარიღი</label></td>
	                   <td><label for="task_start_date">პერიოდი</label></td>
	                   <td><label></label></td>
	               </tr>	              
	               <tr>
	                   <td><input style="float: left;width: 235px;" id="task_create_date" type="text" value="' . ($res[task_date] == '' ? date("Y-m-d h:i:s") : $res[task_date]) . '"></label></td>
	                   <td><input style="float: left;width: 235px;" id="task_start_date" type="text" value="' . $res[task_start_date] . '"><label for="task_start_date" style="float: left;margin-top: 7px;margin-left: 2px;">-დან</label></td>
	                   <td><input style="float: left;width: 235px;" id="task_end_date" type="text" value="' . $res[task_end_date] . '"><label for="task_end_date" style="float: left;margin-top: 7px;margin-left: 2px;">-მდე</label></td>
	               </tr>
	               <tr>
	                   <td><label for="task_description">კომენტერი</label></td>
	               </tr>
	               <tr>
	                   <td colspan=3><textarea style="resize: vertical;width: 800px;" id="task_description">' . $res[task_description] . '</textarea></td>
	               </tr>
	               <tr>
	                   <td><label for="task_note">შედეგი</label></td>
	               </tr>
	               <tr>
	                   <td colspan=3><textarea style="resize: vertical;width: 800px;" id="task_note">' . $res[task_note] . '</textarea></td>
	               </tr>
	            </table>
            </fieldset>
            
            <fieldset style="display:none;" id="sms">
                <legend>SMS</legend>
	            <span class="hide_said_menu">x</span>	 
	            <div class="margin_top_10">           
	            <div id="button_area">
                    <button id="add_sms">ახალი SMS</button>
                </div>
                <table class="display" id="table_sms" >
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 100%;">თარიღი</th>
                            <th style="width: 100%;">ადრესატი</th>
                            <th style="width: 100%;">ტექსტი</th>
                            <th style="width: 100%;">სტატუსი</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                        	   <input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            </div>
            </fieldset>
            
            <fieldset style="display:none;" id="mail">
                <legend>E-mail</legend>
	            <span class="hide_said_menu">x</span>
	            <div class="margin_top_10">           
	            <div id="button_area">
                    <button id="add_mail">ახალი E-mail</button>
                </div>
                <table class="display" id="table_mail" >
                    <thead>
                        <tr id="datatable_header">
                            <th>ID</th>
                            <th style="width: 100%;">თარიღი</th>
                            <th style="width: 100%;">ადრესატი</th>
                            <th style="width: 100%;">გზავნილი</th>
                            <th style="width: 100%;">სტატუსი</th>
                        </tr>
                    </thead>
                    <thead>
                        <tr class="search_header">
                            <th class="colum_hidden">
                        	    <input type="text" name="search_id" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                            	<input type="text" name="search_number" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                            <th>
                                <input type="text" name="search_date" value="ფილტრი" class="search_init" />
                            </th>
                        </tr>
                    </thead>
                </table>
	            </div>
            </fieldset>
            
            <fieldset style="display:none;" id="record">
                <legend>ჩანაწერები</legend>
	            <span class="hide_said_menu">x</span>
	                ' . show_record($res) . '
            </fieldset>
            
            <fieldset style="display:none;" id="file">
                <legend>ფაილი</legend>
	            <span class="hide_said_menu">x</span>
	                ' . show_file($res) . '
            </fieldset>
	                    
	        <fieldset style="display:none;" id="question">
                <legend>ფაილი</legend>
	            <span class="hide_said_menu">x</span>
	                
            </fieldset>';
    if ($rr[0] == '') {
        $my_scenario = $res['inc_scenario_id'];
    } else {
        $my_scenario = $rr[0];
    }
    $query = mysql_query("SELECT \t`question`.id,\n                    \t\t\t\t                    `question`.`name`,\n                    \t\t\t\t                    `question`.note,\n                                                        `scenario`.`name`,\n                \t\t                                `scenario_detail`.id AS sc_det_id,\n                \t\t                                `scenario_detail`.`sort`\n                                            FROM        `scenario`\n                                            JOIN        scenario_detail ON scenario.id = scenario_detail.scenario_id\n                                            JOIN        question ON scenario_detail.quest_id = question.id\n                                            WHERE       scenario.id = {$my_scenario} AND scenario_detail.actived = 1\n                                            ORDER BY    scenario_detail.sort ASC");
    $data .= '
                    <fieldset style="display:none;height: 600px;" id="scenar">
                        <legend>ბილინგი</legend>
		              <iframe src="http://localhost:8080/epro/client-side/call/biling.php" style="width: 875px; height:600px;"></iframe>
	       </fieldset>
	    </div>
	</div><input type="hidden" value="' . $res[id] . '" id="hidden_id">';
    return $data;
}