Exemple #1
0
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) {
        $disable_status = '';
    } else {
        if ($chek_gr[0] == 5) {
            $disable_status = '';
        } else {
            $disable_status = 'disabled';
        }
    }
    $rResult = mysql_query("SELECT  elva_sale_new_juli.id,\r\n                                    elva_sale_new_juli.person_id,\r\n                                    elva_sale_new_juli.name_surname,\r\n                                    elva_sale_new_juli.mail,\r\n                                    elva_sale_new_juli.address,\r\n                                    elva_sale_new_juli.phone,\r\n                                    elva_sale_new_juli.phone1,\r\n                                    shipping.`name` AS `period`,\r\n                                    elva_sale_new_juli.call_date,\r\n                                    elva_sale_new_juli.sum_price as sum_price,\r\n                                    elva_sale_new_juli.callceenter_comment,\r\n                                    elva_sale_new_juli.operator_id AS operator_id,\r\n                                    elva_sale_new_juli.oder_send_date,\r\n                                    elva_sale_new_juli.`status`,\r\n                                    elva_sale_new_juli.coordinator_id,\r\n                                    elva_sale_new_juli.coordinator_comment,\r\n                                    elva_sale_new_juli.elva_status,\r\n                                    elva_sale_new_juli.period AS `period_id`,\r\n                                    elva_sale_new_juli.send_date,\r\n                                    elva_sale_new_juli.cancel_comment,\r\n                                    elva_sale_new_juli.cash,\r\n                                    elva_sale_new_juli.street_done,\r\n                                    elva_sale_new_juli.city_id,\r\n                                    elva_sale_new_juli.send_client_date,\r\n                                    elva_sale_new_juli.prod_cat,\r\n                                    elva_sale_new_juli.main_status,\r\n                                    elva_sale_new_juli.monitor,\r\n                                    elva_sale_new_juli.start_date,\r\n                                    elva_sale_new_juli.done_date,\r\n                                    elva_sale_new_juli.customer_code,\r\n                                    elva_sale_new_juli.customer,\r\n                                    elva_sale_new_juli.organization,\r\n                                    elva_sale_new_juli.monthly_price,\r\n                                    elva_sale_new_juli.product,\r\n                                    elva_sale_new_juli.prod_count,\r\n                                    elva_sale_new_juli.last_count,\r\n                                    elva_sale_new_juli.price,\r\n                                    elva_sale_new_juli.last_sum_price,\r\n                                    elva_sale_new_juli.gift,\r\n                                    elva_sale_new_juli.note,\r\n                                    elva_sale_new_juli.customer_cordinator,\r\n                                    elva_sale_new_juli.custom_code,\r\n                                    elva_sale_new_juli.product_comment,\r\n                                    elva_sale_new_juli.district,\r\n                                    elva_sale_new_juli.contract_status,\r\n                                    elva_sale_new_juli.department_id,\r\n                                     elva_sale_new_juli.director\r\n                            FROM    `elva_sale_new_juli`\r\n                            left JOIN shipping ON elva_sale_new_juli.period = shipping.id\r\n                            WHERE elva_sale_new_juli.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 id="paste_person">
                                    <input type="hidden" id="custom_prod" value="' . $res[custom_prod] . '" />
							    	<legend>ძირითადი ინფორმაცია</legend>
									<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;"  type="text" value="' . $res[person_id] . '" /></td>
											<td><input id="name_surname" class="idle" style="width: 200px;"  type="text" value="' . $res[name_surname] . '" /></td>
											<td><input id="mail" 		 class="idle" style="width: 200px;"  type="text" value="' . $res[mail] . '" /></td>
										    <td><input id="phone" class="idle" style="width: 200px;" 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;"  type="text" value="' . $res[phone1] . '" /></td>

											<td>
											    <select style="width: 206px;"  id="city_id" class="idls object" >' . GetCity($res['city_id']) . '</select>
                                            </td>
											        
											<td><input id="addres" class="idle" style="width: 200px;"  type="text" value="' . $res[address] . '" /></td>
										    <td><input id="street_done" class="idle" style="width: 200px;"  type="text" value="' . $res[street_done] . '" /></td>
										</tr>
										        
										<tr>
											<td style="width: 280px;"><label for="organization">ორგანიზაციის დასახელება</label></td>
										    <td><label for="district">დირექტორი</label></td>
											<td><label for="customer_cordinator">აბონენტის კორდინატორი</label></td>
										    <td><label for="district">უბანი</label></td>
										</tr>
										<tr>
											<td><input id="organization" class="idle" style="width: 200px;" type="text" value="' . htmlspecialchars($res[organization], ENT_QUOTES) . '" /></td>
											<td><input id="district" class="idle" style="width: 200px;"  type="text" value="' . $res[director] . '" /></td>  
											<td><input id="customer_cordinator" class="idle" style="width: 200px;"  type="text" value="' . $res[customer_cordinator] . '" /></td>
										    <td><select style="width: 206px;"  id="district1" class="idls object" >' . Get_elva_district($res[district]) . '</select></td>
										    		
										</tr>
										<tr>
										   	<td style="width: 280px;"><label for="customer_code">აბონენტის.კოდი</label></td>
											<td style="width: 280px;"></td>
										    <td style="width: 280px;"></td>
											<td></td>
										</tr>
										<tr>
										   	<td><input id="customer_code" class="idle" style="width: 200px;"  type="text" value="' . $res[customer_code] . '" /></td>
											<td></td>
											<td></td>  
											<td></td>
										</tr>
										</table>
										</fieldset>
										<fieldset style="margin-top: 5px;">
							    		<legend>ხელშეკრულება</legend>
								        <table class="dialog-form-table">
										      
										<tr>
											<td style="width: 280px;"><label for="start_date">დაწ.თარიღი</label></td>
										    <td style="width: 280px;"><label for="done_date">დას. თარიღი</label></td>
											<td style="width: 280px;"><label for="product_comment">პროდ. შენიშვნა</label></td>
										    <td><label for="contract_status">ხელშეკრულების სტატუსი</label></td>
										</tr>
										<tr>
											<td><input id="start_date" class="idle" style="width: 200px;" type="text" value="' . $res[start_date] . '" /></td>
											<td><input id="done_date" class="idle" style="width: 200px;"  type="text" value="' . $res[done_date] . '" /></td>  
											<td><input id="product_comment" class="idle" style="width: 200px;"  type="text" value="' . $res[product_comment] . '" /></td>
										    <td><select style="width: 206px;"  id="contract_status" class="idls object"  >' . Get_elva_status($res[contract_status]) . '</select></td>
										</tr>
										        
										<tr>
											<td style="width: 280px;"><label for="monthly_price">გამოწერის თვიური ფასი</label></td>
										    <td><label for="product">პროდუქცია</label></td>
											<td><label for="prod_count">რაოდენობა</label></td>
										    <td><label for="customer">დარჩენილი რაოდენობა</label></td>
										</tr>
										<tr>
											<td><input id="monthly_price" class="idle" style="width: 200px;" type="text" value="' . $res[monthly_price] . '" /></td>
											<td><input id="product" class="idle" style="width: 200px;"  type="text" value="' . $res[product] . '" /></td>  
											<td><input id="prod_count" class="idle" style="width: 200px;"  type="text" value="' . $res[prod_count] . '" /></td>
										    <td><input id="last_count" class="idle" style="width: 200px;"  type="text" value="' . $res[last_count] . '" /></td>
										</tr>
										        
										<tr>
											<td style="width: 280px;"><label for="price">ფასი</label></td>
										    <td><label for="last_sum_price">დარჩენილი ჯამური თანხა</label></td>
											<td><label for="gift">შენიშვნა საჩუქარი</label></td>
										    <td><label for="note">შენიშვნა 2</label></td>
										</tr>
										<tr>
											<td><input id="price" class="idle" style="width: 200px;" type="text" value="' . $res[price] . '" /></td>
											<td><input id="last_sum_price" class="idle" style="width: 200px;"  type="text" value="' . $res[last_sum_price] . '" /></td>  
											<td><input id="gift" class="idle" style="width: 200px;"  type="text" value="' . $res[gift] . '" /></td>
										    <td><input id="note" class="idle" style="width: 200px;"  type="text" value="' . $res[note] . '" /></td>
										</tr>
										        
										<tr>
											<td style="width: 280px;"></td>
										    <td></td>
											<td></td>
										    <td></td>
										</tr>
										<tr>
											<td></td>
											<td></td>  
											<td></td>
										    <td><button id="copy_person">არსებული მომხმარებელი</button></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" >' . GetPeriod($res['period_id']) . '</select>
												</td>
												<td><input style="width: 200px;" id="date" 		value="' . $res[call_date] . '" 		class="idls object" ></td>
											    <td><select style="width: 206px;"  id="op_id" class="idls object"  >' . GetOperator($res['operator_id']) . '</select></td>
											    <td><input style="width: 201px;" id="sum_price" value="' . $res[sum_price] . '" class="idls object" ></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" >' . $res[callceenter_comment] . '</textarea>
										        <td><textarea  style="width: 503px; height:50px; resize: vertical;" id="cancel_comment" class="idle" cols="300" >' . $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" >
											    <input style="width: 200px;float: left; margin-left: 50px;" id="send_client_date" value="' . $res[send_client_date] . '" class="idls object" ></td>
											    <td><div style="float:left; margin-right: 89px;">
												    <input style="float:left;" type="radio" class="cash_id" name="cash" value="1"  ' . ($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"  ' . ($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" >' . GetCat($res['prod_cat']) . '</select>
												</td>
											</tr>
										</table>
								        <table class="dialog-form-table">
											<tr>
												<td style="width: 256px;"><label>მთავარი სტატუსი</label></td>
												        <td style="width: 256px;"></td>
												        <td><label>დეპარტამენტი</label></td>
											</tr>
											<tr>
												<td>
												    <select style="width: 206px;"  id="main_status" class="idls object" >' . GetMainStatus($res['main_status']) . '</select>
												</td>
												<td>
												    <select style="width: 206px;"  id="monitor" class="idls object" >' . GetMonitoring($res['monitor']) . '</select>
												</td>
												<td>
												    <select style="width: 206px;"  id="department_id" class="idls object" >' . get_departament($res[department_id]) . '</select>
												</td>
											</tr>
								        </table>
									</fieldset>
								<fieldset style="margin-top: 5px;">
								    	<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"  >' . Getstatus($res['status']) . '</select>
												</td>
												<td><select style="width: 206px;"  id="cooradinator" class="idls object" >' . GetCordin($res['coordinator_id']) . '</select></td>
												<td><input style="width: 200px;" id="elva"          value="' . $res[elva_status] . '" 		class="idls object" ></td>
											    <td><input style="width: 200px;" id="oder_date" value="' . ($res['oder_send_date'] != '' ? $res['oder_send_date'] : '') . '" 	class="idls object"></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" >' . $res[coordinator_comment] . '</textarea>
												</td>
											</tr>
										</table>
							    </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: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 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>
											<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];
}
Exemple #2
0
function GetPage($res = '')
{
    $data = '
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>
	    	
	    	<table class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="category">ქვე კატეგორია</label></td>
					<td>
						<input type="text" id="category" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['name'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="category">კატეგორია</label></td>
					<td>
						<select id="parent_id" class="idls large">' . Get_Category($res['parent_id']) . '</select>
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="departament_id">დეპარტამენტი</label></td>
					<td>
						<select id="departament_id" class="idls large">' . get_departament($res['departament_id']) . '</select>
					</td>
				</tr>
			</table>
			<!-- ID -->
			<input type="hidden" id="cat_id" value="' . $res['id'] . '" />
        </fieldset>
    </div>
    ';
    return $data;
}