Esempio n. 1
0
 static function add_account($obj)
 {
     global $DB;
     $data = Account::toarray($obj);
     if (!iDEMO) {
         unset($data['opentime']);
     }
     if (!$DB->make_insert('Accounts', $data)) {
         return false;
     }
     $id = $DB->insert_id();
     if ($id == false) {
         pdata('Could not retrieve ID from previous INSERT!');
     } elseif ($id == 0) {
         pdata('Previous INSERT did not generate an ID');
     }
     $obj->id = $id;
     return true;
 }
Esempio n. 2
0
 public static function add_letter($obj)
 {
     global $DB;
     if (!$DB->make_insert('Letters', array('title' => $obj->title, 'from' => $obj->from, 'subject' => $obj->subject, 'body' => $obj->body))) {
         return false;
     }
     $id = $DB->insert_id();
     if ($id == false) {
         pdata('Could not retrieve ID from previous INSERT!');
     } elseif ($id == 0) {
         pdata('Previous INSERT did not generate an ID');
     }
     $obj->id = $id;
     return true;
 }
Esempio n. 3
0
 public static function add_payment($obj)
 {
     global $DB;
     if (!$DB->make_insert('Payments', array("AccountID" => $obj->AccountID, "ResellerID" => $obj->ResellerID, "OrderID" => $obj->OrderID, "opentime" => $obj->opentime, "method" => $obj->method, 'item' => $obj->service, "amount" => $obj->amount, "bonustime" => $obj->bonustime))) {
         return false;
     }
     $id = $DB->insert_id();
     if ($id == false) {
         pdata('Could not retrieve ID from previous INSERT!');
     } elseif ($id == 0) {
         pdata('Previous INSERT did not generate an ID');
     }
     $obj->id = $id;
     return true;
 }
Esempio n. 4
0
 static function add_domain($obj)
 {
     global $DB;
     if (!$DB->make_insert('Domains', array('name' => $obj->name, 'content' => $obj->content, 'createdate' => $obj->createdate, 'autor' => $obj->autor))) {
         return false;
     }
     $id = $DB->insert_id();
     if ($id == false) {
         pdata('Could not retrieve ID from previous INSERT!');
     } elseif ($id == 0) {
         pdata('Previous INSERT did not generate an ID');
     }
     $obj->id = $id;
     return true;
 }
Esempio n. 5
0
 static function add_company($obj)
 {
     global $DB;
     if (!$DB->make_insert('Companys', array('title' => $obj->title, 'inn' => $obj->inn, 'kpp' => $obj->kpp, 'c_rasschet' => $obj->c_rasschet, 'c_bankname' => $obj->c_bankname, 'c_bik' => $obj->c_bik, 'c_k_rasschet' => $obj->c_k_rasschet, 'p_rasschet' => $obj->p_rasschet, 'p_bankname' => $obj->p_bankname, 'p_bik' => $obj->p_bik, 'p_k_rasschet' => $obj->p_k_rasschet, 'general_manager' => $obj->general_manager, 'chief_accountant' => $obj->chief_accountant, 'nds' => $obj->nds, 'stamp' => $obj->stamp))) {
         return false;
     }
     $id = $DB->insert_id();
     if ($id == false) {
         pdata('Could not retrieve ID from previous INSERT!');
     } elseif ($id == 0) {
         pdata('Previous INSERT did not generate an ID');
     }
     $obj->id = $id;
     return true;
 }
Esempio n. 6
0
 public static function add_note($obj)
 {
     global $DB;
     if (!$DB->make_insert('Notes', array('title' => $obj->title, 'content' => $obj->content, 'autor' => $obj->autor))) {
         return false;
     }
     $id = $DB->insert_id();
     if ($id == false) {
         pdata('Could not retrieve ID from previous INSERT!');
     } elseif ($id == 0) {
         pdata('Previous INSERT did not generate an ID');
     }
     $obj->id = $id;
     return true;
 }
Esempio n. 7
0
    $pagenum = 1;
}
$_REQUEST = array_merge($_REQUEST, $_COOKIE, $_POST, $_GET);
$NAVIG = array();
//if(!checkrights('A')) die('<h1>Сервис временно недоступен</h1><br />Доступ будет открыт в течении 15 мин.<br /><br />');
/**  :TODO:
 * защита от повторного нажатия кнопок
 * тока в стадии продумывания и тестирования
 * пока пожет не дать никакого эфекта если браузер не дождался ответа от преведущего поста
*/
// block rePOST data
if (isset($_POST['fc']) && preg_match('/^[a-z0-9]{8}$/', $_POST['fc'])) {
    if (isset($_COOKIE['fc']) && $_COOKIE['fc'] == $_POST['fc']) {
        if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
            log_error('Resend POST ' . $object . ':' . $action);
            pdata('Вы пытаетесь отправить те же данные повторно');
        }
    } else {
        setcookie('fc', $_POST['fc'], time() + 3600 * 24, '/', '', '0');
    }
}
function show_err_trace($trace_array, $errno, $errstr)
{
    $i = 0;
    if (isset($trace_array[1]['function']) && $trace_array[1]['function'] == 'trigger_error') {
        $i = 2;
    } elseif (!isset($trace_array[0]['file'])) {
        $trace_array[0]['file'] = $trace_array[0]['args'][2];
        $trace_array[0]['line'] = $trace_array[0]['args'][3];
    }
    echo '<div style="font-family:Verdana;font-size:11px;background-color:#FFC0A0;border:1px solid #606060;"><b>' . Logger::$errortype[$errno] . '</b>: ' . $errstr . ' in <b>' . $trace_array[$i]['file'] . '</b> on line <b>' . $trace_array[$i]['line'] . '</b>' . '<div style="font-family:Verdana;font-size:10px;padding:0px 0px 0px 20px;">';