Jump to content

AllToolKits.com

Members
  • Posts

    139
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by AllToolKits.com

  1. Hi,

     

    I have to call a table i created from the function public function getAdminServiceInfo

     

    I tried below code

    $this->components(array("Record"));
            $cron_log = $this->Record->select()->
                from("my_table")->
                fetchall();
    

    Seems like that is not working.  This table can't be part of the module, so i need a way to query the table.

    Let me know how i can do it?

     

     

    i recall someone told to use plugin for calling custom tables, but i can't use plugin as i need to call the table data from

    module function getAdminServiceInfo. Please let me know how i can do it.

  2. Hi,

     

    I am trying to display some data when i click a service. At the moment i got

    'This service has no details.' message.   

     

    We need to modify

     

    public function getAdminServiceInfo($service, $package) {

               return null;
    }

     

    to display any data i want, right?

     

     

    I just tried

     

    public function getAdminServiceInfo($service, $package) {

               return "hi";
    }

     

    But hi is not displayed.  I should re install the module?

     

    if so is there anyway to take backup of module and then reinstall it?

     

     

     

  3. Hi,

     

    I am developing a blesta plugin.

     

    I have country drop down, on each country select state drop down should  load corresponding states.

     

    Jquery Code:

    $( "#country" ).change(function() {
                            var value = $( "#country" ).val();
    
                                $.post( url + "plugin/name/admin_did/get_states", { country_id: value })
                                    .done(function( data ) {
                                    alert( "Data Loaded: " + data );
                                });
    
    
                                
                        });

    Controller

      public function get_states() {
            $c_id = $this->post['country_id'];
            $states = $this->Country->getList($c_id);
            echo json_encode($states);
            exit;
    
        }

    But got error

     

    Data Loaded:    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" dir="ltr">

        <head>

            <title>Blesta</title>

            <link rel="stylesheet" type="text/css" href="/app/views/errors/css/styles.css" />

            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        </head>



        <body>

                <div class="program_error">
            <h3>Oh noes!</h3>
            <div class="contents">
                <p>Files does not exist: C:\pathofplugin\views\admin\default\message.pdt on line <strong>120</strong> in <strong>

         

     

    What is wrong with this ajax call approch?

  4. Please see the attached shot of a page of my plugin, i would like to add a bread crump  .

     

    How to do it with the code?

    At the moment there is only a star present.

     

     

    My code is below

     

     


    <?php
    echo $this->Html->ifSet($message);
    $this->Widget->clear();
    $this->Widget->setStyleSheet($this->view_dir . "css/styles.css");
    $this->Widget->setTabs($tabs);
    $this->Widget->create("Create DID", true);
    $dirname = $this->base_uri."../plugins/";
    ?>
    <div class="pad">
    
    <div class="inner">
    
    <section class="common_box" id="navigations_staff">
    
    <div class="common_box_inner">
    <table class="table navstaff">

     

     

  5. Hi,

     

    I got that error because of  submitting a form without csrf token it.

    I fixed it by adding

    public function preAction() {
                    if($this->action == "updatebalance"){
                         Configure::set("Blesta.verify_csrf_token", false);
                    }
    
            parent::preAction();
        }

    I wish to use csrf in the form, how i can add that to the form ?

  6. Developing a plugin, in that i have a form with below code

     <form action="<?php echo $this->Html->safe($this->base_uri . "plugin/pname/client_pnaname/updatebalance") ?>" method="post"/>
    Amount: <input type="text" name="amount" />
    <input type="submit" class="btn btn-default"  name="update" value="Update" />
    </form>

    But i post, i get an error

    Oh noes!

    Files does not exist: C:\inetpub\wwwroot\plugins\pname\views\client\bootstrap\message.pdt on line 120 in C:\inetpub\wwwroot\lib\view.php
     

     

     

    I do have a a file controller folder with

    class ClientPname extendsPnameController { and a function in it with name updatebalance

     

    It works if the method is get, but getting error for post only.

     

    any idea why it's so?

  7. for example:  if we set a plan with the monthly period, let's say from 1-st of each month.

    now is 31 August, so tomorrow the Invoice will be generated for the month of september?

    From 01 September till 01 October?And will charge not for August, will charge for this Invoice for the full month of September?

  8. Hi,

     

    I am developing a blesta plugin that display a set of tabular data with pagination. I would like to export selected rows to a PDF and CSV file, is there any ready made blesta class or code for that?

     

    Code already developed will help me a lot.

     

    Thanks in adavnce.

  9. I tried below code, but it's not working. any idea why it's so?

        Loader::loadModels($this, array("Invoices"));
        $params = $event->getParams();
        $invoice_id = $params['invoice_id'];
    
        
        $vars = array(
            "client_id"  => "1501",
            "lines" => array(
                array(
                    "description" => "test item",
                    "qty" => "1",
                    "amount" => "10"
                    
                )
            )
            
        );
        $this->Invoices->edit($invoice_id, $vars);

    The item with cost 10 is not added to that invoice, any idea how we can add the row?

  10. Thanks, this info helped me to create link.

     

    How i can display content  without affecting the header and footer?

    When i click the link i just want to display Say  "Hello World" in the content area, where the top header and  footer, also left side should not be changed .

     

    Just the content area need some content change , how we can achieve that ?

×
×
  • Create New...