Changeset 1188
- Timestamp:
- 02/16/10 13:29:26 (2 years ago)
- Location:
- trunk/unxsISP/interfaces/customer
- Files:
-
- 5 modified
-
customer.c (modified) (4 diffs)
-
interface.h (modified) (3 diffs)
-
main.c (modified) (4 diffs)
-
purchase.c (modified) (3 diffs)
-
templates-english/FirstTime.Body (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/unxsISP/interfaces/customer/customer.c
r1186 r1188 690 690 691 691 printf("\n<!-- Start htmlCustomerPage(%s) -->\n",cTemplateName); 692 // fpTemplate(stdout,cTemplateName,&template);693 692 Template(field[0], &template, stdout); 694 693 printf("\n<!-- End htmlCustomerPage(%s) -->\n",cTemplateName); … … 1309 1308 }//void funcSelectCardType(FILE *fp) 1310 1309 1311 1312 1310 void funcSelectExpMonth(FILE *fp) 1313 1311 { 1312 sysfuncSelectExpMonth(fp,cuExpMonthStyle,uExpMonth,1); 1313 } 1314 1315 void sysfuncSelectExpMonth(FILE *fp,char *cStyle,unsigned uSelector,unsigned uUseStatus) 1316 { 1314 1317 fprintf(fp,"<!-- funcSelectExpMonth(fp) start -->\n"); 1315 1316 fprintf(fp,"<select class=%s name=uExpMonth %s>\n",cuExpMonthStyle,gcInputStatus); 1318 1319 if(uUseStatus) 1320 fprintf(fp,"<select class=%s name=uExpMonth %s>\n",cStyle,gcInputStatus); 1321 else 1322 fprintf(fp,"<select class=%s name=uExpMonth>\n",cStyle); 1317 1323 1318 1324 fprintf(fp,"<option value=0 "); 1319 if(u ExpMonth==0)1325 if(uSelector==0) 1320 1326 fprintf(fp,"selected"); 1321 1327 fprintf(fp,">---</option>\n"); 1322 1328 1323 1329 fprintf(fp,"<option value=1 "); 1324 if(u ExpMonth==1)1330 if(uSelector==1) 1325 1331 fprintf(fp,"selected"); 1326 1332 fprintf(fp,">January</option>\n"); 1327 1333 1328 1334 fprintf(fp,"<option value=2 "); 1329 if(u ExpMonth==2)1335 if(uSelector==2) 1330 1336 fprintf(fp,"selected"); 1331 1337 fprintf(fp,">February</option>\n"); 1332 1338 1333 1339 fprintf(fp,"<option value=3 "); 1334 if(u ExpMonth==3)1340 if(uSelector==3) 1335 1341 fprintf(fp,"selected"); 1336 1342 fprintf(fp,">March</option>\n"); 1337 1343 1338 1344 fprintf(fp,"<option value=4 "); 1339 if(u ExpMonth==4)1345 if(uSelector==4) 1340 1346 fprintf(fp,"selected"); 1341 1347 fprintf(fp,">April</option>\n"); 1342 1348 1343 1349 fprintf(fp,"<option value=5 "); 1344 if(u ExpMonth==5)1350 if(uSelector==5) 1345 1351 fprintf(fp,"selected"); 1346 1352 fprintf(fp,">May</option>\n"); 1347 1353 1348 1354 fprintf(fp,"<option value=6 "); 1349 if(u ExpMonth==6)1355 if(uSelector==6) 1350 1356 fprintf(fp,"selected"); 1351 1357 fprintf(fp,">June</option>\n"); 1352 1358 1353 1359 fprintf(fp,"<option value=7 "); 1354 if(u ExpMonth==7)1360 if(uSelector==7) 1355 1361 fprintf(fp,"selected"); 1356 1362 fprintf(fp,">July</option>\n"); 1357 1363 1358 1364 fprintf(fp,"<option value=8 "); 1359 if(u ExpMonth==8)1365 if(uSelector==8) 1360 1366 fprintf(fp,"selected"); 1361 1367 fprintf(fp,">August</option>\n"); 1362 1368 1363 1369 fprintf(fp,"<option value=9 "); 1364 if(u ExpMonth==9)1370 if(uSelector==9) 1365 1371 fprintf(fp,"selected"); 1366 1372 fprintf(fp,">September</option>\n"); 1367 1373 1368 1374 fprintf(fp,"<option value=10 "); 1369 if(u ExpMonth==10)1375 if(uSelector==10) 1370 1376 fprintf(fp,"selected"); 1371 1377 fprintf(fp,">October</option>\n"); 1372 1378 1373 1379 fprintf(fp,"<option value=11 "); 1374 if(u ExpMonth==11)1380 if(uSelector==11) 1375 1381 fprintf(fp,"selected"); 1376 1382 fprintf(fp,">November</option>\n"); 1377 1383 1378 1384 fprintf(fp,"<option value=12 "); 1379 if(u ExpMonth==12)1385 if(uSelector==12) 1380 1386 fprintf(fp,"selected"); 1381 1387 fprintf(fp,">December</option>\n"); … … 1390 1396 void funcSelectExpYear(FILE *fp) 1391 1397 { 1398 sysfuncSelectExpYear(fp,cuExpYearStyle,uExpYear,1); 1399 1400 }//void funcSelectExpYear(FILE *fp) 1401 1402 1403 void sysfuncSelectExpYear(FILE *fp,char *cStyle,unsigned uSelector,unsigned uUseStatus) 1404 { 1392 1405 fprintf(fp,"<!-- funcSelectExpYear(fp) start -->\n"); 1393 1406 1394 fprintf(fp,"<select class=%s name=uExpYear %s>\n",cuExpYearStyle,gcInputStatus); 1407 if(uUseStatus) 1408 fprintf(fp,"<select class=%s name=uExpYear %s>\n",cStyle,gcInputStatus); 1409 else 1410 fprintf(fp,"<select class=%s name=uExpYear %s>\n",cStyle); 1395 1411 1396 1412 fprintf(fp,"<option value=0 "); … … 1399 1415 fprintf(fp,">---</option>\n"); 1400 1416 1401 fprintf(fp,"<option value=2009 ");1402 if(uExpYear==2009)1403 fprintf(fp,"selected");1404 fprintf(fp,">2009</option>\n");1405 1406 1417 fprintf(fp,"<option value=2010 "); 1407 if(u ExpYear==2010)1418 if(uSelector==2010) 1408 1419 fprintf(fp,"selected"); 1409 1420 fprintf(fp,">2010</option>\n"); 1410 1421 1411 1422 fprintf(fp,"<option value=2011 "); 1412 if(u ExpYear==2011)1423 if(uSelector==2011) 1413 1424 fprintf(fp,"selected"); 1414 1425 fprintf(fp,">2011</option>\n"); 1415 1426 1416 1427 fprintf(fp,"<option value=2012 "); 1417 if(u ExpYear==2012)1428 if(uSelector==2012) 1418 1429 fprintf(fp,"selected"); 1419 1430 fprintf(fp,">2012</option>\n"); -
trunk/unxsISP/interfaces/customer/interface.h
r1184 r1188 89 89 unsigned uGetAdminCompany(void); 90 90 void GetClientOwner(unsigned uClient, unsigned *uOwner); 91 void Logout(void); 91 92 92 93 //Global vars all declared in main.c … … 138 139 void ShowPurchaseRadiusPage(void); 139 140 unsigned IsFirstTimeLogin(void); 141 void sysfuncSelectExpMonth(FILE *fp,char *cStyle,unsigned uSelector,unsigned uUseStatus); 142 void sysfuncSelectExpYear(FILE *fp,char *cStyle,unsigned uSelector,unsigned uUseStatus); 140 143 141 144 typedef struct { … … 217 220 void RegistrationCommands(pentry entries[], int x); 218 221 222 //purchase.c 223 void PurchaseCommands(pentry entries[], int x); 224 -
trunk/unxsISP/interfaces/customer/main.c
r1185 r1188 114 114 115 115 SSLCookieLogin(); 116 116 117 if(gcPage[0]) 117 118 { 119 if(IsFirstTimeLogin()) ShowPurchaseRadiusPage(); 120 118 121 if(!strcmp(gcPage,"Customer")) 119 122 CustomerGetHook(gentries,i); … … 153 156 if(gcFunction[0]) 154 157 { 155 if(!strncmp(gcFunction,"Logout",5)) 156 { 157 printf("Set-Cookie: ispClientLogin=; expires=\"Mon, 01-Jan-1971 00:10:10 GMT\"\n"); 158 printf("Set-Cookie: ispClientPasswd=; expires=\"Mon, 01-Jan-1971 00:10:10 GMT\"\n"); 159 sprintf(gcQuery,"INSERT INTO tLog SET cLabel='logout %.99s',uLogType=7,uPermLevel=%u,uLoginClient=%u,cLogin='%.99s',cHost='%.99s',cServer='%.99s',uOwner=%u,uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())",gcLogin,guPermLevel,guLoginClient,gcLogin,gcHost,gcHostname,guOrg); 160 mysql_query(&gMysql,gcQuery); 161 guPermLevel=0; 162 gcUser[0]=0; 163 guLoginClient=0; 164 htmlLogin(); 165 } 158 if(!strncmp(gcFunction,"Logout",5)) Logout(); 166 159 } 167 160 RegistrationCommands(entries,i); … … 180 173 181 174 //Per page command tree 175 PurchaseCommands(entries,i); 182 176 CustomerCommands(entries,i); 183 177 ProductCommands(entries,i); 184 178 InvoiceCommands(entries,i); 185 179 186 180 //default logged in page 187 181 if(IsFirstTimeLogin()) ShowPurchaseRadiusPage(); … … 190 184 191 185 }//end of main() 186 187 void Logout(void) 188 { 189 printf("Set-Cookie: ispClientLogin=; expires=\"Mon, 01-Jan-1971 00:10:10 GMT\"\n"); 190 printf("Set-Cookie: ispClientPasswd=; expires=\"Mon, 01-Jan-1971 00:10:10 GMT\"\n"); 191 sprintf(gcQuery,"INSERT INTO tLog SET cLabel='logout %.99s',uLogType=7,uPermLevel=%u," 192 "uLoginClient=%u,cLogin='%.99s',cHost='%.99s',cServer='%.99s',uOwner=%u," 193 "uCreatedBy=1,uCreatedDate=UNIX_TIMESTAMP(NOW())" 194 ,gcLogin,guPermLevel,guLoginClient,gcLogin,gcHost,gcHostname,guOrg); 195 mysql_query(&gMysql,gcQuery); 196 guPermLevel=0; 197 gcUser[0]=0; 198 guLoginClient=0; 199 htmlLogin(); 200 201 }//void Logout(void) 192 202 193 203 -
trunk/unxsISP/interfaces/customer/purchase.c
r1186 r1188 9 9 */ 10 10 #include "interface.h" 11 12 void ShowConfirmPurchasePage(void); 13 void htmlPurchasePage(char *cTitle,char *cTemplateName); 14 11 15 12 16 void ProcessPurchaseVars(pentry entries[], int x) … … 29 33 ProcessPurchaseVars(entries,x); 30 34 35 if(!strcmp(gcFunction,"Skip")) 36 { 37 sprintf(gcNewStep,"Confirm "); 38 } 39 else if(!strcmp(gcFunction,"Confirm Skip")) 40 { 41 Logout(); 42 } 43 else if(!strcmp(gcFunction,"Proceed")) 44 { 45 sprintf(gcModStep,"Confirm "); 46 } 47 else if(!strcmp(gcFunction,"Confirm Proceed")) 48 { 49 ShowConfirmPurchasePage(); 50 } 51 52 31 53 } 32 54 }//void PurchaseCommands(pentry entries[], int x) … … 36 58 { 37 59 htmlHeader("unxsISP Client Interface","Header"); 38 html CustomerPage("","FirstTime.Body");60 htmlPurchasePage("","FirstTime.Body"); 39 61 htmlFooter("Footer"); 62 40 63 }//void ShowPurchaseRadiusPage(void) 64 65 66 void ShowConfirmPurchasePage(void) 67 { 68 htmlHeader("unxsISP Client Interface","Header"); 69 htmlPurchasePage("","Purchase.Body"); 70 htmlFooter("Footer"); 71 72 }//void ShowConfirmPurchasePage(void) 73 74 75 void htmlPurchasePage(char *cTitle,char *cTemplateName) 76 { 77 if(cTemplateName[0]) 78 { 79 MYSQL_RES *res; 80 MYSQL_ROW field; 81 82 TemplateSelect(cTemplateName,guTemplateSet); 83 res=mysql_store_result(&gMysql); 84 if((field=mysql_fetch_row(res))) 85 { 86 struct t_template template; 87 88 template.cpName[0]="cTitle"; 89 template.cpValue[0]=cTitle; 90 91 template.cpName[1]="cCGI"; 92 template.cpValue[1]="ispClient.cgi"; 93 94 template.cpName[2]="gcLogin"; 95 template.cpValue[2]=gcLogin; 96 97 template.cpName[3]="gcName"; 98 template.cpValue[3]=gcName; 99 100 template.cpName[4]="gcOrgName"; 101 template.cpValue[4]=gcOrgName; 102 103 template.cpName[5]="cUserLevel"; 104 template.cpValue[5]=(char *)cUserLevel(guPermLevel); 105 106 template.cpName[6]="gcHost"; 107 template.cpValue[6]=gcHost; 108 109 template.cpName[7]="gcMessage"; 110 template.cpValue[7]=gcMessage; 111 112 template.cpName[8]="gcInputStatus"; 113 template.cpValue[8]=gcInputStatus; 114 115 template.cpName[9]="gcNewStep"; 116 template.cpValue[9]=gcNewStep; 117 118 template.cpName[10]="gcModStep"; 119 template.cpValue[10]=gcModStep; 120 121 template.cpName[11]="cISPName"; 122 template.cpValue[11]="AstraQom"; 123 124 template.cpName[12]="mProductPrice"; 125 template.cpValue[12]="15.95"; 126 127 template.cpName[13]=""; 128 129 printf("\n<!-- Start htmlPurchasePage(%s) -->\n",cTemplateName); 130 Template(field[0], &template, stdout); 131 printf("\n<!-- End htmlPurchasePage(%s) -->\n",cTemplateName); 132 } 133 else 134 { 135 printf("<hr>"); 136 printf("<center><font size=1>%s</font>\n",cTemplateName); 137 } 138 mysql_free_result(res); 139 } 140 141 }//void htmlPurchasePage(char *cTemplateName) 41 142 42 143 -
trunk/unxsISP/interfaces/customer/templates-english/FirstTime.Body
r1186 r1188 92 92 <tr> 93 93 <td align=center><input class=largeButton type=submit name=gcFunction value="{{gcNewStep}}Skip"></td> 94 <td align=center><input class=largeButton type=submit name=gcFunction value="{{gcModStep}} Confirm"></td>94 <td align=center><input class=largeButton type=submit name=gcFunction value="{{gcModStep}}Proceed"></td> 95 95 </tr> 96 96 </table>
