Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $this->load->model('racallot_model');
- $r = $this->db->count_all_results('rac_status')-1;
- $v = $this->db->count_all_results('vac_status')-1;
- for ($i=0; $i<=$r; $i++)
- {
- for ($j=0; $j<=$v; $j++)
- {
- $asnmt = $this->racallot_model->match_cat($i, 1, $j, 1);
- if($asnmt == "SA")
- {
- echo $asnmt."---";
- echo "i=".$i."j=".$j."<br>";
- $readdb = $this->racallot_model->getDb('rac_status', $j-1);
- //echo element('berth_no', $readdb);
- //echo $v;
- $readdbv = $this->racallot_model->getDb('vac_status', $j);
- $rseat = element('berth_no', $readdb);
- $vseat = element('berth_no', $readdbv);
- echo $rseat."-to-".$vseat;
- /* if ($i == 1)
- {
- $readdb = $this->racallot_model->getDb('rac_status', $j-1);
- //echo element('berth_no', $readdb);
- //echo $v;
- $readdbv = $this->racallot_model->getDb('vac_status', $j);
- $rseat = element('berth_no', $readdb);
- $vseat = element('berth_no', $readdbv);
- //echo $rseat."-to-".$vseat;
- //seat alloted to the passanger------------------------------.
- $this->db->insert('reserv_status', $readdb);
- $this->db->insert('reserv_status', $readdbv);
- //removing naam 'o' nishan of the rac passanger from rac chart ;)
- $this->db->where('berth_no', 63);
- $this->db->delete('rac_status');
- //the rac passanger goes and sits in the vaccant seat hence there will be no vac seat left, so deleate the seat.
- if (!empty($vseat))
- {
- $this->db->where('berth_no', 68);
- $this->db->delete('vac_status');
- }
- }*/
- }
- if($asnmt == "SNA")
- {
- // Do Nothing.
- //...
- }
- if($asnmt == "CD")
- {
- /*echo $asnmt['1']."---";
- echo "i=".$i."j=".$j."<br>";*/
- }
- if($asnmt == "CSD")
- {
- }
- if($asnmt == "CS")
- {
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement