function GetPage($res = '')
{
    $data = '
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ახლის დამატება</legend>
	    	<table class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="cadre_user_id">პირადი №</label></td>
					<td>
						<input type="text" id="cadre_user_id" class="idle user_id" onblur="this.className=\'idle user_id\'" onfocus="this.className=\'activeField user_id\'" value="' . $res['person_id'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_name">სახელი</label></td>
					<td>
						<input type="text" id="cadre_name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['f_name'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_lname">გვარი</label></td>
					<td>
						<input type="text" id="cadre_lname" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['l_name'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_position">თანამდებობა</label></td>
					<td>
						<input type="text" id="cadre_position" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['position'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_contact">საკონტაქტო</label></td>
					<td>
						<select id="cadre_contact" class="idls small">' . Contact($res['chontacter'], $res['id']) . '</select>
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_phone">ტელეფონი</label></td>
					<td>
						<input type="text" id="cadre_phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['phone'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_m_phone">მობილური</label></td>
					<td>
						<input type="text" id="cadre_m_phone" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['m_phone'] . '" />
					</td>
				</tr>
			</table>
	    </fieldset>
	    <fieldset>		    
	    	<legend>ფასდაკლება</legend>
    		<table class="dialog-form-table">
				<tr>
					<td style="width: 170px;"><label for="cadre_sale">ფასდაკლების %</label></td>
					<td>
						<input type="text" id="cadre_sale" class="idle num" onblur="this.className=\'idle num\'" onfocus="this.className=\'activeField num\'" value="' . $res['sale_rate'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="cadre_limit">ლიმიტი</label></td>
					<td>
						<input type="text" id="cadre_limit" class="idle num" onblur="this.className=\'idle num\'" onfocus="this.className=\'activeField num\'" value="' . $res['sale_limit'] . '" />
					</td>
				</tr>
			</table>
			<!-- ID -->
			<input type="hidden" id="partner_cadre_id" value="' . $res['id'] . '" />
	    </fieldset>
    </div>
    ';
    return $data;
}
Exemple #2
0
 public function Insert($var)
 {
     $username = $var['username'];
     $md5password = md5($var['password']);
     $alias = $var['alias'];
     $email = $var['email'];
     $key = md5(rand());
     if (count($var) != 4) {
         throw new Exception(__METHOD__ . "() required 4 inputs on \$var");
     }
     $sql = " INSERT INTO {$this->TBL_USR}" . "    (user_username,user_password,user_alias,user_email,user_key)" . " VALUES ('{$username}','{$md5password}','{$alias}','{$email}','{$key}');";
     try {
         $db = Database::getConnection();
         $this->sqlQueries[] = array('sql' => $sql, 'method' => __METHOD__);
         $db->executeQuery($sql);
     } catch (SQLException $e) {
         throw new Exception($e->getMessage() . ErrorWraper("SQL", $sql));
     }
     $to = $email;
     $from = "{$this->DEFAULT_SITE_TITLE} <webmaster@{$this->DEFAULT_SITE_URL}>";
     $subject = "Your New Account at {$this->DEFAULT_SITE_TITLE}";
     $body = "Your account has been created at {$this->DEFAULT_SITE_TITLE}\n" . "username: {$username} \n" . "password: {$var['password']} \n" . "alias: {$alias} \n" . "email: {$email} \n" . "key: {$key} or  \n\n--------\n\n" . "http://{$this->DEFAULT_SITE_URL}/validate.php?email={$email}&key={$key} \n" . "\n\n--------\n\n" . "### PLEASE DO NOT DELETE THIS EMAIL, KEEP IT \n" . "### IN CASE YOU FORGET YOUR PASSWORD         \n";
     //
     Contact($to, $from, $subject, $body);
     return true;
 }