Inserting Data Using Cgridview

I followed this tutorial which explains the technique of updating a certain record using CGridView. I did a few modifications to the system in order to insert records to my database using this CGridView. However it doesn’t seem to function at the moment although I have verified that every variable is set and not null or anything

My modified actionUserInputSave method

    $orderId =$_POST['ordId'];

$b =HospOrderPkgDetails::model()->findByPk($orderId);	

$b->item =$_POST['item'];			

$b->currentQty =$_POST['currentQty'];





    $orderId =$_GET['ordId'];	

$b =HospOrderPkgDetails::model()->findByPk($orderId);

$res =array(






echo CJSON::encode($res);

In the form I created the hidden field by getting the value from another textbox


echo $form->hiddenField($a,‘orderId’);

echo CHtml::hiddenField(‘ordId’, ‘orderId’);

There are 4 textboxes in my system, item, currentQty, requiredQty and notes. None of them are datetimepicker

Any ideas on how this could be accomplished