Example #1
0
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['name'] . '" />
					</td>
				</tr>
    
			</table>';
    if ($_REQUEST['quest_id'] != '') {
        if ($_REQUEST['quest_detail_id'] == '') {
            $data .= ' <div id="dt_example" class="inner-table" style="width: 430px;">
    			                <div id="button_area">
                    			    <button id="add_button_detail">დამატება</button>
                    			    <button id="delete_button_detail">წაშლა</button>
                			    </div>
                			    <table class="" id="example1" style="width: 430px;">
                    			    <thead style="width: 430px;">
                        			    <tr id="datatable_header">
                            			    <th style="width: 10%; display:none;">ID</th>
    			                            <th style="width: 10%;">#</th>
                            			    <th style="width: 10%;">დასახელება</th>
                            			    <th style="width: 10%;">ტიპი</th>
                            			    <th class="check">#</th>
                        			    </tr>
                    			    </thead>
                    			    <thead style="width: 430px;">
                        			    <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="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>';
        }
    }
    if ($_REQUEST['quest_detail_id'] != '' || $_REQUEST['add_id'] != '') {
        $data .= ' <table class="dialog-form-table">  
			                    <tr>
                					<td style="width: 170px;"><label for="quest_type_id">ტიპი</label></td>
                					<td>
                						<select style="width: 231px;" id="quest_type_id" class="idls object">' . GetQuestType($res['quest_type_id']) . '</select>
                					</td>
                				</tr>              				
                                <tr>
                					<td style="width: 170px;"><label for="answer" id="qlabel">პასუხი</label></td>
                					<td>
                						<input type="text" id="answer" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['answer'] . '" />
                					</td>
                				</tr>                				
                			</table>
                			<table id="product">
        						<tr>
        							  <td style="width: 170px;"><label for="production_name">დასახელება</label></td>
                                      <td>
                    						<div class="seoy-row" id="goods_name_seoy">
                    							<input type="text" id="production_name" class="idle seoy-address" onblur="this.className=\'idle seoy-address\'" onfocus="this.className=\'activeField seoy-address\'" value="' . $res[product_name] . '" />
                    							<button id="goods_name_btn" class="combobox">production_name</button>
                    						</div>
            				          </td>
        				    	</tr>
        						<tr>
        							<td style="padding-top: 11px;"><label for="genre">ჟანრი</label></td>
        							<td style="padding-top: 11px;"><input type="text" style="margin-bottom: 10px;" id="genre" class="idle" disabled onblur="this.className=\'idle\'" value="' . $res[genre_name] . '"/></td>
        						</tr>
        						<tr>
        							<td><label for="category">განყოფილება</label></td>
        							<td><input type="text" style="margin-bottom: 10px;" id="category" class="idle" disabled onblur="this.className=\'idle\'" value="' . $res[dep_name] . '"/></td>
        						</tr>
        						<tr>
        							<td><label for="description">აღწერილობა</label></td>
        							<td><input type="text" style="margin-bottom: 10px;" id="description" class="idle" disabled onblur="this.className=\'idle\'" value="' . $res[description] . '"/></td>
        						</tr>
        						<tr>
        							<td><label for="price">ფასი</label></td>
        							<td><input type="text" style="margin-bottom: 10px;" id="price" class="idle" disabled onblur="this.className=\'idle\'" value="' . $res[price] . '"/></td>
        							    <input type="text" id="hidden_product_id" class="idle" onblur="this.className=\'idle\'" style="display:none;" value="' . $res[prod_id] . '"/>
        						</tr>
        					</table>';
    } else {
        $data .= '<table class="dialog-form-table">   
			                    <tr>
			                         <td><label for="quest_type_id">მინიშნება</label></td>
			                    </tr>             				
                                <tr>			                         
			                         <td><textarea  style="width: 423px; height:60px; resize: none;" id="note" class="idle" name="note" cols="300" >' . $res['note'] . '</textarea></td>
                				</tr>
                			</table>';
    }
    $data .= '<!-- ID -->
			<input type="hidden" id="quest_id" value="' . $res['quest_id'] . '" />
			<input type="hidden" id="quest_detail_id" value="' . $res['quest_detail_id'] . '" />
			<input type="hidden" id="add_id" value="' . $_REQUEST['add_id'] . '" />
        </fieldset>
    </div>
    ';
    return $data;
}
Example #2
0
function ResetQuest($userID, $ID)
{
    $actualQuestID = GetActualQuestID($userID, $ID);
    if ($actualQuestID < 0) {
        return 0;
    }
    $questType = GetQuestType($actualQuestID);
    if ($questType == -1) {
        return 0;
    }
    //Remove specific quest data first because of foreign key constraints
    switch ($questType) {
        case 1:
            if (!mysql_query("\r\n\t\t\t\t\tDELETE FROM\r\n\t\t\t\t\t\ttblRealtimeQuests\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tp_ID = {$actualQuestID}\r\n\t\t\t\t\t")) {
                return 0;
            }
            break;
        case 2:
            if (!mysql_query("\r\n\t\t\t\t\tDELETE FROM\r\n\t\t\t\t\t\ttblGametimeQuests\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tp_ID = {$actualQuestID}\r\n\t\t\t\t\t")) {
                return 0;
            }
            break;
        case 3:
            if (!mysql_query("\r\n\t\t\t\t\tDELETE FROM\r\n\t\t\t\t\t\ttblStepQuests\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tp_ID = {$actualQuestID}\r\n\t\t\t\t\t")) {
                return 0;
            }
            break;
    }
    //Remove base quest data
    if (!mysql_query("\r\n\t\tDELETE FROM\r\n\t\t\ttblQuests\r\n\t\tWHERE\r\n\t\t\tp_ID = {$actualQuestID}\r\n\t\t")) {
        return 0;
    }
    return 1;
}
Example #3
0
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>
						<textarea id="name" style="margin: 0px; width: 504px; resize:vertical;" >' . $res['name'] . '</textarea>
					</td>
				</tr>
    
			</table>';
    if ($_REQUEST['dialog_check'] == 0) {
        $data .= ' 
    			                <div id="button_area">
                    			    <button id="add_button_detail">დამატება</button>
                    			    <button id="delete_button_detail">წაშლა</button>
                			    </div>
                			    <table class="display" id="table_quest" style="width: 100%; background: #FFF;">
                    			    <thead>
                        			    <tr id="datatable_header">
                            			    <th>ID</th>
    			                            <th style="width: 30px;">№</th>
                            			    <th style="width: 100%;">დასახელება</th>
                            			    <th style="width: 100%;">ტიპი</th>
                            			    <th class="check">&nbsp;</th>
                        			    </tr>
                    			    </thead>
                    			    <thead>
                        			    <tr class="search_header">
                            			    <th class="colum_hidden">
    			                                 <input type="text" name="search_category" value="ფილტრი" class="search_init" />
                            			    </th>                            			    
    			                            <th>
    			                                 <input style="width: 20px;" 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>
                                			     <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>
    			                ';
    }
    if ($_REQUEST['dialog_check'] == 1) {
        $data .= ' <script>
			        $("#quest_type_id").chosen({ search_contains: true });
			         $("#add-edit-form-answer, .add-edit-form-answer-class").css("overflow","visible");</script><table class="dialog-form-table">  
			                    <tr>
                					<td style="width: 170px;"><label for="quest_type_id">ტიპი</label></td>
                					<td>
                						<select style="width: 231px;" id="quest_type_id" class="idls object">' . GetQuestType($res['quest_type_id']) . '</select>
                					</td>
                				</tr>              				
                                <tr id="show_answer">
                					<td style="width: 170px;"><label for="answer" id="qlabel">პასუხი</label></td>
                					<td>
                						<textarea id="answer" style="width: 97.5%; height:40px; resize: vertical;">' . $res['answer'] . '</textarea>
                					</td>
                				</tr>
                				<tr style="display:none;" id="show_handbook">
                					<td style="width: 170px;"><label for="handbook" id="qlabel">ცნობარი</label></td>
                					<td>
                						<select id="handbook" style="width: 230px;">' . GetHandBook($res['answer']) . '</select>
                					</td>
                				</tr>              				
                			</table>
                			<script type="text/javascript">
                						    $("#add-edit-form-answer #name").val($("#add-edit-form #name").val());
                						    $("#add-edit-form-answer #name").prop("disabled", true);
                						    $("#add-edit-form-answer #name").css("width","226");
                						    if($("#quest_type_id").val()==7){
                                		        $("#show_handbook").css("display","table-row");
                                		        $("#show_answer").css("display","none");
                                		    }else{
                                		    	$("#show_answer").css("display","table-row");
                                		    	$("#show_handbook").css("display","none");
                                		    }
                						    </script>';
    } else {
        $data .= '<table class="dialog-form-table">   
			                    <tr>
			                         <td><label for="quest_type_id">მინიშნება</label></td>
			                    </tr>             				
                                <tr>			                         
			                         <td><textarea  style="width: 99.5%; height:60px; resize: vertical;" id="note" name="note" cols="300" >' . $res['note'] . '</textarea></td>
                				</tr>
                			</table>';
    }
    $quest_id_inc = mysql_fetch_row(mysql_query("SELECT id+1 FROM question ORDER BY id DESC LIMIT 1"));
    $data .= '<!-- ID -->
			<input type="hidden" id="quest_id" value="' . $res['quest_id'] . '" />
			<input type="hidden" id="quest_detail_id" value="' . $res['quest_detail_id'] . '" />
			<input type="hidden" id="add_id" value="' . $_REQUEST['add_id'] . '" />
			<input type="hidden" id="delete_id" value="' . $quest_id_inc[0] . '" />
        </fieldset>
    </div>
    ';
    return $data;
}