Пример #1
0
//unsigned char secrets[numslots][4]={0}; //secret numbers for each registered ip
//unsigned int ipturns[numslots];//number of moves for the IP
//unsigned int ipgames[numslots];//number of games won by IP
void bagelspeek(){//show the ip table
	int sendrc,i;
	pages++;
	sendconst(hdr1a);send0s(itoa(pages,pnbuf)); sendconst(hdr1b); 	// Now Send the HTTP Response first part
	sendtable();
	sendconst(trlr); 	// Now Send the rest of the page

}
Пример #2
0
void NewClass::on_pushButton_clicked()
{

    if(ui->lineEdit_3->text()==NULL){


         QMessageBox::information(NULL, "!!!", "subject is null",0 ,0);
    }
    else{
        if(ui->lineEdit->text()==NULL){


             QMessageBox::information(NULL, "!!!", "teacher is null",0 ,0);
        }
        else{
            if(ui->lineEdit_2->text()==NULL){


                 QMessageBox::information(NULL, "!!!", "classroom is null",0 ,0);
            }
            else{
                if(sendtype==2){
                    for(int i=0;i<dt->count();i++){
                         QSqlQuery q;
                         q.exec("delete from tutor where id="+dt->at(i));
                    }
                /*    for(int i=0;i<dp->count();i++){
                         QSqlQuery q;
                         q.exec("delete from problem where title='"+((Problem)(dp->at(i))).getTitle()+"' and type ='"+((Problem)(dp->at(i))).getType()+"' and ddl ='"+
                                ((Problem)(dp->at(i))).getDdl()+"' and text='"+((Problem)(dp->at(i))).getTexe()+"' and mail='"+((Problem)(dp->at(i))).getMail()+"'");
                    }
                   */
                    QSqlQuery q,qd;
                    q.exec("select id from subject where week="+QString::number(j,10)+" and ttime="+QString::number(i,10)+" and tname='"+tname+"'");
                   q.first();
                    qd.exec("delete from problem where id="+q.value(0).toInt());


                    QSqlQuery query,q2,q3,q4,q5;
                    for(int j=0;j<tutor->count();j++){
                        q3.exec("update tutor set name='"+((Tutor)(tutor->at(i))).getName()+"' and set tel='"+((Tutor)(tutor->at(i))).getTel()+"' where id="+QString::number(((Tutor)(tutor->at(i))).getId(),10));



                    }

                     for(int ii=0;ii<problem->count();ii++){


                             q2.prepare("insert into problem (class_id int,title string,type int,text string,ttime string,mail string)");
                             q2.bindValue(0,q.value(0).toInt());
                             q2.bindValue(1,((Problem)(problem->at(ii))).getTitle());
                             q2.bindValue(2,((Problem)(problem->at(ii))).getType());
                             q2.bindValue(3,((Problem)(problem->at(ii))).getTexe());
                             q2.bindValue(4,((Problem)(problem->at(ii))).getDdl());
                             q2.bindValue(5,((Problem)(problem->at(ii))).getMail());
                             q2.exec();




                     }



                }else{

                Table t(ui->lineEdit_3->text(),ui->lineEdit->text(),j,i,ui->lineEdit_2->text(),ui->comboBox_2->currentText());
                emit sendtable(t,tutor,problem,mail);
                this->close();
                }

            }

        }


    }

}