function use_buycodes()
 {
     Load::model('codes');
     Load::model('transaction');
     $Codes = new Codes();
     $Transaction = new Transaction();
     if ($_POST['source'] == "Commission Deduction") {
         $Transaction->add_buycodes($_POST['amount']);
         $Codes->add($_POST['howmany'], $_POST['acc_type']);
     } else {
         $Transaction->add_buycodes_request($_POST['howmany'], $_POST['acc_type'], $_POST['amount']);
     }
     echo 1;
     exit;
 }