1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
if (!clean)
{
bd->execquery("delete from posfacture where expire < now()");
affrow=(int)bd->affected_rows();
std::cout<<"result du affectded row de posfacture :"<<affrow<<std::endl;
delai->raise_log(affrow);
}
if (diff<=0){
fprintf(stderr,"la facture de est trop ancienne : %d\n",REFMOIS);
}else{
#define LGLINE 10240
char line[LGLINE];
char date[20];
sprintf(date,"20%02d-%02d-01",REFMOIS/100,REFMOIS%100);
std::cout<<">>>>>>>>>>>>>>>ICI 0"<<std::endl;
/* Insertion de l'element dans la BD */
char query[LGLINE];
check=bd2->getRow(true,"select charge_type.str,charge_description.str,id_user,id_calling,id_groupe,prix from posfacture,charge_type,charge_description where source=\"%s\" and refmois=%d and id_charge_description=charge_description.id and id_charge_type=charge_type.id",TYPE,REFMOIS);
// sprintf(query,"select charge_type.str,charge_description.str,id_user,id_calling,id_groupe,prix from posfacture,charge_type,charge_description where source=\"%s\" and refmois=%d and id_charge_description=charge_description.id and id_charge_type=charge_type.id",TYPE,REFMOIS);
//
std::cout<<">>>>>>>>>>>>>>>ICI 1"<<std::endl;
// execquery(mysqldb,query);
// ptres=mysql_use_result(&mysqldb);
// (row=mysql_fetch_row(ptres))
int lignedebug =0;
while (check)
{
for (int i=0; i<6; i++)
{
store[i] =bd2->row(i);
//std::cout<<"valeur de store(i)"<<store[i]<<std::endl;
}
std::cout<<">>>>>>>>>>>>>>>ICI 2"<<std::endl;
if (strcmp(store[0],"Call charges")==0) continue;
if (strcmp(store[0],"Taxes d'appels")==0) continue;
if (strcmp(store[0],"Discounts, credits or charges")==0) continue;
if (strcmp(store[0],"Rabais, credits et debits")==0) continue;
if (strcmp(store[0],"Ajustements")==0) continue;
if ( (strcmp(store[0],"Single charges")==0) ||
(strcmp(store[0],"Recurring charges")==0) ||
(strcmp(store[0],"Frais mensuels")==0) ||
(strcmp(store[0],"Taxes periodiques")==0) ) continue;
// unsigned long int id_description=bd2->getindex("description",store[1],bdescription);
//bd2->execquery("insert into cdr(source,refmois,date,heure,duree,taille,sms,prix,id_pays_roaming,id_partner_roaming,id_destination,id_calling,id_called,id_description,id_groupe,id_rate,id_rate_description,id_user,charge) values(\"%s\",%d,\"%s\",\"00:00:00\",0,0,0,%s,1,1,1,%s,1,%lu,%s,1,1,%s,1)",TYPE,REFMOIS,date,store[5],store[3],id_description,store[4],store[2]);
// sprintf(query,"insert into cdr(source,refmois,date,heure,duree,taille,sms,prix,id_pays_roaming,id_partner_roaming,id_destination,id_calling,id_called,id_description,id_groupe,id_rate,id_rate_description,id_user,charge) values(\"%s\",%d,\"%s\",\"00:00:00\",0,0,0,%s,1,1,1,%s,1,%lu,%s,1,1,%s,1)",TYPE,REFMOIS,date,row[5],row[3],id_description,row[4],row[2]);
lignedebug++;
check=bd2->getNext();
std::cout<<"lignedebug <<<<<<<<<<<<<<<<<<:"<<lignedebug<<std::endl;
std::cout<<"le pid est"<<pid<<std::endl;
// continue;
fprintf(stderr,"Je ne sais pas quoi faire avec : %s\n",store[0]);
}//while
// bd->freeResult();
std::cout<<">>>>>>>>>>>>>>>ICI7"<<std::endl;
}//endif
delete bd;
delete bd2;
delete delai;
} |
Partager