function GetPage($res = '') { $data = ' <div id="dialog-form"> <fieldset> <legend>ძირითადი ინფორმაცია</legend> <table class="dialog-form-table" style="margin:0 0 10px 0;"> <tr> <td style="width: 170px;"><label for="name">სახელი</label></td> <td> <input type="text" id="name" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['scenario_name'] . '" /> </td> </tr> <tr> <td style="width: 170px;"><label for="cat">კატეგორია</label></td> <td> <select style="width: 231px;" id="cat" class="idls object">' . GetCat($res[scenario_cat_id]) . '</select> </td> </tr> <tr> <td style="width: 170px;"><label for="le_cat">ქვე-კატეგორია</label></td> <td> <select style="width: 231px;" id="le_cat" class="idls object">' . GetLeCat($res[scenario_cat_id], $res[scenario_le_cat_id]) . '</select> </td> </tr> </table>'; if ($_REQUEST['quest_id'] != '') { if ($_REQUEST['quest_detail_id'] == '') { $data .= ' <div id="tabs" style="width: 98%; margin: 0 auto; margin-top: 25px;"> <ul> <li><a href="#tab-0">დიალოგური ფანჯარა</a></li> <li><a href="#tab-1">კითხვების რიგითობა</a></li> </ul> <div id="tab-0"> <div id="dt_example" class="inner-table"> <div id="button_area"> <button id="add_button_detail">დამატება</button> <button id="delete_button_detail">წაშლა</button> </div> <table class="" id="example2"> <thead > <tr id="datatable_header"> <th style="display:none;">ID</th> <th style="width: 60px;">#</th> <th style="width: 100%;">დასახელება</th> <th class="check">#</th> </tr> </thead> <thead> <tr class="search_header"> <th class="colum_hidden" style="display:none;"></th> <th> </th> <th> <input type="text" name="search_category" value="ფილტრი" class="search_init" /> </th> <th> <input type="checkbox" name="check-all" id="check-all-de"> </th> </tr> </thead> </table> </div> </div> <div id="tab-1">'; $i = 1; $query = mysql_query("SELECT \t `quest_1`.id,\r\n \t\t\t `quest_1`.`name`,\r\n \t\t\t `quest_1`.note,\r\n \t\t\t `scenario`.`name`\r\n \t\t\t FROM `scenario`\r\n \t\t\t JOIN scenario_detail ON scenario.id = scenario_detail.scenario_id\r\n \t\t\t JOIN quest_1 ON scenario_detail.quest_id = quest_1.id\r\n \t\t\t WHERE scenario.id = {$res['scenario_id']} AND scenario_detail.actived = 1\r\n \t\t\t ORDER BY scenario_detail.sort ASC"); $query2 = mysql_query(" SELECT \t`destination`,\r\n \t\t `answer_id`\r\n \t\t FROM \t`scenario_destination`\r\n \t\t JOIN \t`scenario_detail` ON scenario_destination.scenario_detail_id = scenario_detail.id\r\n \t\t JOIN \t`scenario` ON scenario_detail.scenario_id = scenario.id\r\n \t\t WHERE \t`scenario`.id = {$res['scenario_id']} AND scenario_destination.destination != 0"); while ($rame = mysql_fetch_array($query2)) { $destination .= ', ' . $rame[0]; $answer_id .= ', ' . $rame[1]; } $destination = substr($destination, 1); $answer_id = substr($answer_id, 1); //$row_scen = mysql_fetch_array($query); $data .= '<div id="dialog-form" style="width:102%; overflow-y:scroll; max-height:400px;"> <fieldset> <legend>კითხვები</legend>'; while ($row = mysql_fetch_array($query)) { if ($answer_id == '') { $answer_id = 0; } $query1 = mysql_query(" SELECT \tCASE \tWHEN quest_detail.quest_type_id = 1 THEN CONCAT('<tr><td style=\"width:707px; text-align:left;\"><input',IF(quest_detail.id in({$answer_id}) ,' checked',''), ' class=\"check_input\" style=\"float:left;\" type=\"checkbox\" name=\"checkbox', quest_1.id, '\" value=\"', quest_detail.id, '\"><label style=\"float:left; padding: 7px;\">', quest_detail.answer, '</label></td>')\r\n \t\t\t\t\t\t\tWHEN quest_detail.quest_type_id = 2 THEN CONCAT('<tr><td style=\"width:707px; text-align:left;\"><input value=\"\" class=\"inputtext\"style=\"float:left;\" type=\"text\" id=\"input|', quest_1.id, '|', quest_detail.id, '\" /> <label style=\"float:left; padding: 7px;\" for=\"input|', quest_1.id, '|', quest_detail.id, '\">',quest_detail.answer,'</label></td>')\r\n \t\t\t\t\t\t\tWHEN quest_detail.quest_type_id = 3 THEN CONCAT('<tr><td>',production.`name`,'</td><td>',production.`price`,'</td><td>',production.`description`,'</td><td>',production.`comment`,'</td><td><input class=\"prod_inp\" type=\"checkbox\" name=\"checkbox|', quest_1.id, '|',quest_detail.id, '\" value=\"', production.`id`, '\"></td></tr>')\r\n \t\t\t\t\t\t\tWHEN quest_detail.quest_type_id = 4 THEN CONCAT('<tr><td style=\"width:707px; text-align:left;\"><input',IF(quest_detail.id in({$answer_id}),' checked',''), ' class=\"radio_input\" style=\"float:left;\" type=\"radio\" name=\"radio', quest_1.id, '\" value=\"', quest_detail.id, '\"><label style=\"float:left; padding: 7px;\">', quest_detail.answer, '</label></td>')\r\n \t\t\t\t\t\t\tWHEN quest_detail.quest_type_id = 5 THEN CONCAT('<tr><td style=\"width:707px; text-align:left;\"><input value=\"\" class=\"date_input\"style=\"float:left;\" type=\"text\" id=\"input|', quest_1.id, '|', quest_detail.id, '\" /> <label style=\"float:left; padding: 7px;\" for=\"input|', quest_1.id, '|', quest_detail.id, '\">',quest_detail.answer,'</label></td>')\r\n \t\t\t\t\t\t\tWHEN quest_detail.quest_type_id = 6 THEN CONCAT('<tr><td style=\"width:707px; text-align:left;\"><input value=\"\" class=\"date_time_input\"style=\"float:left;\" type=\"text\" id=\"input|', quest_1.id, '|', quest_detail.id, '\" /> <label style=\"float:left; padding: 7px;\" for=\"input|', quest_1.id, '|', quest_detail.id, '\">',quest_detail.answer,'</label></td>')\r\n \t\t\t\t END AS `ans`,\r\n \t\tquest_detail.quest_type_id,\r\n \t\t\t \t\t IF(quest_detail.id in({$answer_id}) ,quest_detail.id,'') AS `checked_quest`,\r\n \t\t\t \t\t scenario_detail.id as sc_id,\r\n \t\t\t \t\t quest_detail.id as as_id,\r\n \t\t\t \t\t scenario_destination.destination as dest\r\n FROM `quest_detail`\r\n JOIN quest_1 ON quest_detail.quest_id = quest_1.id\r\n LEFT JOIN production ON quest_detail.product_id = production.id\r\n LEFT JOIN scenario_detail ON quest_1.id = scenario_detail.quest_id\r\n \t\t\t \t\t LEFT JOIN scenario_destination ON scenario_detail.id = scenario_destination.scenario_detail_id AND scenario_destination.answer_id = quest_detail.id\r\n LEFT JOIN scenario ON scenario_detail.scenario_id = scenario.id \r\n WHERE quest_detail.quest_id = {$row['0']} AND quest_detail.actived = 1 AND scenario.id = {$res['scenario_id']}\r\n GROUP BY quest_detail.id\r\n ORDER BY quest_1.id, quest_detail.quest_type_id ASC"); $data .= '<textarea style="width: 704px; height:100px; resize: none; background: #EBF9FF;" class="idle">' . $row[2] . '</textarea> <table class="dialog-form-table"> <tr> <td style="font-weight:bold;">' . $i++ . '. ' . $row[1] . '</td> </tr> '; while ($row1 = mysql_fetch_array($query1)) { $q_type = $row1[1]; $dest = $row1[5]; if ($row1[1] == 3) { $tr .= $row1[0]; $data1 = ' <style> #prod{ border:2px solid #85B1DE; width:100%; } #prod #prodtr{ background:#F2F2F2; } #prod th{ width:0%; padding:5px; border:1px solid #85B1DE; } #prod td{ border:1px solid #85B1DE; padding:2px; } #prod tr{ background: #FEFEFE } </style> <table id="prod"> <tr id="prodtr"> <th>დასახელება</th> <th>ფასი</th> <th>აღწერა</th> <th>კომენტარი</th> <th>#</th> </tr> ' . $tr . ' </table>'; } else { $data .= $row1[0]; $data .= ' <td style="float:left; width: 350px;"><select style="width: 231px;" id="scenarquest|' . $row1[3] . '|' . $row1[4] . '" class="idls object scenarquest">' . GetAlScenQuest($res[scenario_id], $dest) . '</select></td> </tr>'; } } if ($q_type == 3) { $data .= $data1; } $data .= '</table> <hr><br>'; } $data .= '</fieldset> </div>'; $data .= '</div> </div> '; } } if ($_REQUEST['quest_detail_id'] != '' || $_REQUEST['add_id'] != '') { $data .= ' <table class="dialog-form-table"> <tr> <td style="width: 170px;"><label for="quest_id1">კითხვა</label></td> <td> <select style="width: 231px;" id="quest_id1" class="idls object">' . GetQuest($res['quest_id'], $_REQUEST['quest_detail_id']) . '</select> </td> </tr> </table>'; } $data .= '<!-- ID --> <input type="hidden" id="quest_id" value="' . $res['scenario_id'] . '" /> <input type="hidden" id="quest_detail_id" value="' . $_REQUEST['quest_detail_id'] . '" /> <input type="hidden" id="add_id" value="' . $_REQUEST['add_id'] . '" /> <input type="hidden" id="dest_checker" value="0" /> </fieldset> </div> '; return $data; }
function pagee() { $disabled = ''; $other_disabled = ''; $user = $_SESSION['USERID']; $chek_gr = mysql_fetch_row(mysql_query("SELECT `group_id` FROM `users` WHERE `id` = '{$user}'; ")); if ($chek_gr[0] == 5) { $disabled = ''; } else { $disabled = 'disabled'; } if ($chek_gr[0] == 16) { $sacyobi = 'disabled'; } else { $sacyobi = ''; } if ($chek_gr[0] != 5) { $other_disabled = ''; } else { $other_disabled = 'disabled'; } if ($user == 34 || $user == 1 || $user == 3 || $user == 35 || $user == 48 || $user == 47 || $user == 7) { $disable_status = ''; } else { if ($chek_gr[0] == 5) { $disable_status = ''; } else { $disable_status = 'disabled'; } } $rResult = mysql_query("SELECT elva_sale_new.id,\r\n elva_sale_new.person_id,\r\n elva_sale_new.name_surname,\r\n elva_sale_new.mail,\r\n elva_sale_new.address,\r\n elva_sale_new.phone,\r\n elva_sale_new.phone1,\r\n shipping.`name` AS `period`,\r\n elva_sale_new.books,\r\n elva_sale_new.call_date,\r\n IF(elva_sale_new.`status` = 1, 0 , elva_sale_new.sum_price) as sum_price,\r\n elva_sale_new.callceenter_comment,\r\n elva_sale_new.operator_id AS operator_id,\r\n elva_sale_new.oder_send_date,\r\n elva_sale_new.`status`,\r\n elva_sale_new.coordinator_id,\r\n elva_sale_new.coordinator_comment,\r\n elva_sale_new.task_id,\r\n elva_sale_new.elva_status,\r\n elva_sale_new.period AS `period_id`,\r\n elva_sale_new.send_date,\r\n elva_sale_new.cancel_comment,\r\n elva_sale_new.cash,\r\n elva_sale_new.street_done,\r\n elva_sale_new.city_id,\r\n elva_sale_new.custom_prod,\r\n elva_sale_new.send_client_date,\r\n elva_sale_new.prod_cat,\r\n `status_p`,\r\n `oder_send_date_p`,\r\n `coordinator_id_p`,\r\n `coordinator_comment_p`,\r\n `elva_status_p`,\r\n elva_sale_new.main_status,\r\n elva_sale_new.main_status1,\r\n elva_sale_new.monitor,\r\n elva_sale_new.monitor1\r\n FROM `elva_sale_new`\r\n left JOIN shipping ON elva_sale_new.period = shipping.id\r\n WHERE elva_sale_new.id='{$_REQUEST['id']}'"); $res = mysql_fetch_array($rResult); $data['page'][0] = ''; $data['page'][0] .= '<div id="tabs" style="width: 99%; margin: 0 auto; min-height: 785px;"> <ul> <li><a href="#tab-0">ძირითადი ინფორმაცია</a></li> <li><a href="#tab-1">გაყიდვა</a></li> <li><a href="#tab-2">საუბრის ჩანაწერები</a></li> </ul> <div id="tab-0"> <div id="dialog-form"> <div style="float: left; width: 100%;" disabled> <fieldset > <input type="hidden" id="custom_prod" value="' . $res[custom_prod] . '" /> <legend>ძირითადი ინფორმაცია</legend> <fieldset > <table class="dialog-form-table"> <tr> <td style="width: 280px;"><label for="">პირადი №</label></td> <td style="width: 280px;"><label for="">სახელი გვარი</label></td> <td style="width: 280px;"><label for="">მეილი</label></td> <td style="width: 280px;"><label for="">ტელეფონი 1</label></td> </tr> <tr> <td><input id="person_id" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[person_id] . '" /></td> <td><input id="name_surname" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[name_surname] . '" /></td> <td><input id="mail" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[mail] . '" /></td> <td><input id="phone" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[phone] . '" /></td> </tr> <tr> <td style="width: 280px;"><label for="">ტელეფონი 2</label></td> <td style=""><label for="">ქალაქი / რეგიონი</label></td> <td style=""><label for="">მისმართი</label></td> <td><label for="">მისამართის დაზუსტება</label></td> </tr> <tr> <td><input id="phone1" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[phone1] . '" /></td> <td> <select style="width: 206px;" id="city_id" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetCity($res['city_id']) . '</select> </td> <td><input id="addres" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[address] . '" /></td> <td><input id="street_done" class="idle" style="width: 200px;" ' . $other_disabled . ' ' . $sacyobi . ' type="text" value="' . $res[street_done] . '" /></td> </tr> </table> </fieldset > <fieldset style="margin-top: 5px;"> <legend>დავალების ტიპი</legend> <table class="dialog-form-table" > <tr> <td style="width: 254px;"><label for="period">პერიოდი</label></td> <td style="width: 254px;"><label for="date">ქოლ-ცენტრის დარეკვის თარიღი</label></td> <td style="width: 254px;"><label for="op_id">ოპერატორი</label></td> <td style="width: 190px;"><label>გადასახდელი თანხა</label></td> </tr> <tr> <td> <select style="width: 206px;" id="period" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetPeriod($res['period_id']) . '</select> </td> <td><input style="width: 200px;" id="date" value="' . $res[call_date] . '" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '></td> <td><select style="width: 206px;" id="op_id" class="idls object" ' . $disable_status . ' >' . GetOperator($res['operator_id']) . '</select></td> <td><input style="width: 201px;" id="sum_price" value="' . $res[sum_price] . '" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '></td> </tr> </table> <table class="dialog-form-table" > <tr> <td style="width: 510px;"><label>ქოლცენტრის კომენტარი</label></td> <td style="width: 270px;"><label>გაუქმების მიზეზი</label></td> </tr> <tr> <td><textarea style="width: 456px; height:50px; resize: vertical;" id="c_coment" class="idle" name="content" cols="300" ' . $other_disabled . ' ' . $sacyobi . '>' . $res[callceenter_comment] . '</textarea> <td><textarea style="width: 503px; height:50px; resize: vertical;" id="cancel_comment" class="idle" cols="300" ' . $other_disabled . ' ' . $sacyobi . '>' . $res[cancel_comment] . '</textarea> </tr> <tr> <td style="width: 270px;"><label>გაგზავნის თარიღი</label> <label style="margin-left: 130px;">მიტანის სასურველი დრო</label></td> <td style="width: 270px;"><label>ნაღდი და უნაღდო</label> <label style="margin-left: 133px;">პროდუქტის სახეობა</label></td> </tr> <tr> <td><input style="width: 200px; float: left;" id="send_date" value="' . $res[send_date] . '" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '> <input style="width: 200px;float: left; margin-left: 50px;" id="send_client_date" value="' . $res[send_client_date] . '" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '></td> <td><div style="float:left; margin-right: 89px;"> <input style="float:left;" type="radio" class="cash_id" name="cash" value="1" ' . $other_disabled . ' ' . $sacyobi . ' ' . ($res[cash] == 1 ? 'checked' : "") . ' ><label style="float:left;margin:8px 15px 0 0;">ნაღდი</label> <input style="float:left;" type="radio" class="cash_id" name="cash" value="2" ' . $other_disabled . ' ' . $sacyobi . ' ' . ($res[cash] == 2 ? 'checked' : "") . ' ><label style="float:left;margin:8px 15px 0 0;">უნაღდო</label></div> <select style="width: 206px; float: left;" id="prod_cat" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetCat($res['prod_cat']) . '</select> </td> </tr> </table> <table class="dialog-form-table"> <tr> <td style="width: 270px;"><label>მთავარი სტატუსი</label> </tr> <tr> <td> ' . ($_REQUEST['dep_now'] == 'ელვა.ჯი' ? '<select style="width: 206px;" id="main_status" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetMainStatus($res['main_status']) . '</select>' : '<select style="width: 206px;" id="main_status1" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetMainStatus($res['main_status1']) . '</select>') . ' </td> <td> ' . ($_REQUEST['dep_now'] == 'ელვა.ჯი' ? '<select style="width: 206px;" id="monitor" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetMonitoring($res['monitor']) . '</select>' : '<select style="width: 206px;" id="monitor1" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '>' . GetMonitoring($res['monitor1']) . '</select>') . ' </td> </tr> </table> </fieldset> <fieldset style="margin-top: 5px; ' . ($_REQUEST['dep_now'] == 'კვირის პალიტრა' ? 'display:none;' : '') . ' "> <legend>ელვა.ჯი</legend> <table class="dialog-form-table" > <tr> <td style="width: 280px;"><label for="status">სტატუსი</label></td> <td style="width: 280px;"><label for="cooradinator">კოორდინატორი</label></td> <td style="width: 280px;"><label for="elva">ნინო (ელვა)</label></td> <td style="width: 280px;"><label for="oder_date">ქვითრის გაგზავნის დღე</label></td> </tr> <tr> <td> <select style="width: 206px;" id="status" class="idls object" ' . $disable_status . '>' . Getstatus($res['status']) . '</select> </td> <td><select style="width: 206px;" id="cooradinator" class="idls object" ' . $disable_status . '>' . GetCordin($res['coordinator_id']) . '</select></td> <td><input style="width: 200px;" id="elva" value="' . $res[elva_status] . '" class="idls object" ' . $disabled . ' ' . $sacyobi . '></td> <td><input style="width: 200px;" id="oder_date" value="' . ($res['oder_send_date'] != '' ? $res['oder_send_date'] : '') . '" class="idls object" ' . $disabled . ' ' . $sacyobi . '></td> </tr> </table> <table class="dialog-form-table" style="width: 720px;"> <tr> <td style="width: 520px;"><label>კოოდინატორის შენიშვნა</label></td> </tr> <tr> <td> <textarea style="width: 1015px; resize: vertical; height:80px;" id="k_coment" class="idle" name="content" cols="300" ' . $disable_status . '>' . $res[coordinator_comment] . '</textarea> </td> </tr> </table> </fieldset> <fieldset style="margin-top: 5px; ' . ($_REQUEST['dep_now'] == 'ელვა.ჯი' ? 'display:none;' : '') . '"> <legend>პალიტრა</legend> <table class="dialog-form-table" > <tr> <td style="width: 280px;"><label for="status">სტატუსი</label></td> <td style="width: 280px;"><label for="cooradinator">კოორდინატორი</label></td> <td style="width: 280px;"><label for="elva">თანხის მოტანის თარიღი</label></td> <td style="width: 280px;"><label for="oder_date">ქვითრის გაგზავნის დღე</label></td> </tr> <tr> <td> <select style="width: 206px;" id="status_p" class="idls object" ' . $disable_status . '>' . Getstatus($res['status_p']) . '</select> </td> <td><select style="width: 206px;" id="cooradinator_p" class="idls object" ' . $disable_status . '>' . GetCordin($res['coordinator_id_p']) . '</select></td> <td><input style="width: 200px;" id="elva_p" value="' . $res[elva_status_p] . '" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '></td> <td><input style="width: 200px;" id="oder_date_p" value="' . ($res['oder_send_date_p'] != '' ? $res['oder_send_date_p'] : '') . '" class="idls object" ' . $other_disabled . ' ' . $sacyobi . '></td> </tr> </table> <table class="dialog-form-table" style="width: 720px;"> <tr> <td style="width: 520px;"><label>კოოდინატორის შენიშვნა</label></td> </tr> <tr> <td> <textarea style="width: 1015px; resize: vertical; height:80px;" id="k_coment_p" class="idle" name="content" cols="300" ' . $disable_status . '>' . $res[coordinator_comment_p] . '</textarea> </td> </tr> </table> </fieldset> </fieldset> </div> </div> </div> <div id="tab-1"> <div id="dialog-form"> <fieldset> <legend>გაყიდვა</legend> <div id="dt_example" class="inner-table"> <div style="width:100%;" id="container" > <div id="dynamic"> <div id="button_area"> <button id="add_prod_but">დამატება</button> <button id="delete_prod_but">წაშლა</button> </div> <table id="sub1" style="width: 100%;"> <thead> <tr id="datatable_header"> <th style="width:5%; display:none;">#</th> <th style="width:20%;">შტრიხკოდი</th> <th style="width:20%;">თარიღი</th> <th style="width:20%;">მყიდველი</th> <th style="width:100%;">პროდუქტი</th> <th style="width:40%;">რაოდენობა</th> <th style="width:40%;">ერთის ფასი</th> <th style="width:40%;">ს. ფასი</th> <th style="width:100%;">დეპარტამენტი</th> <th style="width:5%;">#</th> </tr> </thead> <thead> <tr class="search_header"> <th style="display:none;"> <input style="width:20px;" type="text" name="search_overhead" value="" class="search_init" /> </th> <th> <input style="width:100px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:100px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:100px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:100px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:80px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:75px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:65px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:100px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input type="checkbox" name="check-all" id="check-all"> </th> </tr> </thead> <tfoot> <tr id="datatable_header" class="search_header"> <th style="width: 150px; display:none;"></th> <th style="width: 150px"></th> <th style="width: 150px"></th> <th style="width: 150px"></th> <th style="width: 150px"></th> <th style="width: 150px"></th> <th style="width: 150px; text-align: right;">ჯამი :<br>სულ :</th> <th style="width: 100px; text-align: right;" id="my_prod_sum"></th> <th style="width: 150px"></th> <th style="width: 150px"></th> </tr> </tfoot> </table> </div> <div class="spacer"> </div> </div></div> </fieldset> <fieldset> <legend>ცვლილებების ისტორია</legend> <div id="dt_example" class="inner-table"> <div style="width:100%;" id="container" > <div id="dynamic"> <div id="button_area"> </div> <table id="sub2" style="width: 100%;"> <thead> <tr id="datatable_header"> <th style="width:1%; display:none;"></th> <th style="width:25%;">რედაქტირებს თარიღი</th> <th style="width:20%;">ქმედება</th> <th style="width:100%;">ოპერატორი ძველი</th> <th style="width:100%;">ოპერატორი ახალი</th> <th style="width:100%;">პროდუქტი ძველი</th> <th style="width:100%;">პროდუქტი ახალი</th> <th style="width:10%;">რ-ბა ძველი</th> <th style="width:10%;">რ-ბა ახალი</th> <th style="width:10%;">ფასი ძველი</th> <th style="width:10%;">ფასი ახალი</th> <th style="width:10%;">სულ ფასი ძველი</th> <th style="width:10%;">სულ ფასი ახალი</th> </tr> </thead> <thead> <tr class="search_header"> <th style="display:none;"> </th> <th> <input style="width:60px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:30px;" type="text" name="search_overhead" value="" class="search_init" /> </th> <th> <input style="width:30px;" type="text" name="search_partner" value="" class="search_init" /> </th> <th> <input style="width:30px;" type="text" name="search_overhead" value="" class="search_init" /> </th> <th> <input style="width:30px;" type="text" name="search_partner" value="" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_partner" value="ფილტრი" class="search_init" /> </th> <th> <input style="width:60px;" type="text" name="search_overhead" value="ფილტრი" class="search_init" /> </th> </tr> </thead> </table> </div> <div class="spacer"> </div> </div></div> </fieldset> </div> <input type="hidden" id="id" value="' . $_REQUEST[id] . '" /> <input type="hidden" id="my_dep" value="' . $_REQUEST[dep_now] . '"/> </div> </fieldset> <div id="tab-2"> <div id="dialog-form"> ' . GetRecordingsSection($res) . ' </div> </div></div> </div>'; return $data['page'][0]; }
} ?> <tr<?php echo $style; ?> > <td><?php echo $row['name']; ?> </td> <td><?php echo $row['version']; ?> </td> <td><?php echo GetCat($row['catid']); ?> </td> <td><a href="?cat=installscripts&page=allscripts&install&id=<?php echo $row['id']; ?> ">Install</a></td> </tr> <?php } } else { echo '<tr><td colspan="4">None available at this time, sorry.</td></tr>'; } ?> </table>
function GetPage($res = '') { $data = ' <!-- ID --> <input type="hidden" id="quest_id" value="' . $res['scenario_id'] . '" /> <input type="hidden" id="quest_detail_id" value="' . $_REQUEST['id'] . '" /> <input type="hidden" id="add_id" value="' . $_REQUEST['add_id'] . '" /> <input type="hidden" id="dest_checker" value="0" /> <script>$("#cat,#le_cat,#quest_id1").chosen({ search_contains: true });$("#add-edit-form-answer,.add-edit-form-class,.add-edit-form-answer-class").css("overflow","visible")</script> <div id="dialog-form"> <fieldset> <legend>ძირითადი ინფორმაცია</legend> <table class="dialog-form-table" style="margin:0 0 10px 0;"> <tr> <td style="width: 170px;"><label for="name">სახელი</label></td> <td> <textarea type="text" id="name" style="margin: 0px; width: 226px; resize:vertical;">' . $res['scenario_name'] . '</textarea> </td> </tr> <tr> <td style="width: 170px;"><label for="">კატეგორია</label></td> <td> <select style="width: 231px;" id="cat" class="idls object">' . GetCat($res[scenario_cat_id]) . '</select> </td> </tr> <tr> <td style="width: 170px;"><label for="">ქვე-კატეგორია</label></td> <td> <select style="width: 231px;" id="le_cat" class="idls object">' . GetLeCat($res[scenario_cat_id], $res[scenario_le_cat_id]) . '</select> </td> </tr> </table>'; if ($_REQUEST['id'] != '') { if ($_REQUEST['quest_detail_id'] == '') { $data .= ' <div id="taab" style="margin: 0 auto; margin-top: 25px;"> <div id="callapp_tab"> <span id="tab1">დიალოგური ფანჯარა</span> <span id="tab2">კითხვების რიგითობა</span> <span id="tab3">შემოწმება</span> </div> <div id="tab_content_1"> <div id="button_area"> <button id="add_button_detail">დამატება</button> <button id="delete_button_detail">წაშლა</button> </div> <table class="display" id="table_quest" style="background-color: #FFF;"> <thead > <tr id="datatable_header"> <th style="display:none;">ID</th> <th style="width: 60px;">#</th> <th style="width: 100%;">დასახელება</th> <th class="check"> </th> </tr> </thead> <thead> <tr class="search_header"> <th class="colum_hidden" style="display:none;"> <input style="width: 100%;" type="text" name="search_category" value="ფილტრი" class="search_init" /> </th> <th> <input style="width: 100%;" type="text" name="search_category" value="ფილტრი" class="search_init" /> </th> <th> <input style="width: 100%;" type="text" name="search_category" value="ფილტრი" class="search_init" /> </th> <th> <div class="callapp_checkbox"> <input type="checkbox" id="check-all-de" name="check-all" /> <label for="check-all-de"></label> </div> </th> </tr> </thead> </table> </div> <div id="tab_content_2">'; $i = 1; $query = mysql_query("SELECT \t `question`.id,\r\n \t\t\t `question`.`name`,\r\n \t\t\t `question`.note,\r\n \t\t\t `scenario`.`name`\r\n \t\t\t FROM `scenario`\r\n \t\t\t JOIN scenario_detail ON scenario.id = scenario_detail.scenario_id\r\n \t\t\t JOIN question ON scenario_detail.quest_id = question.id\r\n \t\t\t WHERE scenario.id = {$res['scenario_id']} AND scenario_detail.actived = 1\r\n \t\t\t ORDER BY scenario_detail.sort ASC"); $query2 = mysql_query(" SELECT \t`destination`,\r\n \t\t `answer_id`\r\n \t\t FROM \t`scenario_destination`\r\n \t\t JOIN \t`scenario_detail` ON scenario_destination.scenario_detail_id = scenario_detail.id\r\n \t\t JOIN \t`scenario` ON scenario_detail.scenario_id = scenario.id\r\n \t\t WHERE \t`scenario`.id = {$res['scenario_id']} AND scenario_destination.destination != 0"); while ($rame = mysql_fetch_array($query2)) { $destination .= ', ' . $rame[0]; $answer_id .= ', ' . $rame[1]; } $destination = substr($destination, 1); $answer_id = substr($answer_id, 1); //$row_scen = mysql_fetch_array($query); $data .= '<div id="dialog-form" style="width:102%; overflow-y:scroll; max-height:400px;"> <fieldset> <legend>კითხვები</legend>'; while ($row = mysql_fetch_array($query)) { if ($answer_id == '') { $answer_id = 0; } $query1 = mysql_query(" SELECT \tquestion.id as q_id,\r\n \t\tquestion_detail.quest_type_id,\r\n \t\t\t \t\t IF(question_detail.id in({$answer_id}) ,question_detail.id,'') AS `checked_quest`,\r\n \t\t\t \t\t scenario_detail.id as sc_id,\r\n \t\t\t \t\t question_detail.id as as_id,\r\n \t\t\t \t\t scenario_destination.destination as dest,\r\n \t\t\t \t\t question_detail.answer,\r\n \t\t\t \t\t scenario_handbook.name as seleqti\r\n FROM `question_detail`\r\n JOIN question ON question_detail.quest_id = question.id\r\n LEFT JOIN scenario_detail ON question.id = scenario_detail.quest_id\r\n \t\t\t \t\t LEFT JOIN scenario_destination ON scenario_detail.id = scenario_destination.scenario_detail_id AND scenario_destination.answer_id = question_detail.id\r\n LEFT JOIN scenario ON scenario_detail.scenario_id = scenario.id \r\n \t\t\t \t\t LEFT JOIN scenario_handbook ON question_detail.answer = scenario_handbook.id \r\n WHERE question_detail.quest_id = {$row['0']} AND question_detail.actived = 1 AND scenario.id = {$res['scenario_id']}\r\n GROUP BY question_detail.id\r\n ORDER BY question.id, question_detail.quest_type_id ASC"); $data .= '<textarea style="width: 704px; height:100px; resize: none; background: #EBF9FF;" class="idle">' . $row[2] . '</textarea> <table class="dialog-form-table"> <tr> <td style="font-weight:bold;">' . $i++ . '. ' . $row[1] . '</td> </tr> '; while ($row1 = mysql_fetch_array($query1)) { $q_type = $row1[1]; $dest = $row1[5]; if ($row1[1] == 1) { $data .= '<tr><td style="width:707px; text-align:left;"><input class="check_input" style="float:left;" type="checkbox" name="checkbox' . $row1[0] . '" value="' . $row1[4] . '"><label style="float:left; padding: 7px;">' . mysql_real_escape_string($row1[6]) . '</label></td>'; } elseif ($row1[1] == 2) { $data .= '<tr><td style="width:707px; text-align:left;"><input value="" class="inputtext" style="float:left;" type="text" id="input' . $row1[0] . '|' . $row1[4] . '" /> <label style=\\"float:left; padding: 7px;\\" for=\\"input|' . $row1[0] . '|' . $row1[4] . '\\">' . mysql_real_escape_string($row1[6]) . '</label></td>'; } elseif ($row1[1] == 4) { $data .= '<tr><td style="width:707px; text-align:left;"><input class="radio_input" style="float:left;" type="radio" name="radio' . $row1[0] . '" value="' . $row1[4] . '"><label style=\\"float:left; padding: 7px;\\">' . $row1[6] . '</label></td>'; } elseif ($row1[1] == 5) { $data .= '<tr><td style="width:707px; text-align:left;"><input value="" class="date_input" style="float:left;" type="text" id="input|' . $row1[0] . '|' . $row1[4] . '" /> <label style="float:left; padding: 7px;" for="input|' . $row1[0] . '|' . $row1[4] . '">' . mysql_real_escape_string($row1[6]) . '</label></td>'; } elseif ($row1[1] == 6) { $data .= '<tr><td style="width:707px; text-align:left;"><input value="" class="date_time_input" style="float:left;" type="text" id="input|' . $row1[0] . '|' . $row1[4] . '" /> <label style="float:left; padding: 7px;" for="input|' . $row1[0] . '|' . $row1[4] . '">' . mysql_real_escape_string($row1[6]) . '</label></td>'; } elseif ($row1[1] == 7) { $data .= '<tr><td style="width:707px; text-align:left;"><select class="hand_select" style="float:left;" id="hand_select|' . $row1[0] . '|' . $row1[4] . '" ><option>' . $row1[7] . '</option></select> <label style="float:left; padding: 7px;" for="hand_select|' . $row1[0] . '|' . $row1[4] . '"></label></td>'; } //$data .= $row1[0]; $data .= ' <td style="float:left; width: 350px;"><select style="width: 231px;" id="scenarquest|' . $row1[3] . '|' . $row1[4] . '" class="idls object scenarquest">' . GetAlScenQuest($res[scenario_id], $dest) . '</select></td> </tr>'; } $data .= '</table> <hr><br>'; } $data .= '</fieldset> </div>'; $data .= '</div> <div id="tab_content_3">'; $query = mysql_query("SELECT \t`question`.id,\r\n \t `question`.`name`,\r\n \t `question`.note,\r\n \t `scenario`.`name`,\r\n \t `scenario_detail`.id AS sc_det_id,\r\n \t `scenario_detail`.`sort`\r\n \t FROM `scenario`\r\n \t JOIN scenario_detail ON scenario.id = scenario_detail.scenario_id\r\n \t JOIN question ON scenario_detail.quest_id = question.id\r\n \t WHERE scenario.id = {$res['scenario_id']} AND scenario_detail.actived = 1\r\n \t ORDER BY scenario_detail.sort ASC"); $data .= '<button who="0" id="show_all_scenario" style="margin-bottom: 10px;float: right; margin-top: 15px;">ყველას ჩვენება</button>'; while ($row = mysql_fetch_array($query)) { $last_q = mysql_query(" SELECT question_detail.id,question_detail.quest_id\r\n \t FROM `question_detail`\r\n \t JOIN scenario_detail ON scenario_detail.quest_id = question_detail.quest_id\r\n \t AND scenario_detail.scenario_id = {$res['scenario_id']}\r\n \t WHERE question_detail.quest_id = {$row['0']}"); $data .= '<div style="margin-top: 15px;" class="quest_body ' . $row[5] . '" id="' . $row[0] . '"> <table class="dialog-form-table"> <tr> <td style="font-weight:bold;">' . $row[5] . '. ' . $row[1] . ' <img onclick="imnote(\'' . $row[5] . '\')" style="border: none;padding: 0;margin-left: 8px;margin-top: -7px;cursor: pointer;" src="media/images/icons/kitxva.png" alt="14 ICON" height="24" width="24"></td> </tr><tr style="display:none;" id="imnote_' . $row[5] . '" ><td>' . $row[2] . '</td></tr> '; while ($last_a = mysql_fetch_array($last_q)) { $query1 = mysql_query(" SELECT CASE \tWHEN question_detail.quest_type_id = 1 THEN CONCAT('<tr><td style=\"width:428px; text-align:left;\"><input next_quest=\"',scenario_destination.destination,'\" class=\"check_input\" ansver_val=\"',question_detail.answer,'\" style=\"float:left;\" type=\"checkbox\" name=\"checkbox', question_detail.quest_id, '\" id=\"checkbox', question_detail.id, '\" value=\"', question_detail.id, '\"><label for=\"checkbox', question_detail.id, '\" style=\"float:left; padding: 7px;white-space: pre-line;\">', question_detail.answer, '</label></td></tr>')\r\n \t WHEN question_detail.quest_type_id = 2 THEN CONCAT('<tr><td style=\"width:428px; text-align:left;\"><label style=\"float:left; padding: 7px 0;width: 428px;\" for=\"input|', question_detail.quest_id, '|', question_detail.id, '\">',question_detail.answer,'</label><input next_quest=\"',scenario_destination.destination,'\" value=\"\" class=\"inputtext\"style=\"float:left;\" type=\"text\" id=\"input|', question_detail.quest_id, '|', question_detail.id, '\" q_id=\"',question_detail.id,'\" /> </td></tr>')\r\n \t WHEN question_detail.quest_type_id = 4 THEN CONCAT('<tr><td style=\"width:428px; text-align:left;\"><input next_quest=\"',scenario_destination.destination,'\" class=\"radio_input\" ansver_val=\"',question_detail.answer,'\" style=\"float:left;\" type=\"radio\" name=\"radio', question_detail.quest_id, '\" id=\"radio', question_detail.id, '\" value=\"', question_detail.id, '\"><label for=\"radio', question_detail.id, '\" style=\"float:left; padding: 7px;white-space: pre-line;\">', question_detail.answer, '</label></td></tr>')\r\n \t WHEN question_detail.quest_type_id = 5 THEN CONCAT('<tr><td style=\"width:428px; text-align:left;\"><label style=\"float:left; padding: 7px 0;width: 428px;\" for=\"input|', question_detail.quest_id, '|', question_detail.id, '\">',question_detail.answer,'</label><input next_quest=\"',scenario_destination.destination,'\" value=\"\" class=\"date_input\" style=\"float:left;\" type=\"text\" id=\"input|', question_detail.quest_id, '|', question_detail.id, '\" q_id=\"',question_detail.id,'\" /> </td></tr>')\r\n \t WHEN question_detail.quest_type_id = 6 THEN CONCAT('<tr><td style=\"width:428px; text-align:left;\"><label style=\"float:left; padding: 7px 0;width: 428px;\" for=\"input|', question_detail.quest_id, '|', question_detail.id, '\">',question_detail.answer,'</label><input next_quest=\"',scenario_destination.destination,'\" value=\"\" class=\"date_time_input\" style=\"float:left;\" type=\"text\" id=\"input|', question_detail.quest_id, '|', question_detail.id, '\" q_id=\"',question_detail.id,'\" /> </td></tr>')\r\n \t WHEN question_detail.quest_type_id = 7 THEN question_detail.answer\r\n \t END AS `ans`,\r\n \t question_detail.quest_type_id,\r\n \t scenario_handbook.`name`,\r\n \t question_detail.quest_id,\r\n \t question_detail.id,\r\n \t scenario_destination.destination\r\n \t FROM question_detail\r\n \t JOIN scenario_detail ON scenario_detail.scenario_id = {$res['scenario_id']}\r\n \t JOIN scenario_destination ON scenario_detail.id = scenario_destination.scenario_detail_id AND scenario_destination.answer_id = {$last_a['0']}\r\n \t LEFT JOIN scenario_handbook ON question_detail.answer = scenario_handbook.id\r\n \t WHERE question_detail.id = {$last_a['0']} AND question_detail.quest_id = {$last_a['1']} AND scenario_detail.actived = 1\r\n \t "); $g = 0; while ($row1 = mysql_fetch_array($query1)) { $q_type = $row1[1]; if ($q_type == 7) { $data .= ' <tr> <td style="width:428px; text-align:left;"> <label style="float:left; padding: 7px 0;width: 428px;" for="">' . $row1[2] . '</label> <select class="hand_select" next_quest="' . $row1[5] . '" style="float:left;width: 235px;" id="hand_select|' . $row1[3] . '|' . $row1[4] . '" >' . gethandbook($row1[0], '') . '</select> </td>'; } else { $data .= $row1[0]; } } } $data .= '</table> <hr><br></div>'; } $data .= ' <div style="margin-top: 15px; display: none;" class="last_quest"> <table class="dialog-form-table"> <tr> <td style="font-weight:bold;"> არ დაგავიწყდეთ სტატუსის შეცვლა და შენახვის ღილაკზე დაკლიკება! </td> </tr> </table> <hr> <br> </div> <button id="back_quest" back_id="0" style="float:left;">უკან</button><button id="next_quest" style="float:right;" next_id="0">წინ</button> </div> </div> '; } } if ($_REQUEST['quest_detail_id'] != '' || $_REQUEST['add_id'] != '') { $data .= ' <table class="dialog-form-table"> <tr> <td style="width: 170px;"><label for="quest_id1">კითხვა</label></td> <td> <select style="width: 231px;" id="quest_id1" class="idls object">' . GetQuest($res['quest_id'], $_REQUEST['id']) . '</select> </td> </tr> </table> <script>$("#name, #cat, #le_cat").prop("disabled", true);</script>'; } $data .= ' </fieldset> </div> '; return $data; }