/* FILE tClient source code of mysqlSendmail.cgi (built by mysqlRAD2.cgi (c) Gary Wallis 2001,2002 GPL Licensed) $Id: tclient.c 6 2005-11-24 00:02:59Z ggw $ (tAuthorize.cPasswd template set member) PURPOSE */ #include "mysqlrad.h" //Table Variables //uClient: Primary Key static unsigned uClient=0; //cLabel: Short label static char cLabel[33]={""}; //uMaxUsers: Max number of mail users allowed static unsigned uMaxUsers=10; //cFirstName: First Name static char cFirstName[33]={""}; //cLastName: Last Name static char cLastName[33]={""}; //cCompanyName: Company name or extra search field static char cCompanyName[33]={""}; //cEmail: eMail static char cEmail[101]={""}; //cAddr1: Street mailing address static char cAddr1[101]={""}; //cAddr2: Street mailing address line 2 static char cAddr2[101]={""}; //cCity: City static char cCity[101]={""}; //cState: State, Province or Locality static char cState[101]={""}; //cZip: Postal or Zip code static char cZip[33]={""}; //cCountry: Country static char cCountry[65]={""}; //cCardType: Credit Card Type static char cCardType[33]={""}; //cCardNumber: Credit Card Number static char cCardNumber[33]={""}; //uExpMonth: Credit card expiration month static unsigned uExpMonth=0; //uExpYear: Credit card expiration year static unsigned uExpYear=0; //cCardName: Name as appears on credit card static char cCardName[65]={""}; //cShipName: Shipping address name static char cShipName[101]={""}; //cShipAddr1: Shipping street address static char cShipAddr1[101]={""}; //cShipAddr2: Shipping street address line 2 static char cShipAddr2[101]={""}; //cShipCity: Shipping city static char cShipCity[101]={""}; //cShipState: Shipping state or province static char cShipState[101]={""}; //cShipZip: Shipping zip or postal code static char cShipZip[33]={""}; //cShipCountry: Shipping country static char cShipCountry[65]={""}; //cTelephone: Customer Telephone static char cTelephone[33]={""}; //cFax: Customer Fax static char cFax[33]={""}; //uOwner: Record owner static unsigned uOwner=0; //uCreatedBy: uClient for last insert static unsigned uCreatedBy=0; #define ISM3FIELDS //uCreatedDate: Unix seconds date last insert static long unsigned uCreatedDate=0; //uModBy: uClient for last update static unsigned uModBy=0; //uModDate: Unix seconds date last update static long unsigned uModDate=0; #define VAR_LIST_tClient "tClient.uClient,tClient.cLabel,tClient.uMaxUsers,tClient.cFirstName,tClient.cLastName,tClient.cCompanyName,tClient.cEmail,tClient.cAddr1,tClient.cAddr2,tClient.cCity,tClient.cState,tClient.cZip,tClient.cCountry,tClient.cCardType,tClient.cCardNumber,tClient.uExpMonth,tClient.uExpYear,tClient.cCardName,tClient.cShipName,tClient.cShipAddr1,tClient.cShipAddr2,tClient.cShipCity,tClient.cShipState,tClient.cShipZip,tClient.cShipCountry,tClient.cTelephone,tClient.cFax,tClient.uOwner,tClient.uCreatedBy,tClient.uCreatedDate,tClient.uModBy,tClient.uModDate" //Local only void Insert_tClient(void); void Update_tClient(char *rowid); int InsertUpdate_tClient(char *cKey); void ProcesstClientListVars(pentry entries[], int x); //In tClientfunc.h file included below void ExtProcesstClientVars(pentry entries[], int x); void ExttClientCommands(pentry entries[], int x); void ExttClientButtons(void); void ExttClientNavBar(void); void ExttClientGetHook(entry gentries[], int x); void ExttClientSelect(void); void ExttClientSelectRow(void); void ExttClientListSelect(void); void ExttClientListFilter(void); void ExttClientAuxTable(void); #include "tclientfunc.h" //Table Variables Assignment Function void ProcesstClientVars(pentry entries[], int x) { register int i; for(i=0;i\n"); printf("\n"); printf(""); printf("
"); ExttClientNavBar(); printf(""); printf("",rowid); if(i) { printf(" "); if(mode==6) //printf(" Found"); printf(LANG_NBR_FOUND); else if(mode==5) //printf(" Modified"); printf(LANG_NBR_MODIFIED); else if(mode==4) //printf(" New"); printf(LANG_NBR_NEW); printf(LANG_NBRF_SHOWING,rowid,i); } else { if(!result[0]) //printf(" No records found"); printf(LANG_NBR_NORECS); } if(result[0]) printf(" %s",result); printf("
"); ExttClientButtons(); printf(""); printf("\n"); if(mode==2000 || mode==2002) tClientInputContent(); else tClientContent(); printf("
\n"); printf("
\n"); //Bottom table ExttClientAuxTable(); printf("\n"); Footer_ism3(); }//end of tClient(); void tClientContent(void) { OpenRow(LANG_FL_tClient_uClient,"white"); printf("%u\n",uClient,uClient); printf("  "); OpenRow(LANG_FL_tClient_cLabel,"white"); printf("%s",cLabel,EncodeDoubleQuotes(cLabel)); printf("  "); OpenRow(LANG_FL_tClient_uMaxUsers,"white"); printf("%u\n",uMaxUsers,uMaxUsers); printf("  "); OpenRow(LANG_FL_tClient_cFirstName,"white"); printf("%s",cFirstName,EncodeDoubleQuotes(cFirstName)); printf("  "); OpenRow(LANG_FL_tClient_cLastName,"white"); printf("%s",cLastName,EncodeDoubleQuotes(cLastName)); printf("  "); OpenRow(LANG_FL_tClient_cCompanyName,"white"); printf("%s",cCompanyName,EncodeDoubleQuotes(cCompanyName)); printf("  "); OpenRow(LANG_FL_tClient_cEmail,"white"); printf("%s",cEmail,EncodeDoubleQuotes(cEmail)); printf("  "); OpenRow(LANG_FL_tClient_cAddr1,"white"); printf("%s",cAddr1,EncodeDoubleQuotes(cAddr1)); printf("  "); OpenRow(LANG_FL_tClient_cAddr2,"white"); printf("%s",cAddr2,EncodeDoubleQuotes(cAddr2)); printf("  "); OpenRow(LANG_FL_tClient_cCity,"white"); printf("%s",cCity,EncodeDoubleQuotes(cCity)); printf("  "); OpenRow(LANG_FL_tClient_cState,"white"); printf("%s",cState,EncodeDoubleQuotes(cState)); printf("  "); OpenRow(LANG_FL_tClient_cZip,"white"); printf("%s",cZip,EncodeDoubleQuotes(cZip)); printf("  "); OpenRow(LANG_FL_tClient_cCountry,"white"); printf("%s",cCountry,EncodeDoubleQuotes(cCountry)); printf("  "); OpenRow(LANG_FL_tClient_cCardType,"white"); printf("%s",cCardType,EncodeDoubleQuotes(cCardType)); printf("  "); OpenRow(LANG_FL_tClient_cCardNumber,"white"); printf("%s",cCardNumber,EncodeDoubleQuotes(cCardNumber)); printf("  "); OpenRow(LANG_FL_tClient_uExpMonth,"white"); printf("%u\n",uExpMonth,uExpMonth); printf("  "); OpenRow(LANG_FL_tClient_uExpYear,"white"); printf("%u\n",uExpYear,uExpYear); printf("  "); OpenRow(LANG_FL_tClient_cCardName,"white"); printf("%s",cCardName,EncodeDoubleQuotes(cCardName)); printf("  "); OpenRow(LANG_FL_tClient_cShipName,"white"); printf("%s",cShipName,EncodeDoubleQuotes(cShipName)); printf("  "); OpenRow(LANG_FL_tClient_cShipAddr1,"white"); printf("%s",cShipAddr1,EncodeDoubleQuotes(cShipAddr1)); printf("  "); OpenRow(LANG_FL_tClient_cShipAddr2,"white"); printf("%s",cShipAddr2,EncodeDoubleQuotes(cShipAddr2)); printf("  "); OpenRow(LANG_FL_tClient_cShipCity,"white"); printf("%s",cShipCity,EncodeDoubleQuotes(cShipCity)); printf("  "); OpenRow(LANG_FL_tClient_cShipState,"white"); printf("%s",cShipState,EncodeDoubleQuotes(cShipState)); printf("  "); OpenRow(LANG_FL_tClient_cShipZip,"white"); printf("%s",cShipZip,EncodeDoubleQuotes(cShipZip)); printf("  "); OpenRow(LANG_FL_tClient_cShipCountry,"white"); printf("%s",cShipCountry,EncodeDoubleQuotes(cShipCountry)); printf("  "); OpenRow(LANG_FL_tClient_cTelephone,"white"); printf("%s",cTelephone,EncodeDoubleQuotes(cTelephone)); printf("  "); OpenRow(LANG_FL_tClient_cFax,"white"); printf("%s",cFax,EncodeDoubleQuotes(cFax)); printf("  "); OpenRow(LANG_FL_tClient_uOwner,"white"); printf("%s\n",ForeignKey("tClient","cLabel",uOwner),uOwner); printf("  "); OpenRow(LANG_FL_tClient_uCreatedBy,"white"); printf("%s\n",ForeignKey("tClient","cLabel",uCreatedBy),uCreatedBy); printf("  "); OpenRow(LANG_FL_tClient_uCreatedDate,"white"); if(uCreatedDate) printf("%s\n\n",ctime((time_t *)&uCreatedDate)); else printf("---\n\n"); printf("\n",uCreatedDate); printf("  "); OpenRow(LANG_FL_tClient_uModBy,"white"); printf("%s\n",ForeignKey("tClient","cLabel",uModBy),uModBy); printf("  "); OpenRow(LANG_FL_tClient_uModDate,"white"); if(uModDate) printf("%s\n\n",ctime((time_t *)&uModDate)); else printf("---\n\n"); printf("\n",uModDate); printf("  "); printf("\n"); }//tClientContent() void tClientInputContent(void) { OpenRow(LANG_FL_tClient_uClient,"white"); if(uPermLevel>=20) printf("\n",LANG_FT_tClient_uClient,uClient); else printf("%u\n",uClient,uClient); OpenRow(LANG_FL_tClient_cLabel,"white"); if(uPermLevel>=12 || (uPermLevel>=7 && !cLabel[0])) printf("\n",LANG_FT_tClient_cLabel,EncodeDoubleQuotes(cLabel)); else printf("%s",cLabel,EncodeDoubleQuotes(cLabel)); OpenRow(LANG_FL_tClient_uMaxUsers,"white"); if(uPermLevel>=8) printf("\n",LANG_FT_tClient_uMaxUsers,uMaxUsers); else printf("%u\n",uMaxUsers,uMaxUsers); OpenRow(LANG_FL_tClient_cFirstName,"white"); printf("\n",LANG_FT_tClient_cFirstName,EncodeDoubleQuotes(cFirstName)); OpenRow(LANG_FL_tClient_cLastName,"white"); printf("\n",LANG_FT_tClient_cLastName,EncodeDoubleQuotes(cLastName)); OpenRow(LANG_FL_tClient_cCompanyName,"white"); printf("\n",LANG_FT_tClient_cCompanyName,EncodeDoubleQuotes(cCompanyName)); OpenRow(LANG_FL_tClient_cEmail,"white"); printf("\n",LANG_FT_tClient_cEmail,EncodeDoubleQuotes(cEmail)); OpenRow(LANG_FL_tClient_cAddr1,"white"); printf("\n",LANG_FT_tClient_cAddr1,EncodeDoubleQuotes(cAddr1)); OpenRow(LANG_FL_tClient_cAddr2,"white"); printf("\n",LANG_FT_tClient_cAddr2,EncodeDoubleQuotes(cAddr2)); OpenRow(LANG_FL_tClient_cCity,"white"); printf("\n",LANG_FT_tClient_cCity,EncodeDoubleQuotes(cCity)); OpenRow(LANG_FL_tClient_cState,"white"); printf("\n",LANG_FT_tClient_cState,EncodeDoubleQuotes(cState)); OpenRow(LANG_FL_tClient_cZip,"white"); printf("\n",LANG_FT_tClient_cZip,EncodeDoubleQuotes(cZip)); OpenRow(LANG_FL_tClient_cCountry,"white"); printf("\n",LANG_FT_tClient_cCountry,EncodeDoubleQuotes(cCountry)); OpenRow(LANG_FL_tClient_cCardType,"white"); printf("\n",LANG_FT_tClient_cCardType,EncodeDoubleQuotes(cCardType)); OpenRow(LANG_FL_tClient_cCardNumber,"white"); printf("\n",LANG_FT_tClient_cCardNumber,EncodeDoubleQuotes(cCardNumber)); OpenRow(LANG_FL_tClient_uExpMonth,"white"); printf("\n",LANG_FT_tClient_uExpMonth,uExpMonth); OpenRow(LANG_FL_tClient_uExpYear,"white"); printf("\n",LANG_FT_tClient_uExpYear,uExpYear); OpenRow(LANG_FL_tClient_cCardName,"white"); printf("\n",LANG_FT_tClient_cCardName,EncodeDoubleQuotes(cCardName)); OpenRow(LANG_FL_tClient_cShipName,"white"); printf("\n",LANG_FT_tClient_cShipName,EncodeDoubleQuotes(cShipName)); OpenRow(LANG_FL_tClient_cShipAddr1,"white"); printf("\n",LANG_FT_tClient_cShipAddr1,EncodeDoubleQuotes(cShipAddr1)); OpenRow(LANG_FL_tClient_cShipAddr2,"white"); printf("\n",LANG_FT_tClient_cShipAddr2,EncodeDoubleQuotes(cShipAddr2)); OpenRow(LANG_FL_tClient_cShipCity,"white"); printf("\n",LANG_FT_tClient_cShipCity,EncodeDoubleQuotes(cShipCity)); OpenRow(LANG_FL_tClient_cShipState,"white"); printf("\n",LANG_FT_tClient_cShipState,EncodeDoubleQuotes(cShipState)); OpenRow(LANG_FL_tClient_cShipZip,"white"); printf("\n",LANG_FT_tClient_cShipZip,EncodeDoubleQuotes(cShipZip)); OpenRow(LANG_FL_tClient_cShipCountry,"white"); printf("\n",LANG_FT_tClient_cShipCountry,EncodeDoubleQuotes(cShipCountry)); OpenRow(LANG_FL_tClient_cTelephone,"white"); printf("\n",LANG_FT_tClient_cTelephone,EncodeDoubleQuotes(cTelephone)); OpenRow(LANG_FL_tClient_cFax,"white"); printf("\n",LANG_FT_tClient_cFax,EncodeDoubleQuotes(cFax)); OpenRow(LANG_FL_tClient_uOwner,"white"); printf("%s\n",ForeignKey("tClient","cLabel",uOwner),uOwner); OpenRow(LANG_FL_tClient_uCreatedBy,"white"); printf("%s\n",ForeignKey("tClient","cLabel",uCreatedBy),uCreatedBy); OpenRow(LANG_FL_tClient_uCreatedDate,"white"); if(uCreatedDate) printf("%s\n\n",ctime((time_t *)&uCreatedDate)); else printf("---\n\n"); printf("\n",uCreatedDate); OpenRow(LANG_FL_tClient_uModBy,"white"); printf("%s\n",ForeignKey("tClient","cLabel",uModBy),uModBy); OpenRow(LANG_FL_tClient_uModDate,"white"); if(uModDate) printf("%s\n\n",ctime((time_t *)&uModDate)); else printf("---\n\n"); printf("\n",uModDate); printf("\n"); }//void tClientInputContent(void) void NewtClient(unsigned uMode) { register int i=0; MYSQL_RES *res; //New select sprintf(query,"SELECT uClient FROM tClient WHERE uClient=%u",uClient); mysql_query(&mysql,query); if(mysql_errno(&mysql)) mysqlSendmail(mysql_error(&mysql)); res=mysql_store_result(&mysql); i=mysql_num_rows(res); if(i) //tClient("Record already exists"); tClient(LANG_NBR_RECEXISTS); //insert query Insert_tClient(); if(mysql_errno(&mysql)) mysqlSendmail(mysql_error(&mysql)); //sprintf(query,"New record %u added"); uClient=mysql_insert_id(&mysql); sprintf(query,LANG_NBR_NEWRECADDED,uClient); tClient(query); }//NewtClient() void DeletetClient(void) { sprintf(query,"DELETE FROM tClient WHERE uClient=%u AND ( uOwner=%u OR %u>7 )" ,uClient,uLoginClient,uPermLevel); mysql_query(&mysql,query); if(mysql_errno(&mysql)) mysqlSendmail(mysql_error(&mysql)); //tClient("Record Deleted"); if(mysql_affected_rows(&mysql)>0) tClient(LANG_NBR_RECDELETED); else tClient(LANG_NBR_RECNOTDELETED); }//void DeletetClient(void) void Insert_tClient(void) { time_t clock; time(&clock); //insert query //insert query sprintf(query,"INSERT INTO tClient SET uClient=%u, cLabel='%s', uMaxUsers=%u, cFirstName='%s', cLastName='%s', cCompanyName='%s', cEmail='%s', cAddr1='%s', cAddr2='%s', cCity='%s', cState='%s', cZip='%s', cCountry='%s', cCardType='%s', cCardNumber='%s', uExpMonth=%u, uExpYear=%u, cCardName='%s', cShipName='%s', cShipAddr1='%s', cShipAddr2='%s', cShipCity='%s', cShipState='%s', cShipZip='%s', cShipCountry='%s', cTelephone='%s', cFax='%s', uOwner=%u, uCreatedBy=%u, uCreatedDate=%lu, uModBy=%u, uModDate=0", uClient ,TextAreaSave(cLabel) ,uMaxUsers ,TextAreaSave(cFirstName) ,TextAreaSave(cLastName) ,TextAreaSave(cCompanyName) ,TextAreaSave(cEmail) ,TextAreaSave(cAddr1) ,TextAreaSave(cAddr2) ,TextAreaSave(cCity) ,TextAreaSave(cState) ,TextAreaSave(cZip) ,TextAreaSave(cCountry) ,TextAreaSave(cCardType) ,TextAreaSave(cCardNumber) ,uExpMonth ,uExpYear ,TextAreaSave(cCardName) ,TextAreaSave(cShipName) ,TextAreaSave(cShipAddr1) ,TextAreaSave(cShipAddr2) ,TextAreaSave(cShipCity) ,TextAreaSave(cShipState) ,TextAreaSave(cShipZip) ,TextAreaSave(cShipCountry) ,TextAreaSave(cTelephone) ,TextAreaSave(cFax) ,uOwner ,uCreatedBy ,(long unsigned)clock ,uModBy ); mysql_query(&mysql,query); uCreatedDate=clock; }//void Insert_tClient(void) void Update_tClient(char *rowid) { time_t clock; time(&clock); //update query //update query sprintf(query,"UPDATE tClient SET uClient=%u,cLabel='%s',uMaxUsers=%u,cFirstName='%s',cLastName='%s',cCompanyName='%s',cEmail='%s',cAddr1='%s',cAddr2='%s',cCity='%s',cState='%s',cZip='%s',cCountry='%s',cCardType='%s',cCardNumber='%s',uExpMonth=%u,uExpYear=%u,cCardName='%s',cShipName='%s',cShipAddr1='%s',cShipAddr2='%s',cShipCity='%s',cShipState='%s',cShipZip='%s',cShipCountry='%s',cTelephone='%s',cFax='%s',uModBy=%u,uModDate=%lu WHERE _rowid=%s", uClient ,TextAreaSave(cLabel) ,uMaxUsers ,TextAreaSave(cFirstName) ,TextAreaSave(cLastName) ,TextAreaSave(cCompanyName) ,TextAreaSave(cEmail) ,TextAreaSave(cAddr1) ,TextAreaSave(cAddr2) ,TextAreaSave(cCity) ,TextAreaSave(cState) ,TextAreaSave(cZip) ,TextAreaSave(cCountry) ,TextAreaSave(cCardType) ,TextAreaSave(cCardNumber) ,uExpMonth ,uExpYear ,TextAreaSave(cCardName) ,TextAreaSave(cShipName) ,TextAreaSave(cShipAddr1) ,TextAreaSave(cShipAddr2) ,TextAreaSave(cShipCity) ,TextAreaSave(cShipState) ,TextAreaSave(cShipZip) ,TextAreaSave(cShipCountry) ,TextAreaSave(cTelephone) ,TextAreaSave(cFax) ,uModBy ,(long unsigned)clock ,rowid); mysql_query(&mysql,query); uModDate=clock; }//void Update_tClient(void) void ModtClient(void) { register int i=0; MYSQL_RES *res; MYSQL_ROW field; unsigned uPreModDate=0; //Mod select query if(uPermLevel<10) sprintf(query,"SELECT tClient.uClient,\ tClient.uModDate\ FROM tClient\ WHERE tClient.uClient=%u\ AND tClient.uOwner=tClient.uClient\ AND (tClient.uOwner=%u OR tClient.uClient=%u)" ,uClient,uLoginClient,uLoginClient); else sprintf(query,"SELECT uClient,uModDate FROM tClient\ WHERE uClient=%u" ,uClient); mysql_query(&mysql,query); if(mysql_errno(&mysql)) mysqlSendmail(mysql_error(&mysql)); res=mysql_store_result(&mysql); i=mysql_num_rows(res); //if(i<1) tClient("Record does not exist"); if(i<1) tClient(LANG_NBR_RECNOTEXIST); //if(i>1) tClient("Multiple rows!"); if(i>1) tClient(LANG_NBR_MULTRECS); field=mysql_fetch_row(res); sscanf(field[1],"%u",&uPreModDate); if(uPreModDate!=uModDate) tClient(LANG_NBR_EXTMOD); Update_tClient(field[0]); if(mysql_errno(&mysql)) mysqlSendmail(mysql_error(&mysql)); //sprintf(query,"record %s modified",field[0]); sprintf(query,LANG_NBRF_REC_MODIFIED,field[0]); tClient(query); }//ModtClient(void) void tClientList(void) { MYSQL_RES *res; MYSQL_ROW field; ExttClientListSelect(); mysql_query(&mysql,query); if(mysql_error(&mysql)[0]) mysqlSendmail(mysql_error(&mysql)); res=mysql_store_result(&mysql); i=mysql_num_rows(res); PageMachine("tClientList",1,"");//1 is auto header list mode. Opens table! //Filter select drop down ExttClientListFilter(); printf("",command); printf("\n"); printf("\n"); printf(""); mysql_data_seek(res,start-1); for(n=0;n<(end-start+1);n++) { field=mysql_fetch_row(res); if(!field) { printf("
uClientcLabeluMaxUserscFirstNamecLastNamecCompanyNamecEmailcAddr1cAddr2cCitycStatecZipcCountrycCardTypecCardNumberuExpMonthuExpYearcCardNamecShipNamecShipAddr1cShipAddr2cShipCitycShipStatecShipZipcShipCountrycTelephonecFaxuOwneruCreatedByuCreatedDateuModByuModDate
End of data
"); Footer_ism3(); } if(n % 2) printf(""); else printf(""); printf(" %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" ,field[0] ,field[0] ,field[1] ,field[2] ,field[3] ,field[4] ,field[5] ,field[6] ,field[7] ,field[8] ,field[9] ,field[10] ,field[11] ,field[12] ,field[13] ,field[14] ,field[15] ,field[16] ,field[17] ,field[18] ,field[19] ,field[20] ,field[21] ,field[22] ,field[23] ,field[24] ,field[25] ,field[26] ,field[27] ,field[28] ,field[29] ,field[30] ,field[31] ); } printf("\n"); Footer_ism3(); }//tClientList() void CreatetClient(void) { sprintf(query,"CREATE TABLE tClient ( cFax varchar(32) NOT NULL DEFAULT '', cTelephone varchar(32) NOT NULL DEFAULT '', cShipCountry varchar(64) NOT NULL DEFAULT '', cShipZip varchar(32) NOT NULL DEFAULT '', cShipState varchar(100) NOT NULL DEFAULT '', cShipCity varchar(100) NOT NULL DEFAULT '', cShipAddr2 varchar(100) NOT NULL DEFAULT '', cShipName varchar(100) NOT NULL DEFAULT '', cShipAddr1 varchar(100) NOT NULL DEFAULT '', cCardName varchar(64) NOT NULL DEFAULT '', uExpYear int unsigned NOT NULL DEFAULT 0, uExpMonth int unsigned NOT NULL DEFAULT 0, cCardNumber varchar(32) NOT NULL DEFAULT '', cCardType varchar(32) NOT NULL DEFAULT '', cCountry varchar(64) NOT NULL DEFAULT '', cZip varchar(32) NOT NULL DEFAULT '', cState varchar(100) NOT NULL DEFAULT '', cCity varchar(100) NOT NULL DEFAULT '', cAddr2 varchar(100) NOT NULL DEFAULT '', cAddr1 varchar(100) NOT NULL DEFAULT '', cEmail varchar(100) NOT NULL DEFAULT '',index (cEmail), cLastName varchar(32) NOT NULL DEFAULT '',index (cLastName), cFirstName varchar(32) NOT NULL DEFAULT '', uModDate int unsigned NOT NULL DEFAULT 0, uModBy int unsigned NOT NULL DEFAULT 0, uCreatedDate int unsigned NOT NULL DEFAULT 0, uCreatedBy int unsigned NOT NULL DEFAULT 0, uOwner int unsigned NOT NULL DEFAULT 0,index (uOwner), uClient int unsigned PRIMARY KEY AUTO_INCREMENT, cLabel varchar(32) NOT NULL DEFAULT '', UNIQUE (cLabel),index (cLabel), uMaxUsers int unsigned NOT NULL DEFAULT 0, cCompanyName varchar(32) NOT NULL DEFAULT '',index (cCompanyName) )"); mysql_query(&mysql,qstr); if(mysql_errno(&mysql)) mysqlSendmail(mysql_error(&mysql)); }//CreatetClient() //sedall patch1