ACTION FOR CHECK LIST OPERATION FAILED

A place for users and developers of the Xataface to discuss and receive support.

ACTION FOR CHECK LIST OPERATION FAILED

Postby samhans » Mon Jul 30, 2012 10:12 pm

HAI STEVE AND ALL,

This action is to get the service number from the user and then change SELECTED CHECKBOX loan holder to the loan holder entered in the form.
I have tried to do this by the following action but failed.
My code:

<?php
class actions_loan{
function handle(&$params){

if(isset($_POST['submit'])){

$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
$table = &Dataface_Table::loadTable($query['-table']);
$records =& df_get_selected_records($query);
$auth =&Dataface_AuthenticationTool::getInstance();
$user =& $auth ->getLoggedInUser();
$updated = 0; // Count the number of records we update
$errs = array(); // Log the errors we encounter
$service_no = $_POST['serno'];

foreach ($records as $rec){
$role = $user->val('Role');
if ( $role != 'ADMIN') {
$errs[] = Dataface_Error::permissionDenied(
"This type of approval is only for ADMIN'".
$rec->getTitle().
"' cannot be update. Action Denied by web master");
continue;
}
$rec->setValue('loan_holder',$service_no );

$res = $rec->save(true /*secure*/);
if ( PEAR::isError($res) ) $errs[] = $res->getMessage();
else $updated++;

}

}


echo '
<form action="http://111.11.11.11/www/index.php?-action=loan" enctype="application/x-www-form-urlencoded" method="post" >
<b>Enter Service no:</b><input name="serno" type = "number"/>
<input type="reset" name="Reset"/><input type="submit" value="submit" />
</form>';

}
}

THANKS FOR THE HELP
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am

Re: ACTION FOR CHECK LIST OPERATION FAILED

Postby shannah » Tue Jul 31, 2012 10:24 am

Need more info. What do you mean by failed?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: ACTION FOR CHECK LIST OPERATION FAILED

Postby samhans » Tue Jul 31, 2012 10:35 am

steve failed means after entering the service no when i click on submit , the action must execute and change the loan holder column to the value i entered but nothing seems to be working.

i have echoed the $post value. it showing the entered no. but the action is not changing the loan holder field.
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 16 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved