Advertisement
Guest User

ractest

a guest
Jul 13th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.47 KB | None | 0 0
  1.  
  2. <?php
  3.         $this->load->model('racallot_model');
  4.         $r =  $this->db->count_all_results('rac_status')-1;
  5.         $v =  $this->db->count_all_results('vac_status')-1;
  6.        
  7.                       for ($i=0; $i<=$r; $i++)
  8.                                   {
  9.                                  
  10.                                   for ($j=0; $j<=$v; $j++)
  11.                                   {
  12.                                   $asnmt =  $this->racallot_model->match_cat($i, 1, $j, 1);
  13.                                  
  14.                                               if($asnmt == "SA")
  15.                                             {
  16.                                             echo $asnmt."---";
  17.                                         echo "i=".$i."j=".$j."<br>";
  18.                                         $readdb = $this->racallot_model->getDb('rac_status', $j-1);
  19.                                                 //echo element('berth_no', $readdb);
  20.                                                 //echo $v;
  21.                                                 $readdbv = $this->racallot_model->getDb('vac_status', $j);
  22.                                                
  23.                                                 $rseat = element('berth_no', $readdb);
  24.                                                 $vseat = element('berth_no', $readdbv);
  25.                                                
  26.                                                
  27.                                                 echo $rseat."-to-".$vseat;
  28.                                  /* if ($i == 1)
  29.                                                 {
  30.                                                 $readdb = $this->racallot_model->getDb('rac_status', $j-1);
  31.                                                 //echo element('berth_no', $readdb);
  32.                                                 //echo $v;
  33.                                                 $readdbv = $this->racallot_model->getDb('vac_status', $j);
  34.                                                
  35.                                                 $rseat = element('berth_no', $readdb);
  36.                                                 $vseat = element('berth_no', $readdbv);
  37.                                                
  38.                                                
  39.                                                 //echo $rseat."-to-".$vseat;
  40.                         //seat alloted to the passanger------------------------------.
  41.                                                         $this->db->insert('reserv_status', $readdb);
  42.                                                         $this->db->insert('reserv_status', $readdbv);
  43.                       //removing naam 'o' nishan of the rac passanger from rac chart ;)
  44.                                                
  45.                                                     $this->db->where('berth_no', 63);
  46.                                                     $this->db->delete('rac_status');
  47.                         //the rac passanger goes and sits in the vaccant seat hence there will be no vac seat left, so deleate the seat.
  48.                                                     if (!empty($vseat))
  49.                                                         {
  50.                                                         $this->db->where('berth_no', 68);
  51.                                                         $this->db->delete('vac_status');
  52.                        
  53.                                                         }
  54.                                                 }*/
  55.                                                
  56.                        
  57.                                                
  58.                                                
  59.                                             }
  60.                                             if($asnmt == "SNA")
  61.                                             {
  62.                                             // Do Nothing.
  63.                                             //...
  64.                                             }
  65.                                             if($asnmt == "CD")
  66.                                             {
  67.                                             /*echo $asnmt['1']."---";
  68.                                             echo "i=".$i."j=".$j."<br>";*/
  69.                                              
  70.                                             }
  71.                                             if($asnmt == "CSD")
  72.                                             {
  73.                                            
  74.                                             }
  75.                                             if($asnmt == "CS")
  76.                                             {
  77.                                            
  78.                                             }
  79.                                   }
  80.                                   }
  81.                            
  82.                                 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement