The Importance of Business Mentors

Mental Attitude

The choice of life as an "independent enterprise" must have a mental attitude. "The life never flat" is so in business, there are always ups and downs, so the entrepreneur mentality must be owned. In many posts, discussed this mentality, one of which is toughness to survive in a difficult position. Yes .. crisis management is important for beginner entrepreneurs, so that the future does not become "wira was was" .. anxiety continues to income ordernya.he he he. The first crisis stage is when it has overcome the fear to start an independent business. Dare to risk another word. <More>
 
To minimize business failure, in addition to understand the "oportunity" business, must also understand the "risk", so that business-related science is absolute. "Learning by doing", always learn as long as the business is run, "better make mistakes and learn fast" than "delay doing for fear of being wrong". Although the betting error in business is the loss of assets. Make the lost assets as "cost learning", the cost of learning.

Has a Business Mentor


Business novice, should have a successful business mentor, even if the mentor is not in the same business. This is very important for sharing knowledge and experience so that "cost learning" is not so great and "bleeding" the association related to loss of assets can be suppressed. Discover this mentor, a successful businessman profile you think, who can be contacted at any time and invited to sharing of course. From them lah, science and experience stories will be obtained, because this science is applied science that rarely obtained in legal formal education. For example, how to read the character of a potential business partner or overcome the constraints of our limited resources.
 
This business mentor, can also be considered a "vehicle" for the time to succeed not so long. Because at the time of our business start, you are not yet known by the business, "flag" is not bankable, .. no bank wants to disburse capital for you, because your business is still the age of corn. Whereas fresh funds and orders must be obtained, and the role of Mentor, (a successful entrepreneur, who has been known to the business world) is your "personal warranty". Like a car, he is Bamper, all will be borne by him, so that the business "agree" and your business slowly get orders through this Mentor. You will be introduced to the business community ... over time we will (and should) be released after our track record and tested reputation. And integrity is a key word that businesses must have in the future, always welcome in society. Focus is on your business, wake up the flag .. keep your reputation, .rejeki will find you he he he


"Is like a teak tree, which is late growing compared to other trees, due to its root growth priority. And when the buds begin to grow, this tree will not collapse because of storms, floods and other disasters, because its roots pierce deep into the earth, looking for a source of water in the land that is usually chalk and barren ... as a quality Teak habitat of one "

MVC: view and controller model in the framework

The web application developer base is currently using the framework. This product uses the YII framework. In the framework there is the MVC concept stands for Model, View and Controlller.
In principle that there is a separation of the staff of the developer of the database part of the administator, the system analyst and all those associated with the table with the database structure. All the staff in this section are addressing in the Model.
For staff in the layout, artistic look of the web associated with CSS, image files and web design, all of these will handle View. And the last is the staff section that connects the view (view) with the database, that is the programmer, software enginnering, which is related to the procedure, syntax and everything related to the control, this section handles the Controller.

All staff with their own expertise can not compare, because they have their own advantages and disadvantages. So they are expected to support and complement each other to develop a reliable web.

MVC is more complicated than IDE?

If you have ever studied programming, and try to compare IDE based programming with those that do not. IDE is an integrated development environment (please correct if wrong), which is a feature in the compiler that comes with the form design, database and script script writing. <more> The easiest example of this IDE compiler is visual basic. You can easily set the location of the text box object and the command button you want, just by click and drag. If you want to ngCoding, simply by double clicking on the object that is considered to have its event, the compiler will automatically provide a place to write the coding. When you want to see the results of work, simply by pressing F5 then the project will display according to your design earlier, like you design according to what you want.
How about web develop with MVC concept. Web applications with this concept, will separate the parts for layout design, database and place the coding script. Because of the web base, we will upload the results on hosting (read: server) then, in general, contains the .php file and some css for the design.
If still on localhost (offline), all work will be separated in certain folder. And by using notepad ++, we design. The design here is different from the IDE concept, because there is no visa design that is clearly visible. So at this stage, we must understand first with its framework.

CMultiFileUpload to upload files

A sweetener feature in a web is an animated image. Here it can mean moving and changing images. On this web, there is a silder who always change the image, can even added or deleted images if not like. This slider image management module is in the "Upload Image" menu. With the database design to accommodate the uploaded file name, we will direct the slider path to the folder to save it.

With CMultiFileUpload extentiion we can upload multiple image files at once. The Folders path is set inside the params file that resides   /config/params.php

here is the existing slider coding script

$sql="SELECT * FROM file_diupload order by id";
        $dataProvider2=new CSqlDataProvider($sql,array(
            'keyField' => 'id',
            'pagination'=>array(
                'pageSize'=>40,
            ),
        ));
        
            $terserah=array();
            $itu=array();
            $awal=array();
            $iki_fotone=array();
            foreach($dataProvider2->getData() as $i=>$ii)
            {
                $itu[$i]=$ii['nama_file'];
                $awal[$i]=Yii::app()->baseUrl."/uploads/foto/".$itu[$i];
                
                $iki_fotone[$i]=$awal[$i];
                $terserah[$i]=array($iki_fotone[$i],$itu[$i]);
        
            }

View Flow in Yii

Working with the framework, in the current web develop, should understand the concept of MVC. In this post, will sy tangent about the view. In the jni section, handle the look or layout of web design. Yii framework, has a plot in the view as follows.
1. Initially first, by default the web will access the index.php file located  in view/site/index.php
2. The default view yii, can be modified by converting the file into public variable $ layout declared in siteController
3. Suppose a public variable $layout="//layouts/coulumn2"
4. Please modif the coulumn2.php file that is on protected/view/layouts/
note the above script coulumn2.php
<?php $this->beginContent('//layouts/main'); ?>
5. You can add a Div or an additional tag. If you want a better view, then learn the themes with css bostraps
6. So on, when opening the module, then note the public variable $ layout that exist in each controller.

In summary, the View flow can be written Main.php ->coulumn2.php->controller->_form

Editme with a different touch with more

The blog creation phase with the framework (Yii), is to add an extension to simplify article writing. In this blog is used editMe extension. One of the advantages is able to upload image files (in our PC) to be inserted in the article. When the article has been posted, it appears the drawback, the article will look entirely along with the inserted image.
It is less efficient in terms of, the speed of web display. Every internet browser opens, in fact, will also download the files and images that look, meaning it will be lavish pulse :) and also slow when displaying web pages.


One way is to add procedures on the web, so in the article can be inserted more markers. Here is his script:

public function moreLink($idnya,$isinya)
    {
       $hasil="";
       
        if(strstr($isinya, '&lt;more&gt;', true)==false)
        { $hasil= $isinya; }
       else
        {
            $hasil=strstr($isinya, '&lt;more&gt;', true);
            $hasil= $hasil.$isilink='<a href="../post/'.$idnya.'">SELENGKAPNYA</a>';
        }
        
       return $hasil;
    }

Every article that appears on the web page will always be truncated, precisely limited by the visible text, in accordance with the writing of "more" in the article itself. The series of articles will end with the words COMPLETE and when we click on the writing INSTANTLY it will lead to the article in full and eliminate the word COMPLETE earlier. Here's the coding:

public function tanpaMore($isinya)
    {
       
       $hasil="";
       $hasil=str_replace("&lt;more&gt;","" , $isinya);
       return $hasil;
    }


 

CgridView updates automatically when create, update and delete views # 1

By default, in the Yii framework, the CgridView widget is inside admin.php. This component is useful for displaying data and as an effective search for subsequent data manipulation. So it can be said, CgridView is always in Yii project.
When creating and updating, CgridView can be displayed in 1 form with the same input, it needs a coding modification. Look at the picture below: <more>
 
Stage 1, to do CgridView order to display the data directly in accordance with the create as follows:
Open the admin.php file in protected / view / nama_view_anda .... Copy and paste it in _form.php under the cover of its div form


</div><!-- penutup  form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
        'id'=>'kategori-grid',
        'dataProvider'=>$model->search(),
        'filter'=>$model,
        'columns'=>array(
                        'nama_kategori',
                        array(
                                        'class' => 'CButtonColumn',
            'template' => '{update}{delete}',
           
            )
        ),
)); ?>
Modify the coding on the controller
In actionCreate, replace the string coding as follows:
if($model->save())
                                        {
                                                        $this->redirect('create');
//$this->redirect(array('view','id'=>$model->id));   INI YANG ASLI
                                        }
 
Please be practiced to save this new data, it will be able to get new data appear on the grid.
For the next article is a modification in actionUpdate. Please wait.

CgridView updates automatically when create, update and delete views no 2

As my promise in the title article CgridView update otomatis saat create, update dan delete pada 1 tampilan  # 1 , I will continue to make a trick on the gridview. In the first article, when uploading files, there are 2 events that take place: upload files in a specific folder and save the file name in a particular table.
Now we will discuss how to delete the uploaded data in the table and at the same time to delete the stored files. And it will directly remove the data in its gridview so it always updates

1.Open file in view as upload form
Modified cgridview
(
             'class' => 'CButtonColumn',  
             'template' => '{delete}',
  )
Be as below:
array( 'class' => 'CButtonColumn',
                'template' => '{open}',
                'buttons' => array(
  'open' => array(
                 'url' => 'Yii::app()->createUrl("fileDiupload/conAktif", array("id"=>$data->id))',
                 'imageUrl' => Yii::app()->request->baseUrl . '/images/delete.png',  )
            )
),
 
2. Make the conActive function in its controller
public function actionConAktif($id)
        {
                        $konfirmasi=1;
                        $model=$this->loadModel($id);
                       
        $this->render('conaktif',array(
                                        'model'=>$model,
                                        'konfirmasi'=>$konfirmasi,
                        ));
        }
3. Make conactive views
<?php echo $this->renderPartial('_conformAktif', array(
                'model'=>$model,
                'konfirmasi'=>$konfirmasi,
                )); ?>
 
4.Make view _conformActive '
<?php
 
          if(isset($konfirmasi))
           {
                           ?>
                            <script>
 
                                          hasil=window.confirm("Yakin hapus file/data ini ?");
                                          if(hasil)
                                                        {
                                                          
                                                        window.location.href="../hapus/" + <?php echo $model->id ?>;
                                                        }
                                                        else
                                                        {
                                                                       
                                                                        window.location.href="../../unggah/unggahfile";
                                                        }
                                        </script>
                            <?php  
            }                             ?>       
 
5. After that go back to the controller to create the delete function
public function actionHapus($id)
        {
                        //hapus item data yg terpilih'
                        $model=$this->loadModel($id);
                        $file = $model->nama_file;
                       
                        $folder =Yii::app()->params['uploadDir'];
                         if( $file != null  &&  file_exists( $folder.'/'.$file ) )
                         {
             unlink(getcwd().'/'.$folder.$file); //hapus file yg terpilih datanya
                                         if ($model->delete())
                                         {
                                        if(!isset($_GET['ajax']))
        $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('unggah/unggahfile'));
                                         }
                         
                        }
                       
        }


Please follow the steps above, if any bugs learn its errors,

Work Order in Digital Printing

Digital printing business, has the same principle with other retail business. But it has a difference, that is (generally) no goods are sold directly, but processed first. In the digital printing business, every order received, has a plot to delegate to staff. That is, there are staff in charge of working on the order.

In the digital printing cashier system, the need to print a Work Order (SPK). This SPK as a reference for employees working on the order. The information contained in this SPK include: no order, date, name of staff, customer and item order details. The detail item data is equal to the data at the time of the order but there is no value of the price and its total rupiah.