[eluser]resolv_25[/eluser]
Thanks for your reply.
anchor_popup() is another useful function.
Still, it doesn't fit to my needs because I need to pass data from the controller to the view,
actually, almost the same as in the first option
($print==0)
If possible, I don't like to write almost the same method again, or break it on the pieces because of this.
Controller is something like this (shortly):
Code:
function priprema($print1=0) {
if($print1 ==1){
$datum1 = $this->input->post('datum1');
}
$this->load->model('maticni/skolamodel','',TRUE);
$skola = $this->skolamodel->list_all()->row();
$data['skolanaziv'] = $skola->naziv;
$data['skolaziro'] = $skola->ziro;
// etc. - loading more data....
if($print1 == 0) {
$data['print1'] = 0;
$this->load->view('zbrojnalog/zbrojnalog1_view', $data);
}
else {
$data['print1'] = 1;
$data['datum1'] = $datum1;
// ???? load view on blank page
$this->load->view('zbrojnalog/zbrojnalog1_view', $data);
}
}
View is something like this:
Code:
<html>
<body>
<?php
if($print1 == 0) {
echo form_open('zbrojnalog/zbrojnalog/priprema/1');
$datum1 = date("d.m.Y");
echo "<input type='text' name ='datumpredaje' value='$datum1' >";
}
else {
echo $datum1;
}
?>
some html - filling the data from controller
<?php
if($print1 == 0) {
echo "<br><input class='button' id='Unos' name='print' type='submit' value='Print' />
</form>";
}
?>
</body>
</html>
So, after getting the
post value of datum1 I want to return it to the view and print it out.
Not sure that I'm on the right path.