Page 1 of 1
printing loan cards
Posted:
Wed Feb 29, 2012 6:18 am
by samhans
hai steve and all,
i have made a loan management system, where department head are issued with computer/peripherals in loan.
i have made the entire system using xataface. i am now stuck in a point that how could i make a loan card print out.
exactly in the loan card the name, department of the user and a list of computers or peripherals the user had held should be there. same what happens while booking tickets, a pre formatted page displays which a individual can take print out.
i am looking to the printable reports section but it is not making my conditions fullfilled.
can anyone suggest me something?
Re: printing loan cards
Posted:
Wed Feb 29, 2012 10:52 am
by shannah
The html reports module might be helpful here... but it requires Xataface 1.5 or higher (which isn't an official release.... it's just a tie down half way between 1.3.x and 2.0)
http://xataface.com/dox/modules/htmlreports/latestOther than that you will likely need to create a custom function.
If you can create a static version of what you need, you can probably just put in some placeholders and do a find-replace on them to produce your output.
-Steve
Re: printing loan cards
Posted:
Wed Feb 29, 2012 11:06 am
by samhans
steve thanks for reply. the html reports functionality is good for.me but bad to know that it requires 1.5.
next you have told about custom function. can you elaborate it. onething is that i have made the template of loan card in html.what i need i the values got filed when some one gets printout. is it possible.through xataface
Re: printing loan cards
Posted:
Wed Feb 29, 2012 11:12 am
by shannah
Yes. Definitely possible in Xataface. You need to create a custom action:
http://xataface.com/documentation/tutor ... ce_actions
Re: printing loan cards
Posted:
Wed Feb 29, 2012 11:43 am
by samhans
Steve, i have used actions before. but i am thinking the other way. like can i make a form were one can select his employ id and click on submit. the moment he clicks on submit , a page opens that's my template with all values in it. now the question is can i define custom submit actions in xataface and also can i make.a.form in xataface manually .
Re: printing loan cards
Posted:
Wed Feb 29, 2012 11:49 am
by shannah
This is what custom actions are for.
Your action would probably be something like:
- Code: Select all
<?php
class actions_loancard {
function handle($params){
$app = Datataface_Application::getInstance();
$query = $app->getQuery();
if ( $_POST ){
// Output your loan card.
} else {
// Print the form.
// Form just needs to be method "post" and should include a hidden field "-action" with value "loancard" so that it
// Will submit back to your action.
}
}
}
Re: printing loan cards
Posted:
Wed Feb 29, 2012 12:05 pm
by samhans
implementing your way. i will come back in some time