click_pledge_connect-8.x-1.0/click_pledge_connect.install

click_pledge_connect.install
<?php
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * @file
 * Install, update and uninstall functions for the profilename install profile.
 */
 
/**
* Implements hook_install().
*
* Creates some default entries on this module custom table.
*
* @see hook_install()
*
* @ingroup lotus
*/
/*function commerce_cnp_install(){
  drupal_install_schema('commerce_cnp');// where module== name of your module
}*/


function my_goto($path) { 
  $response = new RedirectResponse($path, 302);
  $response->send();
  return;
}

function click_pledge_connect_install() {
   my_goto("cnp_formssettings");
}
// Remove tables. on uninstallation
function click_pledge_connect_uninstall() {
	
}

/**
* Implements hook_schema().
*
* Defines the database tables used by this module.
*
* @see hook_schema()
*
* 
*/

function click_pledge_connect_schema(){
  
	$schema= array();
	$schema["dp_cnpc_forminfo"] = array(
	'description' => 'Stores Form Informatiom',
	"fields"=>array(
		'cnpform_GID' => array(
			'type' => 'serial',
			'not null' => TRUE,
			'description' => 'CnP Form ID',
		),
		'cnpform_groupname' => array(
			'type' => 'varchar',
			'not null' => TRUE,
			'length' => 250,
			'description' => "CnP Form Group Name",
		),
		'cnpform_cnpstngs_ID' => array(
			'type' => 'int',
			'length' => 15,
			'not null' => TRUE,
			'description' => 'CnP Stngs',
		),
		 'cnpform_AccountNumber' => array(
			'type' => 'varchar',
			'length' => 250,
			'not null' => TRUE,
			'description' => 'Account Number',
		),
		'cnpform_guid' => array(
			'type' => 'text',
			'not null' => TRUE,
			'description' => 'GUID',
		),
		'cnpform_type' => array(
			'type' => 'text',
			'not null' => TRUE,
			'description' => 'Form Type',
		),
		'cnpform_ptype' => array(
			'type' => 'text',
			'not null' => TRUE,
			'description' => 'Form pType',
		),
                'cnpform_text' => array(
			'type' => 'varchar',
			'not null' => TRUE,
                        'length' => 250,
			'description' => 'Form pType',
		),
                'cnpform_img' => array(
			'type' => 'text',
			'description' => 'Form Image',
		),
                'cnpform_shortcode' => array(
			'type' => 'text',
			'description' => 'Form ShortCode',
		),
                'cnpform_custommsg' => array(
			'type' => 'varchar',
			'not null' => TRUE,
                        'length' => 250,
			'description' => 'Custom Message',
		),
                'cnpform_Form_StartDate' => array(
                        'type' => 'varchar',
			'not null' => TRUE,
			'length'=>80,
		),
                'cnpform_Form_EndDate' => array(
                        'type' => 'varchar',
			'not null' => TRUE,
			'length'=>80,
		),
                'cnpform_status' => array(
			'type' => 'varchar',
                        'length' => 18,
                       'not null' => TRUE,
			'description' => 'Form Status',
		),
		'cnpform_Date_Created' => array(
			'type' => 'varchar',
			'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP',
			'not null' => TRUE,
			'description' => 'Created Time',
		),
		'cnpform_Date_Modified' => array(
			'type' => 'varchar',
			'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
			'not null' => TRUE,
			'description' => 'Modified Time',
		),
		),
            'primary key' => array('cnpform_GID'),
	);
        //2nd Table creation
	$schema["dp_cnpc_formsdtl"] = array(
		'description' => 'Form Sdtl',
	"fields"=>array(
		'cnpform_id' => array(
			'type' => 'serial',
                        'not null' => TRUE,
                        'length' =>15,
		),
		'cnpform_cnpform_ID' => array(
			'type' => 'int',
			'not null' => TRUE,
			'length' => 15,
		),
		'cnpform_CampaignName' => array(
			'type' => 'varchar',
			'length' => 255,
			'not null' => TRUE,
		),
		 'cnpform_FormName' => array(
			'type' => 'varchar',
			'length' => 255,
			'not null' => TRUE,
		),
		'cnpform_GUID' => array(
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>255,
		),
                'cnpform_FormStartDate' => array(
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>80,
		),
                'cnpform_FormEndDate' => array(
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>80,
		),
                'cnpform_urlparameters' => array(
			'type' => 'text',
			'not null' => TRUE,
		),
                'cnpform_FormStatus' => array(
			'type' => 'varchar',
                        'length' => 18,
                        'not null' => TRUE,
		),
                'cnpform_DateCreated' => array(
			'type' => 'varchar',
			'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP',
			'not null' => TRUE,
			'description' => 'Created Time',
		),
                'cnpform_DateModified' => array(
			'type' => 'varchar',
			'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
			'not null' => TRUE,
			'description' => 'Modified Time',
		),
		),
            'primary key' => array('cnpform_id'),
	);
         //3rd table schema
	$schema["dp_cnpcsettingsdtl"] = array(
		'description' => 'Settings',
	"fields"=>array(
		'cnpstngs_ID' => array(
			'type' => 'serial',
			'not null' => TRUE,
			'length' =>9,
		),
		'cnpstngs_frndlyname' => array(
			'type' => 'varchar',
			'not null' => TRUE,
			'length' => 255,
		),
		'cnpstngs_AccountNumber' => array(
			'type' => 'varchar',
			'length' => 250,
			'not null' => TRUE,
		),
		 'cnpstngs_guid' => array(
			'type' => 'text',
			'not null' => TRUE,
		),
		'cnpstngs_status' => array(
			'type' => 'char',
                        'length' => 1,
                        'default'=>'a',
		),
                'cnpstngs_Date_Created' => array(
			'type' => 'varchar',
			'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP',
			'not null' => TRUE,
			'description' => 'Created Time',
		),
                'cnpstngs_Date_Modified' => array(
			'type' => 'varchar',
			'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
			'not null' => TRUE,
			'description' => 'Modified Time',
		),
		),
		'primary key' => array('cnpstngs_ID'),
	);
        $schema["dp_cnpc_channelgrp"] = array(
    'description' => 'Stores pledgeTV Groups Informatiom',
    "fields"=>array(
        'cnpchannelgrp_ID' => array(
            'type' => 'serial',
            'not null' => TRUE,
            'description' => 'CnP pledgetv ID',
        ),
        'cnpchannelgrp_groupname' => array(
            'type' => 'varchar',
            'not null' => TRUE,
            'length' => 250,
            'description' => "CnP pledgeTV Group Name",
        ),
        'cnpchannelgrp_cnpstngs_ID' => array(
            'type' => 'int',
            'length' => 15,
            'not null' => TRUE,
            'description' => 'CnP Stngs',
        ),
        'cnpchannelgrp_shortcode' => array(
            'type' => 'text',
            'description' => 'pledgeTV ShortCode',
        ),
        'cnpchannelgrp_custommsg' => array(
            'type' => 'varchar',
            'not null' => TRUE,
            'length' => 250,
            'description' => 'Custom Message',
        ),
        'cnpchannelgrp_channel_StartDate' => array(
            'type' => 'varchar',
            'not null' => TRUE,
            'length'=>80,
        ),
        'cnpchannelgrp_channel_EndDate' => array(
            'type' => 'varchar',
            'not null' => TRUE,
            'length'=>80,
        ),
        'cnpchannelgrp_status' => array(
            'type' => 'varchar',
            'length' => 18,
            'not null' => TRUE,
            'description' => 'pledgeTV group Status',
        ),
        'cnpchannelgrp_Date_Created' => array(
            'type' => 'varchar',
            'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP',
            'not null' => TRUE,
            'description' => 'Created Time',
        ),
        'cnpchannelgrp_Date_Modified' => array(
            'type' => 'varchar',
            'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
            'not null' => TRUE,
            'description' => 'Modified Time',
        ),
        ),
            'primary key' => array('cnpchannelgrp_ID'),
    );
    // pledgeTV group info table
    $schema["dp_cnpc_channeldtl"] = array(
        'description' => 'Channels dtl',
    "fields"=>array(
        'cnpchannel_id' => array(
            'type' => 'serial',
                        'not null' => TRUE,
                        'length' =>15,
        ),
        'cnpchannel_cnpchannelgrp_ID' => array(
            'type' => 'int',
            'not null' => TRUE,
            'length' => 15,
        ),
        'cnpchannel_channelName' => array(
            'type' => 'varchar',
            'length' => 255,
            'not null' => TRUE,
        ),
        'cnpchannel_channelStartDate' => array(
            'type' => 'varchar',
            'not null' => TRUE,
            'length'=>80,
        ),
        'cnpchannel_channelEndDate' => array(
            'type' => 'varchar',
            'not null' => TRUE,
            'length'=>80,
        ),
        'cnpchannel_channelStatus' => array(
            'type' => 'varchar',
                        'length' => 18,
                        'not null' => TRUE,
        ),
        'cnpchannel_DateCreated' => array(
            'type' => 'varchar',
            'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP',
            'not null' => TRUE,
            'description' => 'Created Time',
        ),
                'cnpchannel_DateModified' => array(
            'type' => 'varchar',
            'mysql_type' => 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
            'not null' => TRUE,
            'description' => 'Modified Time',
        ),
        ),
            'primary key' => array('cnpchannel_id'),
    );
	return $schema;
}


Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc