public function calc_rich()
 {
     Hasher::checkHash();
     $hash = Hasher::getHash();
     $tgl = addslashes($_POST['tgl']);
     $bln = addslashes($_POST['bln']);
     $thn = addslashes($_POST['th']);
     $gen = addslashes($_POST['gen']);
     $jam = addslashes($_POST['jam']);
     $tgl2 = addslashes($_POST['tgl2']);
     $bln2 = addslashes($_POST['bln2']);
     $thn2 = addslashes($_POST['th2']);
     $gen2 = addslashes($_POST['gen2']);
     $jam2 = addslashes($_POST['jam2']);
     //$tgl2 = 17; $bln2 = 6; $thn2 = 1982; $gen2 = 1;
     /*
     $tgl = 11;
     $bln = 3;
     $thn = 1981;
     $gen = 0;
     */
     $arr = MyBaziCalc::calc($jam, $tgl, $bln, $thn, $gen);
     $arr2 = MyBaziCalc::calc($jam2, $tgl2, $bln2, $thn2, $gen2);
     //pr($arr);
     //pr($arr2);
     $unsur = MyBaziCalc::getArrUnsur();
     /*****************************************
      *  KERJAKAN ARR 1
      *****************************************/
     //kerjakan arr 1
     $pillars = $arr['pillars'];
     //remove jam pillars
     unset($pillars['jam']);
     $kombi = BaziCombination::cek($pillars, $arr, $unsur);
     //pr($kombi);
     $tengod = Tengod::calc($kombi['newpillars'], $arr, $unsur);
     $hasil_type = BaziPembacaan::bacaTipe($kombi['newpillars'], $arr, $unsur, $tengod);
     $unsur_dibutuhkan = BaziPembacaan::unsurDibutuhkan($kombi['newpillars'], $arr, $unsur, $tengod, $hasil_type);
     $gudang = BaziBacaTengod::gudangUang($kombi, $arr, $unsur, $tengod);
     //pr($gudang);
     $posisi_gudang = $gudang['posisi'];
     $adaGudang = $gudang['ada'];
     $exp = explode("_", $posisi_gudang);
     $unsur_wealth = $exp[0];
     $gudang_tanah = $exp[1];
     /******************************************
      *  KERJAKAN ARR 2
      *****************************************/
     //kerjakan arr 2
     $pillars2 = $arr2['pillars'];
     //remove jam pillars
     unset($pillars2['jam']);
     $kombi2 = BaziCombination::cek($pillars2, $arr2, $unsur);
     //pr($kombi2);
     $tengod2 = Tengod::calc($kombi2['newpillars'], $arr2, $unsur);
     $hasil_type2 = BaziPembacaan::bacaTipe($kombi2['newpillars'], $arr2, $unsur, $tengod2);
     $unsur_dibutuhkan2 = BaziPembacaan::unsurDibutuhkan($kombi2['newpillars'], $arr2, $unsur, $tengod2, $hasil_type2);
     $gudang2 = BaziBacaTengod::gudangUang($kombi2, $arr2, $unsur, $tengod2);
     //pr($gudang2);
     $posisi_gudang2 = $gudang2['posisi'];
     $adaGudang2 = $gudang2['ada'];
     $exp2 = explode("_", $posisi_gudang2);
     $unsur_wealth2 = $exp2[0];
     $gudang_tanah2 = $exp2[1];
     /****************************************************8
      *    BERSAMA - SAMA
      ******************************************************/
     // cari apakah yang element gudang uang 1 ada di satunya
     $adaGudang3 = BaziBacaTengod::findElement($gudang_tanah, $pillars2);
     $adaGudang4 = BaziBacaTengod::findElement($gudang_tanah2, $pillars);
     $adaGudangGabungan = 0;
     if ($adaGudang3 > 0 || $adaGudang4 > 0) {
         $adaGudangGabungan = 1;
     }
     $bitcode = $adaGudang . $adaGudang2 . $adaGudangGabungan;
     $title = BaziQuiz::genericText('rich', "title_" . $bitcode);
     $return['picked'] = $title;
     //title nya
     //kerjakan descr nya
     $self = BaziQuiz::genericText('rich', "self_" . $adaGudang);
     $spouse = BaziQuiz::genericText('rich', "spouse_" . $adaGudang2);
     $both = BaziQuiz::genericText('rich', "both_" . $adaGudangGabungan);
     $return['more'] = "<p>" . $self . "</p><p>" . $spouse . "</p><p>" . $both . "</p>";
     // descr
     $return['text'] = $return['more'];
     //descr nya juga
     $return['base'] = base64_encode($bitcode);
     //base nya untuk macam2 titlenya
     /* **************
      * DEBUGERRR
      *************8*/
     /*
     echo "ada1 :".$adaGudang."<br>";
     echo "ada2 :".$adaGudang2."<br>";
     echo "ada3 :".$adaGudangGabungan."<br>";
     echo "bitcode".$bitcode;
     */
     //pr($json);
     echo json_encode($return);
     die;
     //echo "30";
     //exit();
 }
示例#2
0
 public function rich($args)
 {
     list($none, $base) = $args;
     $qid = 'rich';
     //list($id) = $args;
     //if(isset($id))die('no id');
     $arr = QuizUtil::setActiveQuizes();
     //pr($arr);
     $quiz = new QuizGF();
     $quiz = $arr[$qid];
     $actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
     PlayTemplate::incl($qid, $quiz, $actual_link, $base, 2);
     global $template;
     if ($base != "") {
         $dipakai = base64_decode($base);
         $wintext = $dipakai;
         $mytext = BaziQuiz::genericText('rich', "title_" . $wintext);
         $template->title = $mytext;
         $fb_opengraph = '<meta property="og:title" content="' . $mytext . '" />';
         $template->headText[] = $fb_opengraph;
         $fb_opengraph = '<meta property="og:image"  content="' . $quiz->quiz_fb_image . '" /> ';
         $template->headText[] = $fb_opengraph;
     } else {
         $template->title = $quiz->quiz_name;
         $fb_opengraph = '<meta property="og:title" content="' . $quiz->quiz_name . '" />';
         $template->headText[] = $fb_opengraph;
         //image
         $fb_opengraph = '<meta property="og:image"  content="' . $quiz->quiz_fb_image . '" /> ';
         $template->headText[] = $fb_opengraph;
     }
 }