diff --git a/app/Jobs/SMSPelangganSAGLAMAbysag.php b/app/Jobs/SMSPelangganSAGLAMAbysag.php index da21922..c23681a 100644 --- a/app/Jobs/SMSPelangganSAGLAMAbysag.php +++ b/app/Jobs/SMSPelangganSAGLAMAbysag.php @@ -50,22 +50,22 @@ class SMSPelangganSAGLAMAbysag extends Job $mobile_no = ltrim($this->telefon, '+6'); // $mobile_no = '60178916936'; // $message = 'test'; - $tarikhmatang = date('d-m-Y',strtotime($this->tmatang)); - $tarikhmatang = date('d-m-Y',strtotime($this->tmatang)); - $tarikhmatang1 = date('d-m-Y',strtotime($this->tmatang1)); - $date = $current->toDateString(); - $today = date('d-m-Y',strtotime($date)); - // $current_date = new Carbon($current->toDateString()); + $tarikhmatang = $this->tmatang; + $tarikhmatangnew = date('d-m-Y',strtotime($tarikhmatang)); + $tarikhmatang1 = $this->tmatang1; + $tarikhmatang1new = date('d-m-Y',strtotime($tarikhmatang1)); + $today = $current->toDateString(); + // $current_date = new Carbon($current->toDateString()); if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatang.'.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatangnew.'.'; }elseif($tarikhmatang < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatangnew.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} }else if($tarikhmatang1 < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatang1.'.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum '.$tarikhmatang1new.'.'; }elseif($tarikhmatang1 > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang1.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, '.$this->norujukan.' telah tamat tempoh pada '.$tarikhmatang1new.', Sila perbaharui SAG anda di cawangan Ar-Rahn.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); diff --git a/app/Jobs/WhatsappPelangganSAGLAMAbysag.php b/app/Jobs/WhatsappPelangganSAGLAMAbysag.php index 94f818b..2d03e59 100644 --- a/app/Jobs/WhatsappPelangganSAGLAMAbysag.php +++ b/app/Jobs/WhatsappPelangganSAGLAMAbysag.php @@ -51,21 +51,21 @@ class WhatsappPelangganSAGLAMAbysag extends Job $current = new Carbon(); $mobile_no = ltrim($this->telefon, '+6'); // $mobile_no = '60178916936'; - $tarikhmatang = date('d-m-Y',strtotime($this->tmatang)); - $tarikhmatang1 = date('d-m-Y',strtotime($this->tmatang1)); - $date = $current->toDateString(); - $today = date('d-m-Y',strtotime($date)); - // $current_date = new Carbon($current->toDateString()); - if($this->lelong_tawarruq == '1'){ + $tarikhmatang = $this->tmatang; + $tarikhmatangnew = date('d-m-Y',strtotime($tarikhmatang)); + $tarikhmatang1 = $this->tmatang1; + $tarikhmatang1new = date('d-m-Y',strtotime($tarikhmatang1)); + $today = $current->toDateString(); + if($this->lelong_tawarruq == '1'){ if($tarikhmatang > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatang.'*.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatangnew.'*.'; }elseif($tarikhmatang < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatangnew.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} }else if($tarikhmatang1 < $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatang1.'*.'; + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah hampir tamat tempoh untuk tukar ke SAG baru, Sila perbaharui SAG anda di cawangan sebelum *'.$tarikhmatang1new.'*.'; }elseif($tarikhmatang1 > $today){ - $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang1.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} + $message = 'AR-RAHN '.$this->caw_name.': MAKLUMAN, *'.$this->norujukan.'* telah tamat tempoh pada *'.$tarikhmatang1new.'*, Sila perbaharui SAG anda di cawangan Ar-Rahn.';} if(env('APP_ENV') != 'production'){ $mobile_no = env('ADMIN_PHONE_NUMBER'); diff --git a/database/migrations/2023_12_06_155714_add_column_ujrah_stokauditbackdate.php b/database/migrations/2023_12_06_155714_add_column_ujrah_stokauditbackdate.php new file mode 100644 index 0000000..a925dce --- /dev/null +++ b/database/migrations/2023_12_06_155714_add_column_ujrah_stokauditbackdate.php @@ -0,0 +1,178 @@ +getPdo(); + return true; + } catch(\Exception $e){ + return false; + } + }); + return $db_connection; + } + + public function up() + { + $db_connection = $this->getActiveDB(); + + foreach($db_connection as $dbase){ + Schema::connection($dbase)->table('stokaudit1', function (Blueprint $table){ + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit2', function (Blueprint $table){ + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit3', function (Blueprint $table){ + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit4', function (Blueprint $table){ + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit5', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit6', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit7', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + + }); + + + Schema::connection($dbase)->table('stokaudit8', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit9', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit10', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit11', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + Schema::connection($dbase)->table('stokaudit12', function (Blueprint $table){ + + $table->decimal('utgonepercent', 9, 2); + $table->decimal('ujrah', 9, 2); + }); + + }; + + } + + + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $db_connection = $this->getActiveDB(); + + foreach($db_connection as $dbase){ + Schema::connection($dbase)->table('stokaudit1', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit2', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit3', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + Schema::connection($dbase)->table('stokaudit4', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit5', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit6', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit7', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit8', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit9', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit10', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit11', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + + Schema::connection($dbase)->table('stokaudit12', function (Blueprint $table) { + $table->dropColumn(['utgonepercent', 'ujrah']); + }); + } + } +} \ No newline at end of file