<?php
/**
 * @file
 * An example module for how to create a module tutorial.
 */
 
 function exchange_thaihappy_block_info() {
  $blocks['exchange_thaihappy'] = array('info' => t('Thai Happy Tour & Travel - Exchange System'));
  return $blocks;
}


/**
 * Implements hook_permission().
 */
function exchange_thaihappy_permission() {
  return array(
    'exchange_thaihappy' => array(
      'title' => t('Access content for the Exchange module'),
    ),
    'exchange_administer' => array(
      'title' => t('Access content for the Exchange module - admin'),
    ),
    'exchange_accounting' => array(
      'title' => t('Access content for the Exchange module - account'),
    ),
    'exchange_getmoney' => array(
      'title' => t('Access content for the Exchange module - Get money user'),
    ),
    'exchange_sellmoney' => array(
      'title' => t('Access content for the Exchange module - Sell money'),
    ),
    'exchange_superadmin' => array(
      'title' => t('Access content for setting tenant and permission - Super Admin'),
    )
  );
}

/**
 * Implements hook_menu().
 */
function exchange_thaihappy_menu() {
  $items = array();

  //****************** System *****************
  $items['exchange_thaihappy/auth'] = array(
    'title'             => 'Check Auth to redirect page',
    'description'       => 'Exchange - Check Auth to redirect page',
    'page callback'     => '_exchange_thaihappy_check_auth',
    'access callback' => TRUE,
    'file'              => 'exchange_thaihappy.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/rate_list'] = array(
    'title'             => 'Rate list today',
    'description'       => 'Rate list today',
    'page callback'     => '_exchange_thaihappy_rate_list',
    'access callback' => TRUE,
    'file'              => 'exchange_thaihappy.report.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/rate_list/%'] = array(
    'title'             => 'Rate list today',
    'description'       => 'Rate list today',
    'page callback'     => '_exchange_thaihappy_rate_list_booth',
    'access callback' => TRUE,
    'page arguments' => array(2),
    'file' => 'exchange_thaihappy.report.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  
  //****************** Super Admin *****************
  $items['admin/config/content/exchange_thaihappy/superadmin'] = array(
    'title'             => 'Exchange System Management',
    'description'       => 'Thai Happy Tour and Travel : Exchange management',
    'page callback'     => '_exchange_thaihappy_superadmin_menu',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/super/booth_management'] = array(
    'title'             => 'Setting booth',
    'description'       => 'Setting booth',
    'page callback'     => 'exchange_setting_booth',
    'page arguments'    => '',
    'access arguments'  => array('exchange_superadmin'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/super/booth_add/submit'] = array(
    'title'             => 'Setting tenant',
    'description'       => 'Setting tenant',
    'page callback'     => 'exchange_booth_add_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_superadmin'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/super/setting_tenant'] = array(
    'title'             => 'Setting tenant',
    'description'       => 'Setting tenant',
    'page callback'     => 'exchange_setting_tenant',
    'page arguments'    => '',
    'access arguments'  => array('exchange_superadmin'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/super/setting_tenant/submit'] = array(
    'title'             => 'Setting tenant',
    'description'       => 'Setting tenant',
    'page callback'     => 'exchange_setting_tenant_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_superadmin'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  
  $items['admin/config/content/exchange_thaihappy/super/setting_permissions'] = array(
    'title'             => 'Setting tenant',
    'description'       => 'Setting tenant',
    'page callback'     => 'exchange_setting_permissions',
    'page arguments'    => '',
    'access arguments'  => array('exchange_superadmin'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/super/setting_permissions/submit'] = array(
    'title'             => 'Setting tenant',
    'description'       => 'Setting tenant',
    'page callback'     => 'exchange_setting_permissions_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_superadmin'),
    'file'              => 'exchange_thaihappy.super.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
    
  //****************** Admin *****************
  $items['admin/config/content/exchange_thaihappy'] = array(
    'title'             => 'Exchange System Management',
    'description'       => 'Thai Happy Tour and Travel : Exchange management',
    'page callback'     => 'exchange_thaihappy_admin_view',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin'] = array(
    'title'             => 'Exchange System Management',
    'description'       => 'Thai Happy Tour and Travel : Exchange management',
    'page callback'     => '_exchange_thaihappy_admin_menu',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/list'] = array(
    'title' => 'Exchange rate list',
    'description' => 'Exchange rate list',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('_exchange_thaihappy_admin_rate_list'),
    'file' => 'exchange_thaihappy.admin.inc',
    'access arguments' => array('exchange_administer'),
    'type' => MENU_CALLBACK,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/add_booth/%'] = array(
    'title' => 'Add a new rate exchange',
    'description' => 'Add a new rate exchange',
    'page callback'     => '_exchange_thaihappy_admin_rate_add_booth',
    'page arguments' => array(7),
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/rate_copy/%/%'] = array(
    'title' => 'Copy rate',
    'description' => 'Copy rate',
    'page callback'     => '_exchange_thaihappy_admin_rate_copy',
    'page arguments' => array(5,6),
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/add_booth_submit'] = array(
    'title' => 'Booth Configuration',
    'description' => 'Booth Configuration',
    'page callback'     => '_exchange_thaihappy_admin_rate_add_booth_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/add'] = array(
    'title' => 'Add a new rate exchange',
    'description' => 'Add a new rate exchange',
    'page callback'     => '_exchange_thaihappy_admin_rate_add',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/booth/config'] = array(
    'title' => 'Booth Configuration',
    'description' => 'Booth Configuration',
    'page callback'     => '_exchange_thaihappy_admin_booth_config',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/booth/config/submit'] = array(
    'title' => 'Booth Configuration',
    'description' => 'Booth Configuration',
    'page callback'     => '_exchange_thaihappy_admin_booth_config_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/add_auto'] = array(
    'title' => 'Auto add rate',
    'description' => 'Auto add rate',
    'page callback'     => '_exchange_thaihappy_admin_rate_add_auto',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/add/submit'] = array(
    'title' => 'Add a new rate exchange',
    'description' => 'Add a new rate exchange',
    'page callback'     => '_exchange_thaihappy_admin_rate_add_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/rate/edit/%'] = array(
    'title' => 'Edit exchange rate',
    'description' => 'Edit exchange rate',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('_exchange_thaihappy_admin_rate_edit_form', 6),
    'file' => 'exchange_thaihappy.admin.inc',
    'access arguments' => array('exchange_administer'),
    'type' => MENU_CALLBACK,
  );
  
  $items['admin/config/content/exchange_thaihappy/rate/delete/%/%'] = array(
    'title' => 'Delete exchange rate',
    'description' => 'Delete a exchange rate',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('_exchange_thaihappy_admin_rate_delete_form', 6, 7),
    'file' => 'exchange_thaihappy.admin.inc',
    'access arguments' => array('exchange_administer'),
    'type' => MENU_CALLBACK,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/setting_discount'] = array(
    'title' => 'Setting discount rate',
    'description' => 'Setting discount  rate',
    'page callback'     => '_exchange_thaihappy_admin_setting_discount',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/admin/setting_discount/submit'] = array(
    'title' => 'Setting discount rate submit',
    'description' => 'Setting discount rate submit',
    'page callback'     => '_exchange_thaihappy_admin_setting_discount_submit',
    'page arguments'    => '',
    'access arguments'  => array('exchange_administer'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  
  
  
  
  
  //****************** Acounting *****************
  $items['admin/config/content/exchange_thaihappy/acc'] = array(
    'title'             => 'Exchange Accounting',
    'description'       => 'Exchange Accounting',
    'page callback'     => '_exchange_thaihappy_acc',
    'page arguments'    => '',
    'access arguments'  => array('exchange_accounting'),
    'file'              => 'exchange_thaihappy.acc.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/acc/transactions'] = array(
    'title' => 'Exchange Transactions',
    'description' => 'Exchange Transactions',
    'page callback'     => '_exchange_thaihappy_acc_transactions',
    'page arguments'    => '',
    'access arguments'  => array('exchange_accounting'),
    'file'              => 'exchange_thaihappy.acc.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_cancel_trns_approve'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_cancel_trns_approve',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_accounting'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_mytrns_detail'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_mytrns_detail',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_trns_detail'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_trns_detail',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_accounting'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_view_myreason'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_view_myreason',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_view_reason'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_view_reason',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_accounting'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/acc/report_today'] = array(
    'title' => 'Exchange Report Today',
    'description' => 'Exchange Report Today',
    'page callback'     => '_exchange_thaihappy_acc_report_today',
    'page arguments'    => '',
    'access arguments'  => array('exchange_accounting'),
    'file'              => 'exchange_thaihappy.acc.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/acc/report_today_excel'] = array(
    'title' => 'Exchange Report Today',
    'description' => 'Exchange Report Today',
    'page callback'     => '_exchange_thaihappy_acc_report_today_excel_result',
    'page arguments'    => '',
    'access arguments'  => array('exchange_accounting'),
    'file'              => 'exchange_thaihappy.acc.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
 
  $items['admin/config/content/exchange_thaihappy/acc/report_today_excel_all'] = array(
    'title' => 'Exchange Report Today All Branch',
    'description' => 'Exchange Report Today All Branch',
    'page callback'     => '_exchange_thaihappy_acc_report_today_excel_result_all',
    'page arguments'    => '',
    'access arguments'  => array('exchange_accounting'),
    'file'              => 'exchange_thaihappy.acc.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/acc/chart_today'] = array(
    'title' => 'Exchange Report Today',
    'description' => 'Exchange Report Today',
    'page callback'     => '_exchange_thaihappy_acc_chart_today',
    'page arguments'    => '',
    'access arguments'  => array('exchange_accounting'),
    'file'              => 'exchange_thaihappy.acc_chart.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  
  
  
  
  
  //****************** Shop *****************
  $items['admin/config/content/exchange_thaihappy/setting_default'] = array(
    'title'             => 'Exchange Shop - Setting default',
    'description'       => 'Exchange shop - Setting default',
    'page callback' => 'exchange_thaihappy_shop_setting_default',
    'file' => 'exchange_thaihappy.inc',
    'access arguments' => array('exchange_thaihappy'),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/shop'] = array(
    'title'             => 'Exchange Shop',
    'description'       => 'Exchange shop',
    'page callback'     => '_exchange_thaihappy_shop',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_cal_row_total/%/%/%/%/%'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_cal_row',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(2,3,4,5,6),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_mytrns_search'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => 'exchange_thaihappy_ajax_mytrns_search',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_trns_search'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => '_exchange_thaihappy_ajax_trns_search',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_accounting'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/ajax_cancel_trns'] = array(
    'title'             => 'Ajax call',
    'description'       => 'Ajax call',
    'page callback' => 'exchange_thaihappy_ajax_cancel_trns',
    'file' => 'exchange_thaihappy.ajax.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/save_print'] = array(
    'title'             => 'Save & Print',
    'description'       => 'Save & Print',
    'page callback' => '_exchange_thaihappy_save_print',
    'file' => 'exchange_thaihappy.post.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['exchange_thaihappy/printslip/%/%'] = array(
    'title'             => 'Print Slip',
    'description'       => 'Print Slip',
    'page callback' => '_exchange_thaihappy_print_slip',
    'file' => 'exchange_thaihappy.post.inc',
    'access arguments' => array('exchange_thaihappy'),
    'page arguments' => array(2,3),
    'type' => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/shop/buyadd'] = array(
    'title' => 'New Exchange Transaction',
    'description' => 'New Exchange Transaction',
    'page callback'     => '_exchange_thaihappy_shop_buyadd',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.post.inc',
    'type'              => MENU_NORMAL_ITEM,
  );

  $items['admin/config/content/exchange_thaihappy/shop/transactions'] = array(
    'title' => 'Exchange Transactions',
    'description' => 'Exchange Transactions',
    'page callback'     => '_exchange_thaihappy_shop_transactions',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.report.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/shop/selladd'] = array(
    'title' => 'New Exchange Transaction',
    'description' => 'New Exchange Transaction',
    'page callback'     => '_exchange_thaihappy_shop_selladd',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.post.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/shop/report_today_excel'] = array(
    'title' => 'Exchange Report Today',
    'description' => 'Exchange Report Today',
    'page callback'     => '_exchange_thaihappy_shop_report_today_excel_result',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/shop/report_today_excel_all'] = array(
    'title' => 'Exchange Report Today',
    'description' => 'Exchange Report Today',
    'page callback'     => '_exchange_thaihappy_shop_report_today_excel_result_all',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
   
  $items['admin/config/content/exchange_thaihappy/shop/report_today'] = array(
    'title' => 'Summary Exchange Report (today)',
    'description' => 'Summary Exchange Report (today)',
    'page callback'     => '_exchange_thaihappy_shop_report_today',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.inc',
    'type'              => MENU_NORMAL_ITEM,
  );
  
  $items['admin/config/content/exchange_thaihappy/shop/report_all'] = array(
    'title'             => 'Exchange System Report',
    'description'       => 'Exchange System Report',
    'page callback'     => '_exchange_thaihappy_shop_report',
    'page arguments'    => '',
    'access arguments'  => array('exchange_thaihappy'),
    'file'              => 'exchange_thaihappy.admin.inc',
    'type'              => MENU_NORMAL_ITEM,
  );


  return $items;
}


  