예제 #1
0
 function duplicate($newBID)
 {
     $db = Loader::db();
     foreach ($this->options as $opt) {
         $v1 = array($newBID, $opt->getOptionName(), $opt->getOptionDisplayOrder());
         $q1 = "insert into btSurveyOptions (bID, optionName, displayOrder) values (?, ?, ?)";
         $db->query($q1, $v1);
         $v2 = array($opt->getOptionID());
         $newOptionID = get_insert_id();
         $q2 = "select * from btSurveyResults where optionID = ?";
         $r2 = $db->query($q2, $v2);
         if ($r2) {
             while ($row = $r2->fetchRow()) {
                 $v3 = array($newOptionID, $row['uID'], $row['ipAddress'], $row['timestamp']);
                 $q3 = "insert into btSurveyResults (optionID, uID, ipAddress, timestamp) values (?, ?, ?, ?)";
                 $db->query($q3, $v3);
             }
         }
     }
     return parent::duplicate($newBID);
 }
 function duplicate($nbID)
 {
     parent::duplicate($nbID);
     $this->loadBlockInformation();
     $db = Loader::db();
     foreach ($this->images as $im) {
         $db->Execute('insert into btSlideshowImg (bID, fID, url, duration, fadeDuration, groupSet, position, imgHeight) values (?, ?, ?, ?, ?, ?, ?, ?)', array($nbID, $im['fID'], $im['url'], $im['duration'], $im['fadeDuration'], $im['groupSet'], $im['position'], $im['imgHeight']));
     }
 }