PageSourceSearch

https://pizza-tk.ru/js/_signin.js?f0eac8de5ca73d1850dee8b10031e5c0b2445b6f

js pizza-tk.ru collected 2026-10-08 12:45:21 UTC 8,189 bytes, 234 lines download raw bytes

1$(document).ready(function() {
2    // button auth
3    $("#b_signin_form").click(function() {
4      signin();
5    });    
6    $("#b_mobile_auth").click(function() {
7      signin();
8    });
9    $("#b_mobile_reg").click(function() {
10      signin();
11    });
12
13    // test sms auth
14    $("#test").click(function() {    
15      auth_sms();
16    });
17
18
19    // password recovery
20    $("#b_p_recovery").click(function() {
21      $("#modal_signin").modal('hide');
22      $("#modal_p_recovery").modal('show');
23    });      
24    $("#b_p_recovery_send").click(function() {
25      email=$("#str_recovery_email").val();
26      var post_res=$.post('php/email_recovery.php', {
27            u_email: email
28            }, 
29            function(data) {
30                console.log(data);
31                if (data==1) {
32                  $('#s_pass_good').show();
33                  $('#s_pass_bad').hide();
34                } else {$('#s_pass_bad').show();$('#s_pass_good').hide();}
35              });
36    });  
37
38
39//-------------------------------------------------------------------------
40// test auth sms
41//-------------------------------------------------------------------------
42    function auth_sms() {
43      $("#modal_auth_sms").modal("show");
44    }
45//========================================================================= 
46
47
48//-------------------------------------------------------------------------
49// call form auth
50//-------------------------------------------------------------------------
51    function signin() {
52      if (localStorage.getItem('u_uid')!==null) {
53        window.location.assign('profile.php');
54      } else {
55        $("#modal_signin").modal("show");
56      }   
57    }
58//========================================================================= 
59
60
61//-------------------------------------------------------------------------
62// Change signin <> signup
63//-------------------------------------------------------------------------
64  $("#m_signin_reg_href").click(function() {
65    $(".m_signin_auth_div").hide();
66    $(".m_signin_reg_div").show();
67    $(".m_signin_reg_footer").show();
68    $("#m_signin_reg_done_div").hide();
69    $("#err_SignUp").hide();
70    $('#modal_signin_title').hide(500);
71    $('#modal_signup_title').show(500);
72  });   
73  $(".m_signin_auth_href").click(function() {
74    $(".m_signin_reg_div").hide();
75    $(".m_signin_auth_div").show();
76    $(".m_signin_reg_done_div").hide();
77    $("#err_SignUp").hide();
78    $(".m_signin_reg_footer").hide();
79    $("#m_signin_reg_done_div").hide();
80    $('#modal_signup_title').hide(500);
81    $('#modal_signin_title').show(500);
82  });     
83//=========================================================================
84    
85
86//-------------------------------------------------------------------------
87// call signin form \ close profile
88//-------------------------------------------------------------------------
89    // button auth
90    $("#b_signin_form").click(function() {
91      signin();
92    });
93    // button auth    
94    $("#b_mobile_auth").click(function() {
95      signin();
96    });
97    // profile close
98    $("#b_profile_close").click(function() {
99      localStorage.clear();
100      //$('#b_signin_form').text('вход на сайт');
101      window.location.assign('index.php');
102    });
103//=========================================================================
104
105 
106//-------------------------------------------------------------------------
107// send signup data
108//-------------------------------------------------------------------------
109$("#b_signup").click(function() {
110  localStorage.clear();
111  var SignUp_Name=$("#str_signup_name").val();
112  var SignUp_Phone=$("#str_signup_phone").val();
113  //var SignUp_Email=$("#str_signup_email").val();
114  var SignUp_Pass=$("#str_signup_pass").val();
115  //post
116  var post_res=$.post('php/post_signup.php', {
117        u_name: SignUp_Name,
118        u_phone: SignUp_Phone,
119        //u_email: SignUp_Email,
120        u_pass: SignUp_Pass
121        }, 
122        function(data) {
123          console.log(data);
124          var json = jQuery.parseJSON(data);
125          if (json.result=='ok') {
126            $(".m_signin_auth_div").hide();
127            $(".m_signin_reg_div").hide();
128            $("#signUpTgUrl").attr("href",json.data);
129            $("#m_signin_reg_done_div").show();
130            $(".m_signin_reg_footer").show();
131            $("#str_signup_fio").val("");
132            //$("#str_signup_email").val("");
133            $("#str_signup_pass").val("");
134            $("#err_SignUp").hide();
135          }
136          if (json.result=='error') {   
137            $("#err_SignUp").text(json.data);
138            $("#err_SignUp").show();
139          }
140        }
141      ); // post     
142});		
143//========================================================================= 
144
145
146//-------------------------------------------------------------------------
147// send signin data
148//-------------------------------------------------------------------------
149$("#b_signin").click(function() {
150  var SignIn_Phone=$("#str_signin_phone").val();
151  var SignIn_Pass=$("#str_signin_pass").val();
152  console.log(SignIn_Pass);
153  //post
154  var post_res=$.post('php/post_signin.php', {
155        u_phone: SignIn_Phone,
156        u_pass: SignIn_Pass
157        }, 
158        function(data) {
159          console.log(data);
160          if (Array.isArray(data)==true) {
161            localStorage.setItem('u_uid',data[0]);
162            localStorage.setItem('u_name',data[1]);
163            localStorage.setItem('u_email',data[2]);
164            localStorage.setItem('u_phone',data[3]);
165            localStorage.setItem('u_street',data[7]);
166            localStorage.setItem('u_house',data[8]);
167            localStorage.setItem('u_build',data[9]);
168            localStorage.setItem('u_entrance',data[10]);
169            localStorage.setItem('u_doorcode',data[11]);
170            localStorage.setItem('u_stage',data[12]);
171            localStorage.setItem('u_office',data[13]);
172            localStorage.setItem('u_balance',data[14]);
173            localStorage.setItem('u_tg_uid',data[15]);
174            localStorage.setItem('u_date',data[16]);
175            localStorage.setItem('u_auth',data[22]);
176            localStorage.setItem('u_sex',data[21]);
177            localStorage.setItem('u_conf',data[27]);
178            localStorage.setItem('u_pass',data[28]);
179            $('#b_signin_form').text(data[1]);
180            /*
181            $('#u_name').val(data[1]);
182            $('#prof_name').val(data[1]);
183            $('#u_phone').val(data[3])
184            $('#profile_phone').val(data[3]);
185            $('#u_street').val(data[7]);
186            $('#u_house').val(data[8]);
187            $('#u_build').val(data[9]);
188            $('#u_entrance').val(data[10])
189            $('#u_doorcode').val(data[11]);
190            $('#u_stage').val(data[12]);
191            $('#u_office').val(data[13]);
192            $('#profile_date').val(data[16]);
193            */
194            $("#modal_signin").modal("hide");
195            $("#err_SignIn").hide();
196            //$('#modal_profile').modal('show');
197          } else {
198            $("#err_SignIn").show();
199          }
200          if (data=='err') {
201            $("#err_SignIn").show();
202          }
203        }, "json"
204      ); // post
205  });
206  //=========================================================================
207})
208
209//-------------------------------------------------------------------------
210// авторизация
211//-------------------------------------------------------------------------
212    
213    // авторизация
214    
215    function signin() {
216      if (localStorage.getItem('u_uid')==null) {
217        $("#modal_signin").modal("show");
218      }
219    }
220    
221//=========================================================================
222
223
224function auth() {
225  if (localStorage.getItem('user_uid') === null) {
226    $(".m_signin_auth_div").show();
227  } 
228}
229
230$("#rules_yes").click(function() {
231  if ($('#rules_yes').is(":checked")) {
232    $("#b_signup").removeAttr("disabled");
233  }  else {$("#b_signup").attr("disabled", true);}
234});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.