Posts

Showing posts from December, 2010

To control the view section of the MVC framework in PHP (Part 1 of 5)

class View {     function showGrid($data)     {         include_once ('components/product_category/views/grid.php');     }         function showForm($obj_,$cdata)     {         include_once ('components/product_category/views/form.php');     } } ?>

To list the product category from the database in PHP with the use of MVC framework (Part 5 of 5)

Product Categories                             Add New Category              

Form to show editable part and insert section in MVC of PHP(Part 2 of 5)

Untitled Document <?php $cmd = ''; if(isset($obj_)) { $cmd = 'update'; $btnText = 'Save'; } else { $cmd = 'insert'; $btnText = 'Add'; } ?> <div class="heading">Add/Edit Categories</div> <form method="post" onsubmit="return submitbutton('', 'f');" id="f" name="f" enctype="multipart/form-data" action="?menu=<?php echo $_REQUEST['menu']; ?>&p=<?php echo $_REQUEST['p']; ?>&p_sub=list&opt_view=<?php echo $cmd; ?>&edit_id=<?php echo $_GET['edit_id']; ?>"> <table width='50%' class='tblList' cellpadding='0' cellspacing='0'> <tr class="tr_1"> <td style='padding-left:3px; width: 100px;'>Title </td> <td> <input type="text" required="1" id="title" title="Title" name=

Controller Part to list, grid, view, insert, update and delete in the MVC framework (Part 3 of 5)

include_once('components/product_category/model.php'); include_once('components/product_category/views/view.php'); class Controller {     function doAction()     {         switch ($_REQUEST['p_sub'])         {             case 'list':                 if($_REQUEST['opt_view'] =='insert')                 {                                         Model::insert();                 }                                 if($_REQUEST['opt_view'] =='delete')                 {                     Model::delete($_GET['del_id']);                 }                                 if($_REQUEST['opt_view'] =='update')                 {                     Model::update($_GET['edit_id']);                 }                                 $data=Model::getall(0);                 View::showGrid($data);                                 break;                             case 'form':                 if($_REQU

function to edit or update, delete, insert and select as per requirement in MVC framework (Part 4 of 5)

class Model {     function getall($id)     {                 $sql='select * from product_category where parent_id='.$id;         $rs=mysql_query($sql);         $list=array();         while($row=mysql_fetch_assoc($rs))         {             echo ' ';             echo $row['title'];             ?>                        Delete    Edit             echo ' ';             Model::getall($row['id']);             echo' ';             echo ' ';         }         return $list;     }     function getParentCategory()     {         $sql='select * from product_category where parent_id=0';         $rs=mysql_query($sql);         $list=array();         while($row=mysql_fetch_assoc($rs))         {             $list[]=$row;         }         return $list;     }         function update($id)     {         $sql = 'UPDATE product_category SET title = "'.$_POST['title'].'"'.' WHERE id = '.$id;          

Funny things about education

Image
Education is for those who can buy it. If you have no money then you don't have right to be educated Love at first sight is not love, its actually sexual attraction according to scientific research.. ha ha funny , specially when there is hell lots of love songs and movies and shits regarding this... "Love at first sight" is horny thing ..:D Specially in Math , teacher teach some lesson ,ask him what's its use in future his reply will in +2 or in Bachelor i.e in higher level education.. ask him what's its use in real life there will be no answer. Bill Gates left his study and made Microsoft , Mark Zuckerberg Left his study and made Facebook. Richard Branson left study and founded Richard Virigin Group and all of them are billionaires . Those who completed their study now works under them... kinda inspiration biographies.. , Why is Management teacher not manager ? why engineering teacher not engineer and account teacher C.A or accountant . Engineering or BBA or CA t

Image scrolling with div in marquee from left

Image
<marquee scrolldelay="2" behavior="left" onmouseover="this.stop();" onmouseout="this.start();" scrollamount="5" > <? foreach($winners as $winner) { ?> <div class="winner_row" style="float:left;"> <h1><?=$winner['auc_name']?></h1> <div class="img_left" ><img src="<?=UPLOAD_WINNER.$winner['feed_image'];?>" width="65" height="52" /></div> <div class="winner_text"> <?=$winner['sold_for']?><br /> <?=$winner['sold_on']?><br /> Saved <?=$winner['saving']?>% </div> <div class="clean"></div> </div> <? } ?> </marquee>

Dynamic Image rollover from the database

<SCRIPT LANGUAGE="JavaScript"> <!-- var dimages=new Array(); var dimages1=new Array();   <? $banners=$all->get_banner(); foreach($banners as $key => $banner) { ?> var numImages = <?php echo count($banners); ?> dimages[<?php echo $key; ?>]=new Image(); dimages[<?php echo $key; ?>].src="<?=UPLOAD_BANNER_DIR.$banner['image']?>"; <? }?>     var curImage=-1; function swapPicture() { if (document.images) { var nextImage=curImage+1; if (nextImage>=numImages) nextImage=0; if (dimages[nextImage] && dimages[nextImage].complete) { var target=0; if (document.images.myImage) target=document.images.myImage; if (document.all && document.getElementById("myImage")) target=document.getElementById("myImage"); // make sure target is valid. It might not be valid // if the page has not finished loading if (target) { target.sr

Elephant and Ant Jokes....very funny animal jokes from nepal

Why is the elephant scared of the computer? Because of the mouse. eakchoti 2ta kamila haru masta sanga raksi piyera road ma basira thye re...tyahi bela para bata hatti eaklai darai darai aaira dekhechan. ani eauta kamila le aarko lai tyo hatti lai gayera kutidiu bhanecha. aarko kamila chai pura jos ma aara chode eaklai cha bichara..eaklai cha bhanera tyasko faida uthauna hudaina bhanecha Eakchoti kamila le hatti sanga tyasko ganji magecha...ani hatti le kina bhanera sodhda kamila le mero ghar ma bholi bhoj cha tyasko lagi pal chaiyeko cha bhanecha.. Once an hunter was chasing an elephant, the elephant ran into a forest, on the way it met its Ant friend, Ant : Hey, why are you running? Elephant : Hunter is chasing me. Ant (Generously) : You come and hide behind me. Elephant : ??! ek din kamila le hatti lai khedaudai thiyo. daudida daudidai hatti mandir bhitra lukecha. kamila le hatti bhitra chireko na dekhe pani, bhitra gayera chyappa samatera, dyam ki dyam kutecha. kamila le hatti bhit

My new way to study.....

Image
  So why to study when it is mathematically proved if we study we fail My new way to study..... How to prepare for exam.....

Popular Updates in the facebook from my friends....the most commented and like

* If a boy calls you hot, he looks at your body. If he calls you pretty, he looks at your face. But if he calls you beautiful, he looks at your soul * IT WASN'T ME!!! oh.. THAT.. heh, yeah that was me. * Don't make any decisions when you're angry...And never make any promises when you're happy... * When you love, you get hurt. When you get hurt, you hate. When you hate, you try to forget, When you try to forget, you start missing. When you start missing, You fall in Love Again ? * When a song instantly reminds you of a person... a place... a memory... * I ? my own bed. But i'll be honest, id much rather be in yours ;) * I've learned that no matter how much I care, some people are just assholes. * Can somebody please tell this bitch nobody likes her. * I am in a relationship with studies and it's complicated * smiling randomly when you remember something that once made you so happy :) # Are you a parking ticket? (What?) You got fine written all over you. # If

Australian celebrity famous video

Amy Taylor Andrew Bogut Andrew Bogut An Australian big man who dominated while playing center for the Utah Utes in the NCAA, Andrew Bogut was one of the top prospects for the 2005 NBA Draft. He was drafted #1 overall by the Milwaukee Bucks. Anna Rawson Anna Rawson An Australian golfer and model, Anna Rawson has played on the Ladies European Tour and in the LPGA. She also played for the University of Southern California in college. Anna Torv Anna Torv An Australian actress, Anna Torv's TV credits include "Fringe", "Mistresses", "The Secret Life Of Us" and "Young Lions." Ashleigh Francis Ashleigh Francis A beauty queen, Ashleigh Francis represented Australia at the 2010 Miss World pageant.