123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?php
- if (!$logged_me_in_successfully234)
- return;
- if (empty($cmdlevel))
- return;
- getForm(0);
- //if ($active == 1)
- //$dot = "продажи";
- //else if ($active == 2)
- //$dot = "деактивации";
- //if (empty($name) || empty($client) || empty($login) || empty($address))
- //getForm(3);
- //else
- //{
- // $agentpass = genPass(10, false);
- // $md5 = md5($agentpass);
- // $query1 = mysql_query("insert into sell_agents (active, phone, login, client_id, name, email, address, password, skype) values ($active, '$phone','$login', $client, '$name', '$email', '$address', '$md5', '$skype')");
- // echo "Точка $dot <neutral>".$name."</neutral> добавлена, пароль: ".$agentpass;
- //}
- function getForm($errCode)
- {
- global $id, $active, $companyID, $link;
- if ($active == 1 || $active == 10)
- $s = "<neutral>Компании</neutral>";
- $s.="
- <form name='form1' method='post' onsubmit='return emailCheck(this.email.value);'>
- Выберите компанию из списка:
- <input type='hidden' name='active' value='$active'>
- <select onchange='ChangeCompany()' name='companies'>
- ";
- //$s.="<option></option>";
- $query1 = mysqli_query($link,"select id, name from companies where active=1");
- while ($res1 = mysqli_fetch_array($query1))
- {
- $sel = "";
- if ($companyID == $res1['id']) $sel = "selected";
- if ($res1['name'])
- $s.= '<option '.$sel.' value="'.$res1['id'].'">'.$res1['id'].'. '.$res1['name'].'</option>';
- }
- $s.="</select>";
- if (isset($client)){
- $s.="
- <table>
- <tr>
- <td width=200>
- ";
- if($errCode==3) $s.="<span style='font-family:Tahoma, Verdana, Arial, Sans-Serif;font-size:10px;color:#CC0000'>Заполните пустые поля</span><br>";
- $s.=
- "
- Название:
- </td>
- <td>
- </td>
- <td><br>
- <input type='text' name=name>
- </td>
- </tr>
- <tr>
- <td>
- Логин:
- </td>
- <td>
- </td>
- <td>
- <input type='text' name=login>
- </td>
- </tr>
- <tr>
- <td>
- Адрес:
- </td>
- <td>
- </td>
- <td>
- <input type='text' name='address'>
- </td>
- </tr>
- <tr>
- <td>
- Phone*:
- </td>
- <td>
- </td>
- <td>
- <input type='text' name='phone'>
- </td>
- </tr>
- <tr>
- <td>
- E-mail*:
- </td>
- <td>
- </td>
- <td>
- <input type='text' name='email'>
- </td>
- </tr>
- <tr>
- <td>
- Skype*:
- </td>
- <td>
- </td>
- <td>
- <input type='text' name='skype'>
- </td>
- </tr>
- <tr>
- <td>
- </td>
- <td>
- </td>
- <td>
- <input type='submit' value='Вход'>
- </td>
- </tr>
- </table>
- * - необязательные поля
- ";
- }
-
- echo $s.'
- <br>Или добавьте новую: <input name="New" type="button" id="New" onClick="" value="Создать"> </form>';
- }
- ?>
|