/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $contacts = \App\Contacts::where('Ranking', 4)->orderBy('unique_id', 'desc')->get();
     // Show a page to edit and existing template
     $list = \App\Lists::findorFail($id);
     return view('lists.edit', compact('list'))->with('contacts', $contacts);
 }
 public function destroy($id)
 {
     $task = Contacts::findOrFail($id);
     $task->delete();
     Session::flash('flash_message', 'Task successfully deleted!');
     return redirect()->route('crud.tasks.index');
 }
Exemplo n.º 3
0
 public function delete($id)
 {
     if (intval($id)) {
         $contact = Contacts::find(intval($id));
         $contact->delete();
     }
     return redirect(url('/'));
 }
Exemplo n.º 4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Contacts::create(['name' => 'Icam', 'rfc' => 'XAXX010101000', 'address' => 'pendiente', 'phone_1' => '7771234567', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Salvador Arturo Rodriguez Loera', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'PROVEEDOR']);
     Contacts::create(['name' => 'Hospital Angeles', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']);
     Contacts::create(['name' => 'Hospital Reforma', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']);
     Contacts::create(['name' => 'Hospital Siglo XXI', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']);
     Contacts::create(['name' => 'Dr. Eleazar garcía', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']);
     Contacts::create(['name' => 'Médica Sur', 'rfc' => 'XAXX010101000', 'address' => 'Calle Agrarismo No. 208, Escandón, Miguel Hidalgo, 11800 Ciudad de México, D.F., México', 'phone_1' => '01 (55) 5516 9900', 'phone_2' => '', 'fax' => '', 'email_1' => '*****@*****.**', 'email_2' => '', 'contact_name_1' => 'Gela Yever Garces', 'contact_phone_1' => '7777654321', 'contact_email_1' => '*****@*****.**', 'contact_name_2' => '', 'contact_phone_2' => '', 'contact_email_2' => '', 'contact_type' => 'CLIENTE']);
 }
Exemplo n.º 5
0
 public function destroy($id, Request $request)
 {
     //ELIMINACIÓN DE PORCENTAJE
     $contacts = Contacts::find($id);
     if ($contacts->delete()) {
         //SE REGISTRA LA ACTIVIDAD EN LA BITACORA
         $this->binnacle("ELIMINÓ CONTACTO", $request);
     }
     Session::flash('message', 'El contacto se eliminó correctamente');
     return Redirect::to('/contact');
 }
Exemplo n.º 6
0
 public function run()
 {
     //i contatti su cui ciclaer
     $contacts = \App\Contacts::all();
     foreach ($contacts as $contact) {
         //qnt randomica di numeri di telefono da associare al contatto
         $number_qnt = mt_rand(1, 3);
         //ciclo sulla quantita
         for ($j = 0; $j <= $number_qnt; $j++) {
             //numero casuale
             $telefono = substr(number_format(time() * mt_rand(), 0, '', ''), 0, 10);
             \App\Numbers::create(array('number' => $telefono, 'contact_id' => $contact->id));
         }
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $contact = Contacts::find($id);
     $contact->delete();
 }
Exemplo n.º 8
0
 public static function boot()
 {
     parent::boot();
     Contacts::observe(new UserActionsObserver());
 }
Exemplo n.º 9
0
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use App\Contacts, App\Numbers, Illuminate\Support\Facades\Input;
Route::get('/', function () {
    return view('index')->with(array('contacts' => DB::table('contacts')->orderBy('surname')->get()));
});
//CRUD -- Contact
Route::resource('contact', 'contactController');
//CRUD -- Numbers
Route::resource('numbers', 'numberController');
//get detail -- AJAX
Route::get('detail/{id}', function ($id) {
    $contact = Contacts::find($id);
    return response()->json(array('contact' => $contact, 'numbers' => $contact->numbers));
});
Route::post('file/up', function () {
    if (Request::file('file')) {
        //settings
        $destinationPath = 'uploads';
        //store image on server
        $extension = Request::file('file')->getClientOriginalExtension();
        $fileName = rand(11111, 99999) . '.' . $extension;
        Request::file('file')->move($destinationPath, $fileName);
        return response()->json(array('success' => true, 'fileName' => $fileName));
    } else {
        return response()->json(array('success' => false));
    }
});
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  */
 public function destroy($id)
 {
     $contact = Contacts::whereId($id);
     $contact->delete();
     return response()->json(array('contact-exists' => $contact->exists()));
 }
 /**
  * contacts-us page navigation controller.
  *
  *
  * @return Response
  */
 public function showContactUs()
 {
     $contacts = Contacts::all();
     return view('pages.admin.adminContactUs', array('contacts' => $contacts));
 }
Exemplo n.º 12
0
 public function updateContacts(Request $request, $id)
 {
     if (Auth::user()->email == '*****@*****.**') {
         Contacts::where('id', $request->input('contact_id'))->update(['text' => $request->input('text')]);
         return redirect()->back()->with($request->session()->flash('admin-success', 'Контакт беше обновен успешно.'));
     }
 }
Exemplo n.º 13
0
 public function editContact(Request $request)
 {
     $session = $request->get('session');
     $cusid = $request->get('contactcusid');
     $id = $request->get('contactid');
     $name = $request->get("contactname");
     $email = $request->get("contactemail");
     $contactno = $request->get("contacttelno");
     $contact = Contacts::find($id);
     $contact->cusId = $cusid;
     $contact->name = $name;
     $contact->email = $email;
     $contact->contactNo = $contactno;
     $contact->save();
     return Contacts::all()->toJson();
 }
Exemplo n.º 14
0
 /**
  * Mass delete function from index page
  * @param Request $request
  *
  * @return mixed
  */
 public function massDelete(Request $request)
 {
     if ($request->get('toDelete') != 'mass') {
         $toDelete = json_decode($request->get('toDelete'));
         Contacts::destroy($toDelete);
     } else {
         Contacts::whereNotNull('id')->delete();
     }
     return redirect()->route('admin.contacts.index');
 }
Exemplo n.º 15
0
 public function edit($id)
 {
     $transaction = Transactions::find($id);
     $contacts = Contacts::type('CLIENTE')->get()->lists('name', 'id');
     $items = Items::lists('item_name', 'id');
     if ($transaction) {
         return view('transaction.edit', compact('transaction', 'contacts', 'items'));
     } else {
         return redirect()->action('TransactionsController@index')->with('error', 'La orden de venta solicitada no existe');
     }
 }
 /**
  * update contact us basic information
  * @param Request $request
  * @return Response
  */
 public function updateContactUs(Request $request)
 {
     $contacts = Contacts::find(1);
     $contacts->adddress = $request->input('adddress');
     $contacts->telephone = $request->input('telephone');
     $contacts->fax = $request->input('fax');
     $contacts->mobile = $request->input('mobile');
     $contacts->email = $request->input('email');
     $contacts->save();
     $contacts = Contacts::all();
     return view('pages.admin.adminContactUs', array('contacts' => $contacts));
 }
Exemplo n.º 17
0
 public function edit($id)
 {
     $acquisition = Acquisitions::find($id);
     if ($acquisition) {
         $contacts = Contacts::type('PROVEEDOR')->orderBy('name')->get()->lists('name', 'id');
         $items = Items::orderBy('item_name')->lists('item_name', 'id');
         return view('acquisition.edit', compact('acquisition', 'contacts', 'items'));
     } else {
         return redirect()->action('AcquisitionsController@index')->with('error', 'La compra solicitada no existe');
     }
 }
Exemplo n.º 18
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Contacts::destroy($id);
     return redirect('contacts');
 }
Exemplo n.º 19
0
 public function getContacts()
 {
     $contacts = Contacts::all();
     return view('pages.contacts')->with('contacts', $contacts);
 }