صفحه 1 از 2 12 آخرینآخرین
نمایش نتایج: از شماره 1 تا 10 , از مجموع 19

موضوع: ساختار ذخیره دیتا در دیتابیس freer

  1. #1
    عضو جدید
    تاریخ عضویت
    Nov 2011
    نوشته ها
    7
    تشکر تشکر کرده 
    4
    تشکر تشکر شده 
    0
    تشکر شده در
    0 پست

    پیش فرض ساختار ذخیره دیتا در دیتابیس freer

    سلام خدمت دوستان عزیز ... یه سوال داشتم و اون اینکه تو این صفحه دیتاهایی که وارد میشن دقیقا در کجای کد توی دیتا بیس وارد میشن ؟ index .php
    کد PHP:
    <?
    /*
      Virtual Freer
      http://freer.ir/virtual

      Copyright (c) 2011 Mohammad Hossein Beyram, freer.ir

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
      as published by the Free Software Foundation.
    */
    //------------------ Load Configuration
    include 'include/configuration.php';
    //------------------ Start Smarty
    include 'include/startSmarty.php';

        if($post['action'] != '' || $get['action'] != '') 
        {
            if($post['action'] == '')
            {
                $data[action]     = $get['action'];
                $data[card]        = $get['card']; 
                $data[qty]        = $get['qty']; 
                $data[gateway]    = $get['gateway'];
                $data[email]    = $get['email'];
                $data[mobile]    = $get['mobile'];
                $noJavaScript     = 1;
            } else {
                $data[action]     = $post['action'];
                $data[card]        = $post['card'];
                $data[qty]        = $post['qty'];
                $data[gateway]    = $post['gateway'];
                $data[email]    = $post['email'];
                $data[mobile]    = $post['mobile'];
                $noJavaScript     = 0;
            }
        }
        if ($data[action] == "payit")
        {
            if (!$data[card])
                $error    .= 'کارتی انتخاب نکرده‌اید.‌<br />';
            if (!$data[qty])
                $error    .= 'تعداد کارت درخواستی مشخص نشده است.‌<br />';
            if ($data[card] AND $data[qty])
            {
                $count_query    = 'SELECT COUNT(*) FROM `card` WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1"';
                $count_card        = $db->fetch($count_query);
                $total_card        = $count_card['COUNT(*)'];
                if ($total_card < $data[qty])
                    if ($total_card != 0)
                        $error .= 'متاسفانه تعداد کارت درخواستی شما در حال حاضر موجود نمی‌باشد٬ شما الان می‌توانید حداکثر '.Convertnumber2farsi($total_card).' کارت از این نوع سفارش دهید.<br />';
                    else
                        $error .= 'متاسفانه کارت درخواستی شما در حال حاضر موجود نمی‌باشد.‌<br />';
            }
            if (!$data[gateway])
                $error    .= 'دروازه پرداخت را مشخص نکرده اید.‌<br />';
            
            $input_validate    = $db->retrieve('config_input_validate','config','config_id',1);
            if ($input_validate)
            {
                if (!$data[email] AND !$data[mobile])
                    $error    .= 'برای استفاده از پشتیبانی سایت ایمیل یا شماره همراه خود را وارد کنید.‌<br />';
                if ($data[email] AND filter_var($data[email], FILTER_VALIDATE_EMAIL)== false)
                    $error .= 'ایمیل وارد شده نامعتبر است.<br />';
                if ($data[mobile] AND !eregi("^09([0-9]{9})$", $data[mobile]))
                    $error .= "شماره همراه نامعتبر است.<br />";
            }
            if($error)
                echo $error.'__2';
            else
            {
                $insert[payment_user]        = $request[PHPSESSID];
                $insert[payment_email]        = $data[email];
                $insert[payment_mobile]        = $data[mobile];
                $insert[payment_amount]        = $db->retrieve('product_price','product','product_id',$data[card])*$data[qty];
                $insert[payment_gateway]    = $data[gateway];
                $insert[payment_time]        = $now;
                $insert[payment_ip]            = $server[REMOTE_ADDR];
                
                $sql                         = $db->queryInsert('payment', $insert);
                $db->execute($sql);
                $payment_id                 = mysql_insert_id();
                
                $randlen                    = 9-strlen($payment_id);
                $update[payment_rand]        = $payment_id.get_rand_id($randlen);
                $sql = $db->queryUpdate('payment', $update, 'WHERE `payment_id` = "'.$payment_id.'" LIMIT 1;');
                $db->execute($sql);
                $random                        = $update[payment_rand];
                unset($update);
                
                $update[card_customer_email]    = $data[email];
                $update[card_customer_mobile]    = $data[mobile];
                $update[card_res_user]            = $request[PHPSESSID];
                $update[card_res_time]            = $now;
                $update[card_payment_id]        = $payment_id;
                $sql = $db->queryUpdate('card', $update, 'WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1" LIMIT '.$data[qty].';');
                $db->execute($sql);
                
                echo 'gateway.php?random='.$random.'__1';
            }
            exit;
        }

        $query        = 'SELECT * FROM `category` WHERE `category_parent_id` = "0" ORDER BY `category_order`';
        $categories    = $db->fetchAll($query);
        if ($categories)
            foreach ($categories as $key => $category)
            {
                if ($categories[$key][category_image])
                    $categories[$key][category_image] = $config[MainInfo][url].$config[MainInfo][upload][image].'resized/category_'.$category[category_image];
                $query        = 'SELECT * FROM `product` WHERE `product_category` = "'.$category[category_id].'" ORDER BY `product_id` ASC';
                $categories[$key][products]    = $db->fetchAll($query);
                if ($categories[$key][products])
                    foreach ($categories[$key][products] as $product_key => $product)
                    {
                        $count_query    = 'SELECT COUNT(*) FROM `card` WHERE `card_product` = "'.$product[product_id].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1"';
                        $count_card        = $db->fetch($count_query);
                        $total_card        = $count_card['COUNT(*)'];
                        $categories[$key][products][$product_key][counter] = $total_card;
                    }
            }

        $query                = 'SELECT * FROM `plugin` WHERE `plugin_type` = "payment" AND `plugin_status` = "1"';
        $payment_methods    = $db->fetchAll($query);

        for ($i=0;$i<768;$i=$i+32)    {
            $banks_logo     .= '<li style="background-position: -'.$i.'px 0px;"></li>';
        }

        //-- نمایش صفحه
        $query    = 'SELECT * FROM `config` WHERE `config_id` = "1" LIMIT 1';
        $config    = $db->fetch($query);

        $smarty->assign('config', $config);
        $smarty->assign('categories', $categories);
        $smarty->assign('products', $products);
        $smarty->assign('payment_methods', $payment_methods);
        $smarty->assign('banks_logo', $banks_logo);
        $smarty->display('index.tpl');
        exit;
    ویرایش توسط webnevesht : July 13th, 2013 در ساعت 23:38

  2. # ADS




     

  3. #2
    عضو انجمن
    تاریخ عضویت
    Jul 2012
    نوشته ها
    243
    تشکر تشکر کرده 
    88
    تشکر تشکر شده 
    478
    تشکر شده در
    173 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    متغیر $dbکارهای دیتابیس رو انجام میده

    هرجا این متغیر بود در حال اتصال به دیتابیس هستید


    برای مشاهده متد ها مانند fetch fetchall به فایل include/libs/class.smartmysql.php مراجعه کنید

  4. تعداد تشکر ها ازcooper47 به دلیل پست مفید


  5. #3
    عضو انجمن sardarn آواتار ها
    تاریخ عضویت
    Aug 2010
    محل سکونت
    بوشهر
    نوشته ها
    956
    تشکر تشکر کرده 
    387
    تشکر تشکر شده 
    999
    تشکر شده در
    700 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    سلام
    خط 47 دستور
    کد:
    $count_card        = $db->fetch($count_query);
    انتخاب هست.خط 80 و 81 دستور
    کد:
    $sql                         = $db->queryInsert('payment', $insert); 
                $db->execute($sql);
    دستور ذخیره در دیتابیس هست.خط 86 و 87 دستور
    کد:
    $sql = $db->queryUpdate('payment', $update, 'WHERE `payment_id` = "'.$payment_id.'" LIMIT 1;'); 
                $db->execute($sql);
    دستور آپدیت هست.خط 96 و 97 دستور
    کد:
    $sql = $db->queryUpdate('card', $update, 'WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1" LIMIT '.$data[qty].';'); 
                $db->execute($sql);
    دستور آپدیت هست.همین طور خط 104 و 105 انتخاب ، خط و...
    کلا هر جا $db گذاشته یعنی می خواد یک کاری با دیتابیس کنه که با قبلش می شه فهمید.و معمولا با دستور fetch یا fetchall همراه هست.

  6. تعداد تشکر ها ازsardarn به دلیل پست مفید


  7. #4
    عضو جدید
    تاریخ عضویت
    Nov 2011
    نوشته ها
    7
    تشکر تشکر کرده 
    4
    تشکر تشکر شده 
    0
    تشکر شده در
    0 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    حالا یک سوال و اون اینکه الان من میخوام یک قسمت به نام توضیحات اضافه کنم ... متغیرش رو هم گذاشتم tozih
    اینم عکسش :

    07-05-2013 09-35-35 ب.png
    و کدش رو هم به صورت زیر دستکاری کردم :
    البته فراموش نشه که یک جدول هم توی دیتابیس اضافه کردم ...

    یک مشکل که وجود داره اینه که وقتی در قسمت توضیحات چیزی مینویسی وارد دیتا بیس نمیشه .
    مشکلش از کجا میتونه باشه ؟
    کد PHP:
    <?
    /*
      Virtual Freer
      http://freer.ir/virtual

      Copyright (c) 2011 Mohammad Hossein Beyram, freer.ir

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
      as published by the Free Software Foundation.
    */
    //------------------ Load Configuration
    include 'include/configuration.php';
    //------------------ Start Smarty
    include 'include/startSmarty.php';

        if($post['action'] != '' || $get['action'] != '') 
        {
            if($post['action'] == '')
            {
                $data[action]     = $get['action'];
                $data[card]        = $get['card']; 
                $data[qty]        = $get['qty']; 
                $data[gateway]    = $get['gateway'];
                $data[email]    = $get['email'];
                $data[mobile]    = $get['mobile'];
                $data[tozih]    = $get['tozih'];
                $noJavaScript     = 1;
            } else {
                $data[action]     = $post['action'];
                $data[card]        = $post['card'];
                $data[qty]        = $post['qty'];
                $data[gateway]    = $post['gateway'];
                $data[email]    = $post['email'];
                $data[mobile]    = $post['mobile'];
                $data[tozih]    = $post['tozih'];
                $noJavaScript     = 0;
            }
        }
        if ($data[action] == "payit")
        {
            if (!$data[card])
                $error    .= 'کارتی انتخاب نکرده‌اید.‌<br />';
            if (!$data[qty])
                $error    .= 'تعداد کارت درخواستی مشخص نشده است.‌<br />';
            if ($data[card] AND $data[qty])
            {
                $count_query    = 'SELECT COUNT(*) FROM `card` WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1"';
                $count_card        = $db->fetch($count_query);
                $total_card        = $count_card['COUNT(*)'];
                if ($total_card < $data[qty])
                    if ($total_card != 0)
                        $error .= 'متاسفانه تعداد کارت درخواستی شما در حال حاضر موجود نمی‌باشد٬ شما الان می‌توانید حداکثر '.Convertnumber2farsi($total_card).' کارت از این نوع سفارش دهید.<br />';
                    else
                        $error .= 'متاسفانه کارت درخواستی شما در حال حاضر موجود نمی‌باشد.‌<br />';
            }
            if (!$data[gateway])
                $error    .= 'دروازه پرداخت را مشخص نکرده اید.‌<br />';
            
            $input_validate    = $db->retrieve('config_input_validate','config','config_id',1);
            if ($input_validate)
            {
                if (!$data[email] AND !$data[mobile])
                    $error    .= 'برای استفاده از پشتیبانی سایت ایمیل یا شماره همراه خود را وارد کنید.‌<br />';
                if ($data[email] AND filter_var($data[email], FILTER_VALIDATE_EMAIL)== false)
                    $error .= 'ایمیل وارد شده نامعتبر است.<br />';
                if ($data[mobile] AND !eregi("^09([0-9]{9})$", $data[mobile]))
                    $error .= "شماره همراه نامعتبر است.<br />";
            }
            if($error)
                echo $error.'__2';
            else
            {
                $insert[payment_user]        = $request[PHPSESSID];
                $insert[payment_email]        = $data[email];
                $insert[payment_mobile]        = $data[mobile];
                $insert[payment_tozih]        = $data[tozih];
                $insert[payment_amount]        = $db->retrieve('product_price','product','product_id',$data[card])*$data[qty];
                $insert[payment_gateway]    = $data[gateway];
                $insert[payment_time]        = $now;
                $insert[payment_ip]            = $server[REMOTE_ADDR];
                
                $sql                         = $db->queryInsert('payment', $insert);
                $db->execute($sql);
                $payment_id                 = mysql_insert_id();
                
                $randlen                    = 9-strlen($payment_id);
                $update[payment_rand]        = $payment_id.get_rand_id($randlen);
                $sql = $db->queryUpdate('payment', $update, 'WHERE `payment_id` = "'.$payment_id.'" LIMIT 1;');
                $db->execute($sql);
                $random                        = $update[payment_rand];
                unset($update);
                
                $update[card_customer_email]    = $data[email];
                $update[card_customer_mobile]    = $data[mobile];
                $update[card_customer_tozih]    = $data[tozih];
                $update[card_res_user]            = $request[PHPSESSID];
                $update[card_res_time]            = $now;
                $update[card_payment_id]        = $payment_id;
                $sql = $db->queryUpdate('card', $update, 'WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1" LIMIT '.$data[qty].';');
                $db->execute($sql);
                
                echo 'gateway.php?random='.$random.'__1';
            }
            exit;
        }

        $query        = 'SELECT * FROM `category` WHERE `category_parent_id` = "0" ORDER BY `category_order`';
        $categories    = $db->fetchAll($query);
        if ($categories)
            foreach ($categories as $key => $category)
            {
                if ($categories[$key][category_image])
                    $categories[$key][category_image] = $config[MainInfo][url].$config[MainInfo][upload][image].'resized/category_'.$category[category_image];
                $query        = 'SELECT * FROM `product` WHERE `product_category` = "'.$category[category_id].'" ORDER BY `product_id` ASC';
                $categories[$key][products]    = $db->fetchAll($query);
                if ($categories[$key][products])
                    foreach ($categories[$key][products] as $product_key => $product)
                    {
                        $count_query    = 'SELECT COUNT(*) FROM `card` WHERE `card_product` = "'.$product[product_id].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1"';
                        $count_card        = $db->fetch($count_query);
                        $total_card        = $count_card['COUNT(*)'];
                        $categories[$key][products][$product_key][counter] = $total_card;
                    }
            }

        $query                = 'SELECT * FROM `plugin` WHERE `plugin_type` = "payment" AND `plugin_status` = "1"';
        $payment_methods    = $db->fetchAll($query);

        for ($i=0;$i<768;$i=$i+32)    {
            $banks_logo     .= '<li style="background-position: -'.$i.'px 0px;"></li>';
        }

        //-- نمایش صفحه
        $query    = 'SELECT * FROM `config` WHERE `config_id` = "1" LIMIT 1';
        $config    = $db->fetch($query);

        $smarty->assign('config', $config);
        $smarty->assign('categories', $categories);
        $smarty->assign('products', $products);
        $smarty->assign('payment_methods', $payment_methods);
        $smarty->assign('banks_logo', $banks_logo);
        $smarty->display('index.tpl');
        exit;

  8. #5
    عضو انجمن sardarn آواتار ها
    تاریخ عضویت
    Aug 2010
    محل سکونت
    بوشهر
    نوشته ها
    956
    تشکر تشکر کرده 
    387
    تشکر تشکر شده 
    999
    تشکر شده در
    700 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    نقل قول نوشته اصلی توسط webnevesht نمایش پست ها
    حالا یک سوال و اون اینکه الان من میخوام یک قسمت به نام توضیحات اضافه کنم ... متغیرش رو هم گذاشتم tozih
    اینم عکسش :


    و کدش رو هم به صورت زیر دستکاری کردم :
    البته فراموش نشه که یک جدول هم توی دیتابیس اضافه کردم ...

    یک مشکل که وجود داره اینه که وقتی در قسمت توضیحات چیزی مینویسی وارد دیتا بیس نمیشه .
    مشکلش از کجا میتونه باشه ؟
    کد PHP:
    <?
    /*
      Virtual Freer
      http://freer.ir/virtual

      Copyright (c) 2011 Mohammad Hossein Beyram, freer.ir

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
      as published by the Free Software Foundation.
    */
    //------------------ Load Configuration
    include 'include/configuration.php';
    //------------------ Start Smarty
    include 'include/startSmarty.php';

        if($post['action'] != '' || $get['action'] != '') 
        {
            if($post['action'] == '')
            {
                $data[action]     = $get['action'];
                $data[card]        = $get['card']; 
                $data[qty]        = $get['qty']; 
                $data[gateway]    = $get['gateway'];
                $data[email]    = $get['email'];
                $data[mobile]    = $get['mobile'];
                $data[tozih]    = $get['tozih'];
                $noJavaScript     = 1;
            } else {
                $data[action]     = $post['action'];
                $data[card]        = $post['card'];
                $data[qty]        = $post['qty'];
                $data[gateway]    = $post['gateway'];
                $data[email]    = $post['email'];
                $data[mobile]    = $post['mobile'];
                $data[tozih]    = $post['tozih'];
                $noJavaScript     = 0;
            }
        }
        if ($data[action] == "payit")
        {
            if (!$data[card])
                $error    .= 'کارتی انتخاب نکرده‌اید.‌<br />';
            if (!$data[qty])
                $error    .= 'تعداد کارت درخواستی مشخص نشده است.‌<br />';
            if ($data[card] AND $data[qty])
            {
                $count_query    = 'SELECT COUNT(*) FROM `card` WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1"';
                $count_card        = $db->fetch($count_query);
                $total_card        = $count_card['COUNT(*)'];
                if ($total_card < $data[qty])
                    if ($total_card != 0)
                        $error .= 'متاسفانه تعداد کارت درخواستی شما در حال حاضر موجود نمی‌باشد٬ شما الان می‌توانید حداکثر '.Convertnumber2farsi($total_card).' کارت از این نوع سفارش دهید.<br />';
                    else
                        $error .= 'متاسفانه کارت درخواستی شما در حال حاضر موجود نمی‌باشد.‌<br />';
            }
            if (!$data[gateway])
                $error    .= 'دروازه پرداخت را مشخص نکرده اید.‌<br />';
            
            $input_validate    = $db->retrieve('config_input_validate','config','config_id',1);
            if ($input_validate)
            {
                if (!$data[email] AND !$data[mobile])
                    $error    .= 'برای استفاده از پشتیبانی سایت ایمیل یا شماره همراه خود را وارد کنید.‌<br />';
                if ($data[email] AND filter_var($data[email], FILTER_VALIDATE_EMAIL)== false)
                    $error .= 'ایمیل وارد شده نامعتبر است.<br />';
                if ($data[mobile] AND !eregi("^09([0-9]{9})$", $data[mobile]))
                    $error .= "شماره همراه نامعتبر است.<br />";
            }
            if($error)
                echo $error.'__2';
            else
            {
                $insert[payment_user]        = $request[PHPSESSID];
                $insert[payment_email]        = $data[email];
                $insert[payment_mobile]        = $data[mobile];
                $insert[payment_tozih]        = $data[tozih];
                $insert[payment_amount]        = $db->retrieve('product_price','product','product_id',$data[card])*$data[qty];
                $insert[payment_gateway]    = $data[gateway];
                $insert[payment_time]        = $now;
                $insert[payment_ip]            = $server[REMOTE_ADDR];
                
                $sql                         = $db->queryInsert('payment', $insert);
                $db->execute($sql);
                $payment_id                 = mysql_insert_id();
                
                $randlen                    = 9-strlen($payment_id);
                $update[payment_rand]        = $payment_id.get_rand_id($randlen);
                $sql = $db->queryUpdate('payment', $update, 'WHERE `payment_id` = "'.$payment_id.'" LIMIT 1;');
                $db->execute($sql);
                $random                        = $update[payment_rand];
                unset($update);
                
                $update[card_customer_email]    = $data[email];
                $update[card_customer_mobile]    = $data[mobile];
                $update[card_customer_tozih]    = $data[tozih];
                $update[card_res_user]            = $request[PHPSESSID];
                $update[card_res_time]            = $now;
                $update[card_payment_id]        = $payment_id;
                $sql = $db->queryUpdate('card', $update, 'WHERE `card_product` = "'.$data[card].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1" LIMIT '.$data[qty].';');
                $db->execute($sql);
                
                echo 'gateway.php?random='.$random.'__1';
            }
            exit;
        }

        $query        = 'SELECT * FROM `category` WHERE `category_parent_id` = "0" ORDER BY `category_order`';
        $categories    = $db->fetchAll($query);
        if ($categories)
            foreach ($categories as $key => $category)
            {
                if ($categories[$key][category_image])
                    $categories[$key][category_image] = $config[MainInfo][url].$config[MainInfo][upload][image].'resized/category_'.$category[category_image];
                $query        = 'SELECT * FROM `product` WHERE `product_category` = "'.$category[category_id].'" ORDER BY `product_id` ASC';
                $categories[$key][products]    = $db->fetchAll($query);
                if ($categories[$key][products])
                    foreach ($categories[$key][products] as $product_key => $product)
                    {
                        $count_query    = 'SELECT COUNT(*) FROM `card` WHERE `card_product` = "'.$product[product_id].'" AND (`card_res_time` < "'.($now-(60*$config[card][reserveExpire])).'" OR `card_res_time` = "") AND `card_status` = "1" AND `card_show` = "1"';
                        $count_card        = $db->fetch($count_query);
                        $total_card        = $count_card['COUNT(*)'];
                        $categories[$key][products][$product_key][counter] = $total_card;
                    }
            }

        $query                = 'SELECT * FROM `plugin` WHERE `plugin_type` = "payment" AND `plugin_status` = "1"';
        $payment_methods    = $db->fetchAll($query);

        for ($i=0;$i<768;$i=$i+32)    {
            $banks_logo     .= '<li style="background-position: -'.$i.'px 0px;"></li>';
        }

        //-- نمایش صفحه
        $query    = 'SELECT * FROM `config` WHERE `config_id` = "1" LIMIT 1';
        $config    = $db->fetch($query);

        $smarty->assign('config', $config);
        $smarty->assign('categories', $categories);
        $smarty->assign('products', $products);
        $smarty->assign('payment_methods', $payment_methods);
        $smarty->assign('banks_logo', $banks_logo);
        $smarty->display('index.tpl');
        exit;
    سلام
    الان شما فیلد tozih رو هم به تیبل payment هم تیبل card اضاف کردید؟
    در فایل statics\js\main.js فیلد رو تعریف کردید؟

  9. تعداد تشکر ها ازsardarn به دلیل پست مفید


  10. #6
    عضو جدید
    تاریخ عضویت
    Nov 2011
    نوشته ها
    7
    تشکر تشکر کرده 
    4
    تشکر تشکر شده 
    0
    تشکر شده در
    0 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    در هر دو تا تیبل تعریف کردم ...

    اون دومی رو نه انجام ندادم . main.js رو انجام نداده بودم ...

    اینجوری میشه دیگه :

    کد PHP:
            $("#submit").click(function() {
                var 
    card     = $('input:radio[name=card]:checked').val();
                var 
    qty     = $("select#qty option:selected").val();
                var 
    gateway = $("select#gateway option:selected").val();
                var 
    email     = $('input:text[name=email]').val();
                var 
    mobile     = $('input:text[name=mobile]').val();
                var 
    tozih     = $('textarea:text[name=tozih]').val();
                $(
    "#loader").html('<img src="statics/image/loader.gif" align="left">');
                $.
    ajax({
                
    type"POST",
                
    url"index.php",
                
    data: { card:cardqty:qtygateway:gatewayemail:emailmobile:mobiletozih:tozihaction"payit"},
                
    success: function(theResponse) {
                    var 
    theResponseSplitter     theResponse.split("__");
                    var 
    theResponseMessage         theResponseSplitter[0];
                    var 
    theResponseStatus         theResponseSplitter[1];
                    if(
    theResponseStatus == 1)
                    {
                        
    window.location.href theResponseMessage;
                    }
                    else
                    {
                        
    jQuery('body').showMessage({
                            
    'thisMessage':[theResponseMessage],'className':'error','displayNavigation':false,autoClose:false,opacity:75
                        
    });
                    }
                    $(
    "#loader").empty();
                }
                });

            }); 

  11. #7
    عضو انجمن sardarn آواتار ها
    تاریخ عضویت
    Aug 2010
    محل سکونت
    بوشهر
    نوشته ها
    956
    تشکر تشکر کرده 
    387
    تشکر تشکر شده 
    999
    تشکر شده در
    700 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    نقل قول نوشته اصلی توسط webnevesht نمایش پست ها
    در هر دو تا تیبل تعریف کردم ...

    اون دومی رو نه انجام ندادم . main.js رو انجام نداده بودم ...

    اینجوری میشه دیگه :

    کد PHP:
            $("#submit").click(function() {
                var 
    card     = $('input:radio[name=card]:checked').val();
                var 
    qty     = $("select#qty option:selected").val();
                var 
    gateway = $("select#gateway option:selected").val();
                var 
    email     = $('input:text[name=email]').val();
                var 
    mobile     = $('input:text[name=mobile]').val();
                var 
    tozih     = $('textarea:text[name=tozih]').val();
                $(
    "#loader").html('<img src="statics/image/loader.gif" align="left">');
                $.
    ajax({
                
    type"POST",
                
    url"index.php",
                
    data: { card:cardqty:qtygateway:gatewayemail:emailmobile:mobiletozih:tozihaction"payit"},
                
    success: function(theResponse) {
                    var 
    theResponseSplitter     theResponse.split("__");
                    var 
    theResponseMessage         theResponseSplitter[0];
                    var 
    theResponseStatus         theResponseSplitter[1];
                    if(
    theResponseStatus == 1)
                    {
                        
    window.location.href theResponseMessage;
                    }
                    else
                    {
                        
    jQuery('body').showMessage({
                            
    'thisMessage':[theResponseMessage],'className':'error','displayNavigation':false,autoClose:false,opacity:75
                        
    });
                    }
                    $(
    "#loader").empty();
                }
                });

            }); 
    بله.الان کار نمی کنه؟

  12. تعداد تشکر ها ازsardarn به دلیل پست مفید


  13. #8
    عضو انجمن
    تاریخ عضویت
    Jul 2012
    نوشته ها
    243
    تشکر تشکر کرده 
    88
    تشکر تشکر شده 
    478
    تشکر شده در
    173 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    نقل قول نوشته اصلی توسط webnevesht نمایش پست ها
    در هر دو تا تیبل تعریف کردم ...

    اون دومی رو نه انجام ندادم . main.js رو انجام نداده بودم ...

    اینجوری میشه دیگه :

    کد PHP:
            $("#submit").click(function() {
                var 
    card     = $('input:radio[name=card]:checked').val();
                var 
    qty     = $("select#qty option:selected").val();
                var 
    gateway = $("select#gateway option:selected").val();
                var 
    email     = $('input:text[name=email]').val();
                var 
    mobile     = $('input:text[name=mobile]').val();
                var 
    tozih     = $('textarea:text[name=tozih]').val();
                $(
    "#loader").html('<img src="statics/image/loader.gif" align="left">');
                $.
    ajax({
                
    type"POST",
                
    url"index.php",
                
    data: { card:cardqty:qtygateway:gatewayemail:emailmobile:mobiletozih:tozihaction"payit"},
                
    success: function(theResponse) {
                    var 
    theResponseSplitter     theResponse.split("__");
                    var 
    theResponseMessage         theResponseSplitter[0];
                    var 
    theResponseStatus         theResponseSplitter[1];
                    if(
    theResponseStatus == 1)
                    {
                        
    window.location.href theResponseMessage;
                    }
                    else
                    {
                        
    jQuery('body').showMessage({
                            
    'thisMessage':[theResponseMessage],'className':'error','displayNavigation':false,autoClose:false,opacity:75
                        
    });
                    }
                    $(
    "#loader").empty();
                }
                });

            }); 
    کد PHP:
    var tozih     = $('textarea:text[name=tozih]').val(); 
    این خط رو به خط زیر تبدیل کنید

    کد PHP:
    var tozih     = $('textarea[name=tozih]').html(); 

  14. تعداد تشکر ها از cooper47 به دلیل پست مفید


  15. #9
    عضو جدید
    تاریخ عضویت
    Nov 2011
    نوشته ها
    7
    تشکر تشکر کرده 
    4
    تشکر تشکر شده 
    0
    تشکر شده در
    0 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    نه متاسفانه تو برگشت از بانک به سایت به مشکل برخورد ...
    قبل از تغییر تو فایل main برمیگشت ولی اطلاعات ذخیره نمیکرد .
    الان برنمیگرده اطلاعات هم ذخیره نمیکنه .

  16. #10
    عضو جدید
    تاریخ عضویت
    Nov 2011
    نوشته ها
    7
    تشکر تشکر کرده 
    4
    تشکر تشکر شده 
    0
    تشکر شده در
    0 پست

    پیش فرض پاسخ : ساختار ذخیره دیتا در دیتابیس freer

    نقل قول نوشته اصلی توسط cooper47 نمایش پست ها
    کد PHP:
    var tozih     = $('textarea:text[name=tozih]').val(); 
    این خط رو به خط زیر تبدیل کنید

    کد PHP:
    var tozih     = $('textarea[name=tozih]').html(); 
    با تغییر این کد ... برگشت به سایت درست شد ولی اطلاعات مربوط به توضیحات ذخیره نشد .
    ویرایش توسط webnevesht : July 14th, 2013 در ساعت 19:36

صفحه 1 از 2 12 آخرینآخرین

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. مشکل در دیتابیس-عدم ایمپورت دیتا بیس اصلی (MariaDB 5.5.41)
    توسط dreamyeye در انجمن سوالات و مشکلات
    پاسخ ها: 3
    آخرين نوشته: March 31st, 2018, 11:00
  2. پاسخ ها: 3
    آخرين نوشته: September 26th, 2017, 00:34
  3. انتقال ، کپی یک تیبل از دیتابیسی به دیتابیس دیگر
    توسط adnan در انجمن دايرکت ادمين DirectAdmin
    پاسخ ها: 0
    آخرين نوشته: August 4th, 2016, 12:28
  4. پاسخ ها: 4
    آخرين نوشته: May 1st, 2014, 22:27
  5. نصب مجدد Freer و بازنگشتن دیتابیس
    توسط felfel در انجمن اسکریپت های دیگر
    پاسخ ها: 4
    آخرين نوشته: January 9th, 2014, 16:20

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •