예제 #1
0
     if ($_POST['date'] == '0') {
         $cnd .= " OR forms='date'";
     }
     if ($_POST['text'] == '0') {
         $cnd .= " OR forms='textbox'";
     }
     if ($_POST['editor'] == '0') {
         $cnd .= " OR forms='editor'";
     }
     if ($_POST['img'] == '0') {
         $cnd .= " OR forms='img'";
     }
     $db->runQuery("delete from " . FORM . " where category_id='{$getid}' and ({$cnd})");
 } else {
     $db->runQuery("insert into " . CATEGORY . "\n\t\t\t\t\t(\n\t\t\t\t\tparent_id,\n\t\t\t\t\tpage_name,\n\t\t\t\t\ttype,\n\t\t\t\t\tsetting,\n\t\t\t\t\toptions,\n\t\t\t\t\tgoto,\n\t\t\t\t\tslug\t\n\t\t\t\t\t)\n\t\t\t\t\tvalues\n\t\t\t\t\t(\n\t\t\t\t\t'{$_POST['category']}',\n\t\t\t\t\t'{$page_name}',\n\t\t\t\t\t'{$typp}',\n\t\t\t\t\t'" . $db->clearText($setting) . "',\n\t\t\t\t\t'{$option}',\n\t\t\t\t\t'{$goto}',\n\t\t\t\t\t'{$slug}'\n\t\t\t\t\t)\n\t\t\t\t\t");
     $getid = $db->lastInsertID();
 }
 //title
 if ($_POST['titleid'] == '' && $_POST['title1'] != '') {
     $cdate = $db->clearText(strtolower($_POST['title1']));
     $db->runQuery("insert into " . FORM . " (category_id,forms,title,options) values('{$getid}','title','{$cdate}','1')");
 }
 //date
 if ($_POST['date'] == 'date' && $getid != '' && $typp != 'gallery') {
     $sdate = $_POST['sdate'];
     for ($i = 0; $i < count($sdate); $i++) {
         $cdate = $db->clearText(strtolower($sdate[$i]));
         $db->runQuery("insert into " . FORM . " (category_id,forms,title,options) values('{$getid}','date','{$cdate}','1')");
     }
 }
 //textbox
예제 #2
0
 public function addReport()
 {
     $mydb = new myDBC();
     $domain = $mydb->clearText($this->domain);
     $start = $mydb->clearText($this->start_date);
     $end = $mydb->clearText($this->end_date);
     $creation = time();
     $sql = "INSERT INTO Report (domain,start_date,end_date,creation_date)\n\t\tVALUES ('{$domain}','{$start}','{$end}','{$creation}'); ";
     $mydb->runQuery($sql);
     $this->id_report = $mydb->lastInsertID();
     // Creamos directorios
     $this->createDomianDir();
     // Directorio dominio o canal
     $this->createIdReportDir();
     // Directorio del id_Report
     $this->createLogFile();
     // Creamos el archivo del log
     $this->createOutputFile();
     // Creamos archivo de salida para procesos background
     $this->createErrorFile();
     // Creamos archivo para reporte de errores
     // Realizamos processo background de crawl
     //$this->backGroundCrawl();
     return $this->id_report;
 }