コード例 #1
0
ファイル: ajax_processing.php プロジェクト: pontifechs/usage
         echo $e->getMessage();
     }
     break;
 case 'addPlatform':
     $platform = new Platform();
     $platform->name = $_POST['platformName'];
     $platform->reportDisplayName = $_POST['platformName'];
     try {
         $platform->save();
         echo $platform->primaryKey;
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     break;
 case 'deletePlatformNote':
     $platformNote = new PlatformNote(new NamedArguments(array('primaryKey' => $_GET['platformNoteID'])));
     try {
         $platformNote->delete();
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     break;
 case 'submitPublisherNote':
     //update
     if (isset($_POST['publisherPlatformNoteID']) && $_POST['publisherPlatformNoteID'] != '') {
         $publisherPlatformNote = new PublisherPlatformNote(new NamedArguments(array('primaryKey' => $_POST['publisherPlatformNoteID'])));
     } else {
         $publisherPlatformNote = new PublisherPlatformNote();
     }
     $publisherPlatformNote->publisherPlatformID = $_POST['publisherPlatformID'];
     $publisherPlatformNote->startYear = $_POST['startYear'];
コード例 #2
0
ファイル: uploadComplete.php プロジェクト: pontifechs/usage
 //If Platform does not already exist, insert it and get the new ID
 if (!$platformID && $platformName) {
     $platform = new Platform();
     $platform->platformID = '';
     $platform->name = $platformName;
     $platform->reportDisplayName = $platformName;
     $platform->reportDropDownInd = '0';
     $platform->organizationID = '';
     try {
         $platform->save();
         $platformID = $platform->primaryKey;
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     //also insert into Platform Note
     $platformNote = new PlatformNote();
     $platformNote->platformID = $platformID;
     $platformNote->startYear = date('Y');
     $platformNote->counterCompliantInd = '';
     try {
         $platformNote->save();
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     #add to output on screen
     $screenOutput .= "<br /><b>" . _("New Platform set up: ") . $platformName . "   <a href='publisherPlatform.php?platformID=" . $platformID . "'>" . _("edit") . "</a></b>";
 }
 $platformArray[] = $platformID;
 #################################################################
 // PUBLISHER
 // Query to see if the Publisher already exists, if so, get the ID