Posts

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.....